.main-container {
  width: 100%;
  padding: 1rem;
  height: calc(100dvh - 10.5rem);
  overflow-y: auto;
  border-width: 1px;
  border-radius: 0.5rem;

  @media (min-width: 768px) {
    height: calc(100dvh - 11.65rem);
  }
}

.enclosing-container {
  border-color: var(--p-content-border-color);
  background: var(--p-content-background);
}

.settings-header {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--p-text-color);
  margin: 0 0 0.75rem 0;

  .pi {
    color: var(--p-primary-color);
    font-size: 1.25rem;
  }
}

.settings-description {
  color: var(--p-text-muted-color);
  font-size: 0.875rem;
  line-height: 1.5;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.preferences-section {
  @media (min-width: 768px) {
    padding: 0 1rem;
  }
}

.section-header {
  margin-bottom: 1rem;
}

.section-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  @media (max-width: 768px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--p-text-color);
  margin: 0;

  .pi {
    color: var(--p-primary-color);
  }
}

.settings-card {
  border: 1px solid var(--p-content-border-color);
  border-radius: 8px;
  background: var(--p-content-background);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.setting-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;

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

  @media (max-width: 768px) {
    flex-direction: column;
    gap: 1rem;
  }
}

.setting-info {
  flex: 1;
  min-width: 0;

  .setting-label {
    display: block;
    font-weight: 600;
    color: var(--p-text-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .setting-label-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;

    .setting-label {
      margin-bottom: 0;
      flex-shrink: 0;
      min-width: 150px;
    }

    .input-group {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex: 1;

      @media (max-width: 768px) {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }
    }
  }

  .setting-description {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--p-text-muted-color);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;

    .pi {
      color: var(--p-primary-color);
      margin-top: 0.125rem;
      flex-shrink: 0;
    }
  }
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  @media (max-width: 768px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.endpoint-input {
  width: 100%;
  min-width: 25rem;
}

.endpoint-divider {
  height: 1px;
  background: var(--p-content-border-color);
  margin: 1.5rem 0;
}

.setting-description {
  .pi-exclamation-triangle {
    color: var(--p-orange-500);
  }
}

.table-card {
  border: 1px solid var(--p-content-border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--p-content-background);
}

.p-datatable th .header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.p-datatable td {
  text-align: left;
  vertical-align: middle;
}

.p-datatable {
  .p-datatable-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .p-datatable-thead > tr > th {
    background: var(--p-surface-100);
    border-bottom: 2px solid var(--p-content-border-color);
    padding: 1rem;
    font-weight: 600;
    color: var(--p-text-color);
  }

  .p-datatable-tbody > tr {
    transition: background-color 0.2s;

    &:hover {
      background: var(--p-surface-50);
    }

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

  .p-datatable-tbody > tr > td {
    padding: 1rem;
    border: none;
  }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--p-primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.username {
  font-weight: 500;
}

.actions-cell {
  text-align: center;
}

.empty-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--p-text-muted-color);

  .pi {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--p-surface-400);
  }

  .empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .empty-subtitle {
    font-size: 0.875rem;
  }
}

.user-dialog {
  .p-dialog-content {
    padding: 1.5rem;
  }

  .p-dialog-footer {
    padding: 1rem 1.5rem;
  }
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  label {
    font-weight: 600;
    color: var(--p-text-color);
    font-size: 0.875rem;
  }

  input {
    width: 100%;
    padding: 0.75rem;
    transition: border-color 0.2s;

    &:focus {
      outline: none;
      border-color: var(--p-primary-color);
      box-shadow: 0 0 0 2px var(--p-primary-color-alpha-20);
    }

    &::placeholder {
      color: var(--p-text-muted-color);
    }
  }
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.access-denied-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--p-red-400);
  max-width: 500px;

  .pi {
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  .access-denied-content {
    h3 {
      margin: 0 0 0.5rem 0;
      font-size: 1rem;
      font-weight: 600;
      color: var(--p-red-300);
    }

    p {
      margin: 0;
      font-size: 0.875rem;
      line-height: 1.5;
    }
  }
}
