/* Granaderos - Navegación: menú lateral en computadora, barra superior e inferior en celular.
   Rukan - Orden y desarrollo a medida. Usa los tokens de app.css. */
:root { --sb: 236px; --tb: 58px; --bb: 62px; }

.sb { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb); background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 35; overflow-y: auto; }
.sb-head { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.sb-head .logo { width: 150px; }
.sb-head small { display: block; margin-top: 10px; font-size: 13px; color: var(--mute); }
.sb nav { padding: 6px 0; }
.sb-grupo > span { display: block; padding: 14px 22px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.sb a.sb-item small { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.sb-velo { display: none; }
.tb-menu { display: none; }
.sb a.sb-item { display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 19px; border-left: 3px solid transparent;
  color: var(--mute); text-decoration: none; font-size: 15px; }
.sb a.sb-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
.sb a.sb-item:hover { color: var(--marino); background: var(--panel2); }
.sb a.sb-item.on { color: var(--primario); border-left-color: var(--acento); background: var(--acc-suave); font-weight: 700; }
.sb-pie { margin-top: auto; padding: 18px 22px 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sb-pie button { padding: 7px 12px; font-size: 13px; }
.usr { font-size: 14px; font-weight: 700; color: var(--marino); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prueba { font-size: 11px; font-weight: 700; padding: 3px 8px; border: 1px solid var(--line2); border-radius: var(--r); color: var(--mute); background: var(--panel2); }

body.con-sb { padding-left: var(--sb); }
.tb, .bb { display: none; }

@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(300px, 86vw); }
  body.sb-abierto .sb { transform: none; box-shadow: 0 0 30px rgba(7, 36, 81, .25); }
  .sb-velo { position: fixed; inset: 0; background: rgba(7, 36, 81, .45); z-index: 55; }
  body.sb-abierto .sb-velo { display: block; }
  .tb-menu { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; padding: 9px; background: none; border: 0; flex: none; }
  .tb-menu i { display: block; height: 2px; background: var(--marino); border-radius: 2px; }
  .tb { display: flex; align-items: center; gap: 12px; position: fixed; top: 0; left: 0; right: 0; height: var(--tb); padding: 0 12px 0 14px;
    background: var(--bg); border-bottom: 1px solid var(--line); z-index: 34; }
  .tb .logo { height: 40px; width: auto; }
  .tb-sec { flex: 1; min-width: 0; color: var(--marino); font-family: var(--f-display); font-weight: 700; 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; }

  .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(--bg); border-top: 1px solid var(--line); z-index: 34; }
  /* 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(--bg); pointer-events: none; }
  .bb a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none;
    color: var(--mute); font-size: 12px; border-top: 3px solid transparent; }
  .bb a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .bb a.on { color: var(--primario); border-top-color: var(--acento); font-weight: 700; }
  .wrap { padding: 20px 16px 24px; }
  .pie { padding: 16px; }
  h1 { font-size: 24px; }
  .toast { bottom: calc(var(--bb) + 16px); }
}

/* Grupo desplegable (Comercial) y Sales Hub destacado */
.sb-plegable > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 6px; }
.sb-plegable > summary::-webkit-details-marker { display: none; }
.sb-plegable > summary span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.sb-plegable > summary svg { width: 16px; height: 16px; stroke: var(--dim); fill: none; stroke-width: 2; transition: transform .15s; }
.sb-plegable[open] > summary svg { transform: rotate(90deg); }
.sb-plegable > summary:hover span { color: var(--marino); }
.sb-plegable > summary:focus-visible { outline: 3px solid var(--acento); outline-offset: -3px; }
.sb a.sb-item.sb-destacado { margin: 4px 12px 6px; padding: 10px 12px; border: 1px solid #b9d6f5; border-left-width: 1px; border-radius: var(--r);
  background: var(--hub-suave, #eaf3fc); color: var(--primario); font-weight: 700; }
.sb a.sb-item.sb-destacado small { color: var(--primario); opacity: .8; }
.sb a.sb-item.sb-destacado.on { background: var(--primario); color: #fff; border-color: var(--primario); }
.sb a.sb-item.sb-destacado.on small { color: #fff; }
