.sa-drawer {
	[data-slot='drawer-close'] + div {
		border-left: 1px solid var(--l1-border);
		padding-left: var(--padding-4);
		margin-left: var(--margin-2);
	}

	&__tabs {
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-shrink: 0;
	}

	&__layout {
		display: flex;
		flex-direction: column;
		height: 100%;
	}

	&__tab-group {
		[data-slot='toggle-group'] {
			border-radius: 2px;
			background: var(--l2-background);
			gap: 0;
		}

		[data-slot='toggle-group-item'] {
			border-radius: 0;
			border-left: 1px solid var(--l1-border);
			background: transparent;
			color: var(--l2-foreground);
			font-size: var(--font-size-xs);
			font-weight: var(--font-weight-normal);
			font-family: Inter, sans-serif;
			padding: 0 var(--padding-7);
			gap: var(--spacing-3);
			box-shadow: none;
			border: none;

			&:first-child {
				border-left: none;
				border-radius: 2px 0 0 2px;
			}

			&:last-child {
				border-radius: 0 2px 2px 0;
			}

			&:hover {
				background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
				color: var(--l1-foreground);
			}

			&[data-state='on'] {
				background: var(--l1-border);
				color: var(--l1-foreground);
			}
		}

		min-width: 220px;
	}

	&__tab {
		display: inline-flex;
		align-items: center;
		gap: var(--spacing-2);
		font-size: var(--font-size-xs);
		font-weight: var(--font-weight-normal);
	}

	&__tab-count {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		padding: 0 6px;
		border-radius: 50px;
		background: var(--secondary);
		font-size: var(--code-small-400-font-size);
		font-weight: var(--font-weight-normal);
		line-height: var(--line-height-20);
		color: var(--foreground);
		letter-spacing: -0.06px;
	}

	&__body {
		flex: 1;
		overflow-y: auto;
		padding-top: var(--padding-5);
		display: flex;
		flex-direction: column;
		gap: var(--spacing-8);

		&::-webkit-scrollbar {
			width: 0.25rem;
		}

		&::-webkit-scrollbar-thumb {
			background: rgba(136, 136, 136, 0.4);
			border-radius: 0.125rem;

			&:hover {
				background: rgba(136, 136, 136, 0.7);
			}
		}

		&::-webkit-scrollbar-track {
			background: transparent;
		}
	}

	&__footer {
		flex-shrink: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	&__keys-pagination {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		width: 100%;
		padding: var(--padding-2) 0;

		.ant-pagination-total-text {
			margin-right: auto;
		}
	}

	&__pagination-range {
		font-size: var(--font-size-xs);
		color: var(--foreground);
		font-weight: var(--font-weight-normal);
	}

	&__pagination-total {
		font-size: var(--font-size-xs);
		color: var(--foreground);
		opacity: 0.5;
	}

	&__footer-btn {
		padding-left: 0;
		padding-right: 0;
	}

	&__footer-right {
		display: flex;
		align-items: center;
		gap: var(--spacing-6);
	}

	&__field {
		display: flex;
		flex-direction: column;
		gap: var(--spacing-4);
	}

	&__label {
		font-size: var(--font-size-sm);
		font-weight: var(--font-weight-normal);
		color: var(--foreground);
		line-height: var(--line-height-20);
		letter-spacing: -0.07px;
		cursor: default;
	}

	&__input-wrapper {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 32px;
		padding: 0 var(--padding-2);
		border-radius: 2px;
		background: var(--l2-background);
		border: 1px solid var(--border);

		&--disabled {
			cursor: not-allowed;
			opacity: 0.8;
		}
	}

	&__input-text {
		font-size: var(--paragraph-base-400-font-size);
		font-weight: var(--paragraph-base-400-font-weight);
		color: var(--foreground);
		line-height: var(--line-height-18);
		letter-spacing: -0.07px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		flex: 1;
	}

	&__lock-icon {
		color: var(--foreground);
		flex-shrink: 0;
		margin-left: 6px;
		opacity: 0.6;
	}

	&__disabled-roles {
		display: flex;
		flex-wrap: wrap;
		gap: var(--spacing-2);
	}

	&__meta {
		display: flex;
		flex-direction: column;
		gap: var(--spacing-8);
		margin-top: var(--margin-1);
	}

	&__meta-item {
		display: flex;
		flex-direction: column;
		gap: var(--spacing-2);

		[data-slot='badge'] {
			padding: var(--padding-1) var(--padding-2);
			align-items: center;
			font-size: var(--uppercase-small-500-font-size);
			font-weight: var(--uppercase-small-500-font-weight);
			line-height: 100%;
			letter-spacing: 0.44px;
			text-transform: uppercase;
		}
	}

	&__meta-label {
		font-size: var(--font-size-xs);
		font-weight: var(--font-weight-medium);
		color: var(--foreground);
		line-height: var(--line-height-20);
		letter-spacing: 0.48px;
		text-transform: uppercase;
	}

	&__save-errors {
		display: flex;
		flex-direction: column;
		gap: var(--spacing-2);
	}
}

.sa-error-item {
	border: 1px solid var(--l1-border);
	border-radius: 4px;
	overflow: hidden;

	&__header {
		display: flex;
		align-items: center;
		gap: var(--spacing-3);
		width: 100%;
		padding: var(--padding-2) var(--padding-4);
		background: transparent;
		border: none;
		cursor: pointer;
		text-align: left;
		outline: none;

		&:hover {
			background: rgba(229, 72, 77, 0.08);
		}

		&:focus-visible {
			outline: 2px solid var(--primary);
			outline-offset: -2px;
		}

		&[aria-disabled='true'] {
			cursor: default;
			pointer-events: none;
		}
	}

	&:hover {
		border-color: var(--callout-error-border);
	}

	&__icon {
		flex-shrink: 0;
		color: var(--danger-background);
	}

	&__title {
		flex: 1;
		min-width: 0;
		font-size: var(--font-size-xs);
		font-weight: var(--font-weight-medium);
		color: var(--danger-background);
		line-height: var(--line-height-18);
		letter-spacing: -0.06px;
		text-align: left;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	&__chevron {
		flex-shrink: 0;
		color: var(--l2-foreground);
	}

	&__body {
		border-top: 1px solid var(--l1-border);

		.error-content {
			&__summary {
				padding: 10px 12px;
			}

			&__summary-left {
				gap: 6px;
			}

			&__error-code {
				font-size: 12px;
				line-height: 18px;
			}

			&__error-message {
				font-size: 11px;
				line-height: 16px;
			}

			&__docs-button {
				font-size: 11px;
				padding: 5px 8px;
			}

			&__message-badge {
				padding: 0 12px 10px;
				gap: 8px;
			}

			&__message-item {
				font-size: 11px;
				padding: 2px 12px 2px 22px;
				margin-bottom: 2px;
			}
		}
	}
}

.keys-tab {
	&__loading {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: var(--padding-8) var(--padding-4);
	}

	&__empty {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: var(--padding-8) var(--padding-4);
		gap: var(--spacing-4);
		text-align: center;
		height: 80%;
	}

	&__empty-icon {
		color: var(--l2-foreground);
	}

	&__empty-text {
		font-size: var(--paragraph-base-400-font-size);
		font-weight: var(--paragraph-base-400-font-weight);
		color: var(--foreground);
		margin: 0;
	}

	&__learn-more {
		background: transparent;
		border: none;
		color: var(--primary);
		font-size: var(--font-size-sm);
		cursor: pointer;
		text-decoration: none;

		&:hover {
			text-decoration: underline;
		}
	}

	// todo: styles should easeup by upgrading the component with table component from persiscope
	&__table {
		.ant-table {
			background: transparent;
			border: 1px solid var(--l1-border);
			border-radius: 4px;
			overflow: hidden;
		}

		.ant-table-thead > tr > th,
		.ant-table-thead > tr > td {
			height: 38px;
			padding: 0 var(--padding-4);
			background: transparent !important;
			border-bottom: 1px solid var(--l1-border) !important;
			font-size: var(--uppercase-small-500-font-size);
			font-weight: var(--uppercase-small-500-font-weight);
			color: var(--l2-foreground);
			letter-spacing: 0.44px;
			text-transform: uppercase;

			&::before {
				display: none !important;
			}

			.ant-table-column-sorter {
				color: var(--l2-foreground);
				opacity: 0.5;
			}

			&.ant-table-column-sort {
				background: transparent !important;
				color: var(--l1-foreground);

				.ant-table-column-sorter {
					color: var(--l1-foreground);
					opacity: 1;
				}
			}

			&:hover {
				background: transparent !important;
				color: var(--l1-foreground);

				.ant-table-column-sorter {
					opacity: 1;
				}
			}
		}

		.ant-table-tbody > tr > td {
			height: 38px;
			padding: 0 var(--padding-4);
			border-bottom: 1px solid var(--l1-border);
			font-size: 13px;
			font-weight: var(--font-weight-normal);
			color: var(--l2-foreground);
			letter-spacing: -0.07px;
			cursor: pointer;
			background: transparent;
			transition: none;
			font-variant-numeric: lining-nums tabular-nums stacked-fractions ordinal
				slashed-zero;

			&.ant-table-column-sort {
				background: transparent;
			}
		}

		.ant-table-tbody > tr:last-child > td {
			border-bottom: none;
		}

		.ant-table-tbody > tr {
			background: transparent;

			&:hover > td {
				background: color-mix(
					in srgb,
					var(--bg-robin-200) 6%,
					transparent
				) !important;
			}

			&.keys-tab__table-row--alt > td {
				background: color-mix(in srgb, var(--bg-robin-200) 2%, transparent);

				&:hover {
					background: color-mix(
						in srgb,
						var(--bg-robin-200) 6%,
						transparent
					) !important;
				}
			}
		}

		&--disabled {
			.ant-table-tbody > tr {
				cursor: not-allowed;
				opacity: 0.6;

				&:hover > td {
					background: transparent !important;
				}
			}
		}

		.ant-table-cell-row-hover {
			background: transparent !important;
		}
	}

	&__name-column {
		.ant-table-column-sorters {
			justify-content: flex-start;
			gap: var(--spacing-2);
		}

		.ant-table-column-title {
			flex: none;
		}
	}

	&__name-text {
		font-size: 13px;
		font-weight: var(--font-weight-normal);
		color: var(--l2-foreground);
		letter-spacing: -0.07px;
		text-transform: none;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	&__expiry--never {
		color: var(--l2-foreground);
	}

	&__expiry--expired {
		color: var(--l3-foreground);
	}

	&__revoke-btn {
		width: 32px;
		height: 32px;
		padding: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}

.sa-delete-dialog {
	background: var(--l2-background);
	border: 1px solid var(--l1-border);

	[data-slot='dialog-title'] {
		color: var(--l1-foreground);
	}

	&__body {
		font-size: var(--paragraph-base-400-font-size);
		font-weight: var(--paragraph-base-400-font-weight);
		color: var(--l2-foreground);
		line-height: var(--paragraph-base-400-line-height);
		letter-spacing: -0.065px;
		margin: 0;

		strong {
			font-weight: var(--font-weight-medium);
			color: var(--l1-foreground);
		}
	}

	&__footer {
		display: flex;
		justify-content: flex-end;
		gap: var(--spacing-4);
	}
}
