/* Unlocked RMS shell -------------------------------------------------------
   Shared sidebar and topbar branding, based on the Idea Bank green/gold
   language while preserving this application's existing navigation model. */

:root {
  --unlocked-green: #123f2e;
  --unlocked-green-deep: #061c14;
  --unlocked-green-black: #03120d;
  --unlocked-gold: #d9ad55;
  --unlocked-gold-bright: #efc96f;
  --unlocked-gold-dark: #93671f;
  --unlocked-cream: #f7f1e5;
  --unlocked-paper: #fffdf8;
  --unlocked-sage: #70877d;
}

/* Sidebar */
#sidebar.sidebar {
  isolation: isolate;
  overflow: hidden;
  border-right: 1px solid rgba(217, 173, 85, .34) !important;
  background:
    radial-gradient(circle at 15% 4%, rgba(65, 124, 91, .3), transparent 25%),
    radial-gradient(circle at 98% 86%, rgba(30, 92, 64, .46), transparent 34%),
    linear-gradient(158deg, var(--unlocked-green-black) 0%, #082b1f 64%, #0d412f 100%) !important;
  box-shadow: 14px 0 40px rgba(5, 29, 20, .1);
  transition: width .28s ease, margin-left .28s ease, box-shadow .28s ease !important;
}

#sidebar.sidebar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px;
  border: 1px solid rgba(217, 173, 85, .14);
  pointer-events: none;
}

#sidebar.sidebar::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -150px;
  bottom: 48px;
  width: 240px;
  height: 330px;
  border: 1px solid rgba(217, 173, 85, .14);
  border-bottom: 0;
  border-radius: 140px 140px 0 0;
  box-shadow: 0 0 0 28px rgba(217, 173, 85, .018), 0 0 0 56px rgba(217, 173, 85, .012);
  transform: rotate(-7deg);
  pointer-events: none;
}

#sidebar.sidebar > * {
  z-index: 1;
}

#sidebar .sidebar-logo {
  position: absolute !important;
  top: 0;
  left: 0;
  width: var(--crms-sidenav-width) !important;
  min-height: 92px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(217, 173, 85, .24) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .008)) !important;
  backdrop-filter: blur(10px);
  transition: width .28s ease, padding .28s ease !important;
}

#sidebar [data-simplebar] {
  top: 92px !important;
  height: calc(100% - 92px) !important;
}

.navbar-header,
.page-wrapper {
  transition: margin-left .28s ease, width .28s ease !important;
}

@media (min-width: 992px) {
  body.mini-sidebar #sidebar.sidebar,
  body.mini-sidebar.expand-menu #sidebar.sidebar {
    width: var(--crms-sidenav-width-sm) !important;
  }

  body.mini-sidebar #sidebar .sidebar-logo,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo {
    width: var(--crms-sidenav-width-sm) !important;
    padding: 10px 5px !important;
    gap: 2px;
  }

  body.mini-sidebar #sidebar .sidebar-logo__brand,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo__brand {
    flex: 0 0 30px;
    justify-content: center;
  }

  body.mini-sidebar #sidebar .sidebar-logo__brand .logo-normal,
  body.mini-sidebar #sidebar .sidebar-logo__brand .dark-logo,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo__brand .logo-normal,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo__brand .dark-logo {
    display: none !important;
  }

  body.mini-sidebar #sidebar .sidebar-logo__brand .logo-small,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo__brand .logo-small {
    display: flex !important;
    width: 28px !important;
    min-width: 28px;
  }

  body.mini-sidebar #sidebar .sidebar-logo__brand .logo-small .sidebar-brand-img,
  body.mini-sidebar.expand-menu #sidebar .sidebar-logo__brand .logo-small .sidebar-brand-img {
    width: 26px !important;
    height: 26px !important;
  }

  body.mini-sidebar #sidebar #toggle_btn,
  body.mini-sidebar.expand-menu #sidebar #toggle_btn {
    display: flex !important;
    width: 22px;
    height: 32px;
    flex: 0 0 22px;
    opacity: 1 !important;
    transform: none !important;
  }

  body.mini-sidebar #sidebar-menu > ul,
  body.mini-sidebar.expand-menu #sidebar-menu > ul {
    padding: 12px 8px 24px !important;
  }

  body.mini-sidebar #sidebar-menu .sidebar-group-toggle,
  body.mini-sidebar.expand-menu #sidebar-menu .sidebar-group-toggle {
    min-height: 46px;
    justify-content: center !important;
    padding: 7px !important;
    transform: none !important;
  }

  body.mini-sidebar #sidebar #sidebar-menu .sidebar-group-toggle > .sidebar-group-label,
  body.mini-sidebar.expand-menu #sidebar #sidebar-menu .sidebar-group-toggle > .sidebar-group-label {
    display: flex !important;
    width: 100%;
    justify-content: center;
  }

  body.mini-sidebar #sidebar-menu .sidebar-group-label span,
  body.mini-sidebar #sidebar-menu .sidebar-group-arrow,
  body.mini-sidebar.expand-menu #sidebar-menu .sidebar-group-label span,
  body.mini-sidebar.expand-menu #sidebar-menu .sidebar-group-arrow {
    display: none !important;
  }

  body.mini-sidebar #sidebar-menu .sidebar-group.is-open > .sidebar-submenu,
  body.mini-sidebar.expand-menu #sidebar-menu .sidebar-group.is-open > .sidebar-submenu {
    display: none !important;
  }

  body.mini-sidebar #sidebar-menu .sidebar-group + .sidebar-group,
  body.mini-sidebar.expand-menu #sidebar-menu .sidebar-group + .sidebar-group {
    padding-top: 6px;
  }
}

