@import url("css/Platform/Shell/shell.tokens.css");
@import url("css/Platform/Shell/app-shell.css");
@import url("css/Platform/Shell/header.css");
@import url("css/Platform/Shell/sidebar.css");
@import url("css/Platform/Shell/footer.css");

/* ModernAdmin-to-Xinkco semantic bridges. */
:root,
[data-theme="light"] {
    --background-color: var(--shell-bg);
    --default-color: var(--shell-text);
    --heading-color: var(--shell-heading);
    --accent-color: var(--shell-primary);
    --surface-color: var(--shell-surface);
    --muted-color: var(--shell-text-muted);
    --border-color: var(--shell-border);
    --card-bg: var(--shell-surface);
    --card-border: var(--shell-border);
    --card-shadow: var(--shell-shadow-sm);
    --table-header-bg: var(--shell-table-header-bg);
    --table-hover-bg: var(--shell-table-hover-bg);
    --table-stripe-bg: var(--shell-table-stripe-bg);
    --input-bg: var(--shell-input-bg);
    --input-border: var(--shell-input-border);
    --input-focus-border: var(--shell-input-focus-border);
    --input-focus-ring: var(--shell-input-focus-ring);
    --bs-body-color: var(--shell-text);
    --bs-body-bg: var(--shell-bg);
    --bs-border-color: var(--shell-border);
    --bs-secondary-color: var(--shell-text-muted);
}

html,
body {
    color: var(--shell-text);
    background: var(--shell-bg);
    font-family: var(--shell-font-body);
}

a,
.btn-link {
    color: var(--shell-primary);
}

a:hover,
.btn-link:hover {
    color: color-mix(in srgb, var(--shell-primary), black 12%);
}

.btn-primary {
    --bs-btn-color: var(--shell-primary-contrast);
    --bs-btn-bg: var(--shell-primary);
    --bs-btn-border-color: var(--shell-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--shell-primary), black 10%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--shell-primary), black 10%);
    --bs-btn-active-bg: color-mix(in srgb, var(--shell-primary), black 15%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--shell-primary), black 15%);
}

.btn,
.form-control,
.form-select,
.input-group-text {
    border-radius: var(--shell-radius-md);
    transition: border-color var(--shell-transition-fast), box-shadow var(--shell-transition-fast), background-color var(--shell-transition-fast);
}

