/* ============================================================================
   topbar.css — Topbar horizontal fixa no topo da área main.
   Contém: breadcrumb | busca central | refresh + sino + avatar (dropdown).
   ============================================================================ */

/* Topbar container — sticky no topo da .main */
.ell-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(6px);
}

.ell-topbar__left,
.ell-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}
.ell-topbar__center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* Breadcrumb */
.ell-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.ell-breadcrumb__item {
  color: var(--text-3);
  white-space: nowrap;
}
.ell-breadcrumb__item--link {
  cursor: pointer;
  transition: color .15s ease;
  text-decoration: none;
  /* M28: garante área de toque mínima sem mudar visual horizontal */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 2px;
}
.ell-breadcrumb__item--link:hover,
.ell-breadcrumb__item--link:focus-visible {
  color: var(--accent);
}
.ell-breadcrumb__sep {
  width: 12px;
  height: 12px;
  color: var(--text-4);
  stroke-width: 1.5;
}
.ell-breadcrumb__current {
  color: var(--text);
  font-weight: 500;
}

/* Search trigger (abre command palette) */
.ell-search-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 12px;
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-3);
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  min-width: 280px;
  max-width: 480px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ell-search-btn:hover {
  background: var(--bg-elev);
  border-color: var(--line);
}
.ell-search-btn > i[data-lucide] {
  width: 14px; height: 14px;
  stroke-width: 1.5;
  flex-shrink: 0;
}
.ell-search-btn > span:not(.ell-kbd) {
  flex: 1;
  text-align: left;
}
.ell-kbd {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-3);
}

/* Topbar ícones */
.ell-topbar__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Botão hamburger mobile — Sprint C. Escondido por padrão, só aparece em
   mobile via @media(max-width:640px) no core.css. */
.ell-topbar__mobile-menu {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  margin-right: var(--space-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ell-topbar__mobile-menu:hover {
  background: var(--bg-sunken);
  color: var(--text);
}
.ell-topbar__icon:hover {
  background: var(--bg-sunken);
  color: var(--text);
}
.ell-topbar__icon > i[data-lucide] {
  width: 16px; height: 16px;
  stroke-width: 1.5;
  transition: transform .3s ease;
}
.ell-topbar__icon.is-spinning > i[data-lucide="refresh-cw"] {
  animation: spin 0.7s linear;
}

/* Bolinha de status da conexão (verde=ok, vermelha=offline) */
.ell-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: ell-pulse-ok 2.5s ease-out infinite;
  margin-right: 6px;
  flex-shrink: 0;
}
.ell-status-dot.is-offline {
  background: var(--err);
  box-shadow: 0 0 0 0 var(--err);
  animation: ell-pulse-err 1.4s ease-out infinite;
}
@keyframes ell-pulse-ok {
  0%   { box-shadow: 0 0 0 0 rgba(80, 200, 120, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(80, 200, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(80, 200, 120, 0); }
}
@keyframes ell-pulse-err {
  0%   { box-shadow: 0 0 0 0 rgba(224, 85, 85, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(224, 85, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 85, 85, 0); }
}

.ell-topbar__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ell-topbar__badge--dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  top: 6px;
  right: 6px;
}

/* Avatar */
.ell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur) var(--ease);
  font-family: inherit;
}
.ell-avatar:hover { border-color: var(--line-strong); }
.ell-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Dropdown do user menu ───────────────────────────────────────── */
.ell-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  z-index: 100;
  padding: 6px;
}
.ell-dropdown__header {
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line-subtle);
  margin-bottom: 4px;
}
.ell-dropdown__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.ell-dropdown__email {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  word-break: break-all;
}
.ell-dropdown__role {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
}
.ell-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--text-sm);
  background: transparent;
  border: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.ell-dropdown__item:hover {
  background: var(--bg-sunken);
  color: var(--text);
}
.ell-dropdown__item > i[data-lucide] {
  width: 15px; height: 15px;
  stroke-width: 1.5;
  color: var(--text-3);
}
.ell-dropdown__item:hover > i[data-lucide] { color: var(--text); }
.ell-dropdown__divider {
  height: 1px;
  background: var(--line-subtle);
  margin: 4px 0;
}

/* ── Avatar wrapper pra position:relative (pro dropdown) ─────────── */
.ell-topbar__right > .ell-avatar,
.ell-topbar__right > .ell-topbar__icon {
  position: relative;
}

/* ── Painel de notificações (dropdown do sino) ─────────────────── */
/* Sessão 31 movou o painel pro document.body com position:fixed inline —
   as propriedades position/top/right abaixo foram removidas pra evitar conflito. */
.ell-notif-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 360px;
  max-width: calc(100vw - 16px);
  max-height: 480px;
  overflow: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.ell-notif-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.ell-notif-panel__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.ell-notif-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}
.ell-notif-item {
  padding: var(--space-3);
  border-radius: var(--radius);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
}
.ell-notif-item:hover { background: var(--bg-sunken); }
.ell-notif-item.unread { background: var(--accent-soft); }
.ell-notif-item__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ell-notif-item__icon > i[data-lucide] { width: 14px; height: 14px; stroke-width: 1.5; }
.ell-notif-item__body { flex: 1; min-width: 0; }
.ell-notif-item__title { font-size: var(--text-sm); font-weight: 500; color: var(--text); }
.ell-notif-item__desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.ell-notif-item__time { font-size: 11px; color: var(--text-4); margin-top: 4px; }

.ell-notif-panel__empty {
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* Remove .sb-foot que antes tinha refresh+logout — vira simples rodapé */
.sb-foot {
  padding: var(--space-3);
  font-size: 11px;
  color: var(--text-4);
  text-align: center;
}

/* Esconder conteúdo antigo de botões da sb-foot que foram pro topbar */
.sb-foot > button { display: none; }
