/* TissueArg - Navegación por módulos: menú lateral en computadora, barra superior e inferior en celular.
   Núcleo de Rukan (DESIGN-marca-rukan.md, «Sistemas de gestión»): Archivo, sin radios, sin chips, sin títulos de grupo
   en mayúsculas espaciadas, el activo con la línea a la izquierda, «con Rukan» al pie. Colores de la marca TissueArg
   (los de app.css): letra en el azul oscuro de la marca, activo en el celeste de la web oscurecido para AA.
   Solo el menú, la portada de cada módulo y el Inicio usan esta piel: el resto de las pantallas sigue con app.css.
   Rukan - Orden y desarrollo a medida */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,300..900&display=swap");
:root {
  --sb: 240px; --tb: 58px; --bb: 62px;
  --nav: #F4F7FA; --nav-texto: #0F2D57; --nav-suave: #4F5B6C; --nav-activo: #006A9C; --nav-hover: #E5ECF4; --nav-linea: #DDE4EC;
  --nav-f: "Archivo", system-ui, sans-serif;
}

.sb { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb); background: var(--nav); color: var(--nav-texto); font-family: var(--nav-f); border-right: 1px solid var(--nav-linea);
  display: flex; flex-direction: column; z-index: 35; overflow-y: auto; overflow-x: hidden; }
.sb-head { padding: 22px 22px 14px; display: flex; flex-direction: column; align-items: center; width: max-content; max-width: 100%; }
.sb-head a { display: block; line-height: 0; }
.sb-head .logo { width: 150px; }
.sb-head small { display: block; margin-top: 8px; font-size: 13px; color: var(--nav-suave); text-align: center; }
.sb nav { padding: 4px 0; }
.sb-velo { display: none; }
.tb-menu { display: none; }

/* Buscar una pantalla (Ctrl K) */
.sb-buscar { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; margin: 2px 16px 8px; padding: 8px 10px;
  background: #fff; border: 1px solid var(--nav-linea); color: var(--nav-suave); font: 400 14px var(--nav-f); }
.sb-buscar svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: square; flex: none; }
.sb-buscar span { white-space: nowrap; }
.sb-buscar kbd { margin-left: auto; white-space: nowrap; font: 12px var(--nav-f); color: var(--nav-suave); border: 1px solid var(--nav-linea); padding: 0 5px; }
.sb-buscar:hover { border-color: var(--nav-suave); color: var(--nav-texto); }
.sb-buscar:focus-visible { outline: 2px solid var(--nav-activo); outline-offset: -2px; }

/* Un ítem por módulo. El activo: la línea a la izquierda y la letra en el color activo. */
.sb a.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 22px 9px 19px; border-left: 3px solid transparent;
  color: var(--nav-texto); text-decoration: none; font: 400 15px/1.35 var(--nav-f); }
