.shared-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 6px 10px;
}

.shared-home-icon {
  display: flex;
  align-items: center;
  width: 48px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}

.shared-home-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.shared-banner {
  display: block;
  width: min(620px, 48%);
  max-height: 80px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  flex: 0 1 auto;
  margin: 0 auto;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  cursor: pointer;
  position: relative;
  min-height: 36px;
}

.user-button img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
}

.user-button span {
  font-weight: 500;
  color: #1f2937;
  font-size: 13px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  min-width: 260px;
  z-index: 200;
  flex-direction: column;
  padding: 4px;
}

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  text-decoration: none;
  color: #1f2937;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  border-radius: 6px;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: #eef2ff;
}

/* ── Divisória vertical ── */
.shared-topbar-divider {
  width: 1px;
  height: 28px;
  background: #d1d5db;
  flex: 0 0 auto;
  margin: 0 2px;
}

/* ── Título da página no topbar ── */
.shared-page-title-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  margin-right: 8px;
}

.shared-page-title-area .page-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.shared-page-title-area .page-subtitle {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Dark mode para componentes do shared-header ── */
html.dark .shared-topbar {
  background: #161b22;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html.dark .shared-topbar-divider {
  background: #30363d;
}

html.dark .shared-page-title-area .page-title {
  color: #e6edf3;
}

html.dark .shared-page-title-area .page-subtitle {
  color: #8b949e;
}

html.dark .user-button {
  background: #21262d;
  border-color: #30363d;
}

html.dark .user-button span {
  color: #c9d1d9;
}

html.dark .user-dropdown {
  background: #161b22;
  border-color: #30363d;
}

html.dark .user-dropdown a,
html.dark .user-dropdown button {
  color: #c9d1d9;
}

html.dark .user-dropdown a:hover,
html.dark .user-dropdown button:hover {
  background: #21262d;
}

html.dark .theme-toggle-btn {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

html.dark .theme-toggle-btn:hover {
  background: #30363d;
  border-color: #8b949e;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.theme-toggle-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

@media (max-width: 860px) {
  .shared-banner {
    width: 58vw;
    max-height: 44px;
  }

  .user-button span {
    display: none;
  }

  .shared-topbar {
    padding: 6px 8px;
  }

  .shared-page-title-area .page-title {
    font-size: 12px;
  }

  .shared-page-title-area .page-subtitle {
    display: none;
  }
}
