/* Sidebar icon rendering using the theme sprite and per-link custom property. */
.fixed-sidebar-link--has-icon {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
}

.fixed-sidebar-link--has-icon::before {
  content: "";
  display: inline-block;
  width: var(--gin-icon-size-toolbar, 20px);
  height: var(--gin-icon-size-toolbar, 20px);
  background-color: currentColor;
  -webkit-mask: var(--icon, url("/themes/custom/b5subtheme/media/sprite.svg#fallback-view"));
          mask: var(--icon, url("/themes/custom/b5subtheme/media/sprite.svg#fallback-view"));
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
}

/* Icons on regular Bootstrap menus outside the Gin-style sidebar. */
.b5-menu-link--has-icon {
  display: inline-flex;
  gap: 0.625rem;
  align-items: center;
}

.b5-menu-link--has-icon::before {
  flex: 0 0 auto;
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}

/* Admin form icon picker */
.b5sidebar-icon-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.b5sidebar-icon-input {
  cursor: text;
}

.b5sidebar-icon-picker-dropdown {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  z-index: 20;
  display: none;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  box-shadow: 0 4px 22px rgba(13, 27, 62, 0.15);
  max-height: 360px;
  overflow: auto;
}

.b5sidebar-icon-picker-dropdown.is-open {
  display: block;
}

.b5sidebar-icon-picker__hint {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.b5sidebar-icon-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.b5sidebar-icon-picker__option {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.b5sidebar-icon-picker__option:hover,
.b5sidebar-icon-picker__option:focus-visible {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
  background-color: #fff;
}

.b5sidebar-icon-picker__preview {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background-color: #111;
  -webkit-mask: var(--icon, url("/themes/custom/b5subtheme/media/sprite.svg#fallback-view"));
          mask: var(--icon, url("/themes/custom/b5subtheme/media/sprite.svg#fallback-view"));
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
}

.b5sidebar-icon-picker__label {
  line-height: 1.35;
  color: #0b1526;
  font-weight: 500;
}

.b5sidebar-icon-picker__empty {
  grid-column: 1 / -1;
  padding: 0.5rem 0.25rem;
  color: #6b7280;
  font-size: 0.95rem;
}
