/* StreamCore 2.5.9 - Theme Responsive Visual Fix R1
   Scope:
   - one theme-aware active indicator on top navigation (keeps the rounded inset accent, removes the straight duplicate bar)
   - one theme-aware side indicator on submenu rows (removes border-left + box-shadow duplication)
   - same active accent behavior in Dark and Light themes
   - identical Login geometry in Dark/Light; theme changes colors only
   - identical Profile geometry in Dark/Light; theme changes colors only
*/

/* --------------------------------------------------------------------------
   TOP NAVIGATION: keep only the rounded/inset theme accent.
   The legacy ::before/::after center bar is the straight duplicate line.
   -------------------------------------------------------------------------- */
.xui-shell .xui-nav .nav-item > button,
.xui-shell .xui-nav.nav-rework .nav-item > button {
  overflow: hidden !important;
  position: relative !important;
}

.xui-shell .xui-nav .nav-item > button::before,
.xui-shell .xui-nav .nav-item > button::after,
.xui-shell .xui-nav.nav-rework .nav-item > button::before,
.xui-shell .xui-nav.nav-rework .nav-item > button::after {
  content: none !important;
  display: none !important;
}

.xui-shell .xui-nav .nav-item.active > button,
.xui-shell .xui-nav .nav-item:hover > button,
.xui-shell .xui-nav .nav-item > button:focus-visible,
.xui-shell .xui-nav.nav-rework .nav-item.active > button,
.xui-shell .xui-nav.nav-rework .nav-item:hover > button,
.xui-shell .xui-nav.nav-rework .nav-item > button:focus-visible {
  background: linear-gradient(
    180deg,
    rgba(var(--theme-accent-rgb, 47, 130, 255), .20),
    rgba(var(--theme-accent-rgb, 47, 130, 255), .08)
  ) !important;
  box-shadow:
    inset 0 -3px 0 var(--nav-accent, var(--theme-accent, #2f82ff)),
    0 10px 26px rgba(0, 0, 0, .12) !important;
}

/* Dark previously lost the theme accent on the active item. */
.xui-shell.theme-dark .xui-nav .nav-item.active > button,
.xui-shell.theme-dark .xui-nav .nav-item:hover > button,
.xui-shell:not(.theme-light) .xui-nav .nav-item.active > button,
.xui-shell:not(.theme-light) .xui-nav .nav-item:hover > button {
  background: linear-gradient(
    180deg,
    rgba(var(--theme-accent-rgb, 47, 130, 255), .18),
    rgba(9, 17, 31, .30)
  ) !important;
  box-shadow:
    inset 0 -3px 0 var(--nav-accent, var(--theme-accent, #2f82ff)),
    0 10px 26px rgba(0, 0, 0, .20) !important;
}

.xui-shell.theme-light .xui-nav .nav-item.active > button,
.xui-shell.theme-light .xui-nav .nav-item:hover > button {
  background: linear-gradient(
    180deg,
    rgba(var(--theme-accent-rgb, 47, 130, 255), .22),
    rgba(15, 23, 42, .18)
  ) !important;
  box-shadow:
    inset 0 -3px 0 var(--nav-accent, var(--theme-accent, #2f82ff)),
    0 10px 26px rgba(0, 0, 0, .10) !important;
}

/* --------------------------------------------------------------------------
   SUBMENUS: one side accent only. Remove border-left + inset duplication and
   keep the rounded inset indicator, driven by the same theme accent as Dashboard.
   -------------------------------------------------------------------------- */
.xui-shell .xui-nav.nav-rework .nav-dropdown > a,
.xui-shell .xui-nav.nav-rework .nav-flyout > a,
.xui-shell .xui-nav.nav-rework .nav-subitem > button,
.xui-shell .nav-dropdown > a,
.xui-shell .nav-flyout > a,
.xui-shell .nav-subitem > button {
  border-left: 0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  position: relative !important;
}

.xui-shell .xui-nav.nav-rework .nav-dropdown > a:hover,
.xui-shell .xui-nav.nav-rework .nav-flyout > a:hover,
.xui-shell .xui-nav.nav-rework .nav-subitem:hover > button,
.xui-shell .xui-nav.nav-rework .nav-subitem > button:focus-visible,
.xui-shell .nav-dropdown > a:hover,
.xui-shell .nav-flyout > a:hover,
.xui-shell .nav-subitem:hover > button,
.xui-shell .nav-subitem > button:focus-visible,
.xui-shell .nav-dropdown > a.active,
.xui-shell .nav-flyout > a.active,
.xui-shell .nav-dropdown > a[aria-current="page"],
.xui-shell .nav-flyout > a[aria-current="page"] {
  border-left: 0 !important;
  background: rgba(var(--theme-accent-rgb, 47, 130, 255), .13) !important;
  box-shadow: inset 3px 0 0 var(--nav-accent, var(--theme-accent, #2f82ff)) !important;
}

.xui-shell.theme-light .xui-nav.nav-rework .nav-dropdown > a:hover,
.xui-shell.theme-light .xui-nav.nav-rework .nav-flyout > a:hover,
.xui-shell.theme-light .xui-nav.nav-rework .nav-subitem:hover > button,
.xui-shell.theme-light .nav-dropdown > a:hover,
.xui-shell.theme-light .nav-flyout > a:hover,
.xui-shell.theme-light .nav-subitem:hover > button {
  background: rgba(var(--theme-accent-rgb, 47, 130, 255), .10) !important;
  box-shadow: inset 3px 0 0 var(--nav-accent, var(--theme-accent, #2f82ff)) !important;
}

/* Explicitly neutralize R2's border-color based side stripe. */
.xui-shell .xui-nav.nav-rework .nav-dropdown > a:hover,
.xui-shell .xui-nav.nav-rework .nav-flyout > a:hover,
.xui-shell .xui-nav.nav-rework .nav-subitem:hover > button {
  border-left-color: transparent !important;
}

/* --------------------------------------------------------------------------
   LOGIN: geometry is shared by Dark and Light. Only palette variables change.
   This restores the same visible gap between the credentials panel and button.
   -------------------------------------------------------------------------- */
.login-shell .login-card,
.login-shell.theme-light .login-card,
.theme-light.login-shell .login-card {
  width: min(405px, calc(100vw - 36px)) !important;
  max-width: none !important;
  padding: 0 !important;
}

.login-shell .login-form,
.login-shell.theme-light .login-form,
.theme-light.login-shell .login-form {
  box-sizing: border-box !important;
  display: grid !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 34px 33px 0 !important;
  position: relative !important;
  width: 100% !important;
}

.login-shell .login-form::before,
.login-shell.theme-light .login-form::before,
.theme-light.login-shell .login-form::before {
  height: 222px !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
}

.login-shell .login-form label,
.login-shell.theme-light .login-form label,
.theme-light.login-shell .login-form label {
  display: grid !important;
  gap: 9px !important;
  margin: 0 !important;
}

.login-shell .login-form input,
.login-shell.theme-light .login-form input,
.theme-light.login-shell .login-form input {
  box-sizing: border-box !important;
  min-height: 33px !important;
  width: 100% !important;
}

.login-shell .login-form button,
.login-shell.theme-light .login-form button,
.theme-light.login-shell .login-form button {
  box-sizing: border-box !important;
  height: 45px !important;
  margin: 54px -33px 0 !important;
  width: calc(100% + 66px) !important;
}

/* --------------------------------------------------------------------------
   PROFILE: lock one geometry for both themes. Light/Dark may override palette,
   but never width, row proportions, input height, card spacing or breakpoints.
   -------------------------------------------------------------------------- */
.xui-shell .profile-page.profile-modern-page,
.xui-shell.theme-light .profile-page.profile-modern-page,
.xui-shell.theme-dark .profile-page.profile-modern-page {
  display: grid !important;
  justify-content: center !important;
  justify-items: center !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 34px !important;
  width: 100% !important;
}

.xui-shell .profile-shell,
.xui-shell.theme-light .profile-shell,
.xui-shell.theme-dark .profile-shell {
  box-sizing: border-box !important;
  gap: 24px !important;
  margin: 0 auto !important;
  max-width: 816px !important;
  width: min(816px, calc(100vw - 36px)) !important;
}

.xui-shell .profile-modern-card,
.xui-shell.theme-light .profile-modern-card,
.xui-shell.theme-dark .profile-modern-card {
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100% !important;
}

.xui-shell .profile-tabs.modern-tabs,
.xui-shell.theme-light .profile-tabs.modern-tabs,
.xui-shell.theme-dark .profile-tabs.modern-tabs {
  align-items: stretch !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-height: 68px !important;
  padding: 24px 0 0 !important;
}

.xui-shell .profile-tabs.modern-tabs button,
.xui-shell.theme-light .profile-tabs.modern-tabs button,
.xui-shell.theme-dark .profile-tabs.modern-tabs button {
  box-sizing: border-box !important;
  height: auto !important;
  margin: 0 auto !important;
  min-height: 44px !important;
  padding: 0 34px !important;
  width: auto !important;
}

.xui-shell .profile-modern-form,
.xui-shell.theme-light .profile-modern-form,
.xui-shell.theme-dark .profile-modern-form,
.xui-shell .profile-form,
.xui-shell.theme-light .profile-form,
.xui-shell.theme-dark .profile-form {
  box-sizing: border-box !important;
  display: grid !important;
  gap: 0 !important;
  grid-template-columns: 1fr !important;
  padding: 30px 24px 24px !important;
  width: 100% !important;
}

.xui-shell .profile-modern-form label,
.xui-shell.theme-light .profile-modern-form label,
.xui-shell.theme-dark .profile-modern-form label,
.xui-shell .profile-form label,
.xui-shell.theme-light .profile-form label,
.xui-shell.theme-dark .profile-form label {
  box-sizing: border-box !important;
  display: grid !important;
  gap: 20px !important;
  grid-template-columns: 244px minmax(0, 1fr) !important;
  min-height: 73px !important;
  padding: 0 !important;
  width: 100% !important;
}

.xui-shell .profile-modern-form input,
.xui-shell .profile-modern-form select,
.xui-shell.theme-light .profile-modern-form input,
.xui-shell.theme-light .profile-modern-form select,
.xui-shell.theme-dark .profile-modern-form input,
.xui-shell.theme-dark .profile-modern-form select,
.xui-shell .profile-form input,
.xui-shell .profile-form select {
  box-sizing: border-box !important;
  min-height: 36px !important;
  width: 100% !important;
}

.xui-shell .profile-actions button,
.xui-shell.theme-light .profile-actions button,
.xui-shell.theme-dark .profile-actions button {
  min-height: 36px !important;
}

@media (max-width: 820px) {
  .xui-shell .profile-modern-form label,
  .xui-shell.theme-light .profile-modern-form label,
  .xui-shell.theme-dark .profile-modern-form label,
  .xui-shell .profile-form label,
  .xui-shell.theme-light .profile-form label,
  .xui-shell.theme-dark .profile-form label {
    gap: 8px !important;
    grid-template-columns: 1fr !important;
    min-height: auto !important;
    padding: 10px 0 !important;
  }
}

@media (max-width: 560px) {
  .login-shell .login-card,
  .login-shell.theme-light .login-card,
  .theme-light.login-shell .login-card {
    width: min(405px, calc(100vw - 32px)) !important;
  }

  .login-shell .login-form,
  .login-shell.theme-light .login-form,
  .theme-light.login-shell .login-form {
    gap: 16px !important;
    padding: 30px 26px 0 !important;
  }

  .login-shell .login-form::before,
  .login-shell.theme-light .login-form::before,
  .theme-light.login-shell .login-form::before {
    height: 216px !important;
  }

  .login-shell .login-form button,
  .login-shell.theme-light .login-form button,
  .theme-light.login-shell .login-form button {
    margin: 46px -26px 0 !important;
    width: calc(100% + 52px) !important;
  }

  .xui-shell .profile-shell,
  .xui-shell.theme-light .profile-shell,
  .xui-shell.theme-dark .profile-shell {
    width: min(816px, calc(100vw - 24px)) !important;
  }

  .xui-shell .profile-modern-form,
  .xui-shell.theme-light .profile-modern-form,
  .xui-shell.theme-dark .profile-modern-form,
  .xui-shell .profile-form,
  .xui-shell.theme-light .profile-form,
  .xui-shell.theme-dark .profile-form {
    padding: 22px 18px 20px !important;
  }
}
