.device-passcode-panel {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  background: #fff;

  &__body {
    flex: 1;
    min-height: 0;
    padding: 16px 24px 24px;
    overflow: auto;
  }

  &__state,
  &__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 100%;
    min-height: 320px;
  }

  &__state > [class*='-alert'] {
    width: 100%;
  }

  &__empty {
    text-align: center;

    h3 {
      margin: 16px 0 8px;
    }

    p {
      max-width: 320px;
      margin: 0;
      color: rgba(0, 0, 0, 0.45);
    }
  }

  &__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-size: 26px;
    color: rgba(0, 0, 0, 0.35);
    background: #f5f5f5;
    border-radius: 50%;
  }

  &__content {
    padding-bottom: 8px;
  }

  &__qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0 24px;
  }

  &__qr {
    position: relative;
  }

  &__qr--unavailable > [class$='-qrcode-wrap'] {
    opacity: 0.35;
    filter: grayscale(1);
  }

  &__qr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #667085;
    background: rgba(255, 255, 255, 0.58);
    border-radius: 8px;

    > [class*='anticon'],
    > svg {
      font-size: 32px;
    }
  }

  &__code {
    margin-top: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      monospace;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  &__code--unavailable {
    color: #98a2b3;
    text-decoration: line-through;
  }

  &__expired-text {
    color: #ff4d4f;
  }

  &__no-uses-text {
    color: #ff4d4f;
  }

  &__details {
    [class*='-descriptions-item-container'] {
      display: flex;
      justify-content: space-between;
      width: 100%;
    }

    [class*='-descriptions-item-content'] {
      flex: 1;
      justify-content: flex-end;
      min-width: 0;
      text-align: right;
    }
  }

  &__help {
    margin-top: 20px;
  }

  &__footer {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
  }

  &__footer-primary {
    flex: 1;
    min-width: 0;
  }

  &__confirmation {
    margin: 12px 0;
  }

  &__modal-count {
    margin: 8px 0;
    color: rgba(0, 0, 0, 0.65);
  }

  &__modal-alert {
    margin-bottom: 20px;
  }

  &__action-form {
    padding-bottom: 24px;
  }

  &__form-section {
    h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      line-height: 24px;
    }

    p {
      margin: 4px 0 16px;
      font-size: 14px;
      line-height: 20px;
      color: rgba(0, 0, 0, 0.45);
    }
  }

  &__form-section--usage {
    margin-top: 24px;
  }

  &__form-segmented {
    [class*='-segmented-group'] {
      width: 100%;
    }

    [class*='-segmented-group'] > [class*='-segmented-item'] {
      flex: 1;
    }
  }

  &__duration-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    margin-top: 16px;
  }

  &__field-item {
    margin-bottom: 0;
  }

  &__date-item {
    margin-top: 16px;
  }

  &__usage-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;

    .device-passcode-panel__field-item {
      width: 120px;
    }

    > span {
      line-height: 22px;
      color: rgba(0, 0, 0, 0.45);
    }
  }

  &__unlimited-help {
    margin-top: 16px;
  }
}

.device-passcode-drawer {
  &__title {
    font-size: 16px;
    font-weight: 600;
  }

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

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

.device-passcode-tab {
  width: 100%;
  height: 100%;
  min-height: 0;
}

@media (max-width: 600px) {
  .device-passcode-panel {
    &__duration-row {
      grid-template-columns: 1fr;
    }

    &__usage-row .device-passcode-panel__field-item {
      width: min(120px, 60%);
    }
  }
}
