/* shell.css — ajustes del shell de Creative Stack sobre el molde (styles.css, que no se edita). */

/* ---------- ACENTO: el único lugar donde se elige el color de identidad ---------- */
/* Cambiar el acento es tocar SOLO la línea de --acc; todo lo demás se deriva de ella. */
:root {
  --acc: #a78bfa;
  --acc-soft: color-mix(in srgb, var(--acc) 62%, #fff);
  --acc-fondo: color-mix(in srgb, var(--acc) 8%, transparent);
  --acc-fondo2: color-mix(in srgb, var(--acc) 12%, transparent);
  --acc-borde: color-mix(in srgb, var(--acc) 40%, transparent);
}

/* El molde trae el naranja escrito en varias reglas: se redirigen a la variable. */
.sb-item.activo, .sb-sub-item.activo { background: var(--acc-fondo); }
.btn-ghost:hover { border-color: var(--acc-borde); background: var(--acc-fondo); }
.btn-primario { background: linear-gradient(180deg, var(--acc-soft), var(--acc)); color: #0c0c0e; }
.btn-primario:hover { box-shadow: 0 6px 16px -8px var(--acc-borde); }
.grafico-linea { stroke: var(--acc); }
.grafico-punto { fill: var(--acc); }
.btn-icono:hover { background: var(--acc-fondo); }
.tab-cliente.activa .tab-cuenta { background: var(--acc-fondo2); }

/* ---------- banner superior: marca · migas · usuario ---------- */
.top { gap: 14px; }
.top .migas { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; justify-content: center; }
.top .miga { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.top .miga-sec { color: var(--text); font-weight: 600; }
.top .miga-sep { color: var(--muted2); font-size: .8125rem; }
.top .usuario { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.top .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--acc-fondo2); color: var(--acc-soft);
  border: 1px solid var(--acc-borde); display: inline-flex; align-items: center; justify-content: center;
  font-size: .6875rem; font-weight: 700; letter-spacing: .3px;
}
.top .who { margin-right: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-salir { display: inline-flex; align-items: center; gap: 6px; }
.chip-demo {
  flex: 0 0 auto; font-size: .6563rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--acc-soft); border: 1px solid var(--acc-borde); background: var(--acc-fondo); border-radius: 999px; padding: 2px 9px;
}

/* ---------- barra lateral: se expande por hover y por foco de teclado ---------- */
.sb { display: flex; }
.sb:hover, .sb:has(:focus-visible) { width: var(--sb-open); box-shadow: 14px 0 40px -14px #000c; }
.sb:hover .sb-item .tx, .sb:has(:focus-visible) .sb-item .tx { opacity: 1; }
.sb-item { position: relative; }
.sb-item .ic { position: relative; }
.sb-item .tx .tx-corto { display: none; }
.sb-item[aria-current="page"] { background: var(--acc-fondo); color: var(--acc-soft); box-shadow: inset 2px 0 0 var(--acc); }
.sb-item[aria-current="page"] .tx { font-weight: 600; }
/* Enlace a la app hermana, al pie de la barra. */
.sb-pie { margin-top: auto; display: flex; flex-direction: column; }
.sb-ext { color: var(--muted2); }

/* ---------- contenido a toda la pantalla ---------- */
.shell { min-height: 100vh; }
.wrap { outline: none; }

/* ---------- login ---------- */
.login-card .login-linea { color: var(--muted2); font-size: .75rem; margin: -2px 0 14px; letter-spacing: .1px; }
.login-aviso { color: var(--muted2); font-size: .75rem; margin: 14px 0 0; }

/* ---------- celular: barra lateral como cajón con botón hamburguesa ---------- */
.btn-menu { display: none; }
.sb-fondo { display: none; }
@media (max-width: 720px) {
  .btn-menu {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 40px; height: 40px; margin-left: 4px; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; border-radius: 8px;
  }
  .btn-menu:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
  .sb {
    top: var(--topbar); bottom: 0; left: 0; right: auto; width: min(260px, 82vw); height: auto; flex-direction: column;
    border-top: 0; border-right: 1px solid var(--border-soft); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    overflow-x: hidden; overflow-y: auto; justify-content: flex-start;
    transform: translateX(-105%); transition: transform .18s var(--ease); box-shadow: none; z-index: 50;
  }
  body.menu-abierto .sb { transform: none; box-shadow: 14px 0 40px -14px #000c; }
  .sb:hover, .sb:has(:focus-visible) { width: min(260px, 82vw); }
  .sb-item { flex-direction: row; justify-content: flex-start; gap: 0; flex: 0 0 auto; height: 44px; min-height: 40px; margin: 1px 8px; width: calc(100% - 16px); padding: 0; }
  .sb-item .ic { width: 40px; flex: 0 0 40px; }
  .sb-item .tx { opacity: 1; font-size: .875rem; }
  .sb-item .tx .tx-largo { display: inline; }
  .sb-item .tx .tx-corto { display: none; }
  .sb-item[aria-current="page"] { box-shadow: inset 2px 0 0 var(--acc); }
  .sb-pie { margin-top: auto; flex-direction: column; }
  .sb-fondo { position: fixed; inset: var(--topbar) 0 0 0; background: #000a; z-index: 45; }
  body.menu-abierto .sb-fondo { display: block; }
  .shell { padding-left: 0; padding-bottom: 0; }
  .top { gap: 8px; padding: 0 10px 0 0; }
  .top .marca .cubo { width: 40px; }
  .top .miga-raiz, .top .miga-sep { display: none; }
  .top .migas { justify-content: flex-start; }
  .top .btn-salir span { display: none; }
  .top .btn-salir { min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .top .avatar { display: none; }
  .top .usuario { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .sb { transition: none; } }

/* ---------- selector de espacio y marca/cliente (barra superior) ---------- */
.top .sel-espacio { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.top .sel-campo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.top .sel-et { font-size: .6875rem; color: var(--muted2); white-space: nowrap; }
.top .sel-ctl {
  min-height: 40px; max-width: 150px; padding: 0 8px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: .8125rem; cursor: pointer;
}
.top .sel-ctl:hover { border-color: var(--acc-borde); }
.top .sel-ctl:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (max-width: 720px) {
  /* En celular los selects ocupan el lugar de la miga (el título de la pantalla ya dice dónde estás). */
  .top .migas { display: none; }
  .top .sel-espacio { flex: 1 1 0; min-width: 0; }
  .top .sel-campo { flex: 1 1 0; }
  .top .sel-et { display: none; }
  .top .sel-ctl { width: 100%; min-height: 40px; max-width: none; }
}
