.device-detail-drawer-root {
  .ant-drawer-content,
  .ant-drawer-wrapper-body,
  .ant-drawer-body {
    height: 100%;
  }

  .ant-drawer-body {
    padding: 0;
  }
}

.device-detail-drawer {
  --device-detail-drawer-header-height: 88px;

  .ant-drawer-body {
    height: 100%;
    padding: 0;
  }

  &__root {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    min-height: 0;

    &.is-smart {
      .device-detail-drawer__header {
        background: #e6f4ff;
      }

      .device-detail-drawer__icon {
        background: #dbeafe;
        color: #1677ff;
      }
    }

    &.is-dumb {
      .device-detail-drawer__header {
        background: #fffbe6;
      }

      .device-detail-drawer__icon {
        background: #fff1b8;
        color: #faad14;
      }
    }

    &.is-integrated {
      .device-detail-drawer__header {
        background: #eef7e8;
      }

      .device-detail-drawer__icon {
        background: #d9ead2;
        color: #389e0d;
      }
    }
  }

  &__sidebar {
    display: flex;
    flex: 0 0 72px;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
  }

  &__sidebar-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    height: var(--device-detail-drawer-header-height);
    min-height: var(--device-detail-drawer-header-height);
    width: 100%;
    padding: 8px 4px;
    color: rgba(0, 0, 0, 0.55);
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;

    .anticon {
      font-size: 18px;
    }

    span {
      font-size: 12px;
      line-height: 16px;
    }

    &::before {
      position: absolute;
      top: 0;
      left: 0;
      width: 2px;
      height: 100%;
      background: transparent;
      content: '';
    }

    &:hover,
    &.is-active {
      color: #1677ff;
      background: #fff;
    }

    &.is-active::before {
      background: #1677ff;
    }
  }

  &__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
  }

  &__header {
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    min-height: var(--device-detail-drawer-header-height);
    padding: 16px;
  }

  &__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }

  &__heading {
    flex: 1;
    min-width: 0;
  }

  &__name {
    font-size: 15px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.88);
  }

  &__type {
    margin-top: 2px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
  }

  &__content {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow: auto;
    background: #fff;
  }

  &__footer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    padding: 24px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
  }
}
