/* Вкладка «Доступы»: группы сотрудников и раздача доступа к вкладкам. */

/* Шапка фиксированная, тело раздела прокручивается (иначе низ списка вкладок обрезается). */
.b24-access-root .b24-section-chrome {
  flex: 0 0 auto;
}

.b24-access-root .b24-section-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.b24-access-note {
  max-width: 860px;
}

.b24-access-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
  padding: 12px 0 24px;
}

@media (max-width: 980px) {
  .b24-access-layout {
    grid-template-columns: 1fr;
  }
}

.b24-access-col__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.b24-access-col__title + .b24-access-col__title,
.b24-access-rules + .b24-access-col__title {
  margin-top: 22px;
}

/* --------------------------------------------------------------- группы */

.b24-access-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.b24-access-group {
  border: 1px solid rgba(83, 92, 105, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.b24-access-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.b24-access-group__toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 4px;
  color: inherit;
  opacity: 0.65;
}

.b24-access-group__toggle:hover {
  opacity: 1;
}

.b24-access-group__count {
  white-space: nowrap;
}

.b24-access-group_collapsed .b24-access-group__members,
.b24-access-group_collapsed .b24-access-group__search,
.b24-access-group_collapsed .b24-access-group__results {
  display: none;
}

.b24-access-group__name {
  flex: 1 1 180px;
  min-width: 140px;
  font-weight: 600;
}

.b24-access-group__delete {
  margin-left: auto;
}

.b24-access-badge {
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.b24-access-badge_auto {
  background: rgba(255, 163, 0, 0.16);
  color: #a86500;
}

.b24-access-badge_b24 {
  background: rgba(47, 198, 246, 0.16);
  color: #0b76a0;
}

.b24-access-group__members,
.b24-access-rule__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.b24-access-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: 12px;
  background: rgba(83, 92, 105, 0.1);
  font-size: 13px;
}

.b24-access-chip__remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  color: inherit;
  opacity: 0.6;
}

.b24-access-chip__remove:hover {
  opacity: 1;
}

.b24-access-group__results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* --------------------------------------------------------------- правила */

.b24-access-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.b24-access-rule {
  border: 1px solid rgba(83, 92, 105, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
}

.b24-access-rule__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.b24-access-rule__name {
  font-weight: 600;
}

/* Подсказка под названием действия: почему список нельзя выключить. */
.b24-access-rule__hint {
  margin: 2px 0 0;
}

.b24-access-rule__toggle {
  margin-left: auto;
}

.b24-access-rule__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.b24-access-rule__select {
  max-width: 280px;
}

.b24-access-rules__err {
  margin: 0;
}

/* --------------------------------------------------- список групп Битрикс24 */

.b24-access-b24-panel {
  margin-top: 8px;
  border: 1px solid rgba(83, 92, 105, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-basis: 100%;
}

.b24-access-b24-panel__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.b24-access-b24-panel__name {
  flex: 1 1 auto;
}

/* Тёмная тема (Nocturne): границы и подложки чуть светлее. */
.is-theme-nocturne .b24-access-group,
.is-theme-nocturne .b24-access-rule,
.is-theme-nocturne .b24-access-b24-panel {
  border-color: rgba(148, 163, 184, 0.28);
}

.is-theme-nocturne .b24-access-chip {
  background: rgba(148, 163, 184, 0.18);
}
