/* ============================================================
   Portal Instalaciones — menú lateral izquierdo.
   Misma línea que los portales Sixt y Rental
   (/opt/sixt-portal/public/assets/shell.css): barra fija a la
   izquierda, colapsable, con versión de celular. Usa los tokens
   --brand / --text / --border que define cada hoja.
   ============================================================ */
:root {
  --shell-w: 210px;
  --shell-w-min: 68px;
  --shell-bg: #FFFFFF;
}

/* El contenido vive a la derecha del menú */
body.has-shell { padding-left: var(--shell-w); transition: padding-left .18s ease; }
body.has-shell.shell-collapsed { padding-left: var(--shell-w-min); }
/* En computadora el contenido aprovecha el ancho; en celular manda la hoja */
body.has-shell main { max-width: 820px; }

/* Con menú lateral sobra la navegación vieja, pero NO los botones propios de
   cada hoja (Mis gestiones, Registrar nueva…): solo se ocultan los enlaces. */
body.has-shell header.topbar { display: none !important; }
body.has-shell header.hdr img { display: none !important; }
body.has-shell .menu a[href^="/"],
body.has-shell .menuwrap a[href^="/"],
body.has-shell .navwrap a[href^="/"],
body.has-shell .nav-vieja { display: none !important; }

/* ===== El menú ===== */
#tlxShell {
  position: fixed; inset: 0 auto 0 0; width: var(--shell-w);
  background: var(--shell-bg);
  border-right: 1px solid var(--border, #E5E7EB);
  display: flex; flex-direction: column; z-index: 100;
  transition: width .18s ease;
}
body.shell-collapsed #tlxShell { width: var(--shell-w-min); }

#tlxShell .sh-top {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border, #E5E7EB);
}
#tlxShell .sh-logo { height: 28px; width: auto; display: block; flex: none; }
#tlxShell .sh-name { font-weight: 800; font-size: 13.5px; color: var(--ink, #0F1419); letter-spacing: -.01em; white-space: nowrap; }
body.shell-collapsed #tlxShell .sh-name { display: none; }
body.shell-collapsed #tlxShell .sh-top { justify-content: center; padding: 14px 0 10px; }

#tlxShell nav { flex: 1; padding: 12px 10px; display: grid; gap: 2px; align-content: start; overflow-y: auto; }
#tlxShell nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--muted, #6B7280); font-size: 14px; font-weight: 600;
  text-decoration: none; border-left: 3px solid transparent; white-space: nowrap;
}
#tlxShell nav a:hover { background: var(--surface-soft, #F9FAFB); color: var(--text, #1F2937); }
#tlxShell nav a.active {
  background: var(--brand-soft, #FEF2F2); color: var(--brand, #E1121C);
  border-left-color: var(--brand, #E1121C);
}
#tlxShell nav a .ic { font-size: 17px; width: 22px; text-align: center; flex: none; }
body.shell-collapsed #tlxShell nav a { justify-content: center; padding: 12px 0; border-left-width: 0; }
body.shell-collapsed #tlxShell nav a .lbl { display: none; }

#tlxShell .sh-foot { padding: 10px 12px 14px; border-top: 1px solid var(--border, #E5E7EB); display: grid; gap: 6px; }
#tlxShell .sh-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
#tlxShell .sh-user .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success, #10B981); flex: none; }
#tlxShell .sh-user .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text, #1F2937); }
#tlxShell .sh-user .rl { color: var(--muted, #6B7280); font-size: 11px; white-space: nowrap; }
body.shell-collapsed #tlxShell .sh-user .nm,
body.shell-collapsed #tlxShell .sh-user .rl { display: none; }
#tlxShell .sh-actions { display: flex; gap: 8px; margin-top: 4px; }
#tlxShell .sh-btn {
  flex: 1; background: none; border: 1px solid var(--border-strong, #D1D5DB); border-radius: 9px;
  padding: 7px 0; font: inherit; font-size: 12px; color: var(--muted, #6B7280); cursor: pointer; min-height: 36px;
}
#tlxShell .sh-btn:hover { color: var(--brand, #E1121C); border-color: var(--brand, #E1121C); }
body.shell-collapsed #tlxShell .sh-actions { flex-direction: column; }

/* ===== Celular: el menú entra por la izquierda ===== */
#tlxShellBurger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 120;
  width: 42px; height: 42px; border-radius: 12px; font-size: 18px;
  background: var(--surface, #fff); border: 1px solid var(--border-strong, #D1D5DB); cursor: pointer;
}
#tlxShellVelo { display: none; position: fixed; inset: 0; background: rgba(15,20,25,.35); z-index: 99; }

@media (max-width: 820px) {
  body.has-shell, body.has-shell.shell-collapsed { padding-left: 0; padding-top: 62px; }
  #tlxShell { transform: translateX(-100%); transition: transform .2s ease; width: var(--shell-w) !important; box-shadow: 0 0 60px rgba(0,0,0,.25); }
  body.shell-abierto #tlxShell { transform: none; }
  body.shell-abierto #tlxShellVelo { display: block; }
  #tlxShellBurger { display: block; }
  /* el botón ☰ no debe taparle el logo al menú abierto */
  #tlxShell .sh-top { padding-left: 64px; }
  body.shell-collapsed #tlxShell nav a { justify-content: flex-start; padding: 11px 12px; border-left-width: 3px; }
  body.shell-collapsed #tlxShell nav a .lbl,
  body.shell-collapsed #tlxShell .sh-name,
  body.shell-collapsed #tlxShell .sh-user .nm,
  body.shell-collapsed #tlxShell .sh-user .rl { display: inline; }
  body.shell-collapsed #tlxShell .sh-actions { flex-direction: row; }
}