#sidebar .sidebar-logo__brand .logo-normal,
#sidebar .sidebar-logo__brand .dark-logo {
  height: 70px !important;
  gap: 11px;
  text-decoration: none;
}

#sidebar .sidebar-logo__brand .logo-normal .sidebar-brand-img,
#sidebar .sidebar-logo__brand .dark-logo .sidebar-brand-img {
  width: 66px !important;
  height: 66px !important;
  flex: 0 0 66px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .24));
}

#sidebar .sidebar-logo__brand .logo-small {
  width: 100%;
  min-width: 0;
}

#sidebar .sidebar-logo__brand .logo-small .sidebar-brand-img {
  width: 46px !important;
  height: 46px !important;
  border: 1px solid rgba(217, 173, 85, .2);
  border-radius: 4px;
}

.sidebar-brand-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: var(--unlocked-cream);
  line-height: 1;
}

.sidebar-brand-copy > span {
  overflow: hidden;
  color: rgba(247, 241, 229, .58);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-brand-copy strong {
  color: var(--unlocked-gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .14em;
}

#sidebar .sidenav-toggle-btn,
#sidebar .sidebar-close {
  color: rgba(247, 241, 229, .72) !important;
}

#sidebar .sidenav-toggle-btn:hover,
#sidebar .sidebar-close:hover {
  color: var(--unlocked-gold-bright) !important;
}

#sidebar-menu > ul {
  padding: 12px 13px 24px !important;
}

#sidebar-menu .sidebar-group + .sidebar-group,
#sidebar-menu .sidebar-item + .sidebar-group,
#sidebar-menu .sidebar-group + .sidebar-item {
  margin-top: 7px !important;
  padding-top: 7px;
  border-top: 1px solid rgba(217, 173, 85, .08);
}

#sidebar-menu .sidebar-item > a,
#sidebar-menu .sidebar-group-toggle {
  min-height: 48px;
  border: 1px solid transparent !important;
  border-left: 2px solid transparent !important;
  border-radius: 4px !important;
  padding: 9px 11px !important;
  color: rgba(247, 241, 229, .72) !important;
}

#sidebar-menu .sidebar-group-label span,
#sidebar-menu .sidebar-item > a > span,
#sidebar-menu .sidebar-group-toggle > span {
  color: inherit !important;
  font-size: 13px;
  font-weight: 600;
}

#sidebar-menu .sidebar-group-toggle:hover,
#sidebar-menu .sidebar-item > a:hover {
  border-color: rgba(217, 173, 85, .15) !important;
  border-left-color: rgba(217, 173, 85, .48) !important;
  background: rgba(255, 255, 255, .055) !important;
  color: #fff8e9 !important;
  box-shadow: none !important;
  transform: translateX(2px);
}

#sidebar-menu .sidebar-group.is-open > .sidebar-group-toggle,
#sidebar-menu .sidebar-group-toggle[aria-expanded="true"] {
  color: #fff8e9 !important;
  background: rgba(255, 255, 255, .035) !important;
}

#sidebar-menu .sidebar-item > a.active,
#sidebar-menu .sidebar-submenu > li > a.active {
  border-color: rgba(217, 173, 85, .24) !important;
  border-left-color: var(--unlocked-gold) !important;
  background: linear-gradient(90deg, rgba(217, 173, 85, .18), rgba(255, 255, 255, .045)) !important;
  color: #fff8e9 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04) !important;
}

#sidebar #sidebar-menu .sidebar-group-toggle > .sidebar-group-label > i,
#sidebar #sidebar-menu .sidebar-item > a > i,
#sidebar #sidebar-menu .sidebar-submenu > li > a > i {
  border-color: rgba(217, 173, 85, .13) !important;
  background: rgba(217, 173, 85, .09) !important;
  color: #e8c573 !important;
}