/* Sales Hub: el módulo madre de ventas se ve distinto. Bloque en el color del texto del menú, letra clara. */
.sb .sb-hub { margin: 0 0 8px; background: var(--nav-texto); } /* a todo el ancho, alineado con el resto */
.sb .sb-hub > a.sb-item { color: var(--nav, #F4F7FA); font-weight: 600; }
.sb .sb-hub > a.sb-item:hover { background: var(--nav-activo); color: #FFFFFF; }
.sb .sb-hub > a.sb-item[aria-current="page"], .sb .sb-hub > a.sb-item.on { border-left-color: var(--nav-activo); color: #FFFFFF; }
.sb .sb-hub .sb-indice { background: var(--nav); }
.sb a.sb-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: square; flex: none; }
.sb a.sb-item small { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--nav-suave); white-space: nowrap; }
.sb a.sb-item:hover { background: var(--nav-hover); }
.sb a.sb-item:focus-visible { outline: 2px solid var(--nav-activo); outline-offset: -2px; }
.sb a.sb-item.on { color: var(--nav-activo); border-left-color: var(--nav-activo); font-weight: 600; }
.sb .sb-fl { display: none; }
.sb-sep { height: 1px; background: var(--nav-linea); margin: 8px 22px; }
.sb-otros { border-top: 1px solid var(--nav-linea); margin: 8px 0 0; }
/* El índice del módulo dentro del menú: solo en el celular («Más») */
.sb-indice { display: none; }

.sb-pie { margin-top: auto; padding: 16px 22px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sb-pie button { all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 12px; border: 1px solid var(--nav-texto); font: 500 14px var(--nav-f); color: var(--nav-texto); }
.sb-pie button:hover, .sb-pie button:focus-visible { border-color: var(--nav-activo); color: var(--nav-activo); }
.sb-firma { color: var(--nav-suave); font-size: 12px; }
.usr { font-family: var(--nav-f); font-size: 14px; font-weight: 600; color: var(--nav-texto); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «Datos de prueba»: texto suave con la línea fina (aviso tibio del manual), sin chip */
.prueba { font-family: var(--nav-f); font-size: 12px; padding: 1px 0 1px 8px; border-left: 2px solid var(--nav-suave); color: var(--nav-suave); }

body.con-sb { padding-left: var(--sb); }
.tb, .bb { display: none; }
/* El Sales Hub cambia el fondo de la pantalla, no el del menú */
body.hub .sb, body.hub .tb, body.hub .bb { background: var(--nav); border-color: var(--nav-linea); }
body.hub .sb a.sb-item:hover { background: var(--nav-hover); }

/* ---------------- Buscador Ctrl K (diálogo) ---------------- */
.bq { margin: 10vh auto auto; border: 1px solid var(--nav-linea); padding: 0; width: calc(100% - 32px); max-width: 560px; color: var(--nav-texto); background: #fff; font-family: var(--nav-f); }
.bq::backdrop { background: rgba(15, 45, 87, .35); }
.bq-c { display: grid; }
.bq-campo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--nav-linea); }
.bq-campo svg { width: 20px; height: 20px; stroke: var(--nav-suave); fill: none; stroke-width: 1.5; stroke-linecap: square; flex: none; }
.bq-campo input { all: unset; flex: 1; min-width: 0; font: 400 16px var(--nav-f); color: var(--nav-texto); }
.bq-res { list-style: none; margin: 0; padding: 6px 0; max-height: min(420px, 60vh); overflow-y: auto; }
.bq-res a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px 8px 11px; border-left: 3px solid transparent; color: var(--nav-texto); text-decoration: none; }
.bq-res a small { color: var(--nav-suave); font-size: 13px; text-align: right; }
.bq-res [aria-selected="true"] a, .bq-res a:hover { border-left-color: var(--nav-activo); background: var(--nav); }
.bq-vacio { padding: 12px 14px; color: var(--nav-suave); font-size: 14px; }
.bq-pie { margin: 0; padding: 8px 14px; border-top: 1px solid var(--nav-linea); color: var(--nav-suave); font-size: 12px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
  body.con-sb { padding-left: 0; padding-top: var(--tb); padding-bottom: calc(var(--bb) + env(safe-area-inset-bottom, 0px)); }
  .sb { transform: translateX(-100%); transition: transform .2s ease; z-index: 60; width: min(320px, 88vw); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  body.sb-abierto .sb { transform: none; box-shadow: 0 0 30px rgba(15, 45, 87, .25); }
  .sb-velo { position: fixed; inset: 0; background: rgba(15, 45, 87, .45); z-index: 55; }
  body.sb-abierto .sb-velo { display: block; }
  .tb-menu { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 44px; height: 44px; padding: 11px; background: none; border: 0; flex: none; }
  .tb-menu i { display: block; height: 2px; background: var(--nav-texto); }
  .tb { display: flex; align-items: center; gap: 12px; position: fixed; top: 0; left: 0; right: 0; height: var(--tb); padding: 0 12px 0 8px;
    background: var(--nav); border-bottom: 1px solid var(--nav-linea); z-index: 34; font-family: var(--nav-f); }
  .tb .logo { height: 40px; width: auto; }
  .tb-sec { flex: 1; min-width: 0; color: var(--nav-texto); font-family: var(--nav-f); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb .prueba { flex: none; }
  .tb .usr { flex: none; max-width: 30vw; font-size: 13px; }
  /* En el celular angosto, «Datos de prueba» queda solo en el pie del menú: así entra el nombre de la pantalla */
  @media (max-width: 600px) { .tb .prueba { display: none !important; } .tb .usr { max-width: 26vw; } }

  .bb { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--bb) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--nav); border-top: 1px solid var(--nav-linea); z-index: 34; font-family: var(--nav-f); }
  /* bb-relleno: en iPhone, cuando Safari achica o agranda su barra al scrollear, la barra queda un instante despegada del borde. Este relleno tapa ese hueco. */
  .bb::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--nav); pointer-events: none; }
  .bb a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; text-decoration: none;
    color: var(--nav-texto); font-size: 12px; border-top: 3px solid transparent; }
  .bb a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: square; }
  .bb a.on { color: var(--nav-activo); border-top-color: var(--nav-activo); font-weight: 600; }
  .wrap { padding: 20px 16px 24px; }
  .pie { padding: 16px; }
  h1 { font-size: 24px; }
  .toast { bottom: calc(var(--bb) + 16px); }

  /* «Más»: los módulos; al tocar uno se abre su índice ahí mismo. Cada renglón se toca cómodo (44 px). */
  .sb-buscar { min-height: 44px; }
  .sb-buscar kbd { display: none; }
  .sb a.sb-item { min-height: 44px; }
  .sb a.sb-item .sb-fl { display: block; width: 16px; height: 16px; margin-left: 4px; transition: transform .15s; }
  .sb a.sb-item small + .sb-fl { margin-left: 8px; }
  .sb a.sb-item .sb-nom + .sb-fl { margin-left: auto; }
  .sb-mod.abierto > a.sb-item .sb-fl { transform: rotate(90deg); }
  .sb-mod.abierto .sb-indice { display: block; padding: 0 0 8px; }
  .sb-gt { margin: 0; padding: 10px 22px 2px 52px; color: var(--nav-suave); font-size: 13px; }
  .sb-pant { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 22px 6px 49px;
    border-left: 3px solid transparent; color: var(--nav-texto); text-decoration: none; font-size: 15px; }
  .sb-pant small { color: var(--nav-suave); font-size: 12px; text-align: right; }
  a.sb-pant:hover { background: var(--nav-hover); }
  a.sb-pant.on { border-left-color: var(--nav-activo); color: var(--nav-activo); font-weight: 600; }
  .sb-pant.prox { color: var(--nav-suave); }
  .sb-portada { color: var(--nav-activo); }
  .sb-pie button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .sb, .sb .sb-fl { transition: none; } }

