:host {
  position: relative;

  overflow: hidden;
  display: flex;
  flex-direction: column;
  row-gap: 12px;

  box-sizing: border-box;
  width: 50vw;
  height: 70vh;

  .dialog__title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 20px;

    background-color: var(--theme-hack-bg-color, #f9f9f9);
    border-bottom: 1px solid #bebebe;

    .title__header {
      display: flex;
      font-size: 1.25rem;
      line-height: 1.21;

      .title__text {
        display: flex;
        align-items: center;
        margin-right: 10px;
      }

      .document-approved,
      .document-notapproved {
        display: block;

        height: fit-content;
        margin-top: 4px;

        font-size: 0.875rem;
        font-weight: 400;
        color: #28a529;
      }

      .document-notapproved {
        color: var(--color-alert-red);
      }
    }

    .close-btn {
      cursor: pointer;
      display: flex;
    }
  }

  .dialog__body {
    overflow: hidden;
    display: flex;
    flex: 1 1 auto;
    flex-flow: column nowrap;

    padding: 0 20px;

    line-height: 1.21;

    .is-draft-approve-icon {
      cursor: pointer;
    }

    .need-approve {
      display: flex;
      margin-bottom: 15px;

      .need-approve__text {
        padding: 2px;
        font-size: 0.875rem;
      }
    }

    .approval-sheet {
      overflow: hidden;
      display: flex;
      flex: 1 1 auto;
      flex-flow: column nowrap;

      .approval-sheet__item {
        overflow: hidden;
        display: flex;
        flex: 1 0 auto;
        flex-flow: column nowrap;

        .approval-item__title {
          display: inline-block;
          margin: 5px 0;
          font-size: 1rem;
          font-weight: 500;
        }

        .approval-item__body {
          overflow: auto;
          flex-grow: 1;

          padding: 10px;

          border: 1px solid #e8e8e8;
          border-radius: 5px;
        }

        &.reason {
          flex: 0 0 auto;
        }

        &.diff {
          flex: 1 1 auto;

          .approval-item__body {
            .diff__text {
              ::ng-deep {
                // без ::ng-deep не применяется
                del {
                  display: inline-block;
                  padding: 3px;
                  text-decoration: line-through;
                  background-color: #fbe9eb;
                }

                ins {
                  display: inline-block;
                  padding: 3px;
                  text-decoration: underline;
                  background-color: #ecfdf0;
                }
              }
            }
          }

          .text {
            padding-left: 10px;
          }
        }
      }

      .approval-sheet__table {
        border-collapse: collapse;
        width: 100%;
        font-size: 0.875rem;

        th,
        td {
          padding: 5px;
          font-weight: 400;
          border: none;

          &.strong {
            font-weight: 500;
          }
        }

        .mat-header-row {
          border-bottom: 1px solid #d9d9d9;
        }

        .mat-row {
          border-bottom: 1px solid #f2f2f2;

          &:last-child {
            border-bottom: none;
          }
        }

        .name {
          max-width: 50%;
          padding-left: 10px;
        }

        .signature {
          min-width: 80px;
          max-width: 125px;
        }

        .stamp {
          max-width: 40px;
        }

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

          .signer-icon {
            display: flex;
            align-items: center;
          }
        }

        .approval-table__scrollbox {
        }
      }
    }
  }

  .dialog__buttons {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;

    padding: 12px 20px;

    .create-btn {
      margin-left: 6px;
      color: var(--accent-color-bg);
      border: 1px solid var(--accent-color-bg);
    }

    .wrapp-btn {
      margin-right: 8px;

      &:first-child {
        margin-left: 6px;
      }

      &:last-child {
        margin-right: 0;
      }
    }

    .btn {
      color: #fff;
      background-color: var(--accent-color-bg);
      border: 1px solid var(--accent-color-bg);

      &.disabled {
        cursor: not-allowed;
        color: rgb(0 0 0 / 26%);
        background: transparent;
      }
    }

    .checkbox-field {
      display: flex;
      gap: 8px;
    }
  }
}

ngx-simplebar {
  overflow: hidden auto;
  height: 100%;
}

.field {
  display: flex;
}

.not-signed {
  opacity: 0.3;
}

.empty-value {
  color: #999;
}

::ng-deep .documentSignDialog {
  width: 100%;
  height: 100%;

  .mat-dialog-container {
    padding: 0;
  }

  .mat-dialog-title {
    margin: 0;
  }

  .mat-dialog-content {
    margin: 0;
    padding: 0;
  }

  .mat-dialog-actions {
    min-height: unset;
    margin: 0;
    padding: 0;
  }
}

:host ::ng-deep .approval-sheet__table {
  .mat-header-cell,
  .mat-cell {
    font-size: 0.875rem;
  }

  .mat-header-cell {
    font-weight: 600;
    color: inherit;
  }

  tr.mat-header-row {
    height: 0.875rem;
  }
}

.sign-btn {
  background-color: var(--default-color-green) !important;
  border: 1px solid var(--default-color-green) !important;
}

.right-buttons {
  display: flex;
  flex-flow: row nowrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;

  .spinner-wrap {
    display: flex;
    height: 30px;
  }
}

:host ::ng-deep .inline-edit-wrap .inline-edit .inline-edit-text {
  // В инлайн-едите это значение 300px и вес добавляется селекторами ангулар, поэтому нгдип и импотант
  max-width: none !important;
}

:host .diffLoader {
  display: flex;
  flex-flow: row nowrap;
  column-gap: 14px;
  align-items: center;
  justify-content: flex-start;

  .spinner {
    display: inline-block;
    flex: 0 1 auto;
  }

  div {
    flex: 1 0 auto;
  }

  mat-spinner {
    margin: 0 auto;
  }

  & ::ng-deep .mat-progress-spinner circle,
  .mat-spinner circle {
    stroke: #3d87ff;
  }
}