#sidebar #sidebar-menu .sidebar-item > a:hover > i,
#sidebar #sidebar-menu .sidebar-item > a.active > i,
#sidebar #sidebar-menu .sidebar-submenu > li > a:hover > i,
#sidebar #sidebar-menu .sidebar-submenu > li > a.active > i,
#sidebar #sidebar-menu .sidebar-group-toggle:hover > .sidebar-group-label > i,
#sidebar #sidebar-menu .sidebar-group-toggle[aria-expanded="true"] > .sidebar-group-label > i,
#sidebar #sidebar-menu a.subdrop > i {
  border-color: rgba(239, 201, 111, .32) !important;
  background: rgba(217, 173, 85, .17) !important;
  color: var(--unlocked-gold-bright) !important;
}

#sidebar-menu .sidebar-group-arrow {
  color: rgba(239, 201, 111, .7) !important;
}

#sidebar-menu .sidebar-submenu {
  margin: 5px 0 11px !important;
  padding: 3px 0 4px 11px !important;
  border-left: 1px solid rgba(217, 173, 85, .13);
}

#sidebar-menu .sidebar-submenu > li > a {
  min-height: 42px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 3px !important;
  padding: 7px 10px 7px 28px !important;
  color: rgba(247, 241, 229, .62) !important;
}

#sidebar-menu .sidebar-submenu > li > a:hover {
  border-color: rgba(217, 173, 85, .12);
  background: rgba(255, 255, 255, .045) !important;
  color: #fff8e9 !important;
}

#sidebar-menu .sidebar-submenu > li > a::before {
  left: 13px !important;
  width: 6px !important;
  height: 6px !important;
  margin-top: -3px !important;
  background: rgba(217, 173, 85, .42) !important;
}

#sidebar-menu .sidebar-submenu > li > a.active::before {
  background: var(--unlocked-gold-bright) !important;
  box-shadow: 0 0 0 4px rgba(217, 173, 85, .11);
}

#sidebar-menu .sidebar-subhead {
  padding: 12px 10px 5px 28px !important;
  color: rgba(239, 201, 111, .64) !important;
  font-size: 9px !important;
  letter-spacing: .16em !important;
}

#sidebar-menu .badge.bg-danger {
  border: 1px solid rgba(255, 255, 255, .24);
  background: #b43a32 !important;
  color: #fff !important;
}

/* Topbar */
.navbar-header {
  min-height: 76px;
  border-bottom: 1px solid rgba(18, 63, 46, .12) !important;
  background:
    radial-gradient(circle at 12% -70%, rgba(217, 173, 85, .17), transparent 36%),
    linear-gradient(90deg, rgba(255, 253, 248, .98), rgba(248, 244, 235, .96)) !important;
  box-shadow: 0 8px 28px rgba(12, 42, 31, .055);
  backdrop-filter: blur(14px);
}

.navbar-header .topbar-menu {
  min-height: 76px;
}

.navbar-header .topbar-menu .header-item {
  height: 76px !important;
}

.topbar-context {
  align-items: center;
  gap: 10px;
  min-width: 218px;
  margin-right: 13px;
  padding-right: 16px;
  border-right: 1px solid rgba(18, 63, 46, .12);
}

.topbar-context-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(217, 173, 85, .42);
  border-radius: 50%;
  background: linear-gradient(145deg, #f8eedb, #ecdbb8);
  color: var(--unlocked-gold-dark);
  box-shadow: 0 6px 16px rgba(151, 113, 38, .08);
}

.topbar-context-mark i {
  font-size: 18px;
}

.topbar-context-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  line-height: 1.1;
}

