/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.light-style .menu .app-brand.demo {
  height: 64px;
}

.dark-style .menu .app-brand.demo {
  height: 64px;
}

.app-brand-logo.demo svg {
  width: 38px;
  height: 20px;
}

.app-brand-text.demo {
  font-size: 1.25rem;
  letter-spacing: 0.15px;
}

/* ! For .layout-navbar-fixed added fix padding top tpo .layout-page */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}

/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1.25rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.rtl-only {
  display: none !important;
  text-align: left !important;
  direction: ltr !important;
}

[dir='rtl'] .rtl-only {
  display: block !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 300px;
    position: relative;
  }
  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    right: 0.65rem;
  }
}
/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1.25rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1.25rem;
}

/*
* Правое узкое меню (аккаунт / тема / выход)
******************************************************************************/

:root {
  --layout-right-menu-width: 48px;
}

.layout-right-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1085;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--layout-right-menu-width);
  height: 100vh;
  padding-top: 1.15rem;
  background: var(--bs-paper-bg, #fff);
  border-left: 1px solid var(--bs-border-color, rgba(47, 43, 61, 0.12));
}

.dark-style .layout-right-menu {
  background: var(--bs-paper-bg, #2f3349);
}

.layout-right-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
}

.layout-right-menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--bs-heading-color, #433c50);
  background: transparent;
  border: 0;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.layout-right-menu-item:hover,
.layout-right-menu-item:focus {
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb, 105, 108, 255), 0.08);
  outline: none;
}

.layout-right-menu-logout-form {
  margin: 0;
}

.layout-right-menu-logout {
  cursor: pointer;
}

/* Список уведомлений: ограничение высоты + скролл (flex только у .show) */
.dropdown-notifications .dropdown-menu.show {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 32rem);
  overflow: hidden;
}

.dropdown-notifications .dropdown-notifications-list {
  flex: 1 1 auto;
  max-height: min(50vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dropdown-notifications .dropdown-menu > li.border-top {
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .layout-wrapper:has(#layout-right-menu) .content-wrapper {
    padding-right: var(--layout-right-menu-width);
  }
}

@media (max-width: 1199.98px) {
  .layout-right-menu {
    display: none !important;
  }
}

#template-customizer > .template-customizer-open-btn.d-none-by-right-menu {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Подсказка страницы: Markdown внутри модального окна «?» */
.page-hint-body > * + * {
  margin-top: 0.85rem;
}

.page-hint-body h2,
.page-hint-body h3,
.page-hint-body h4,
.page-hint-body h5 {
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0;
}

.page-hint-body h2 {
  font-size: 1.05rem;
}

.page-hint-body h3,
.page-hint-body h4,
.page-hint-body h5 {
  font-size: 1rem;
}

.page-hint-body p,
.page-hint-body ul,
.page-hint-body ol {
  margin-bottom: 0;
}

.page-hint-body ul,
.page-hint-body ol {
  padding-left: 1.25rem;
}

.page-hint-body li + li {
  margin-top: 0.35rem;
}

.page-hint-body code {
  font-size: 0.875em;
}

/*
 * Выбор клиента в боковом меню
 ******************************************************************************/

.menu-client-switch {
  position: relative;
  padding: 0.75rem 1rem 0.5rem;
}

.menu-client-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #a1acb8);
}

.menu-client-trigger {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.125rem;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  color: inherit;
  background: var(--bs-paper-bg, #fff);
  border: 1px solid var(--bs-border-color, rgba(47, 43, 61, 0.16));
  border-radius: 0.375rem;
  text-align: left;
}

.menu-client-trigger:hover,
.menu-client-trigger:focus {
  border-color: var(--bs-primary);
  outline: none;
}

.menu-client-mark {
  flex-shrink: 0;
}

.menu-client-favicon {
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
  border-radius: 3px;
}

.menu-client-icon {
  font-size: 1.375rem;
  line-height: 1;
  color: var(--bs-heading-color, #566a7f);
}

.menu-client-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.menu-client-caret {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.6;
}

.menu-client-dropdown {
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--bs-paper-bg, #fff);
  border: 1px solid var(--bs-border-color, rgba(47, 43, 61, 0.16));
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 1rem rgba(15, 20, 34, 0.12);
}

.menu-client-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
}

.menu-client-option:hover,
.menu-client-option.is-selected {
  background: rgba(var(--bs-primary-rgb, 105, 108, 255), 0.08);
}

/* Свёрнутое меню: только иконка, как у пунктов ниже. Текст прячем жёстко. */
@media (min-width: 1200px) {
  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-label,
  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-name,
  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-caret {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    visibility: hidden !important;
  }

  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-switch {
    padding: 0.35rem 0 0.15rem !important;
    display: flex;
    justify-content: center;
  }

  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-trigger {
    width: 2.375rem;
    min-width: 2.375rem;
    height: 2.375rem;
    min-height: 2.375rem;
    padding: 0;
    border: 0;
    background: transparent;
    justify-content: center;
    gap: 0;
  }

  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-trigger:hover,
  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-trigger:focus {
    background: rgba(var(--bs-primary-rgb, 105, 108, 255), 0.08);
  }

  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-favicon,
  html.layout-menu-collapsed:not(.layout-menu-hover) .menu-client-icon {
    width: 1.375rem;
    height: 1.375rem;
    font-size: 1.375rem;
  }
}

/* Запасной путь: если меню уже узкое по ширине (даже без класса на html) */
.layout-menu.menu-vertical {
  container-type: inline-size;
  container-name: sd-menu;
}

@container sd-menu (max-width: 5.25rem) {
  .menu-client-label,
  .menu-client-name,
  .menu-client-caret {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    font-size: 0 !important;
    visibility: hidden !important;
  }

  .menu-client-switch {
    padding: 0.35rem 0 0.15rem !important;
    display: flex;
    justify-content: center;
  }

  .menu-client-trigger {
    width: 2.375rem;
    min-width: 2.375rem;
    height: 2.375rem;
    min-height: 2.375rem;
    padding: 0;
    border: 0;
    background: transparent;
    justify-content: center;
    gap: 0;
  }
}
