.api-client-token {
    display: block;
    overflow-wrap: anywhere;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}

.api-client-card-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.api-client-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-client-label-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.api-client-required-asterisk {
    color: var(--p-red-600);
    margin-left: 0.125rem;
}

.api-client-field-error {
    color: var(--p-red-600);
    font-size: 0.75rem;
}

.api-client-scope {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid var(--p-content-border-color);
    background: var(--p-content-hover-background);
}

.api-client-scope-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.api-client-scope-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.api-client-scope-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    border: 1px solid var(--p-content-border-color);
    background: var(--p-content-background);
}

.api-client-scope-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.api-client-listing {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.api-client-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.api-client-table-tools {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.api-client-table-caption {
    display: flex;
    justify-content: flex-end;
}

.api-client-empty-state {
    display: flex;
    min-height: 10rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    border: 1px dashed var(--p-content-border-color);
    border-radius: 0.75rem;
    background: var(--p-content-hover-background);
    text-align: center;
}

.api-client-name-row {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.45rem;
}

.api-client-date-cell {
    white-space: nowrap;
}

.api-client-status-icon {
    flex: none;
    font-size: 0.9rem;
    line-height: 1;
}

.api-client-status-icon--active {
    color: var(--p-green-700);
}

.api-client-status-icon--inactive {
    color: var(--p-red-700);
}

.api-client-status-icon--expired {
    color: var(--p-amber-700);
}

.api-client-site-grant-list {
    display: flex;
    max-width: 18rem;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.api-client-site-grant-summary {
    display: inline-flex;
    max-width: 18rem;
    align-items: center;
    gap: 0.35rem;
}

:host ::ng-deep .api-client-site-grant-tag,
:host ::ng-deep .api-client-no-site-access-tag {
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 600;
}

:host ::ng-deep .api-client-site-grant-tag .p-tag-label,
:host ::ng-deep .api-client-no-site-access-tag .p-tag-label {
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:host ::ng-deep .api-client-site-grant-count-button.p-button {
    flex: none;
    padding: 0.22rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

:host ::ng-deep .api-client-site-grant-count-button .p-button-label {
    line-height: 1;
}

:host-context(.p-dark) .api-client-required-asterisk,
:host-context(.p-dark) .api-client-field-error {
    color: var(--p-red-300);
}

:host-context(.p-dark) .api-client-token {
    background: color-mix(in srgb, var(--p-surface-800) 78%, var(--p-content-background));
}

:host-context(.p-dark) .api-client-status-icon--active {
    color: var(--p-green-300);
}

:host-context(.p-dark) .api-client-status-icon--inactive {
    color: var(--p-red-300);
}

:host-context(.p-dark) .api-client-status-icon--expired {
    color: var(--p-amber-300);
}

@media (max-width: 768px) {
    .api-client-scope-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .api-client-listing-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .api-client-table-caption {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .api-client-table-tools {
        width: auto;
        align-items: flex-start;
    }

    .api-client-card-actions {
        width: 100%;
        align-items: stretch;
    }

    :host ::ng-deep .api-client-card-actions p-button,
    :host ::ng-deep .api-client-card-actions .p-button,
    :host ::ng-deep .api-client-table-tools p-button,
    :host ::ng-deep .api-client-table-tools .p-button {
        width: 100%;
    }
}
