:root { --top-navigation-height: 86px; }
.top-navigation {
  min-height: var(--top-navigation-height);
  grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid #334155;
  background:
    linear-gradient(90deg, rgba(56, 189, 248, .055) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(56, 189, 248, .04) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, #07111f, #101d31 62%, #111827);
  box-shadow: 0 6px 20px rgba(2, 6, 23, .32);
}
.top-brand {
  gap: 0;
  height: 58px;
  padding: 0 16px 0 8px;
  border-right: 1px solid #334155;
}
.top-brand .product-identity strong { display: block; color: #fff; font-size: 17px; letter-spacing: .015em; }
.top-brand .product-identity > span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #94a3b8; font-size: 9px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.top-brand .product-identity img { display: block; width: 67px; height: 19px; object-fit: contain; object-position: left center; }
.top-navigation-links { gap: 8px; align-items: center; }
.top-navigation-links a {
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(30,41,59,.92), rgba(15,23,42,.92));
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .015em;
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 2px 5px rgba(0,0,0,.2);
}
.top-navigation-links a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 2px;
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100,116,139,.15);
}
.top-navigation-links a:hover {
  border-color: #64748b;
  background: linear-gradient(180deg, #27364d, #1e293b);
  color: #fff;
}
.top-navigation-links a.active {
  border-color: #38bdf8;
  background: linear-gradient(180deg, #123552, #0f2942);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.18), 0 0 18px rgba(56,189,248,.12);
}
.top-navigation-links a.active::before {
  background: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56,189,248,.15), 0 0 9px #38bdf8;
}
.top-navigation-meta {
  padding: 9px 11px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: rgba(15,23,42,.7);
}
@media (max-width: 1050px) {
  .top-navigation { grid-template-columns: 165px minmax(0,1fr); gap: 8px; padding: 0 14px; }
  .top-brand { padding-right: 8px; }
  .top-navigation-links { gap: 4px; }
  .top-navigation-links a { min-height: 42px; padding: 0 8px; font-size: 9px; }
  .top-navigation-links a::before { display: none; }
}
@media (max-width: 760px) {
  :root { --top-navigation-height: 62px; }
  .top-navigation { grid-template-columns: 1fr auto; padding: 0 12px; }
  .top-brand { height: 48px; border-right: 0; }
  .top-brand .product-identity strong { font-size: 15px; }
  .top-navigation-links { align-items: stretch; gap: 4px; }
  .top-navigation-links a { min-height: 42px; }
}

.top-navigation-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}
.top-user-menu { position: relative; color: #e2e8f0; }
.top-user-menu > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 7px 11px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, .78);
  cursor: pointer;
  list-style: none;
}
.top-user-menu > summary::-webkit-details-marker { display: none; }
.top-user-menu > summary::after {
  content: "⌄";
  color: #94a3b8;
  font-size: 12px;
}
.top-user-menu[open] > summary,
.top-user-menu > summary:hover {
  border-color: #38bdf8;
  background: #14243a;
}
.top-user-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(56, 189, 248, .2);
}
.top-user-identity { display: grid; min-width: 78px; line-height: 1.1; }
.top-user-identity strong { max-width: 145px; overflow: hidden; color: #f8fafc; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.top-user-identity small { margin-top: 4px; color: #94a3b8; font-size: 8px; text-transform: uppercase; }
.top-user-popover {
  position: absolute;
  z-index: 200;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 230px;
  padding: 15px;
  border: 1px solid #334155;
  border-radius: 11px;
  background: #0f1d31;
  box-shadow: 0 16px 35px rgba(2, 6, 23, .45);
}
.top-user-popover > span { color: #94a3b8; font-size: 9px; text-transform: uppercase; }
.top-user-popover > strong { margin-top: 5px; color: #fff; font-size: 13px; }
.top-user-popover > small { margin-top: 3px; color: #38bdf8; font-size: 10px; }
.top-user-popover form { margin-top: 14px; }
.top-user-popover button {
  width: 100%;
  min-height: 36px;
  border: 1px solid #475569;
  border-radius: 7px;
  background: #1e293b;
  color: #f8fafc;
  font-weight: 750;
  cursor: pointer;
}
.top-user-popover button:hover { border-color: #ef4444; background: #3b1d26; }
@media (max-width: 1250px) {
  .top-user-identity { display: none; }
  .top-user-menu > summary::after { display: none; }
}
@media (max-width: 760px) {
  .top-navigation-meta { display: none; }
}

/* Keep operator name and authentication provider visually separated. */
.top-user-menu > summary {
  min-width: 158px;
}
.top-user-identity {
  display: flex;
  min-width: 92px;
  max-width: 150px;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.top-user-identity strong,
.top-user-identity small {
  display: block;
  width: 100%;
  line-height: 1.15;
}
.top-user-identity small {
  margin-top: 3px;
  white-space: nowrap;
}
.top-user-popover {
  top: calc(100% + 6px);
}
@media (max-width: 1250px) {
  .top-user-menu > summary { min-width: 52px; }
}

/* Override the generic navigation span rule so the initial is truly centered. */
.top-navigation-meta .top-user-avatar {
  display: grid;
  flex: 0 0 29px;
  padding: 0;
  place-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  text-indent: 0;
}


/* User-owned display language preference. */
.top-language-form{margin:10px -2px 6px;padding:10px 2px;border-top:1px solid #e4e7ec;border-bottom:1px solid #e4e7ec}
.top-language-form label{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px}
.top-language-form label>span{color:#475467;font-size:10px;font-weight:800}
.top-language-form select{min-width:126px;padding:7px 28px 7px 9px;border:1px solid #98a2b3;border-radius:7px;background:#fff;color:#101828;font:inherit;font-size:11px;font-weight:700;cursor:pointer}
.top-language-form select:focus{outline:2px solid #84caff;outline-offset:1px}


/* Make the active display language discoverable from the closed user menu. */
.top-user-language-flag {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 7px;
  background: rgba(15, 23, 42, .72);
  font-size: 16px;
  line-height: 1;
}

.top-user-language-flag svg {
  display: block;
  width: 18px;
  height: 13px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}


/* Always-visible deployment identity for distinguishing fresh Azure releases. */
.top-build-indicator {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 7px;
  min-width: 132px;
  min-height: 46px;
  padding: 5px 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, .78);
  color: #e2e8f0;
  line-height: 1.05;
}
.top-build-environment {
  padding: 3px 5px;
  border: 1px solid rgba(251, 191, 36, .34);
  border-radius: 5px;
  background: rgba(245, 158, 11, .14);
  color: #fbbf24;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}
.top-build-version {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.top-build-indicator code {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}
.top-build-indicator time {
  color: #94a3b8;
  font-size: 8px;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 1450px) {
  .top-build-indicator {
    min-width: 74px;
    grid-template-columns: auto;
    gap: 3px;
  }
  .top-build-version { text-align: left; }
  .top-build-indicator time { display: none; }
}
@media (max-width: 1150px) {
  .top-build-indicator { display: none; }
}


/* Administrator navigation groups platform-only tools. */
.top-admin-menu{position:relative}
.top-admin-menu>summary{
  display:flex;
  align-items:center;
  min-height:46px;
  padding:0 15px;
  border:1px solid #334155;
  border-radius:10px;
  background:linear-gradient(180deg,rgba(30,41,59,.92),rgba(15,23,42,.92));
  color:#cbd5e1;
  cursor:pointer;
  list-style:none;
  font-size:11px;
  font-weight:760;
  letter-spacing:.015em;
  box-shadow:inset 0 1px rgba(255,255,255,.035),0 2px 5px rgba(0,0,0,.2);
}
.top-admin-menu>summary::-webkit-details-marker{display:none}
.top-admin-menu>summary::before{
  content:"";
  width:6px;
  height:6px;
  margin-right:8px;
  border-radius:2px;
  background:#64748b;
  box-shadow:0 0 0 2px rgba(100,116,139,.15);
}
.top-admin-menu>summary::after{content:"⌄";margin-left:8px;color:#94a3b8;font-size:11px}
.top-admin-menu>summary:hover,.top-admin-menu[open]>summary{
  border-color:#64748b;
  background:linear-gradient(180deg,#27364d,#1e293b);
  color:#fff;
}
.top-admin-menu.active>summary{
  border-color:#38bdf8;
  background:linear-gradient(180deg,#123552,#0f2942);
  color:#f8fafc;
  box-shadow:inset 0 0 0 1px rgba(56,189,248,.18),0 0 18px rgba(56,189,248,.12);
}
.top-admin-menu.active>summary::before{background:#38bdf8;box-shadow:0 0 0 2px rgba(56,189,248,.15),0 0 9px #38bdf8}
.top-admin-popover{
  position:absolute;
  z-index:320;
  top:calc(100% + 8px);
  right:0;
  display:grid;
  width:245px;
  padding:7px;
  border:1px solid #334155;
  border-radius:11px;
  background:#0f1d31;
  box-shadow:0 18px 38px rgba(2,6,23,.48);
}
.top-navigation-links .top-admin-popover a{
  display:flex;
  min-height:38px;
  padding:0 10px;
  border:0;
  border-radius:7px;
  background:transparent;
  box-shadow:none;
  color:#d7e0ec;
  font-size:11px;
}
.top-navigation-links .top-admin-popover a::before{display:block;width:5px;height:5px;margin-right:9px}
.top-navigation-links .top-admin-popover a:hover{background:#1e3048;color:#fff}
.top-navigation-links .top-admin-popover a.active{background:#123552;color:#fff;box-shadow:inset 3px 0 #38bdf8}
@media(max-width:1050px){
  .top-admin-menu>summary{min-height:42px;padding:0 8px;font-size:9px}
  .top-admin-menu>summary::before{display:none}
}
@media(max-width:760px){
  .top-admin-menu>summary{justify-content:space-between}
  .top-admin-popover{position:static;width:auto;margin-top:4px;box-shadow:none}
}


/* Direct Administration navigation */
.top-administration-menu {
  position: relative;
  display: flex;
  align-self: stretch;
  align-items: center;
}
.top-administration-menu > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}
.top-administration-popover {
  position: absolute;
  z-index: 1200;
  top: calc(100% - 2px);
  left: 0;
  width: max-content;
  min-width: 240px;
  padding: 8px;
  border: 1px solid #30445f;
  border-radius: 10px;
  background: #0d1b2e;
  box-shadow: 0 18px 40px rgb(3 12 25 / 35%);
  display: grid;
  gap: 3px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}
.top-administration-popover a {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #f5f8fc;
  text-decoration: none;
  white-space: nowrap;
}
.top-administration-popover a:hover,
.top-administration-popover a:focus-visible {
  background: #16324f;
  color: #fff;
  outline: none;
}
.top-administration-menu:hover .top-administration-popover,
.top-administration-menu:focus-within .top-administration-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 980px) {
  .top-administration-menu {
    display: block;
  }
  .top-administration-popover {
    position: static;
    width: auto;
    margin: 4px 0 0 12px;
    border-color: #263c57;
    box-shadow: none;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
  .top-administration-menu:focus-within .top-administration-popover {
    display: grid;
  }
}


/* Desktop navigation must not clip the Administration flyout. */
@media (min-width: 1051px) {
  .top-navigation-links {
    overflow: visible;
  }
}


/* Administration is a direct flyout, not a landing-page link. */
.top-navigation-links .top-administration-trigger{
  display:inline-flex;
  min-height:46px;
  align-items:center;
  padding:0 15px;
  border:1px solid #334155;
  border-radius:10px;
  background:linear-gradient(180deg,rgba(30,41,59,.92),rgba(15,23,42,.92));
  color:#cbd5e1;
  font:inherit;
  font-size:11px;
  font-weight:760;
  letter-spacing:.015em;
  cursor:pointer;
  box-shadow:inset 0 1px rgba(255,255,255,.035),0 2px 5px rgba(0,0,0,.2);
}
.top-administration-trigger::before{content:"";width:6px;height:6px;margin-right:8px;border-radius:2px;background:#64748b;box-shadow:0 0 0 2px rgba(100,116,139,.15)}
.top-administration-trigger:hover,.top-administration-trigger:focus-visible{border-color:#64748b;background:linear-gradient(180deg,#27364d,#1e293b);color:#fff;outline:none}
.top-administration-trigger.active{border-color:#38bdf8;background:linear-gradient(180deg,#123552,#0f2942);color:#f8fafc;box-shadow:inset 0 0 0 1px rgba(56,189,248,.18),0 0 18px rgba(56,189,248,.12)}
.top-administration-trigger.active::before{background:#38bdf8;box-shadow:0 0 0 2px rgba(56,189,248,.15),0 0 9px #38bdf8}
@media(max-width:1050px){.top-navigation-links .top-administration-trigger{min-height:42px;padding:0 8px;font-size:9px}.top-administration-trigger::before{display:none}}


/* An active pending Agent request is an operational signal, not a passive link. */
.top-navigation-links .top-pending-agent-button{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:0 10px;border:1px solid #35516f;border-radius:9px;background:rgba(15,35,60,.8);color:#bed0e4;font-size:10px;font-weight:800;text-decoration:none;box-shadow:inset 0 1px rgba(255,255,255,.04),0 2px 4px rgba(0,0,0,.18)}
.top-navigation-links .top-pending-agent-button:hover{border-color:#5f86ad;background:#183452;color:#fff}
.top-pending-agent-mark{display:grid;width:18px;height:18px;place-items:center;border-radius:6px;background:#294866;color:#8fe9ff;font-size:14px;font-weight:900;line-height:1}
.top-pending-agent-button b{display:grid;min-width:18px;height:18px;padding:0 4px;place-items:center;border-radius:999px;background:#f04438;color:#fff;font-size:9px;box-shadow:0 0 0 3px rgba(240,68,56,.15)}
.top-navigation-links .top-pending-agent-button.has-pending{border-color:#f79009;background:linear-gradient(180deg,#3a2b15,#262015);color:#fff;box-shadow:inset 0 0 0 1px rgba(247,144,9,.16),0 0 14px rgba(247,144,9,.16)}
.top-pending-agent-button.has-pending .top-pending-agent-mark{background:#f79009;color:#10233e;animation:traze-pending-pulse 1.6s ease-in-out infinite}
@keyframes traze-pending-pulse{50%{transform:scale(.86);box-shadow:0 0 0 5px rgba(247,144,9,.14)}}
@media(max-width:1150px){.top-navigation-links .top-pending-agent-button{min-height:42px;padding:0 8px;font-size:9px}.top-pending-agent-button>span:nth-child(2){display:none}}
@media(max-width:760px){.top-navigation-links .top-pending-agent-button{justify-content:flex-start}.top-pending-agent-button>span:nth-child(2){display:inline}}
@media(prefers-reduced-motion:reduce){.top-pending-agent-button.has-pending .top-pending-agent-mark{animation:none}}
