.kanban-wrapper {
  will-change: scroll-position;
  scrollbar-gutter: stable;

  contain: strict;
  overflow: auto;
  display: flex;
  flex-direction: column;

  height: calc(100vh - 66px);

  // TODO: Хак для темы Jira / Confluence Убрать после рефакторинга верстки контейнеров в project, desk
  &.displaced {
    height: calc(100vh - 116px);
  }

  wg-version-label {
    position: sticky;
    left: -15px;

    flex: none;
    align-self: flex-start;

    margin-left: -15px;
  }

  .upper {
    position: sticky;
    left: 0;

    display: flex;
    flex: none;
    gap: 20px;

    margin-right: 50px;
    margin-bottom: 20px;

    .description {
      flex: 1 1 auto;

      &__content {
        display: flex;
      }

      &__version {
        align-self: center;
      }

      &__title {
        width: 100%;
        margin-right: 15px;
        font: var(--default-font-h1);
      }
    }

    .people {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .approves-wrapper {
      display: flex;
      flex-direction: column;

      min-width: 350px;
      padding: 20px;

      border: 1px solid var(--color-gray-eee);

      .title {
        cursor: pointer;
        user-select: none;

        display: flex;
        gap: 20px;
        justify-content: space-between;

        font-weight: bold;
      }

      .collapsed {
        overflow: hidden;
        height: 0;
        margin-top: 0;
      }
    }

    .responsibles {
      display: grid;
      grid-template-columns: 1fr max-content max-content max-content;
      gap: 5px;
      align-self: baseline;

      width: 100%;
      margin-top: 10px;

      &:hover {
        .filter-icon {
          opacity: 1;
        }
      }

      &__count {
        justify-content: flex-end;
      }

      &__name,
      &__count {
        cursor: pointer;
        display: flex;
        align-items: center;

        &.responsibles_active {
          font-weight: 600;

          .filter-icon {
            opacity: 1;
          }
        }
      }

      .filter-icon {
        opacity: 0;
      }
    }
  }

  .main-kanban {
    position: relative;

    .kanban__titles {
      position: sticky;
      z-index: 9999;
      top: 0;

      display: flex;
      gap: 10px;

      .kanban__column {
        overflow-x: hidden;
        display: flex;
        flex: 1 0 260px;
        flex-wrap: wrap;

        padding: 4px;

        border-radius: 3px;

        .column__title {
          user-select: none;
          user-select: none;

          top: 0;

          display: flex;
          flex: 1;
          gap: 5px;
          align-items: center;

          max-width: 100%;
          height: 48px;
          padding: 4px 10px;

          font-size: 16px;
          color: #fff;

          .title__text {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;

            max-height: 36px;

            text-decoration: none;

            -webkit-line-clamp: 2;
          }
        }

        &:hover {
          .title__options {
            opacity: 1;
          }
        }

        .title__options {
          cursor: pointer;

          display: flex;
          flex: none;
          align-items: center;
          justify-content: center;

          margin-left: auto;

          opacity: 0;

          transition: opacity ease-in-out 0.2s;
        }

        .column__constraints {
          display: flex;
          gap: 5px;
          align-items: center;
          justify-content: space-between;

          max-height: 48px;
          margin-left: auto;
          padding: 4px 10px;

          color: #fff;
        }
      }
    }

    .widget {
      flex: none;

      &.hidden {
        display: none;
      }
    }
  }

  .rows-container {
    position: sticky;
    z-index: 9999;
    top: 0;
    left: 0;

    background-color: var(--color-gray-fff);

    .quick-filters-panel-wrapper {
      display: flex;
      flex: none;
      gap: 10px;
      align-items: flex-start;
      margin-bottom: 10px;
      margin-right: 10px;
      
      .quick-filters-panel {
        overflow: hidden;
      }

      .settings-buttons-wrapper {
        display: flex;
        align-items: center;
        height: 38px;
        margin-left: auto;
      }

      .swimlane-settings-button,
      .kanban-filters-button,
      .kanban-settings-button {
        cursor: pointer;
        margin-left: 10px;
      }
    }
  }

  .quick-filters-panel {
    width: 100%;
  }

  .swimlane {
    display: flex;
    flex-direction: column;
    margin-right: 50px;

    &_collapsed {
      max-height: 0;
    }

    .widget {
      flex: none;
    }

    &__control {
      cursor: pointer;

      position: sticky;
      top: 56px;

      display: flex;
      flex: none;
      gap: 5px;
      align-items: center;
      align-self: flex-start;

      padding: 10px 0 5px;

      font-weight: 600;
      color: var(--color-gray-444);

      background-color: var(--color-gray-fff);

      &.swimlane_collapsed {
        display: none;
      }

      &.hidden {
        display: none;
      }
    }
  }
}

.kanban-filters-wrapper {
  display: flex;
  align-items: center;
}

app-cmf-gravatar,
app-cmf-icon,
app-cmf-doodle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

::ng-deep .mat-menu-panel.kanban-card-menu {
  .mat-menu-item.alert {
    color: var(--color-alert-red);
  }
}

.toolbar-kanban {
  display: flex;
  align-items: center;
  width: 100%;

  .release-button {
    display: flex;
    align-items: center;
    margin-right: 10px;

    &.opened {
      color: var(--theme-btn-accent-color);
      background-color: var(--theme-btn-accent-bg-color);
      border-color: var(--theme-btn-accent-bg-color);
    }
  }

  app-cmf-favorites-button {
    display: flex;
    justify-content: center;
  }
}

.quick-filters-menu-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 50px;
}

.wrap-plan-dates {
  margin-bottom: 30px;
  color: var(--color-gray-aaa);
}

.display-menu-section-title {
  padding: 8px 16px;
  font-weight: bold;
}

.status-disabled {
  pointer-events: none;
  cursor: not-allowed;
}

.filter-editor {
  overflow: hidden;
}

.close-period {
  width: 135px;
}

.line {
  border-bottom: 1px solid var(--color-gray-eee);
}

::ng-deep .mat-menu-panel.release-menu {
  max-width: unset;
  margin-top: 8px;
}

.release-title {
  pointer-events: none;
  opacity: 0.7;
}

.close-period {
  width: 135px;
}

.action {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
}

.swimlane-name {
  position: sticky;
  left: 0;
  display: flex;
  gap: 3px;

  .name-link {
    color: inherit;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.filters-wrapper {
  display: flex;
  align-items: baseline;
  max-width: 100%;
  overflow: hidden;
}

.fixed-position {
  position: relative;
  top: 5px;
}

.buttons-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: 10px;

  .filter-button {
    cursor: pointer;

    display: flex;
    align-items: center;

    height: 32px;
    padding: 0 8px;

    font-weight: bold;
    color: var(--color-gray-666);

    border-radius: 4px;

    &:hover {
      color: var(--default-color);
      background-color: var(--color-gray-eee);
    }

    &.selected {
      color: var(--default-color);
      background-color: var(--color-gray-eee);
    }
  }
}

.quick-filters-wrapper {
  margin-bottom: 10px;
}
