.device-detail-drawer {
  &__connections {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  &__connections-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: #fff;
  }

  &__connections-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.72);

    .anticon {
      color: rgba(0, 0, 0, 0.45);
    }
  }

  &__connections-empty {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    background: #fafafa;
  }

  &__connection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 24px 16px;
  }

  &__connection-card {
    border-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: none;

    &:hover {
      border-color: #d9d9d9;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .ant-card-head {
      min-height: 46px;
      padding: 0 12px;
      border-bottom: 0;
    }

    .ant-card-head-title {
      padding: 12px 0 8px;
    }

    .ant-card-extra {
      padding: 8px 0 4px;
    }

    .ant-card-body {
      padding: 0 12px 12px;
    }
  }

  &__connection-card-heading {
    min-width: 0;
  }

  &__connection-card-title {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: rgba(0, 0, 0, 0.88);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__connection-card-desc {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.45);
  }

  &__connection-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  &__connection-card-action {
    color: rgba(0, 0, 0, 0.65);
  }

  &__connection-card-device {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    background: #fafafa;
  }

  &__connection-card-connection {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fafafa;
  }

  &__connection-card-connection-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: center;
    width: 24px;
    padding-top: 2px;
    color: #1677ff;
  }

  &__connection-card-connection-main {
    flex: 1;
    min-width: 0;
  }

  &__connection-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: center;
    width: 24px;
    padding-top: 2px;
    color: #faad14;
  }

  &__connection-card-device-main {
    flex: 1;
    min-width: 0;
  }

  &__connection-card-model {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: rgba(0, 0, 0, 0.88);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__connection-card-meta,
  &__connection-card-lines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.55);
  }

  &__connection-card-statuses {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;

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

  &__connection-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 18px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.72);
    border-radius: 9px;
    background: #f5f5f5;

    &.is-success {
      color: #078f4f;
      background: #e6f7ef;
    }

    &.is-processing {
      color: #1677ff;
      background: #e6f4ff;
    }

    &.is-warning {
      color: #ad6800;
      background: #fff7e6;
    }

    &.is-error {
      color: #c41d7f;
      background: #fff0f6;
    }
  }

  &__connection-card-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
  }

  &__connection-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
  }

  &__connection-card-profiles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  &__connection-card-profile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.65);
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background: #fff;
  }

  &__connection-card-last-seen {
    flex: 0 0 auto;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
  }

  &__preview-modal {
    .ant-modal-header {
      padding: 24px 24px 16px;
      border-bottom: 0;
    }

    .ant-modal-title {
      padding-right: 28px;
    }
  }

  &__preview-title {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  &__preview-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fffbe6;
    color: #faad14;
  }

  &__preview-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.88);
  }

  &__preview-type {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.45);
  }

  &__preview-section {
    & + & {
      margin-top: 22px;
    }
  }

  &__preview-section-title {
    margin: 24px 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #101828;
  }

  &__preview-connection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}
