/* Canonical live statistics bar used by the dashboard and every shell page. */
.ua-livebar,
.ua-livebar * {
  box-sizing: border-box;
}

.ua-livebar {
  position: relative;
  /* The alert/user menus must stay above the desktop window-tab strip. */
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 5px 7px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--ua-accent, #e7b62f) 34%, rgba(126, 151, 182, .24));
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--ua-accent, #e7b62f) 10%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--ua-theme-topbar, #0d1725) 94%, white 3%), color-mix(in srgb, var(--ua-theme-topbar, #0d1725) 90%, black 8%));
  color: var(--ua-ds-text, #dce7f4);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .045);
  direction: rtl;
  isolation: isolate;
  justify-content: space-between;
}

.ua-livebar--shell {
  margin-top: 6px;
  margin-bottom: 5px;
}

.ua-livebar--dashboard {
  width: 100%;
  margin: 0 0 6px;
}

.ua-livebar__chip,
.ua-livebar__user > summary {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  min-width: 0;
  padding: 0 8px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--ua-control-border, rgba(126, 151, 182, .26)) 74%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ua-stat-chip-bg, #101d2d) 90%, transparent);
  color: var(--ua-stat-chip-text, var(--ua-ds-text, #dce7f4));
  font-family: inherit;
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.ua-livebar__chip strong {
  display: inline-block;
  min-width: 1ch;
  color: var(--ua-sem-title,var(--ua-ds-title,#f7fbff));
  font-size: 12.5px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ua-livebar__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ua-livebar__brand {
  max-width: 150px;
  color: color-mix(in srgb, var(--ua-accent, #e7b62f) 86%, white 14%);
  border-color: color-mix(in srgb, var(--ua-accent, #e7b62f) 34%, transparent);
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 8%, var(--ua-stat-chip-bg, #101d2d));
}

.ua-livebar__company {
  max-width: 105px;
}

.ua-livebar__icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--ua-sem-icon,#9eacbd);
  font-size: 11px;
}

.ua-livebar__chip.is-green strong { color: var(--ua-sem-success,#78d8b0); }
.ua-livebar__chip.is-red strong { color: var(--ua-sem-danger,#ef8a92); }
.ua-livebar__chip.is-yellow strong { color: var(--ua-sem-warning,#d9bf7b); }
.ua-livebar__chip.is-purple strong { color: var(--ua-sem-purple,#f7fbff); }
.ua-livebar__system.is-green strong { color: var(--ua-sem-success,#78d8b0); }
.ua-livebar__system.is-red strong { color: var(--ua-sem-danger,#ef8a92); }
.ua-livebar__system.is-yellow strong { color: var(--ua-sem-warning,#d9bf7b); }
.ua-livebar__system.is-pending strong,
.ua-livebar__chip.is-muted strong { color: var(--ua-sem-muted,#8fa0b5); }

/* Network health is the only main metric whose icon carries a semantic color. */
body.ua-authed .ua-livebar__system.is-green .ua-livebar__icon,
body.ua-authed .ua-livebar__system.is-green .ua-livebar__icon :is(i,.fa,span) { color: #37d69b !important; }
body.ua-authed .ua-livebar__system.is-yellow .ua-livebar__icon,
body.ua-authed .ua-livebar__system.is-yellow .ua-livebar__icon :is(i,.fa,span) { color: #f3b82f !important; }
body.ua-authed .ua-livebar__system.is-red .ua-livebar__icon,
body.ua-authed .ua-livebar__system.is-red .ua-livebar__icon :is(i,.fa,span) { color: #f0646f !important; }
body.ua-authed .ua-livebar__system.is-pending .ua-livebar__icon,
body.ua-authed .ua-livebar__system.is-pending .ua-livebar__icon :is(i,.fa,span) { color: var(--ua-sem-muted,#8fa0b5) !important; }

.ua-livebar__brand .ua-livebar__icon,
.ua-livebar__alert-trigger .ua-livebar__icon { color: color-mix(in srgb, var(--ua-accent, #e7b62f) 70%, #dbe5f0 30%); }

/* The global semantic-color guard is useful in tables, but the compact main
   bar intentionally uses one calm icon palette and reserves color for health. */
body.ua-authed .ua-livebar__chip:is(.is-green,.is-red,.is-purple):not(.ua-livebar__system) .ua-livebar__icon,
body.ua-authed .ua-livebar__chip:is(.is-green,.is-red,.is-purple):not(.ua-livebar__system) .ua-livebar__icon :is(i,.fa,span) {
  color: var(--ua-sem-icon,#9eacbd) !important;
}
body.ua-authed .ua-livebar__chip:is(.is-green,.is-red,.is-purple):not(.ua-livebar__system) > strong {
  color: var(--ua-sem-title,var(--ua-ds-title,#f7fbff)) !important;
}
body.ua-authed .ua-livebar__chip:is(.is-green,.is-red,.is-purple):not(.ua-livebar__system) > .ua-livebar__label {
  color: var(--ua-stat-chip-text, var(--ua-ds-text, #dce7f4)) !important;
}

.ua-livebar__alerts,
.ua-livebar__user {
  position: relative;
  flex: 0 1 auto;
  height: 32px;
  margin: 0;
}

.ua-livebar__alerts > summary,
.ua-livebar__user > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.ua-livebar__alert-trigger {
  color: color-mix(in srgb, var(--ua-accent, #e7b62f) 82%, white 18%);
  border-color: color-mix(in srgb, var(--ua-accent, #e7b62f) 34%, transparent);
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 7%, var(--ua-stat-chip-bg, #101d2d));
}

.ua-livebar__alerts[open] > .ua-livebar__alert-trigger {
  border-color: color-mix(in srgb, var(--ua-accent, #e7b62f) 58%, transparent);
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 13%, var(--ua-stat-chip-bg, #101d2d));
}

.ua-livebar__alerts > summary::-webkit-details-marker,
.ua-livebar__user > summary::-webkit-details-marker { display: none; }

.ua-livebar__icon--bell .nocx-alert-badge {
  position: absolute;
  inset: -7px auto auto -8px;
}

.ua-livebar__alerts .nocx-alert-popover {
  position: absolute !important;
  top: calc(100% + 9px) !important;
  right: auto !important;
  bottom: auto !important;
  left: 4px !important;
  width: min(420px, calc(100vw - 40px)) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 40px) !important;
  max-height: 330px !important;
  margin: 0 !important;
  overflow: hidden !important;
  transform: none !important;
  z-index: 1005 !important;
  border-color: var(--ua-ds-line) !important;
  background: var(--ua-theme-menu,#0a1625) !important;
  color: var(--ua-ds-text) !important;
}

.ua-livebar__alerts .nocx-alert-popover__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 44px !important;
  padding: 8px 11px !important;
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--ua-accent, #e7b62f) 28%, transparent) !important;
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 6%, var(--ua-theme-menu,#0a1625)) !important;
}

.ua-livebar__alerts .nocx-alert-popover__head strong {
  color: var(--ua-sem-title,var(--ua-ds-title,#f3f7fc)) !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.ua-livebar__alerts .nocx-alert-popover__head small {
  color: var(--ua-sem-muted,#8293aa) !important;
  font-size: 10px !important;
  font-weight: 750 !important;
}

.ua-livebar__alerts .nocx-alert-feed {
  display: block !important;
  max-height: 278px !important;
  padding: 5px 7px !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--ua-theme-menu,#081321) !important;
}

.ua-livebar__alerts .nocx-alert-line {
  position: relative !important;
  display: block !important;
  min-height: 50px !important;
  padding: 8px 38px 8px 9px !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ua-ds-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ua-ds-text,#dce7f4) !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

.ua-livebar__alerts .nocx-alert-line:last-child {
  border-bottom: 0 !important;
}

.ua-livebar__alerts .nocx-alert-line::after {
  display: none !important;
  content: none !important;
}

.ua-livebar__alerts .nocx-alert-line__main {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 3px 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: normal !important;
}

.ua-livebar__alerts .nocx-alert-line__count {
  grid-row: 1 / 3 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 25px !important;
  height: 23px !important;
  padding: 0 6px !important;
  border: 1px solid color-mix(in srgb, var(--ua-accent, #e7b62f) 24%, transparent) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 10%, transparent) !important;
  color: #f2c552 !important;
  font-size: 10px !important;
  font-weight: 950 !important;
}

.ua-livebar__alerts .nocx-alert-line__title,
.ua-livebar__alerts .nocx-alert-line__text {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.35 !important;
}

.ua-livebar__alerts .nocx-alert-line__title {
  color: var(--ua-sem-title,#f3f7fc) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.ua-livebar__alerts .nocx-alert-line__text {
  color: var(--ua-sem-muted,#8fa0b5) !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
}

.ua-livebar__alerts .nocx-alert-line__close {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  bottom: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: color-mix(in srgb,var(--ua-text) 6%,transparent) !important;
  color: var(--ua-sem-muted,#aebccc) !important;
  font-size: 15px !important;
  line-height: 1 !important;
  transform: translateY(-50%) !important;
  cursor: pointer !important;
}

.ua-livebar__alerts .nocx-alert-line__close:hover {
  background: #d8394b !important;
  color: #fff !important;
}

.ua-livebar__user {
  margin-inline-start: auto;
}

.ua-livebar__user > summary {
  max-width: 150px;
  padding-inline: 5px 8px;
}

.ua-livebar__avatar {
  display: inline-flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ua-accent, #e7b62f) 45%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ua-accent, #e7b62f) 12%, var(--ua-theme-input,#0a1523));
  color: var(--ua-sem-title,#fff3c1);
  font-size: 10px;
  font-weight: 950;
}

.ua-livebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ua-livebar__username {
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ua-livebar__caret {
  color: var(--ua-sem-muted,#91a2b7);
  font-size: 9px;
}

.ua-livebar__user .nocx-user-menu-panel {
  position: absolute !important;
  top: calc(100% + 9px) !important;
  right: auto !important;
  bottom: auto !important;
  left: 0 !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: min(220px, calc(100vw - 40px)) !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1005 !important;
}

.ua-livebar__user .nocx-user-menu-panel {
  padding: 6px !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--ua-accent, #e7b62f) 28%, rgba(126, 151, 182, .22)) !important;
  border-radius: 10px !important;
  background: var(--ua-theme-menu,#0a1625) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .42) !important;
}

.ua-livebar__user .nocx-user-menu-panel a {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 36px !important;
  padding: 7px 9px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--ua-sem-title,#dce7f4) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.ua-livebar__user .nocx-user-menu-panel a:hover {
  background: color-mix(in srgb,var(--ua-accent) 12%,var(--ua-theme-menu)) !important;
  color: var(--ua-sem-title,#fff) !important;
}

html[dir="ltr"] .ua-livebar__alerts .nocx-alert-popover,
html[dir="ltr"] .ua-livebar__user .nocx-user-menu-panel {
  right: 0 !important;
  left: auto !important;
}

html[dir="ltr"] .ua-livebar__alerts .nocx-alert-line {
  padding-right: 9px !important;
  padding-left: 38px !important;
}

html[dir="ltr"] .ua-livebar__alerts .nocx-alert-line__close {
  right: auto !important;
  left: 8px !important;
}

@media (max-width: 1250px) {
  .ua-livebar { gap: 4px; padding-inline: 5px; }
  .ua-livebar__chip,
  .ua-livebar__user > summary { gap: 4px; padding-inline: 6px; font-size: 11px; }
  .ua-livebar__company { max-width: 82px; }
  .ua-livebar__username { display: none; }
}

@media (max-width: 1100px) {
  .ua-livebar__chip { padding-inline: 5px; }
  .ua-livebar__label { max-width: 76px; }
  .ua-livebar__brand { min-width: 72px; }
}

@media (max-width: 900px) {
  .ua-livebar {
    height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .ua-livebar::-webkit-scrollbar { display: none; }
  .ua-livebar__user { margin-inline-start: 0; }
}
