:root {
  --ts-module-header-height: 48px;
  --ts-module-header-bg: #020c08;
  --ts-module-header-bg-soft: rgba(0, 230, 154, 0.08);
  --ts-module-header-bg-hover: rgba(0, 230, 154, 0.06);
  --ts-module-header-border: rgba(0, 220, 145, 0.16);
  --ts-module-header-border-strong: rgba(0, 230, 154, 0.45);
  --ts-module-header-text: #dcefe8;
  --ts-module-header-text-strong: #ffffff;
  --ts-module-header-muted: #78928a;
  --ts-module-header-accent: #00e69a;
  --ts-module-header-warning: #f2b93b;
  --ts-module-header-danger: #ef5d6c;
  --ts-module-header-info: #28a8f5;
  --ts-module-header-offline: #7b8c86;
}

body.ts-has-module-header {
  padding-top: 0 !important;
  display: block !important;
}

.ts-module-header {
  position: sticky;
  top: 0;
  z-index: 3000;
  height: var(--ts-module-header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--ts-module-header-bg);
  border-bottom: 1px solid var(--ts-module-header-border);
  color: var(--ts-module-header-text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.ts-module-header * {
  box-sizing: border-box;
}

.ts-module-brand {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ts-module-header-text-strong);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ts-module-brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #02110b;
  background: linear-gradient(145deg, var(--ts-module-header-accent), #12835d);
  box-shadow: 0 0 18px rgba(0, 230, 154, 0.28);
  font-size: 12px;
}

.ts-header-separator {
  width: 1px;
  height: 20px;
  flex: 0 0 auto;
  background: rgba(120, 146, 138, 0.28);
}

.ts-current-module {
  color: var(--ts-module-header-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.ts-module-navigation {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.ts-module-nav-item {
  position: relative;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--ts-module-header-muted);
  background: transparent;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ts-module-nav-item i {
  color: inherit;
  font-size: 12px;
}

.ts-module-nav-item:hover,
.ts-module-nav-item:focus-visible {
  color: #dff9ef;
  background: var(--ts-module-header-bg-hover);
  outline: none;
}

.ts-module-nav-item.is-active {
  color: var(--ts-module-header-text-strong);
  background: var(--ts-module-header-bg-soft);
  border-bottom-color: var(--ts-module-header-accent);
}

.ts-module-nav-item.is-active i {
  color: var(--ts-module-header-accent);
}

.ts-module-nav-item.is-disabled {
  color: rgba(120, 146, 138, 0.45);
  cursor: not-allowed;
}

.ts-module-nav-item.is-disabled:hover {
  background: transparent;
  color: rgba(120, 146, 138, 0.45);
}

.ts-header-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.ts-data-status {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(120, 146, 138, 0.22);
  border-radius: 999px;
  background: rgba(6, 22, 16, 0.82);
  color: var(--ts-module-header-text);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ts-data-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ts-module-header-offline);
}

.ts-data-status[data-state="realtime"]::before {
  background: var(--ts-module-header-accent);
  box-shadow: 0 0 12px rgba(0, 230, 154, 0.72);
}

.ts-data-status[data-state="updating"]::before {
  background: var(--ts-module-header-info);
  box-shadow: 0 0 12px rgba(40, 168, 245, 0.66);
}

.ts-data-status[data-state="stale"]::before {
  background: var(--ts-module-header-warning);
  box-shadow: 0 0 12px rgba(242, 185, 59, 0.58);
}

.ts-data-status[data-state="offline"]::before {
  background: var(--ts-module-header-offline);
}

.ts-data-status[data-state="error"]::before {
  background: var(--ts-module-header-danger);
  box-shadow: 0 0 12px rgba(239, 93, 108, 0.64);
}

.ts-header-icon-button,
.ts-user-button {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(120, 146, 138, 0.22);
  border-radius: 8px;
  background: rgba(6, 22, 16, 0.78);
  color: var(--ts-module-header-text);
  cursor: pointer;
}

.ts-header-icon-button:hover,
.ts-header-icon-button:focus-visible,
.ts-user-button:hover,
.ts-user-button:focus-visible {
  color: #ffffff;
  border-color: var(--ts-module-header-border-strong);
  background: var(--ts-module-header-bg-hover);
  outline: none;
}

.ts-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ts-module-header-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  border: 1px solid var(--ts-module-header-bg);
}

.ts-header-clock {
  min-width: 44px;
  color: var(--ts-module-header-text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.ts-header-popover {
  position: fixed;
  top: calc(var(--ts-module-header-height) + 8px);
  right: 12px;
  z-index: 3200;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 72px));
  overflow: auto;
  border: 1px solid rgba(120, 146, 138, 0.26);
  border-radius: 8px;
  background: rgba(5, 16, 12, 0.98);
  color: var(--ts-module-header-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.ts-header-popover[hidden] {
  display: none !important;
}

.ts-header-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(120, 146, 138, 0.18);
}

.ts-header-popover__head strong {
  font-size: 13px;
}

.ts-header-popover__link,
.ts-user-menu button {
  border: 0;
  background: transparent;
  color: var(--ts-module-header-accent);
  font: inherit;
  cursor: pointer;
}

.ts-header-popover__body {
  padding: 10px;
}

.ts-header-popover__empty {
  padding: 18px 10px;
  color: var(--ts-module-header-muted);
  font-size: 12px;
  text-align: center;
}

.ts-notification-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(120, 146, 138, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 8px;
}

.ts-notification-item strong {
  font-size: 12px;
}

.ts-notification-item span,
.ts-notification-item time {
  color: var(--ts-module-header-muted);
  font-size: 11px;
}

.ts-user-menu {
  width: 260px;
}

.ts-user-identity {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-bottom: 1px solid rgba(120, 146, 138, 0.18);
}

.ts-user-identity strong {
  font-size: 13px;
}

.ts-user-identity span {
  color: var(--ts-module-header-muted);
  font-size: 11px;
}

.ts-user-menu button,
.ts-user-menu a {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--ts-module-header-text);
  text-decoration: none;
  font-size: 12px;
  text-align: left;
}

.ts-user-menu button:hover,
.ts-user-menu a:hover,
.ts-user-menu button:focus-visible,
.ts-user-menu a:focus-visible {
  background: var(--ts-module-header-bg-hover);
  outline: none;
}

.ts-operational-strip,
.ts-webgis-info-strip {
  border-top: 0 !important;
}

.ts-operational-strip .brand,
.ts-operational-strip .title-block,
.ts-webgis-info-strip .ts-header__brand,
.ts-webgis-info-strip .ts-header__right {
  display: none !important;
}

body.ts-has-module-header .phase2-shell,
body.ts-has-module-header .gis,
body.ts-has-module-header .ts-app {
  height: calc(100vh - var(--ts-module-header-height)) !important;
  min-height: 0 !important;
}

body.ts-has-module-header .ts-module-body-flex {
  display: flex;
  min-height: 0;
  height: calc(100vh - var(--ts-module-header-height));
  overflow: hidden;
}

body.ts-has-module-header .ts-module-body-flex > .sidebar,
body.ts-has-module-header .ts-module-body-flex > .dash {
  height: calc(100vh - var(--ts-module-header-height)) !important;
  max-height: calc(100vh - var(--ts-module-header-height)) !important;
}

body.ts-has-module-header .ts-shell {
  min-height: calc(100vh - var(--ts-module-header-height)) !important;
}

body.ts-has-module-header > .sidebar.ts-remove-legacy-nav {
  display: none !important;
}

body.ts-has-module-header > .dash {
  min-height: calc(100vh - var(--ts-module-header-height));
  width: 100%;
}

body.ts-has-module-header .tabs {
  top: var(--ts-module-header-height);
}

.ts-header-legacy-compat {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 1280px) {
  .ts-module-header {
    gap: 7px;
    padding: 0 10px;
  }

  .ts-module-nav-item {
    padding: 0 7px;
    gap: 5px;
  }

  .ts-data-status {
    max-width: 176px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