.topbar-context-copy > span {
  overflow: hidden;
  color: var(--unlocked-gold-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-context-copy strong {
  overflow: hidden;
  max-width: 240px;
  color: var(--unlocked-green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-header .header-search .form-control {
  min-width: 260px;
  border-color: rgba(18, 63, 46, .15) !important;
  border-radius: 4px;
  background: rgba(255, 255, 255, .78) !important;
  color: var(--unlocked-green) !important;
}

.navbar-header .header-search .form-control::placeholder {
  color: #74867e !important;
  opacity: 1;
}

.navbar-header .header-search .input-icon-addon {
  color: var(--unlocked-gold-dark) !important;
}

.navbar-header .topbar-menu .header-item .topbar-link,
.navbar-header .mobile-btn,
.navbar-header #toggle_btn2 {
  border-color: rgba(18, 63, 46, .15) !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, .7);
  color: var(--unlocked-green) !important;
  box-shadow: 0 5px 14px rgba(12, 42, 31, .045) !important;
}

.navbar-header .topbar-menu .header-item .topbar-link:hover,
.navbar-header .mobile-btn:hover,
.navbar-header #toggle_btn2:hover {
  border-color: var(--unlocked-green) !important;
  background: var(--unlocked-green) !important;
  color: var(--unlocked-cream) !important;
}

.navbar-header .topbar-profile-link {
  display: flex !important;
  align-items: center !important;
  width: auto;
  min-width: 190px;
  height: 48px;
  justify-content: flex-start;
  gap: 9px;
  padding: 4px 9px 4px 5px;
  border: 1px solid rgba(18, 63, 46, .15);
  border-radius: 4px;
  background: rgba(255, 255, 255, .7);
  color: var(--unlocked-green);
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(12, 42, 31, .045);
}

.navbar-header .topbar-profile-link:hover {
  border-color: var(--unlocked-green);
  background: var(--unlocked-green);
  color: var(--unlocked-cream);
}

.topbar-profile-link > img {
  border: 1px solid rgba(217, 173, 85, .45);
  box-shadow: 0 4px 12px rgba(12, 42, 31, .09);
}

.topbar-user-copy {
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
  line-height: 1.1;
  text-align: left;
}

.topbar-user-copy strong,
.topbar-user-copy span {
  overflow: hidden;
  max-width: 120px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-copy strong {
  color: var(--unlocked-green);
  font-size: 12px;
  font-weight: 700;
}

.topbar-user-copy span {
  color: var(--unlocked-sage);
  font-size: 10px;
}

.topbar-profile-link:hover .topbar-user-copy strong,
.topbar-profile-link:hover .topbar-user-copy span,
.topbar-profile-link:hover .topbar-profile-chevron {
  color: var(--unlocked-cream) !important;
}

.topbar-profile-chevron {
  color: var(--unlocked-gold-dark);
  font-size: 15px;
}

.navbar-header .dropdown-menu {
  border: 1px solid rgba(18, 63, 46, .13);
  border-radius: 6px;
  box-shadow: 0 18px 42px rgba(7, 31, 22, .14);
}

html[data-bs-theme="dark"] .navbar-header {
  border-bottom-color: rgba(217, 173, 85, .24) !important;
  background: linear-gradient(100deg, #061c14, #0d3d2c) !important;
}

html[data-bs-theme="dark"] .topbar-context-copy strong,
html[data-bs-theme="dark"] .topbar-user-copy strong {
  color: var(--unlocked-cream);
}

html[data-bs-theme="dark"] .topbar-context-copy > span,
html[data-bs-theme="dark"] .topbar-user-copy span {
  color: rgba(239, 201, 111, .72);
}

html[data-bs-theme="dark"] .navbar-header .header-search .form-control,
html[data-bs-theme="dark"] .navbar-header .topbar-menu .header-item .topbar-link {
  border-color: rgba(217, 173, 85, .22) !important;
  background: rgba(255, 255, 255, .06) !important;
  color: var(--unlocked-cream) !important;
}

html[data-bs-theme="dark"] .navbar-header .header-search .form-control::placeholder {
  color: rgba(247, 241, 229, .55) !important;
}

@media (max-width: 1199.98px) {
  .navbar-header .header-search .form-control {
    min-width: 0;
  }
}

@media (max-width: 991.98px) {
  #sidebar .sidebar-logo {
    min-height: 84px !important;
  }

  #sidebar [data-simplebar] {
    top: 84px !important;
    height: calc(100% - 84px) !important;
  }

  #sidebar .sidebar-logo__brand .logo-normal,
  #sidebar .sidebar-logo__brand .dark-logo {
    height: 62px !important;
  }

  #sidebar .sidebar-logo__brand .logo-normal .sidebar-brand-img,
  #sidebar .sidebar-logo__brand .dark-logo .sidebar-brand-img {
    width: 58px !important;
    height: 58px !important;
    flex-basis: 58px;
  }

  .navbar-header,
  .navbar-header .topbar-menu {
    min-height: 68px;
  }

  .navbar-header .topbar-profile-link {
    min-width: 48px;
    width: 48px;
    padding: 4px;
  }
}

@media (max-width: 575.98px) {
  .navbar-header .topbar-menu .header-item {
    height: 68px;
  }

  .navbar-header .topbar-menu .header-item .topbar-link {
    width: 40px;
    height: 40px;
  }

  .navbar-header .header-item.me-2,
  .navbar-header .header-item .dropdown.me-2 {
    margin-right: 6px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sidebar-menu a,
  #sidebar-menu button {
    transition: none !important;
  }
}
