/* Hotfix ahead of the CRM deploy (same rule lands in apps/business global.css):
   Max and Pro list more doors than a laptop screen is tall. */
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Demo sign-in panel. Uses the CRM's own tokens from global.css (DESIGN.md). */
.demo-cuentas {
  --demo-ease: var(--ease-out, cubic-bezier(0.19, 1, 0.22, 1));
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.demo-cuentas summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-s);
}

.demo-cuentas summary::-webkit-details-marker { display: none; }

.demo-cuentas > summary {
  font-size: var(--size-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.demo-cuentas summary svg {
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  transform: rotate(90deg);
  transition: transform 200ms var(--demo-ease);
}

.demo-cuentas details:not([open]) > summary svg,
.demo-cuentas:not([open]) > summary svg { transform: rotate(0deg); }

.demo-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.demo-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  margin: 0 calc(var(--space-3) * -1);
  width: calc(100% + var(--space-3) * 2);
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 160ms var(--demo-ease);
}

.demo-fila:active { transform: scale(0.97); }

.demo-texto { display: grid; gap: 2px; min-width: 0; }

.demo-texto b { font-size: 15px; font-weight: 600; }

.demo-texto small {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-usuario { font-variant-numeric: tabular-nums; color: var(--ink); }

.demo-fila svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  transition: transform 200ms var(--demo-ease), color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .demo-fila:hover { background: var(--fill); }
  .demo-fila:hover svg { color: var(--accent); transform: translateX(2px); }
  .demo-cuentas summary:hover { color: var(--ink); }
}

.demo-fila:focus-visible,
.demo-cuentas summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.demo-fila[aria-busy='true'] { background: var(--fill-strong); }
.demo-fila[aria-busy='true'] svg { color: var(--accent); }

.demo-grupo {
  margin-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.demo-grupo > summary {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.demo-cuenta {
  margin-left: 6px;
  font-weight: 500;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.demo-nota {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--ink-muted);
}

.demo-nota code {
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .demo-cuentas summary svg,
  .demo-fila,
  .demo-fila svg { transition: none; }
}

/* Top-right account switcher on every signed-in page of the demo. */
#demo-salir {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-4) 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  box-shadow: 0 1px 2px rgba(46, 35, 21, 0.08), 0 6px 18px -8px rgba(46, 35, 21, 0.25);
  color: var(--ink);
  font: inherit;
  font-size: var(--size-small);
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease-out, ease-out), background-color 150ms ease;
}

#demo-salir svg { width: 16px; height: 16px; color: var(--ink-muted); }
#demo-salir:active { transform: scale(0.97); }
#demo-salir:disabled { opacity: 0.6; cursor: progress; }
#demo-salir:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  #demo-salir:hover { background: var(--surface); }
  #demo-salir:hover svg { color: var(--accent); }
}

/* On a phone it rides in the top bar's right corner. */
@media (max-width: 639px) {
  #demo-salir { top: 8px; right: 12px; min-height: 32px; padding: 0 var(--space-3); }
  #demo-salir span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #demo-salir { transition: none; }
}
