/* ============================================================
   shell.css — Navegación lateral compartida (v216)
   Panel de resultados · Mi organización / Clientes · Cuentas.
   Usa los mismos tokens (--panel, --line, --gold…) que dashboard.html
   y admin-ui.css, así que respeta el tema claro / oscuro.
   ============================================================ */
:root { --sb-w: 256px; }
body.has-sb { padding-left: var(--sb-w); }
body.has-sb .bar { display: none !important; }      /* la barra superior vieja ya no se usa */

.sb {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sb-w); z-index: 60;
  background: var(--panel-solid); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  font-family: "Inter", ui-sans-serif, "Segoe UI", system-ui, sans-serif;
}
html.ed-light .sb { background: #fbfcfe; }
.sb-in { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* Marca (logo del cliente o marca del motor) */
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; text-decoration: none; color: var(--txt); border-bottom: 1px solid var(--line); }
.sb-logo { flex: none; width: 46px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.sb-logo img { max-width: 40px; max-height: 40px; object-fit: contain; display: block; }
.sb-mark img { width: 27px; height: auto; display: block; }
.sb-mark { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-content: center; font-weight: 900; font-size: 14px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 28%, transparent); }
.sb-bt { min-width: 0; line-height: 1.25; }
.sb-brand.has-logo { flex-direction: column; align-items: stretch; gap: 10px; }
.sb-logo-wide { display: grid; place-items: center; height: 72px; padding: 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.sb-logo-wide img { max-width: 100%; max-height: 56px; object-fit: contain; display: block; }
.sb-brand.has-logo .sb-bt { padding: 0 2px; }
.sb-bt b { display: block; font-size: 14.5px; font-weight: 800; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-bt small { display: block; font-size: 11px; color: var(--mut); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

/* Navegación */
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 12px 8px; }
.sb-sec { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mut2); padding: 14px 10px 7px; }
.sb-sec:first-child { padding-top: 4px; }
.sb-it {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; margin: 2px 0; border-radius: 10px; border: 1px solid transparent;
  color: var(--txt2); text-decoration: none; font: inherit; font-size: 13.5px; font-weight: 600;
  background: transparent; cursor: pointer; text-align: left; transition: background .15s, color .15s, border-color .15s;
}
.sb-it:hover { background: var(--raise2); color: var(--txt); }
.sb-it svg { flex: none; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.sb-it span { min-width: 0; line-height: 1.25; }
.sb-it small { display: block; font-size: 11.5px; font-weight: 500; color: var(--mut); margin-top: 2px; }
.sb-it.on { color: var(--gold-hi); background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 26%, transparent); }
html.ed-light .sb-it.on { color: var(--gold-deep); }
.sb-it.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sb-it.on svg { opacity: 1; }
.sb-it .ext { margin-left: auto; width: 14px; height: 14px; opacity: .5; }

/* Pie: usuario, tema, salir, crédito */
.sb-foot { border-top: 1px solid var(--line); padding: 14px 14px 12px; display: grid; gap: 12px; }
.sb-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; font-size: 13px; font-weight: 800;
  color: var(--gold-deep); background: color-mix(in srgb, var(--gold) 16%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.sb-ut { min-width: 0; line-height: 1.3; }
.sb-ut small { display: block; font-size: 10.5px; color: var(--mut2); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sb-ut b { display: block; font-size: 13px; font-weight: 700; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ut span { display: block; font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-acts { display: flex; gap: 8px; }
.sb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--txt2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s; }
.sb-btn:hover { background: var(--hover); border-color: var(--line2); }
.sb-btn.wide { flex: 1; }
.sb-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-made { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--mut2); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding-top: 2px; opacity: .85; }
.sb-made:hover { opacity: 1; }
.sb-made img { height: 13px; width: auto; display: block; }
.sb-made .lt { display: none; }
html:not(.ed-light) .sb-made .dk { display: none; }
html:not(.ed-light) .sb-made .lt { display: block; }

/* Barra móvil + fondo */
.sb-top { display: none; }
.sb-back { display: none; }
@media (max-width: 1000px) {
  body.has-sb { padding-left: 0; padding-top: 56px; }
  .sb { transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: none; width: min(300px, 86vw); }
  .sb.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  .sb-top { display: flex; position: fixed; left: 0; right: 0; top: 0; height: 56px; z-index: 55; align-items: center; gap: 12px; padding: 0 14px;
    background: var(--panel-solid); border-bottom: 1px solid var(--line); }
  html.ed-light .sb-top { background: #fbfcfe; }
  .sb-top b { font-size: 15px; font-weight: 800; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-top .sb-logo { width: auto; height: 38px; padding: 3px 8px; border-radius: 10px; margin-left: auto; }
  .sb-top .sb-logo img { max-width: 110px; max-height: 30px; }
  .sb-burger { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); display: grid; place-content: center; cursor: pointer; }
  .sb-burger svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .sb-back.on { display: block; position: fixed; inset: 0; z-index: 58; background: rgba(3,7,14,.45); backdrop-filter: blur(2px); }
}

/* Ayuda y soporte (modal) */
.sb-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(3,7,14,.55); backdrop-filter: blur(3px); animation: sbfade .16s ease; }
@keyframes sbfade { from { opacity: 0 } to { opacity: 1 } }
.sb-mbox { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel-solid); color: var(--txt); border: 1px solid var(--line2);
  border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); font-family: "Inter", ui-sans-serif, "Segoe UI", system-ui, sans-serif; }
.sb-mhead { padding: 22px 24px 6px; position: relative; }
.sb-mhead h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.sb-mhead p { margin: 0; color: var(--mut); font-size: 13.5px; line-height: 1.55; }
.sb-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt2); font-size: 18px; cursor: pointer; }
.sb-mbody { padding: 14px 24px 22px; display: grid; gap: 14px; }
.sb-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-cc { display: flex; gap: 11px; align-items: center; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); text-decoration: none; color: var(--txt); }
.sb-cc:hover { border-color: var(--line2); background: var(--raise2); }
.sb-cc svg { flex: none; width: 22px; height: 22px; stroke: var(--gold-deep); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-cc small { display: block; font-size: 11px; color: var(--mut); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sb-cc b { display: block; font-size: 13.5px; font-weight: 700; word-break: break-all; }
.sb-faq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sb-faq details { border-top: 1px solid var(--line); }
.sb-faq details:first-child { border-top: 0; }
.sb-faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.sb-faq summary::-webkit-details-marker { display: none; }
.sb-faq summary::after { content: "+"; color: var(--mut); font-weight: 800; }
.sb-faq details[open] summary::after { content: "–"; }
.sb-faq details p { margin: 0; padding: 0 14px 13px; color: var(--mut); font-size: 13px; line-height: 1.6; }
.sb-hours { font-size: 12.5px; color: var(--mut); }
@media (max-width: 520px) { .sb-contact { grid-template-columns: 1fr; } }
@media print { .sb, .sb-top, .sb-back { display: none !important; } body.has-sb { padding: 0 !important; } }

/* Que los estilos globales de botones de otras pantallas no afecten al menú */
.sb button, .sb-top button, .sb-modal button { box-shadow: none; text-transform: none; letter-spacing: 0; }
.sb button:hover, .sb-top button:hover, .sb-modal button:hover { filter: none; }
.sb a, .sb-modal a { text-decoration: none; }
/* Contenido principal junto al menú */
body.has-sb .tabsbar { top: 0; }
@media (max-width: 1000px) { body.has-sb .tabsbar { top: 56px; } }
@media (max-width: 700px) { body.has-sb .tabsbar { position: static; } }
