@--theme-blue--: #2468f2;

.editable-table {
  .el-table__body {
    width: 100% !important;
  }

  &__selected-color {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
  }

  &__color-title {
    text-align: center;
    width: 28px;
    padding: 0 !important;
  }

  &__color-icon {
    padding: 0 !important;
    margin-left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    // left: 5px;
    position: relative;
    background-color: #fcae46;
    cursor: pointer;
    overflow: visible !important;

    &::before {
      background-color: #fc6559;
      left: -10px;
      z-index: 2;
    }

    &::after {
      background-color: #409eff;
      left: -5px;
      z-index: 1;
    }

    &::before,
    &::after {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      position: absolute;
      top: 0;
    }
  }

  &__color-column,
  &__drag-cell {
    padding: 0 !important;

    & .cell {
      padding: 0 !important;
      height: 100%;

      display: flex !important;
      justify-content: center;
      align-items: center;
      text-align: center;
    }
  }

  &__color-column {
    & .cell {
      padding: 0 !important;
      border: none !important;
    }
  }

  &__drag-line {
    border: none;
    border-top: 1px solid #13161b;
    height: 4px;
    width: 15px;

    &:last-child {
      height: 1px;
    }
  }

  &__drag-icon {
    width: 100%;
    height: 100%;
    min-height: 45px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  &__sort-icon {
    position: relative;
    width: 12px;
    height: 12px;
    border: 1px solid #7b7b7b;
    padding: 0 !important;
    margin-left: 4px;
    border-radius: 50%;

    &::after {
      position: absolute;
      top: 50%;
      left: 50%;
      content: "";
      width: 3px;
      height: 3px;
      border-bottom: 1px solid;
      border-left: 1px solid;
      border-color: #7b7b7b;
      transform: translate(-50%, -55%) rotate(-45deg);
    }

    &--active {
      border: 1px solid @--theme-blue--;

      &::after {
        border-color: @--theme-blue--;
      }
    }
  }

  &__sort-reference {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;

    &:hover {
      cursor: pointer;
    }

    &--active {
      color: @--theme-blue--;
    }
  }

  &-view-setting {
    &__btn-wrapper {
      display: flex;
      justify-content: flex-end;
    }

    &__btn {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      font-weight: 400;
      font-size: 14px;
      color: @--theme-blue--;
      margin-bottom: 17px;
      margin-right: 20px;
    }

    &__btn-text {
      margin-left: 4px;
    }

    &__dialog {
      padding: 0px;

      .el-dialog__body {
        max-height: 70vh;
      }

      .el-dialog__body {
        padding: 0;
      }

      & .el-button--primary {
        background-color: @--theme-blue-- !important;
        border-color: @--theme-blue-- !important;
      }

      & .el-checkbox.is-checked:not(.is-disabled) {
        .el-checkbox__input .el-checkbox__inner {
          background-color: @--theme-blue-- !important;
          border-color: @--theme-blue-- !important;
        }

        .el-checkbox__label {
          color: @--theme-blue-- !important;
        }
      }

      & .el-button {
        border-radius: 2px;
      }

      .el-dialog__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
        background-color: #eeeeee;
        height: 36px;
        line-height: 36px;
        padding: 0 20px;
      }

      .el-dialog__title {
        font-size: 14px;
        line-height: 20px;
        color: #333333;
      }

      .el-dialog__footer {
        background-color: #eeeeee;
        height: 42px;
        line-height: 42px;
        padding: 0 20px;

        & .el-button {
          height: 24px;
          // line-height: 24px;
          font-size: 12px;
          padding: 5px 12px;
        }
      }
    }

    &__content {
      display: flex;
      min-height: 500px;
    }

    &__content-left {
      min-width: 417px;
      width: 417px;

      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
    }

    &__content-left-item {
      width: 130px;
      margin-bottom: 15px;
    }

    &__content-right {
      border-left: 1px solid #d9d9d9;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
    }

    &__content-right-title,
    &__content-left-title {
      border-bottom: 1px solid #d9d9d9;
      width: 100%;
      height: 46px;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      padding-left: 20px;
    }

    &__selected-count {
      margin-left: 20px;
    }

    &__checkbox-wrapper {
      padding-left: 37px;
      padding-top: 24px;
    }

    &__content-right {
      flex-grow: 1;
    }

    &__content-right-frize {
      width: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      height: 50px;
      border-bottom: 1px solid #d9d9d9;
      padding-left: 20px;
    }

    &__content-right-input.el-input {
      width: 140px;
      margin: 0 4px;

      .el-input__inner {
        height: 28px;
        line-height: 28px;
      }
    }

    &__content-right-selected {
      display: flex;
      justify-content: flex-start;
      flex-direction: column;
      align-items: flex-start;
      width: 100%;
      flex-grow: 1;
      padding-left: 18px;
      padding-top: 17px;
      padding-right: 23px;
    }

    &__selected-item-left {
      display: flex;
      justify-content: flex-start;
      align-items: center;
    }

    &__icon-wrapper {
      width: 14px;
      height: 14px;
      line-height: 14px;
      padding: 2px 4px;
      margin-right: 10px;
      cursor: grab;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    &__selected-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      line-height: 30px;
      height: 30px;
      width: 100%;
    }

    &__selected-item-close {
      cursor: pointer;

      &--disabled {
        cursor: not-allowed;
        color: #989ea9;
      }
    }
  }

  &-color-popover {
    min-width: 102px !important;
    width: 102px !important;
    padding: 0 !important;

    & .popper__arrow::after {
      left: 0 !important;
    }

    .color-list {
      color: #fff;
      width: 102px;
      border-radius: 5px;
      overflow: hidden;

      &__item {
        display: inline-block;
        width: 100%;
        height: 27px;
        line-height: 27px;
        padding-left: 6px;
      }
    }
  }

  &-sort-filter {
    padding: 0 !important;
    width: 258px;

    &__column-title {
      font-size: 14px;
      font-weight: 600;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-bottom: 1px solid #d6dbe3;
    }

    &__item {
      margin-top: 14px;
    }

    &__date-picker-content {
      display: flex;
      flex-direction: column;
      gap: 12px;

      .el-date-editor.el-input,
      .el-date-editor.el-input__inner {
        width: 100%;
      }
    }

    &__filter,
    &__search {
      padding: 0 14px;

      .el-select {
        width: 100%;
      }

      .el-radio {
        width: 100%;
        margin-top: 10px;

        &:first-child {
          margin-top: 0;
        }
      }

      .el-radio__input {
        line-height: 10px;
      }

      .el-radio__inner {
        width: 14px;
        height: 14px;
      }

      .el-radio__label {
        white-space: nowrap;
        overflow-x: hidden;
        text-overflow: ellipsis;
        width: calc(100% - 20px);
        display: inline-block;
        vertical-align: middle;
        font-size: 12px;
        line-height: normal;
      }
    }

    &__filter {

      .el-radio-group,
      .el-checkbox-group {
        max-height: 166px;
        overflow-y: auto;
        overflow-x: hidden;
      }
    }

    &__sort {
      padding: 0 14px;
      display: flex;
      flex-direction: column;
    }

    &__filter-title,
    &__sort-title,
    &__search-title {
      font-weight: 600;
      font-size: 14px;
      color: #1f1f1f;
      margin-bottom: 10px;
    }

    &__search {
      &-input {
        & .el-input__inner {
          height: 32px;
        }
      }

      &__date-range {
        display: flex;
        flex-direction: column;
        gap: 12px;

        .el-date-editor.el-input,
        .el-date-editor.el-input__inner {
          width: 100%;
        }
      }
    }

    &__sort-btns {
      display: flex;
      justify-content: space-between;
      align-items: center;

      & .el-button {
        border: none;
      }
    }

    &__sort-btn.el-button {
      width: 112px;
      height: 28px;
      padding: 4px 42px;
      display: inline-block;
      background-color: #f4f4f4;
      color: #4a4a4a;

      &:hover {
        background-color: #fafafa;
      }
    }

    &__sort-btn--active.el-button {
      color: @--theme-blue--;
      border-color: #eef3ff;
      background: #f4f7fe;

      &:hover {
        background-color: #f4f7fe;
      }
    }

    &__filter-checkbox-group {
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
    }

    &__filter-checkbox {
      margin-top: 10px;
      font-size: 14px;
      width: 100%;

      &:first-child {
        margin-top: 0;
      }

      .el-checkbox__input {
        line-height: 10px;
      }

      .el-checkbox__label {
        white-space: nowrap;
        overflow-x: hidden;
        text-overflow: ellipsis;
        width: calc(100% - 20px);
        display: inline-block;
        vertical-align: middle;
        font-size: 12px;
        line-height: normal;
      }
    }

    &__footer {
      display: flex;
      height: 47px;
      border-top: 1px solid #d6dbe3;
      justify-content: flex-end;
      align-items: center;
      padding: 0 15px;
      margin-top: 14px;
    }

    &__reset-btn,
    &__confirm-btn {
      &.el-button {
        width: 50px;
        height: 28px;
        margin-left: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 2px;
        font-size: 14px;
        font-weight: 400;
      }
    }

    &__confirm-btn.el-button {
      background-color: @--theme-blue--;
      border-color: @--theme-blue--;
    }

    .el-checkbox__input.is-checked .el-checkbox__inner,
    .el-radio__input.is-checked .el-radio__inner {
      background: @--theme-blue--;
      border-color: @--theme-blue--;
    }

    .el-checkbox__input.is-checked+.el-checkbox__label,
    .el-radio__input.is-checked+.el-radio__label {
      color: @--theme-blue--;
    }
  }

  &__pin-top {
    width: 24px;
    height: 24px;
    color: white;
    background-color: #969ca4;
  }

  & .el-table td,
  .el-table th.is-leaf {
    border-bottom: 1px solid #dfe3ec;
  }

  & .el-table {
    &__expanded-cell {
      background-color: #fafafa;
    }
  }

  & .el-table tr td {
    min-height: 45px;
    border-top: none;
    border-left: none;
    border-right: none;
  }

  & thead tr th {
    background-color: #f3f4f8 !important;
    border-right: none !important;

    & .cell {
      color: #13161b;
    }

    &:not(:last-child) .cell {
      border-right: 2px #e4e8ef solid;
    }
  }

  .el-table-filter,
  th.el-table__cell .el-table__column-filter-trigger,
  th.is-sortable .caret-wrapper {
    display: none;
  }

  .el-table__body tr.current-row>td,
  .el-table__body tr.hover-row>td {
    background-color: #fafafa;
  }

  table tbody tr td {
    & .el-date-editor.el-input {
      width: 100%;
    }

    & .cell {
      font-size: 12px;
    }
  }

  & table th {
    font-size: 12px;
    font-weight: bold;
  }

  & table td {
    font-size: 12px;
    color: #13161b;
  }

  .el-table th>.cell {
    color: #5b6984
  }

  .el-table__fixed-body-wrapper {
    background: #fff;
  }

  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background: @--theme-blue--;
    border-color: @--theme-blue--;
  }

  .no-inner-cell-border {
    & .cell {
      border: none !important;
    }
  }

  .custom-row-classname-pinned {
    & td:last-child {
      background-image: url("./pin-top.png");
      background-repeat: no-repeat;
      background-size: 24px 24px;
      background-position: right 0 top 0;
    }
  }

  &-operation-popover {
    min-width: 120px;
    padding: 0;

    &__operation {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
    }

    &__operation-reference {
      display: inline-block;

      &--active {
        color: @--theme-blue--;
      }

      .el-button {
        background: transparent;
        border: none;
        padding: 0;
        font-weight: 400;
        color: #13161b;
        font-size: 14px;

        &:focus {
          color: @--theme-blue--;
        }
      }
    }

    &__operation-item {
      height: 40px;
      line-height: 40px;
      width: 100%;
      text-align: center;
      color: #1f1f1f;
      cursor: pointer;

      &:hover {
        background: #f4f7fe;
      }
    }

    &__save-cancel {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      color: @--theme-blue--;
    }

    &__btn {
      cursor: pointer;

      &:first-child {
        margin-right: 15px;
      }
    }

    &__operation-btn {
      color: @--theme-blue-- !important;
    }
  }

  .pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;

    & .el-pagination.is-background {
      padding: 0;

      .el-pager li.number {
        background-color: #fff;
        border: 1px solid #d6dbe3;
        font-weight: 400;
        font-size: 14px;

        &.active {
          background-color: @--theme-blue--;
          color: #fff;
        }
      }

      & .btn-prev,
      & .btn-next,
      & .el-icon-more {
        background-color: #fff !important;
      }
    }
  }
}

.btn-pointer {
  cursor: pointer;
}

.editable-table-drag-icon {
  position: relative;
  width: 5px;
  height: 2px;
  border-left: 2px solid #989ea9;
  border-right: 2px solid #989ea9;
  cursor: grab;

  &::after,
  &::before {
    position: absolute;
    content: "";
    box-sizing: border-box;
    left: -2px;
    display: block;
    width: 5px;
    height: 2px;
    border-left: 2px solid #989ea9;
    border-right: 2px solid #989ea9;
  }

  &::after {
    top: -4px;
  }

  &::before {
    bottom: -4px;
  }
}