.emq-crud {
  .crud-header {
    margin-bottom: 32px;
    margin-top: 14px;
    height: 50px;
    line-height: 50px;
    border-bottom: 1px solid var(--color-line-bg);

    .crud-title {
      font-size: 18px;
      display: inline-block;
      color: var(--color-main-green);
    }

    .el-button {
      float: right;
    }

    .create-btn {
      color: #fff;
      background: linear-gradient(180deg, rgba(59, 206, 153, 1) 0%, rgba(0, 195, 121, 1) 100%);
      border: none;
      min-width: 96px;
      height: 32px;
      border-radius: 32px;
      box-shadow: 0 1px 10px var(--color-main-green);

      &:hover {
        color: #fff !important;
        background-color: var(--color-main-green);
        border-color: var(--color-main-green);
        box-shadow: 0 1px 20px var(--color-main-green);
      }
    }
  }

  .el-card {
    background-color: var(--color-bg-card);

    .el-table {
      background-color: var(--color-bg-card);

      td,
      th {
        padding: 8px 0;
      }

      .cell {
        line-height: 25px;

        a {
          cursor: pointer;
          color: var(--color-main-green);
        }
      }

      .caret-wrapper {
        height: 24px;
        margin-top: -2px;

        .sort-caret.ascending {
          top: 0;
        }

        .sort-caret.descending {
          bottom: 2px;
        }
      }

      .oper {
        padding: 2px 0;

        .cell {
          height: 30px;
          line-height: 30px;
        }

        .oper-button {
          cursor: pointer;
          visibility: hidden;
          display: inline-block;
          width: 26px;
          height: 26px;
          line-height: 26px;
          border-radius: 50%;
          text-align: center;
          background-color: var(--color-main-green);
          color: #f5f5f5;
          margin-right: 5px;
          box-shadow: 0 1px 6px rgba(35, 200, 142, 0.6);

          &.custom-text {
            font-size: 14px;
          }
        }
      }

      .el-table__body tr:hover .oper {
        .oper-button {
          visibility: visible;
        }
      }

      tbody {
        .el-table__row {
          transition: background .5s;
          &.is-last {
            background: var(--color-bg-hover);
          }
        }
      }

      .el-table__row {
        height: 50px;
      }

      tr td.el-table__expanded-cell {
        background: var(--color-bg-table-expand);
        &:hover {
          background: var(--color-bg-table-expand) !important;
        }
        .expand-table {
          padding: 10px 20px;
          .expand-table__header {
            margin-bottom: 15px;
            color: var(--color-text-lighter);
            .header-oper__right {
              float: right;
              padding-left: 20px;
            }
          }
          .el-table .el-table__header {
            padding: 5px 0;
            background: var(--color-bg-table-expand);
          }
          .el-table.el-table--fit {
            border: 1px solid var(--color-line-bg);
          }
          .el-table::before {
            background-color: none !important;
            height: 0px !important;
          }
          th.is-leaf {
            background: var(--color-bg-table-expand);
            border-bottom-color: var(--color-line-bg);
            .cell {
              color: var(--color-text-light);
            }
          }
          .el-table .el-table__body tr {
            background-color: var(--color-bg-table-expand);
            &:hover {
              & > td {
                background-color: var(--color-bg-table-expand) !important;
                border-color: var(--color-line-bg);
              }
            }
          }
          .el-table__empty-block {
            background: var(--color-bg-table-expand);
          }
          .el-table--group::after, .el-table--border::after,
          .el-table--group::before, .el-table--border::before {
            background: none;
          }
          .el-table--border th, .el-table--border td {
            border-right: 0px;
          }
        }
      }
    }
  }

  .el-button.is-disabled,
  .el-button.is-disabled:focus,
  .el-button.is-disabled:hover {
    background-color: #2f2f2f;
    border-color: #666;
    color: #999;
  }

  .el-button--danger {
    background-color: rgba(220, 41, 121, .9);
    border-color: rgba(220, 41, 121, .7);
  }

  .el-card__body {
    position: relative;

    .el-button.is-disabled,
    .el-button.is-disabled:focus,
    .el-button.is-disabled:hover {
      color: #666;
      background-color: rgba(255, 255, 255, 0);
      border-color: #444;
    }

    .el-button--danger,
    .el-button--danger:focus,
    .el-button--danger:hover {
      color: #ff4949;
      background: 0;
      border-color: #ff4949;
    }
  }

  .el-date-editor.el-input__inner {
    background-color: var(--color-input-bg);
    color: var(--color-text-lighter);
  }

  .el-checkbox__input.is-checked .el-checkbox__inner {
    background-color: var(--color-main-green);
    border-color: var(--color-main-green);
  }

  .footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }

  &.emq-crud--details {
    position: relative;

    .sub-button {
      color: var(--color-bg-card);
      height: 25px;
      line-height: 12px;
      border: none;

      &.is-active {
        background-color: #34C388;
      }

      &.is-inactive {
        background-color: #ff4949;
      }
    }

    .crud-header {
      position: absolute;
      right: 0;
      top: -60px;
      border: 0;
    }

    .el-card {
      a {
        float: left;
      }

      .el-card__body {
        padding: 30px;
      }

      .el-card__body .el-table.el-table--fit {
        border: 0;
      }
    }
  }

  .custom-btn__wrapper {
    position: relative;
    z-index: 1;
    width: 30%;
    &.inline {
      margin: -54px 0 22px 0;
    }
    &.block {
      margin: 36px 0 22px 0;
    }
    button {
      background-color: var(--color-bg-card);
    }

    .operation-btn {
      color: #34C388;
      font-size: 14px;
      margin-right: 20px;
      min-width: 96px;

      &:hover,
      &:focus,
      &.active {
        background-color: var(--color-bg-card);
        border-color: var(--color-bg-card);
      }

      &.delete-all {
        color: #e86aa6;

        &:hover,
        &:active,
        &:focus {
          background-color: var(--color-bg-card);
          border-color: var(--color-bg-card);
        }
      }
    }
  }

  @media screen and (min-width: 1366px) {
    .crud-header {
      .create-btn {
        height: 38px;
        border-radius: 38px;
      }
    }

    .custom-btn__wrapper {
      &.inline {
        margin: -60px 0 22px 0;
      }
      .operation-btn {
        height: 38px;
        border-radius: 38px;
        line-height: 20px;
      }
    }
  }
}

// The style of the custom button for the table of the latest data
.emq-crud.latest-crud {
  .custom-btn__wrapper {
    &.block {
      margin: 24px 0 22px 0;
    }
  }
}

.el-select-dropdown__item.selected {
  color: var(--color-main-green);
}