.form-control,
.form-select,
.input-group-text {
    color: var(--shell-text);
    background-color: var(--shell-input-bg);
    border-color: var(--shell-input-border);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible,
.btn-link.nav-link:focus-visible {
    border-color: var(--shell-input-focus-border);
    box-shadow: 0 0 0 0.25rem var(--shell-input-focus-ring);
    outline: 0;
}

.form-control::placeholder {
    color: var(--shell-text-muted);
    opacity: 1;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    color: var(--shell-text-muted);
    background: var(--shell-surface-muted);
    opacity: 1;
}

.form-label {
    color: var(--shell-heading);
    font-weight: 600;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid var(--shell-success);
}

.invalid {
    outline: 1px solid var(--shell-danger);
}

.validation-message,
.invalid-feedback {
    color: var(--shell-danger);
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
    background: var(--shell-danger);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: var(--shell-text-muted);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Shared cards. */
.xk-surface-card,
.xk-data-table-shell {
    color: var(--shell-text);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-card-radius);
    box-shadow: var(--shell-card-shadow);
    overflow: hidden;
    transition: border-color var(--shell-transition-fast), box-shadow var(--shell-transition-base), transform var(--shell-transition-base);
}

.xk-surface-card:hover {
    box-shadow: var(--shell-shadow-md);
}

.xk-surface-card__header,
.xk-surface-card__footer,
.xk-data-table-shell__header,
.xk-data-table-shell__footer {
    padding: var(--shell-spacing-4) var(--shell-spacing-5);
}

.xk-surface-card__header,
.xk-data-table-shell__header {
    border-bottom: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.xk-surface-card__body {
    padding: var(--shell-spacing-5);
}

.xk-stat-card-shell .xk-stat-card__surface-body {
    height: 100%;
    padding: 1.25rem;
}

.xk-stat-card__label {
    color: var(--shell-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.xk-stat-card__value {
    color: var(--shell-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.xk-stat-card__meta {
    color: var(--shell-text);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.xk-stat-card__description,
.xk-stat-card__trend {
    color: var(--shell-text-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.xk-stat-card-shell--default .xk-stat-card__icon { color: var(--shell-primary); background: var(--shell-primary-soft); }
.xk-stat-card-shell--info .xk-stat-card__icon { color: var(--shell-kpi-icon-info-color); background: var(--shell-kpi-icon-info-bg); }
.xk-stat-card-shell--success .xk-stat-card__icon { color: var(--shell-kpi-icon-success-color); background: var(--shell-kpi-icon-success-bg); }
.xk-stat-card-shell--warning .xk-stat-card__icon { color: var(--shell-kpi-icon-warning-color); background: var(--shell-kpi-icon-warning-bg); }
.xk-stat-card-shell--danger .xk-stat-card__icon { color: var(--shell-kpi-icon-danger-color); background: var(--shell-kpi-icon-danger-bg); }
.xk-stat-card-shell--muted .xk-stat-card__icon { color: var(--shell-kpi-icon-muted-color); background: var(--shell-kpi-icon-muted-bg); }

.xk-surface-card__footer,
.xk-data-table-shell__footer {
    border-top: 1px solid var(--shell-border);
    background: var(--shell-surface-muted);
}

.xk-data-table-shell__footer:empty {
    display: none;
}

.xk-surface-card__body > :last-child,
.xk-content-card__body > :last-child {
    margin-bottom: 0;
}

.xk-section-block__title,
.xk-section-header__title,
.xk-page-header__title,
.xk-modal-shell__title,
.xk-slide-panel__title {
    margin: 0;
    color: var(--shell-heading);
    font-family: var(--shell-font-heading);
    font-weight: 600;
    line-height: 1.3;
}

.xk-page-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.xk-section-block__subtitle,
.xk-section-header__subtitle,
.xk-page-header__subtitle {
    margin: 0.35rem 0 0;
    color: var(--shell-text-muted);
    line-height: 1.55;
}

.xk-page-header__breadcrumbs .breadcrumb-item,
.xk-page-header__breadcrumbs .breadcrumb-item a {
    color: var(--shell-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.xk-page-header__breadcrumbs .breadcrumb-item.active {
    color: var(--shell-text);
    font-weight: 500;
}

/* Shared toolbar and forms. */
.xk-action-toolbar {
    padding: var(--shell-spacing-4);
    color: var(--shell-text);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-lg);
}

.xk-action-toolbar__content {
    color: var(--shell-text-muted);
}

.xk-data-table-toolbar__search-box {
    min-height: 2.75rem;
    padding: 0 var(--shell-spacing-3);
    color: var(--shell-text);
    background: var(--shell-input-bg);
    border: 1px solid var(--shell-input-border);
    border-radius: var(--shell-radius-md);
}

.xk-data-table-toolbar__search-icon {
    color: var(--shell-text-muted);
}

.xk-data-table-toolbar__search-input {
    color: var(--shell-text);
    background: transparent;
    border: 0;
    outline: 0;
}

.xk-data-table-toolbar__search-box:focus-within {
    border-color: var(--shell-input-focus-border);
    box-shadow: 0 0 0 0.25rem var(--shell-input-focus-ring);
}

.xk-data-table-toolbar__search-input::placeholder {
    color: var(--shell-text-muted);
    opacity: 1;
}

.xk-form-section + .xk-form-section {
    margin-top: var(--shell-spacing-5);
    padding-top: var(--shell-spacing-5);
    border-top: 1px solid var(--shell-border);
}

.xk-form-actions-bar {
    margin-top: var(--shell-spacing-5);
    padding-top: var(--shell-spacing-4);
    border-top: 1px solid var(--shell-border);
}

.xk-validation-summary {
    padding: var(--shell-spacing-4);
    color: var(--shell-text);
    background: var(--shell-danger-soft);
    border: 1px solid var(--shell-danger-border);
    border-radius: var(--shell-radius-lg);
}

.xk-validation-summary__icon {
    color: var(--shell-danger);
    background: color-mix(in srgb, var(--shell-danger), transparent 88%);
}

.xk-validation-summary__title {
    color: var(--shell-heading);
    font-weight: 600;
}

/* Shared detail typography and user-visible identifiers. */
.xk-detail-label {
    color: var(--shell-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.xk-detail-value {
    color: var(--shell-text);
    font-size: 0.875rem;
    font-weight: 400;
}

.xk-ui-identifier {
    display: inline-block;
    width: fit-content;
    padding: 0.125rem 0.375rem;
    color: var(--shell-heading);
    background: var(--shell-surface-hover);
    border-radius: var(--shell-table-badge-radius);
    font-family: var(--shell-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

/* Reusable detail-modal viewport contract. */
.xk-detail-modal .xk-modal-shell__dialog {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}

.xk-detail-modal .xk-modal-shell__content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}

.xk-detail-modal .xk-modal-shell__header,
.xk-detail-modal .xk-modal-shell__footer {
    flex: 0 0 auto;
}

.xk-detail-modal .xk-modal-shell__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Shared overlays. */
.xk-modal-shell__backdrop,
.xk-slide-panel__backdrop {
    background: var(--shell-overlay-bg);
    backdrop-filter: blur(2px);
}

.xk-modal-shell__content,
.xk-slide-panel__surface {
    color: var(--shell-text);
    background: var(--shell-surface);
    border-color: var(--shell-border);
    box-shadow: var(--shell-shadow-lg);
}

.xk-modal-shell__content {
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-xl);
    overflow: hidden;
}

.xk-modal-shell__header,
.xk-modal-shell__footer,
.xk-slide-panel__header {
    border-color: var(--shell-border);
}

.xk-modal-shell__footer {
    background: var(--shell-surface-muted);
}

/* Shared states. */
.xk-empty-state__icon,
.xk-loading-state__spinner {
    color: var(--shell-primary);
}

.xk-empty-state__icon {
    background: var(--shell-primary-soft);
    border-radius: var(--shell-radius-xl);
}

.xk-error-state {
    color: var(--shell-text);
    background: var(--shell-danger-soft);
    border: 1px solid var(--shell-danger-border);
    border-radius: var(--shell-radius-xl);
}

.xk-error-state__icon {
    color: var(--shell-danger);
    background: color-mix(in srgb, var(--shell-danger), transparent 88%);
}

.xk-empty-state__title,
.xk-error-state__title,
.xk-loading-state__title {
    color: var(--shell-heading);
    font-weight: 600;
}

.xk-empty-state__message,
.xk-error-state__message,
.xk-loading-state__message {
    color: var(--shell-text-muted);
}

/* Shared data table. DataTableShell is the sole overflow owner. */
.xk-data-table-shell__content {
    min-width: 0;
    color: var(--shell-text);
    background: var(--shell-surface);
}

.xk-data-table-shell__table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.xk-data-table-shell__state {
    padding: calc(var(--shell-spacing-5) * 1.25) var(--shell-spacing-4);
}

.xk-data-table-shell__loading-overlay {
    color: var(--shell-text);
    background: color-mix(in srgb, var(--shell-surface) 72%, transparent);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    cursor: progress;
}

.xk-data-table {
    --bs-table-color: var(--shell-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--shell-border);
    --bs-table-striped-bg: var(--shell-table-stripe-bg);
    --bs-table-hover-bg: var(--shell-table-hover-bg);
    width: 100%;
    min-width: 44rem;
    margin: 0;
    vertical-align: middle;
}

.xk-data-table-heading__title,
.xk-content-card__title,
.xk-capability-status-list__title--top-level {
    margin: 0;
    color: var(--shell-heading);
    font-family: var(--shell-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.3;
}

.xk-data-table-heading__subtitle,
.xk-content-card__subtitle,
.xk-capability-status-list__description,
.xk-form-section__subtitle {
    margin: 0;
    color: var(--shell-text-muted);
    font-family: var(--shell-font-body);
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.6;
}

.xk-form-section__title,
.xk-capability-status-list__title--nested {
    margin: 0;
    color: var(--shell-heading);
    font-family: var(--shell-font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.4;
}

.xk-capability-status-list__item {
    background: var(--shell-surface-muted);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-md);
}

.xk-capability-status-list__status-icon,
.xk-capability-status-list__capability-icon {
    border-radius: var(--shell-kpi-icon-radius);
}

.xk-capability-status-list__status-icon {
    font-size: 0.95rem;
    font-weight: 700;
}

.xk-capability-status-list__status-icon--available {
    color: var(--shell-kpi-icon-success-color);
    background: var(--shell-kpi-icon-success-bg);
}

.xk-capability-status-list__status-icon--unavailable {
    color: var(--shell-kpi-icon-danger-color);
    background: var(--shell-kpi-icon-danger-bg);
}

.xk-capability-status-list__status-icon--warning {
    color: var(--shell-kpi-icon-warning-color);
    background: var(--shell-kpi-icon-warning-bg);
}

.xk-capability-status-list__status-icon--neutral {
    color: var(--shell-kpi-icon-muted-color);
    background: var(--shell-kpi-icon-muted-bg);
}

.xk-capability-status-list__capability-icon {
    color: var(--shell-text-muted);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    font-size: 1rem;
}

.xk-capability-status-list__item-title {
    margin: 0;
    color: var(--shell-text);
    font-size: 0.975rem;
    font-weight: 700;
    line-height: 1.35;
}

.xk-capability-status-list__item-description {
    margin: 0;
    color: var(--shell-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
}

.xk-capability-status-list__item-detail {
    margin: 0;
    color: var(--shell-text);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.xk-data-table > thead > tr > th {
    padding: 1rem;
    color: var(--shell-text-muted);
    background: var(--shell-table-header-bg);
    border-bottom: 1px solid var(--shell-border);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.xk-data-table > tbody > tr > td {
    padding: 1rem;
    color: var(--shell-text);
    border-bottom: 1px solid var(--shell-border);
    font-size: 0.875rem;
    vertical-align: middle;
}

.xk-data-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.xk-data-table > tbody > tr:hover > td {
    background: var(--shell-table-hover-bg);
}

.xk-data-table > tbody > tr[aria-selected="true"] > td,
.xk-data-table > tbody > tr.xk-data-table__row--selected > td {
    background: var(--shell-table-selected-bg);
}

.xk-table-primary {
    color: var(--shell-heading);
    font-weight: 600;
}

.xk-table-secondary {
    color: var(--shell-text-muted);
    font-size: 0.875rem;
}

.xk-table-numeric {
    text-align: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.xk-table-status {
    white-space: nowrap;
}

.xk-table-actions {
    text-align: end;
    white-space: nowrap;
}

td.xk-table-actions {
    display: table-cell;
}

.xk-table-actions > * + * {
    margin-inline-start: var(--shell-spacing-2);
}

.xk-table-actions .btn {
    min-width: 2rem;
}

.xk-data-table .badge,
.xk-capability-status-list__badge .badge,
.xk-overview-status-pills .badge {
    padding: 0.25em 0.5em;
    border-radius: var(--shell-table-badge-radius) !important;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.xk-data-table .badge.text-bg-primary,
.xk-capability-status-list__badge .badge.text-bg-primary,
.xk-overview-status-pills .badge.text-bg-primary {
    color: var(--shell-primary) !important;
    background: color-mix(in srgb, var(--shell-primary), transparent 84%) !important;
}

.xk-data-table .badge.text-bg-info,
.xk-capability-status-list__badge .badge.text-bg-info,
.xk-overview-status-pills .badge.text-bg-info {
    color: var(--shell-info) !important;
    background: color-mix(in srgb, var(--shell-info), transparent 84%) !important;
}

.xk-data-table .badge.text-bg-success,
.xk-capability-status-list__badge .badge.text-bg-success,
.xk-overview-status-pills .badge.text-bg-success {
    color: var(--shell-kpi-icon-success-color) !important;
    background: var(--shell-kpi-icon-success-bg) !important;
}

.xk-data-table .badge.text-bg-warning,
.xk-capability-status-list__badge .badge.text-bg-warning,
.xk-overview-status-pills .badge.text-bg-warning {
    color: var(--shell-warning-text) !important;
    background: var(--shell-kpi-icon-warning-bg) !important;
}

.xk-data-table .badge.text-bg-danger,
.xk-capability-status-list__badge .badge.text-bg-danger,
.xk-overview-status-pills .badge.text-bg-danger {
    color: var(--shell-kpi-icon-danger-color) !important;
    background: var(--shell-kpi-icon-danger-bg) !important;
}

.xk-data-table .badge.text-bg-secondary,
.xk-capability-status-list__badge .badge.text-bg-secondary,
.xk-overview-status-pills .badge.text-bg-secondary {
    color: var(--shell-text-muted) !important;
    background: color-mix(in srgb, var(--shell-text-muted), transparent 84%) !important;
}

.xk-data-table-record-count {
    color: var(--shell-text-muted);
    font-size: 0.8125rem;
}

.xk-data-table-pagination,
.xk-data-table-pagination .pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin: 0;
}

.xk-data-table-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--shell-table-control-size);
    height: var(--shell-table-control-size);
    padding: 0 var(--shell-spacing-2);
    color: var(--shell-text);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-table-control-radius) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--shell-transition-fast), background-color var(--shell-transition-fast), border-color var(--shell-transition-fast), box-shadow var(--shell-transition-fast);
}

.xk-data-table-pagination .page-link:hover {
    color: var(--shell-primary);
    background: var(--shell-surface-hover);
    border-color: color-mix(in srgb, var(--shell-border), var(--shell-text-muted) 35%);
}

.xk-data-table-pagination .page-link:focus-visible {
    z-index: 2;
    outline: 0;
    border-color: var(--shell-primary);
    box-shadow: 0 0 0 0.25rem var(--shell-input-focus-ring);
}

.xk-data-table-pagination .page-item.active .page-link {
    color: var(--shell-primary-contrast);
    background: var(--shell-primary);
    border-color: var(--shell-primary);
}

.xk-data-table-pagination .page-item.disabled .page-link,
.xk-data-table-pagination .page-link:disabled {
    color: var(--shell-text-muted);
    pointer-events: none;
    background: var(--shell-surface);
    border-color: var(--shell-border);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Shared definition list. */
.xk-definition-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.xk-definition-item {
    display: grid;
    grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr);
    gap: 0.25rem var(--shell-spacing-4);
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--shell-border);
}

.xk-definition-item:first-child {
    padding-top: 0;
}

.xk-definition-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.xk-definition-item > dt {
    margin: 0;
    color: var(--shell-text-muted);
    font-size: 0.875rem;
    font-weight: 700;
}

.xk-definition-item > dd {
    min-width: 0;
    margin: 0;
    color: var(--shell-text);
    overflow-wrap: anywhere;
}

/* Registry sort surface and shared overview hierarchy visual contract. */
.xk-registry-sort-toolbar {
    align-items: flex-start;
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--shell-spacing-3);
    justify-content: space-between;
    margin-block-end: var(--shell-spacing-3);
    padding: var(--shell-spacing-3);
    width: 100%;
}

.xk-registry-sort-toolbar__copy {
    display: grid;
    gap: var(--shell-spacing-1);
    min-width: 0;
}

.xk-registry-sort-toolbar .form-switch {
    align-items: center;
    display: flex;
    gap: var(--shell-spacing-2);
    min-height: 1.5rem;
    padding-inline-start: 0;
}

.xk-registry-sort-toolbar .form-switch .form-check-input {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2364748b'/%3e%3c/svg%3e");
    background-color: var(--shell-input-bg);
    background-image: var(--bs-form-switch-bg);
    background-position: left center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 1px solid var(--shell-input-border);
    border-radius: var(--shell-radius-pill);
    cursor: pointer;
    float: none;
    height: 1.25rem;
    margin: 0;
    width: 2.5rem;
    transition: background-position var(--shell-transition-fast), background-color var(--shell-transition-fast), border-color var(--shell-transition-fast), box-shadow var(--shell-transition-fast);
}

.xk-registry-sort-toolbar .form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: var(--shell-primary);
    background-position: right center;
    border-color: var(--shell-primary);
}

.xk-registry-sort-toolbar .form-switch .form-check-label {
    color: var(--shell-text);
    cursor: pointer;
    font-size: 0.9375rem;
}

.xk-registry-sort-toolbar .form-switch .form-check-input:disabled,
.xk-registry-sort-toolbar .form-switch .form-check-input:disabled ~ .form-check-label {
    cursor: default;
}

.xk-registry-sort-toolbar__help {
    color: var(--shell-text-muted);
    margin: 0;
}

.xk-registry-sort-toolbar__status {
    align-items: center;
    color: var(--shell-text-muted);
    display: inline-flex;
    gap: var(--shell-spacing-2);
    margin-inline-start: auto;
}

.xk-overview-hierarchy {
    display: grid;
    gap: var(--shell-spacing-4);
    min-width: 0;
}

.xk-overview-hierarchy__empty,
.xk-overview-hierarchy__scope,
.xk-overview-hierarchy__category-header,
.xk-overview-hierarchy__item {
    color: var(--shell-text);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-lg);
}

.xk-overview-hierarchy__empty {
    padding: var(--shell-spacing-5);
    color: var(--shell-text-muted);
    border-style: dashed;
}

.xk-overview-hierarchy__scope {
    overflow: hidden;
}

.xk-overview-hierarchy__scope-header {
    border-bottom: 1px solid var(--shell-border);
}

.xk-overview-hierarchy__scope-title,
.xk-overview-hierarchy__category-title,
.xk-overview-hierarchy__item-title {
    color: var(--shell-text);
    font-size: 0.975rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.xk-overview-hierarchy__scope-description,
.xk-overview-hierarchy__category-description,
.xk-overview-hierarchy__item-description {
    color: var(--shell-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

.xk-overview-hierarchy__category {
    border-inline-start: 1px solid var(--shell-border);
}

.xk-overview-hierarchy__category-header {
    background: var(--shell-primary-soft);
}

.xk-overview-hierarchy__title-link {
    color: inherit;
    text-decoration: none;
}

.xk-overview-hierarchy__title-link:hover {
    color: var(--shell-primary);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.xk-overview-hierarchy__title-link:focus-visible {
    border-radius: var(--shell-table-control-radius);
    color: var(--shell-primary);
    outline: 0.15rem solid color-mix(in srgb, var(--shell-primary), transparent 65%);
    outline-offset: 0.15rem;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.xk-overview-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--shell-spacing-2);
    margin: 0;
    min-width: 0;
}

.xk-overview-meta-list__item {
    align-items: center;
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-pill);
    color: var(--shell-text-muted);
    display: inline-flex;
    font-size: 0.8125rem;
    gap: 0.25rem;
    line-height: 1.35;
    min-width: 0;
    padding: 0.25rem 0.625rem;
}

.xk-overview-meta-list__item dt {
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.xk-overview-meta-list__item dd {
    color: var(--shell-text);
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.xk-overview-status-pills {
    align-items: flex-start;
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--shell-spacing-2);
    justify-content: flex-end;
}

.xk-registry-sort-busy,
.xk-registry-branch-loading {
    background: color-mix(in srgb, var(--shell-primary) 8%, var(--shell-surface) 92%);
    border: 1px dashed color-mix(in srgb, var(--shell-primary) 32%, transparent);
    border-radius: var(--shell-radius-lg);
    color: var(--shell-text-muted);
    padding: var(--shell-spacing-2) var(--shell-spacing-3);
}

.xk-registry-sortable__handle,
.xk-registry-tree-toggle {
    align-items: center;
    background: color-mix(in srgb, var(--shell-surface) 86%, var(--shell-primary) 14%);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-pill);
    color: var(--shell-primary);
    cursor: pointer;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    padding: 0.125rem;
    width: 2rem;
}

.xk-registry-sortable__handle {
    color: var(--shell-text-muted);
    cursor: grab;
}

.xk-registry-sortable__handle:active {
    cursor: grabbing;
}

.xk-registry-sortable__handle:hover,
.xk-registry-sortable__handle:focus-visible,
.xk-registry-tree-toggle:hover,
.xk-registry-tree-toggle:focus-visible {
    border-color: color-mix(in srgb, var(--shell-primary) 52%, transparent);
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--shell-primary) 20%, transparent);
    color: var(--shell-primary);
    outline: 0;
}

.xk-registry-tree-toggle:disabled,
.xk-registry-sortable__handle:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.xk-registry-sort-placeholder {
    background: color-mix(in srgb, var(--shell-primary) 10%, var(--shell-surface) 90%);
    border: 2px dashed color-mix(in srgb, var(--shell-primary) 58%, transparent);
    border-radius: var(--shell-radius-lg);
    box-shadow: inset 0 0 0 0.125rem color-mix(in srgb, var(--shell-primary) 10%, transparent);
    color: var(--shell-primary);
    cursor: copy;
}

.xk-registry-sort-placeholder__label {
    align-items: center;
    background: color-mix(in srgb, var(--shell-primary) 14%, var(--shell-surface) 86%);
    border: 1px solid color-mix(in srgb, var(--shell-primary) 42%, transparent);
    border-radius: var(--shell-radius-pill);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.375rem 1rem;
    text-transform: uppercase;
}

.xk-registry-sortable--drop-target > .xk-overview-hierarchy__scope-header,
.xk-registry-sortable--drop-target > .xk-overview-hierarchy__category-header,
.xk-registry-sortable--drop-target.xk-overview-hierarchy__item {
    border-color: color-mix(in srgb, var(--shell-primary) 42%, var(--shell-border));
    box-shadow: 0 0 0 0.12rem color-mix(in srgb, var(--shell-primary) 14%, transparent);
}

.xk-overview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--shell-spacing-2);
    margin-top: var(--shell-spacing-3);
}

@media (max-width: 767.98px) {
    .xk-registry-sort-toolbar__status {
        margin-inline-start: 0;
    }

    .xk-overview-status-pills {
        justify-content: flex-start;
    }
}

.xk-registry-form {
    max-width: 72rem;
}

@media (max-width: 575.98px) {
    .xk-definition-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .xk-data-table {
        min-width: 40rem;
    }

    .xk-data-table-pagination,
    .xk-data-table-pagination .pagination {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

@media (min-width: 992px) {
    .xk-surface-card__header,
    .xk-surface-card__body,
    .xk-surface-card__footer,
    .xk-data-table-shell__header,
    .xk-data-table-shell__footer {
        padding-inline: 1.5rem;
    }
}

/* Reusable data-table pagination/filter builder. */
.xk-data-table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--shell-spacing-4);
    width: 100%;
}

.xk-data-table-pagination-footer .form-select,
.xk-data-table-filter-builder .form-select,
.xk-data-table-filter-builder .form-control {
    color: var(--shell-text);
    background-color: var(--shell-surface);
    border-color: var(--shell-border);
    border-radius: var(--shell-table-control-radius);
}

.xk-data-table-pagination-footer .form-select:focus,
.xk-data-table-filter-builder .form-select:focus,
.xk-data-table-filter-builder .form-control:focus {
    border-color: var(--shell-primary);
    box-shadow: 0 0 0 0.25rem var(--shell-input-focus-ring);
}

.xk-data-table-filter-builder {
    padding-top: var(--shell-spacing-3);
    border-top: 1px solid var(--shell-border);
}

.xk-data-table-filter-builder__row {
    padding: var(--shell-spacing-3);
    background: var(--shell-surface-muted);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-table-control-radius);
}

.xk-data-table-filter-builder__field-label,
.xk-data-table-filter-builder__date > span {
    color: var(--shell-text-muted);
}

@media (max-width: 767.98px) {
    .xk-data-table-pagination-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .xk-data-table-pagination,
    .xk-data-table-pagination .pagination {
        justify-content: center;
    }
}
