:root {
  --user-bar-bg: var(--brand-blue, #1c4d8c);
}

/* Shared top navigation / user bar */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  background: var(--user-bar-bg);
  color: #fff;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  opacity: 0.85;
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  text-transform: none;
  white-space: nowrap;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.user-link {
  color: inherit;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s, transform 0.1s;
  font-weight: 500;
  white-space: nowrap;
}

.user-link:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.user-link:active {
  transform: scale(0.97);
}

.user-link.active {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

@media (min-width: 701px) {
  .user-nav {
    gap: 4px;
  }
}

.logout-btn {
  padding: 6px 14px;
  background: rgba(220, 53, 69, 0.85);
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.1s;
}

.logout-btn:hover {
  background: rgba(220, 53, 69, 1);
}

.logout-btn:active {
  transform: scale(0.97);
}

@media (max-width: 700px) {
  .user-bar {
    padding: 10px 14px;
  }

  .user-name {
    max-width: 62vw;
  }
}

@media print {
  .user-bar {
    display: none !important;
  }
}