/* ---------------- Selector de sección (secciones-movil.js) ----------------
   En el celular la tira de pestañas que se desliza de costado pasa a ser un renglón con la sección actual; al tocarlo
   sube una hoja desde abajo con todas (variante A de maqueta-secciones-celular.html). Núcleo de Rukan:
   Archivo, sin radios, la línea a la izquierda marca la activa, sin chips. En la computadora no se ve. */
.sm-sel, .sm-hoja { display: none; }
@media (max-width: 900px) {
  [data-secciones-movil].sm-listo { display: none !important; }
  .sm-sel:not([hidden]) { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; min-height: 48px; margin: 8px 0 16px; padding: 10px 14px; background: var(--nav); border: 1px solid var(--nav-linea);
    color: var(--nav-texto); font: 600 15px/1.3 var(--nav-f); -webkit-tap-highlight-color: transparent; }
  .sm-sel-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sm-sel svg { width: 20px; height: 20px; flex: none; stroke: var(--nav-suave); fill: none; stroke-width: 1.5; stroke-linecap: square; }
  .sm-sel:hover { border-color: var(--nav-suave); }
  .sm-sel:focus-visible { outline: 2px solid var(--nav-activo); outline-offset: -2px; }
  .sm-sel[aria-expanded="true"] svg { transform: rotate(180deg); }

  .sm-hoja[open] { display: block; position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 640px; max-height: 85vh; max-height: 85dvh;
    padding: 0; border: 0; border-top: 1px solid var(--nav-linea); background: #fff; color: var(--nav-texto); font-family: var(--nav-f);
    box-shadow: 0 -10px 30px rgba(15, 45, 87, .18); overflow-y: auto; overscroll-behavior: contain; z-index: 70; animation: sm-sube .2s ease-out; }
  .sm-hoja::backdrop { background: rgba(15, 45, 87, .35); animation: sm-velo .2s ease-out; }
  .sm-hoja:focus { outline: none; }
  .sm-hoja-c { padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
  .sm-agarre { width: 36px; height: 4px; background: var(--nav-linea); margin: 4px auto 8px; }
  .sm-hoja-t { margin: 0; padding: 4px 18px 8px; color: var(--nav-suave); font-size: 13px; }
  .sm-lista { list-style: none; margin: 0; padding: 0; }
  .sm-it { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; width: 100%; min-height: 48px; padding: 10px 18px 10px 15px;
    border-left: 3px solid transparent; color: var(--nav-texto); font: 400 15px/1.3 var(--nav-f); -webkit-tap-highlight-color: transparent; }
  .sm-it:hover { background: var(--nav-hover); }
  .sm-it:focus-visible { outline: 2px solid var(--nav-activo); outline-offset: -2px; }
  .sm-it.on { border-left-color: var(--nav-activo); font-weight: 600; }
  html.sm-abierta { overflow: hidden; }
}
@keyframes sm-sube { from { transform: translateY(100%); } }
@keyframes sm-velo { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sm-hoja[open], .sm-hoja::backdrop { animation: none; } .sm-sel svg { transition: none; } }
@media print { .sm-sel, .sm-hoja { display: none !important; } }
