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

/* ---------- banner superior: marca · migas con selector de cliente · 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; }
.sel-cliente { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.sel-cliente select {
  appearance: none; -webkit-appearance: none; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; height: 32px; padding: 0 30px 0 12px;
  font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; max-width: 260px;
  text-overflow: ellipsis; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.sel-cliente select:hover { border-color: #fb923c66; background: #fb923c0f; }
.sel-cliente select:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sel-cliente select option { background: var(--panel); color: var(--text); }
.sel-flecha { position: absolute; right: 9px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--muted); pointer-events: none; display: flex; }
.top .usuario { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.top .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #fb923c1f; color: var(--acc-soft);
  border: 1px solid #fb923c40; 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 #fb923c55; background: #fb923c14; border-radius: 999px; padding: 2px 9px;
}

/* ---------- panel «Cuentas» (vincular una segunda cuenta de Google) ---------- */
.cuentas { position: relative; }
.btn-cuentas { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; user-select: none; }
.btn-cuentas::-webkit-details-marker { display: none; }
.btn-cuentas:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.cuentas[open] > .btn-cuentas { border-color: #fb923c66; color: var(--acc-soft); background: #fb923c0f; }
.cuentas-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; max-width: calc(100vw - 16px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 14px 16px;
  box-shadow: 0 16px 40px -12px #000c; z-index: 50; display: flex; flex-direction: column; gap: 10px;
}
.cuentas-panel p { margin: 0; }
.cuentas-titulo { font-size: .6875rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted2); font-weight: 700; }
.cuentas-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cuentas-panel li { font-size: .8125rem; color: var(--text); overflow-wrap: anywhere; }
.cuentas-panel .muted { font-size: .8125rem; color: var(--muted); }
.cuentas-panel .btn-ghost { align-self: flex-start; }
.vinculo-aviso { font-size: .75rem; overflow-wrap: anywhere; }
.vinculo-aviso:empty { display: none; }
.vinculo-ok { color: #4ade80; }
.vinculo-error { color: #f87171; }

/* ---------- 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 .tx .tx-corto { display: none; }
.sb-item[aria-current="page"] { background: #fb923c14; color: var(--acc-soft); box-shadow: inset 2px 0 0 var(--acc); }
.sb-item[aria-current="page"] .tx { font-weight: 600; }

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

/* ---------- login ---------- */
.login-aviso { color: var(--muted2); font-size: .75rem; margin: 14px 0 0; }

/* ---------- celular: barra inferior ---------- */
@media (max-width: 720px) {
  .sb { padding-bottom: env(safe-area-inset-bottom); height: calc(56px + env(safe-area-inset-bottom)); overflow: hidden; justify-content: space-around; }
  .sb:hover, .sb:has(:focus-visible) { width: 100%; box-shadow: none; }
  .sb-item { flex: 1 1 0; min-width: 40px; min-height: 40px; height: 56px; padding: 0 2px; }
  .sb-item .tx .tx-largo { display: none; }
  .sb-item .tx .tx-corto { display: inline; }
  .sb-item .tx { opacity: 1; font-size: 9px; }
  .sb-item[aria-current="page"] { box-shadow: inset 0 2px 0 var(--acc); }
  .shell { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .top { gap: 8px; padding: 0 10px 0 0; }
  .top .miga-raiz, .top .miga-sep-sec, .top .miga-sec, .top .miga-sep { display: none; }
  .top .migas { justify-content: flex-start; }
  .sel-cliente select { max-width: 46vw; }
  .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; }
  .btn-cuentas span { display: none; }
  .btn-cuentas { min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
}
@media (max-width: 520px) {
  .cuentas { position: static; }
  .cuentas-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar) + 8px); width: auto; max-width: none; }
}
