/*
 * Application shell and project navigation.
 *
 * This layer intentionally follows app.css so global navigation, contextual
 * navigation and actions have one predictable hierarchy without disturbing
 * the existing workflow-specific layouts.
 */

:root {
  --shell-control-radius: 8px;
  --shell-focus-ring: 0 0 0 3px rgba(95, 200, 255, 0.32);
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.primary-button,
.secondary-button,
.danger-button,
.download-link {
  border-radius: var(--shell-control-radius);
  font-weight: 700;
  letter-spacing: 0;
}

.topbar {
  min-height: 74px;
  height: 74px;
  gap: 26px;
}

.topbar .brand {
  flex: 0 0 auto;
  gap: 14px;
}

.topbar .brand img {
  width: 184px;
}

.topbar .brand-product {
  padding-left: 14px;
}

.topbar .brand-product b {
  font-size: 13px;
  letter-spacing: 0.075em;
}

.global-nav {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.global-nav-link {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: var(--shell-control-radius);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.global-nav-link:hover,
.global-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.global-nav-link:focus-visible,
.user-menu summary:focus-visible,
.project-nav-link:focus-visible {
  outline: none;
  box-shadow: var(--shell-focus-ring);
}

.global-nav-link[aria-current="page"] {
  background: rgba(95, 200, 255, 0.13);
  color: #fff;
}

.global-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: -16px;
  left: 13px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
}

.global-nav-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--navy-deep);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.topbar .topbar-actions {
  flex: 0 0 auto;
  gap: 13px;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu .user-chip {
  min-height: 46px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: var(--shell-control-radius);
  cursor: pointer;
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid rgba(95, 200, 255, 0.45);
  border-radius: 50%;
  object-fit: cover;
}

.user-menu .user-menu-name {
  min-width: 0;
  max-width: 130px;
}

.user-menu .user-menu-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 4px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.65);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.65);
  transform: rotate(45deg);
  transition: margin 0.18s ease, transform 0.18s ease;
}

.user-menu[open] .user-menu-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.user-menu[open] .user-chip,
.user-menu .user-chip:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.user-menu .user-chip small {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(3, 47, 80, 0.2);
  color: var(--ink);
}

.user-menu-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 4px 6px;
  padding: 7px 7px 11px;
  border-bottom: 1px solid var(--line);
}

.user-menu-identity strong,
.user-menu-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-identity strong {
  color: var(--navy);
  font-size: 12px;
}

.user-menu-identity span {
  color: var(--muted);
  font-size: 10px;
}

.user-menu-link,
.user-menu-logout-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--navy);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.user-menu-link:hover,
.user-menu-link:focus-visible,
.user-menu-link[aria-current="page"],
.user-menu-logout-button:hover,
.user-menu-logout-button:focus-visible {
  outline: none;
  background: var(--sky);
  color: var(--navy);
}

.user-menu-logout {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.user-menu-logout-button {
  color: var(--danger);
}

/* Project hero: compact context first, project actions second. */
.project-hero {
  padding: 30px 0 0;
}

.project-hero-inner {
  display: block;
}

.project-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.project-breadcrumb .back-link {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.project-breadcrumb .back-link:hover {
  color: var(--cyan);
}

.project-hero-meta {
  min-height: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
}

.project-access-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.project-access-summary .access-badge {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.project-access-summary .access-badge.restricted {
  background: rgba(255, 210, 107, 0.14);
  color: #ffe09b;
}

.project-access-summary .access-badge.company {
  background: rgba(95, 200, 255, 0.14);
  color: var(--cyan-bright);
}

.project-hero-main {
  min-height: 145px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 18px 0 28px;
}

.project-hero-copy {
  min-width: 0;
}

.project-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(36px, 4.1vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.project-hero p {
  margin-bottom: 9px;
  font-size: 14px;
}

.project-hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.project-primary-action {
  min-height: 48px;
  padding-inline: 21px;
  box-shadow: 0 9px 24px rgba(2, 31, 52, 0.18);
}

.project-nav {
  min-height: 52px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.project-nav-link {
  position: relative;
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 650;
}

.project-nav-link:hover,
.project-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.project-nav-link[aria-current="page"] {
  color: #fff;
}

.project-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
}

#project-meetings {
  scroll-margin-top: 92px;
}

@media (max-width: 1120px) {
  .topbar {
    gap: 14px;
    padding-inline: 20px;
  }

  .topbar .brand img {
    width: 160px;
  }

  .topbar .brand-product {
    display: none;
  }

  .global-nav-link {
    padding-inline: 10px;
  }

}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    row-gap: 5px;
    padding: 8px 12px 0;
  }

  .topbar .brand {
    order: 1;
  }

  .topbar .brand img {
    width: 148px;
  }

  .topbar .topbar-actions {
    order: 2;
    margin-left: auto;
  }

  .global-nav {
    order: 3;
    flex: 0 0 calc(100% + 24px);
    width: calc(100% + 24px);
    min-height: 43px;
    justify-content: flex-start;
    margin-inline: -12px;
    padding-inline: 8px;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    scrollbar-width: none;
  }

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

  .global-nav-link {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 11px;
  }

  .global-nav-link[aria-current="page"]::after {
    right: 11px;
    bottom: 0;
    left: 11px;
  }

  .user-menu .user-menu-name {
    display: none;
  }

  .user-menu-panel {
    position: fixed;
    top: 62px;
    right: 12px;
  }

  .project-hero {
    padding-top: 23px;
  }

  .project-hero-main {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 16px 0 24px;
  }

  .project-hero h1 {
    font-size: clamp(32px, 10vw, 42px);
  }

  .project-hero-actions,
  .project-primary-action {
    width: 100%;
  }

  .project-nav {
    width: calc(100% + 24px);
    margin-left: -12px;
    padding-inline: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .project-nav-link {
    min-width: 104px;
    padding-inline: 14px;
  }
}

@media (max-width: 420px) {
  .topbar .brand img {
    width: 132px;
  }

  .user-menu .user-chip {
    padding-inline: 4px;
  }

  .project-hero-meta {
    align-items: flex-start;
  }

  .project-access-summary {
    flex-basis: 100%;
  }
}
