:root {
  --ifg-header-bg-1: #0a1220;
  --ifg-header-bg-2: #111827;
  --ifg-header-border: rgba(197, 165, 114, 0.18);
  --ifg-header-text: rgba(255, 255, 255, 0.86);
  --ifg-header-text-dim: rgba(255, 255, 255, 0.56);
  --ifg-header-accent: #c5a572;
  --ifg-header-accent-soft: rgba(197, 165, 114, 0.12);
}

.ifg-connected-header {
  background: linear-gradient(140deg, var(--ifg-header-bg-1), var(--ifg-header-bg-2));
  border-bottom: 1px solid var(--ifg-header-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ifg-connected-header .header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ifg-connected-brand {
  display: inline-flex;
  align-items: center;
  min-width: 140px;
}

.ifg-connected-brand img {
  height: 34px !important;
  width: auto;
  display: block;
}

.ifg-connected-nav {
  display: none !important;
}

.ifg-connected-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ifg-header-text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
  line-height: 1;
}

.ifg-connected-link:hover {
  color: var(--ifg-header-accent);
  background: var(--ifg-header-accent-soft);
}

.ifg-connected-link.active {
  color: var(--ifg-header-accent);
  background: var(--ifg-header-accent-soft);
}

.ifg-connected-email {
  display: none;
}

.ifg-connected-burger {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.ifg-connected-header .header-actions {
  margin-left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ifg-connected-mobile-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: -360px;
  width: 320px;
  height: 100vh;
  background: linear-gradient(145deg, #0b1424, #0f1b2d);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: -18px 0 38px rgba(0, 0, 0, 0.36);
  z-index: 9999;
  transition: right 0.26s ease;
}

.ifg-connected-mobile-menu.open {
  right: 0;
}

.ifg-connected-mobile-menu .menu-item {
  font-size: 14px;
}

.ifg-connected-mobile-menu .menu-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: #ef4444;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-top: 1px solid var(--ifg-header-border);
  margin-top: 8px;
  transition: all 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.ifg-connected-mobile-menu .menu-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ── Rich menu components (shared across all pages) ── */
.ifg-connected-mobile-menu .menu-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ifg-connected-mobile-menu .menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.ifg-connected-mobile-menu .menu-user-info {
  flex: 1;
  min-width: 0;
}

.ifg-connected-mobile-menu .menu-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ifg-connected-mobile-menu .menu-email {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ifg-connected-mobile-menu .menu-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: background 0.1s ease;
  font-size: 14px;
  font-weight: 400;
}

.ifg-connected-mobile-menu .menu-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.95);
}

.ifg-connected-mobile-menu .menu-item i {
  margin-right: 12px;
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

.ifg-connected-mobile-menu .menu-item:hover i {
  color: rgba(255,255,255,0.7);
}

.ifg-connected-mobile-menu .menu-item img {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.ifg-connected-mobile-menu .menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

.ifg-connected-mobile-menu .menu-section-label {
  padding: 12px 16px 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.ifg-connected-mobile-menu .menu-lang-selector {
  padding: 8px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ifg-connected-mobile-menu .menu-lang-select {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--ifg-header-border);
  background: rgba(17, 24, 39, 0.9);
  color: rgba(255,255,255,0.86);
  font-size: 16px;
  font-weight: 600;
  padding: 0 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ifg-header-accent) 50%),
    linear-gradient(135deg, var(--ifg-header-accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.ifg-connected-mobile-menu .menu-lang-select:focus {
  border-color: var(--ifg-header-accent);
  box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.14);
}

.nav-beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--ifg-header-border);
  background: rgba(197, 165, 114, 0.16);
  color: var(--ifg-header-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .ifg-connected-header {
    padding: 0 14px;
    height: 60px;
  }

  .ifg-connected-header .header-inner {
    height: 60px;
  }

  .ifg-connected-brand img {
    height: 30px !important;
  }

  .ifg-connected-nav {
    display: none !important;
  }

  .ifg-connected-burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .ifg-connected-header .header-actions {
    margin-left: auto;
    gap: 8px;
  }

  .ifg-connected-header .header-actions .lang-dropdown,
  .ifg-connected-header .header-actions .trial-indicator,
  .ifg-connected-nav #headerLogoutBtn {
    display: none !important;
  }

  .ifg-connected-email {
    display: none;
  }

  /* Mobile side drawer — works with both `.open` and toggle via `.hidden` */
  .ifg-connected-mobile-menu {
    position: fixed !important;
    top: 0 !important;
    right: min(-340px, -78vw) !important;
    left: auto !important;
    width: min(340px, 78vw) !important;
    max-width: 78vw;
    height: 100vh !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-left: 1px solid var(--ifg-header-border) !important;
    padding: max(14px, env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom)) !important;
    z-index: 1200 !important;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transition: right 0.26s ease !important;
    visibility: hidden;
    pointer-events: none;
  }

  /* Dashboard/Radar pattern: toggle class .open */
  .dash-mobile-menu.ifg-connected-mobile-menu.open {
    right: 0 !important;
    visibility: visible;
    pointer-events: auto;
    box-shadow: 0 16px 40px rgba(0,0,0,0.42), 0 0 0 9999px rgba(5,10,20,0.52);
  }

  /* Chat pattern: toggle class .hidden */
  .burger-menu.ifg-connected-mobile-menu:not(.hidden) {
    right: 0 !important;
    visibility: visible;
    pointer-events: auto;
    box-shadow: 0 16px 40px rgba(0,0,0,0.42), 0 0 0 9999px rgba(5,10,20,0.52);
  }

  .ifg-connected-mobile-menu.hidden {
    right: min(-340px, -78vw) !important;
    visibility: hidden;
    pointer-events: none;
    display: flex !important;
  }
}
