/* Shell compartilhado — topbar estilo sistema SaaS */
.app-topbar {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06);
  position: sticky;
  top: 0;
  z-index: 200;
}

.app-topbar-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  min-width: 0;
}

.app-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.app-brand-text {
  line-height: 1.25;
  min-width: 0;
}

.app-brand-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand-tenant {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.app-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 60px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
  display: none;
}

.app-nav-item {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-nav-item:hover {
  color: #1a1a2e;
  background: #fafafa;
}

.app-nav-item.is-active {
  color: #d63384;
  border-bottom-color: #d63384;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid #eceef2;
}

.app-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d63384 0%, #a8175a 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.app-user-info {
  line-height: 1.3;
  min-width: 0;
}

.app-user-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.app-user-role {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.app-logout {
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-logout:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1a1a2e;
}

.app-logout svg {
  display: block;
}

.app-topbar--guest .app-topbar-end {
  display: none;
}

@media (max-width: 900px) {
  .app-topbar-inner {
    padding: 0 16px;
    flex-wrap: wrap;
    gap: 0;
  }

  .app-topbar-end {
    width: 100%;
    order: 3;
    border-top: 1px solid #f0f0f0;
    padding: 8px 0 10px;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  .app-nav {
    width: 100%;
    height: auto;
    margin-right: 0;
    padding-bottom: 2px;
  }

  .app-nav-item {
    padding: 8px 12px;
    margin-bottom: 0;
    border-bottom-width: 2px;
    border-radius: 6px 6px 0 0;
  }

  .app-user {
    width: 100%;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    justify-content: space-between;
  }

  .app-user-name {
    max-width: none;
  }
}
