:root {
  --ha-nav-height: 56px;
  --ha-nav-bg: #ffffff;
  --ha-nav-text: #4b5563;
  --ha-nav-text-active: #144E9A;
  --ha-nav-hover-bg: #f3f4f6;
  --ha-nav-accent: #144E9A;
  --ha-nav-border: rgba(15, 23, 42, 0.12);
  --ha-nav-shadow: 0 1px 0 rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.06);
}

body {
  box-sizing: border-box;
  padding-top: var(--ha-nav-height);
}

.ha-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ha-nav-height);
  background: var(--ha-nav-bg);
  color: var(--ha-nav-text);
  z-index: 10000;
  border-bottom: 1px solid var(--ha-nav-border);
  box-shadow: var(--ha-nav-shadow);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.ha-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
}

.ha-nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.ha-nav-logo img {
  height: 30px;
  width: auto;
  display: block;
}

.ha-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.ha-nav-link {
  display: inline-block;
  padding: 8px 14px;
  color: var(--ha-nav-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.ha-nav-link:hover {
  background: var(--ha-nav-hover-bg);
  color: var(--ha-nav-text-active);
}

.ha-nav-link.is-active {
  color: var(--ha-nav-text-active);
  background: var(--ha-nav-hover-bg);
  position: relative;
}

.ha-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  background: var(--ha-nav-accent);
  border-radius: 1px;
}

.ha-nav-profile {
  position: relative;
  flex-shrink: 0;
}

.ha-nav-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ha-nav-text);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--ha-nav-border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.ha-nav-profile-trigger:hover,
.ha-nav.is-profile-open .ha-nav-profile-trigger {
  background: var(--ha-nav-hover-bg);
  border-color: var(--ha-nav-accent);
  color: var(--ha-nav-text-active);
}

.ha-nav-profile-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.ha-nav-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--ha-nav-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 10;
}

.ha-nav-profile-menu[hidden] {
  display: none;
}

.ha-nav-profile-identity {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--ha-nav-border);
  margin-bottom: 6px;
}

.ha-nav-profile-caption {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 4px;
}

.ha-nav-profile-email {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  word-break: break-all;
  line-height: 1.35;
}

.ha-nav-profile-access {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--ha-nav-border);
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ha-nav-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ha-nav-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e0e7ff;
  color: #3730a3;
}

.ha-nav-badge--geo {
  background: #d1fae5;
  color: #065f46;
}

.ha-nav-profile-markets {
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
}

.ha-nav-profile-action {
  display: block;
  padding: 9px 12px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ha-nav-profile-action:hover {
  background: var(--ha-nav-hover-bg);
  color: var(--ha-nav-accent);
}

.ha-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.ha-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ha-nav-text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ha-nav.is-open .ha-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ha-nav.is-open .ha-nav-toggle span:nth-child(2) {
  opacity: 0;
}

.ha-nav.is-open .ha-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  .ha-nav-inner {
    gap: 12px;
    padding: 0 12px;
  }

  .ha-nav-profile {
    margin-left: auto;
  }

  .ha-nav-toggle {
    display: flex;
  }

  .ha-nav-links {
    position: fixed;
    top: var(--ha-nav-height);
    left: 0;
    right: 0;
    background: var(--ha-nav-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 2px;
    max-height: calc(100vh - var(--ha-nav-height));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  }

  .ha-nav.is-open .ha-nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .ha-nav-links .ha-nav-link {
    display: block;
    text-align: left;
    padding: 12px 14px;
    border-radius: 6px;
  }

  .ha-nav-link.is-active::after {
    display: none;
  }

  .ha-nav-profile-trigger {
    padding: 6px 10px;
    font-size: 13px;
    gap: 6px;
  }

  .ha-nav-profile-label {
    display: none;
  }

  .ha-nav-profile-menu {
    right: 0;
    left: auto;
    min-width: 220px;
  }

  .ha-nav-logo img {
    height: 26px;
  }
}

.ha-nav-coming-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ha-nav-coming-modal.is-open {
  display: flex;
}

.ha-nav-coming-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.ha-nav-coming-card {
  position: relative;
  background: #fff;
  color: #1f2937;
  border-radius: 12px;
  padding: 28px 28px 24px;
  max-width: 380px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.ha-nav-coming-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.ha-nav-coming-card p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.ha-nav-coming-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px 12px;
}

.ha-nav-coming-close:hover {
  color: #1f2937;
}
