/* Global UI kit (sx-*). Generalised from support.css; support.css loads after this and stays authoritative for Support. */
/*
 * Support module UI kit. Global classes prefixed sx-, used by Pages/Support/Shared components and every
 * support page (setup tabs, supervisor, knowledge base, reports). Colours, radii and spacing come from
 * css/tokens.css; spacing follows the 8px grid.
 */

/* ---------- Page frame ---------- */
.sx-page,
.sx-setup {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-family: var(--ps-font-sans);
    color: var(--ps-ink);
}

.sx-muted { color: var(--ps-muted); }
.sx-num { font-variant-numeric: tabular-nums; }
.sx-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.sx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--ps-font-size-caption);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ps-primary-strong);
    margin-bottom: 4px;
}

/* ---------- Setup shell ---------- */
.sx-setup__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sx-setup__intro { min-width: 0; }
.sx-setup__title { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; margin: 0; color: var(--ps-ink); }
.sx-setup__desc { margin: 4px 0 0; font-size: var(--ps-font-size-sm); color: var(--ps-muted); }

.sx-tenant { display: flex; flex-direction: column; gap: 4px; min-width: 240px; margin: 0; }
.sx-tenant__label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ps-font-size-caption); font-weight: 600; color: var(--ps-muted); }
.sx-tenant .form-select { height: var(--ps-size-input-height); font-size: var(--ps-font-size-sm); border-radius: var(--ps-radius-lg); }

.sx-tabs {
    position: relative;
    border-bottom: 1px solid var(--ps-border);
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sx-tabs::-webkit-scrollbar { display: none; }
.sx-tabs__track { display: flex; align-items: stretch; gap: 2px; min-width: max-content; }

.sx-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: var(--ps-font-size-sm);
    font-weight: 500;
    line-height: 20px;
    color: var(--ps-muted);
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--ps-radius-lg) var(--ps-radius-lg) 0 0;
    transition: color .15s ease, background-color .15s ease;
}

.sx-tab i { width: 14px; text-align: center; font-size: 13px; color: var(--ps-gray-400); transition: color .15s ease; }

.sx-tab::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--ps-primary);
    transform: scaleX(0);
    transition: transform .2s ease;
}

.sx-tab:hover { color: var(--ps-ink); background: var(--ps-gray-50); text-decoration: none; }
.sx-tab:hover i { color: var(--ps-ink-soft); }
.sx-tab:focus-visible { outline: none; box-shadow: inset var(--ps-focus-ring); }
.sx-tab.is-active { color: var(--ps-primary-strong); font-weight: 600; }
.sx-tab.is-active i { color: var(--ps-primary); }
.sx-tab.is-active::after { transform: scaleX(1); }

.sx-tabs__sep { flex: none; width: 1px; margin: 12px 6px; background: var(--ps-border); }

.sx-setup__body { min-width: 0; }

/* ---------- Page header ---------- */
.sx-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sx-page-header__text { min-width: 0; flex: 1 1 320px; }
.sx-page-header__title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sx-page-header__title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ps-ink); }
.sx-page-header--section .sx-page-header__title { font-size: var(--ps-font-size-h2); font-weight: 600; letter-spacing: 0; }
.sx-page-header__desc { margin: 4px 0 0; font-size: var(--ps-font-size-sm); color: var(--ps-muted); max-width: 720px; }
.sx-page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.sx-page-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ps-radius-lg);
    background: var(--ps-primary-soft);
    color: var(--ps-primary);
}

.sx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: var(--ps-font-size-sm);
    font-weight: 500;
    color: var(--ps-muted);
    text-decoration: none;
}

.sx-back:hover { color: var(--ps-primary-strong); text-decoration: none; }

/* ---------- Toolbar & search ---------- */
.sx-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sx-toolbar__spacer { flex: 1 1 auto; }

.sx-toolbar .form-select,
.sx-toolbar .form-control {
    width: auto;
    min-width: 160px;
    height: var(--ps-size-input-height);
    font-size: var(--ps-font-size-sm);
    border-radius: var(--ps-radius-lg);
}

.sx-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 280px;
    max-width: 420px;
    height: var(--ps-size-input-height);
    padding: 0 12px;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border-strong);
    border-radius: var(--ps-radius-lg);
    color: var(--ps-gray-400);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sx-search:focus-within { border-color: var(--ps-primary); box-shadow: var(--ps-focus-ring); color: var(--ps-primary); }

.sx-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: var(--ps-font-size-sm);
    color: var(--ps-ink);
}

.sx-search input::placeholder { color: var(--ps-gray-400); }

/* ---------- Table ---------- */
.sx-table-wrap {
    position: relative;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-xl);
    overflow: auto;
    max-height: calc(100vh - 300px);
    min-height: 120px;
}

.sx-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--ps-font-size-sm);
    color: var(--ps-ink);
    background: var(--ps-surface);
}

.sx-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 16px;
    background: var(--ps-surface-2);
    border-bottom: 1px solid var(--ps-border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--ps-muted);
}

.sx-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ps-border);
    vertical-align: middle;
    background: var(--ps-surface);
    transition: background-color .12s ease;
}

.sx-table tbody tr:last-child td { border-bottom: 0; }
.sx-table tbody tr:hover td { background: var(--ps-gray-50); }
.sx-table tbody tr.is-clickable { cursor: pointer; }
.sx-table tbody tr.is-selected td { background: var(--ps-primary-soft); }
.sx-table tbody tr.is-muted td { color: var(--ps-muted); }
.sx-table .sx-col-actions { width: 1%; text-align: right; white-space: nowrap; }
.sx-table .sx-col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-table .sx-col-shrink { width: 1%; white-space: nowrap; }

.sx-cell-title { font-weight: 600; color: var(--ps-ink); }
.sx-cell-sub { display: block; margin-top: 2px; font-size: var(--ps-font-size-caption); color: var(--ps-muted); }

.sx-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--ps-primary-soft);
    color: var(--ps-primary-strong);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.sx-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Opt-in: on phones each row becomes a stacked card. Put data-label="Column" on each td. */
@media (max-width: 640px) {
    .sx-table-wrap { max-height: none; }
    .sx-table--stack thead { display: none; }
    .sx-table--stack tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--ps-border); }
    .sx-table--stack tbody tr:last-child { border-bottom: 0; }
    .sx-table--stack tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; background: transparent; }
    .sx-table--stack tbody td[data-label]::before { content: attr(data-label); font-size: var(--ps-font-size-caption); font-weight: 600; color: var(--ps-muted); }
    .sx-table--stack .sx-col-actions { width: auto; justify-content: flex-end; }
}

/* ---------- Pager ---------- */
.sx-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 4px 0;
    font-size: var(--ps-font-size-sm);
    color: var(--ps-muted);
}

.sx-pager__summary { display: flex; align-items: center; gap: 16px; }
.sx-pager__size { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.sx-pager__size .form-select { width: auto; height: var(--ps-size-input-height-sm); font-size: var(--ps-font-size-sm); border-radius: var(--ps-radius-md); }
.sx-pager__pages { display: flex; align-items: center; gap: 4px; }

.sx-pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--ps-radius-lg);
    background: transparent;
    color: var(--ps-ink-soft);
    font-size: var(--ps-font-size-sm);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.sx-pager__btn:hover:not(:disabled) { background: var(--ps-gray-100); color: var(--ps-ink); }
.sx-pager__btn:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }
.sx-pager__btn:disabled { opacity: .4; cursor: default; }
.sx-pager__btn.is-active { background: var(--ps-primary-soft); border-color: var(--ps-primary-soft-2); color: var(--ps-primary-strong); font-weight: 600; }
.sx-pager__gap { padding: 0 4px; color: var(--ps-gray-400); }
.sx-pager__compact { display: none; padding: 0 8px; }

@media (max-width: 576px) {
    .sx-pager__num, .sx-pager__gap { display: none; }
    .sx-pager__compact { display: inline; }
}

/* ---------- Card, empty state, alerts ---------- */
.sx-card {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-xl);
    padding: 24px;
}

.sx-card__title { margin: 0 0 4px; font-size: var(--ps-font-size-h3); font-weight: 600; }
.sx-card__desc { margin: 0 0 16px; font-size: var(--ps-font-size-sm); color: var(--ps-muted); }

.sx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 56px 24px;
    text-align: center;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-xl);
}

.sx-card .sx-empty,
.sx-table-wrap .sx-empty { border: 0; border-radius: 0; background: transparent; }

.sx-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--ps-primary-soft);
    color: var(--ps-primary);
    font-size: 18px;
    box-shadow: 0 0 0 8px rgba(var(--ps-primary-rgb), .05);
}

.sx-empty__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ps-ink); }
.sx-empty__message { margin: 0; max-width: 440px; font-size: var(--ps-font-size-sm); color: var(--ps-muted); }
.sx-empty__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.sx-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--ps-radius-lg);
    font-size: var(--ps-font-size-sm);
}

.sx-alert > i { margin-top: 3px; }
.sx-alert--danger { background: var(--ps-danger-soft); border-color: rgba(220, 38, 38, .18); color: var(--ps-danger-text); }
.sx-alert--warning { background: var(--ps-warning-soft); border-color: rgba(217, 119, 6, .2); color: var(--ps-warning-text); }
.sx-alert--success { background: var(--ps-success-soft); border-color: rgba(22, 163, 74, .2); color: var(--ps-success-text); }
.sx-alert--info { background: var(--ps-info-soft); border-color: rgba(2, 132, 199, .2); color: var(--ps-info-text); }

/* ---------- Pills ---------- */
.sx-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    vertical-align: middle;
}

.sx-pill i { font-size: 10px; }
.sx-pill__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.sx-pill--success { background: var(--ps-success-soft); color: var(--ps-success-text); }
.sx-pill--warning { background: var(--ps-warning-soft); color: var(--ps-warning-text); }
.sx-pill--danger { background: var(--ps-danger-soft); color: var(--ps-danger-text); }
.sx-pill--info { background: var(--ps-info-soft); color: var(--ps-info-text); }
.sx-pill--neutral { background: var(--ps-neutral-soft); color: var(--ps-neutral-text); }
.sx-pill--primary { background: var(--ps-primary-soft); color: var(--ps-primary-strong); }

/* ---------- Buttons ---------- */
.sx-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.sx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--ps-radius-lg);
    background: transparent;
    color: var(--ps-muted);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.sx-icon-btn:hover { background: var(--ps-gray-100); color: var(--ps-ink); text-decoration: none; }
.sx-icon-btn:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }
.sx-icon-btn:disabled, .sx-icon-btn.disabled { opacity: .4; pointer-events: none; }
.sx-icon-btn--danger:hover { background: var(--ps-danger-soft); color: var(--ps-danger); }
.sx-icon-btn--primary:hover { background: var(--ps-primary-soft); color: var(--ps-primary-strong); }

/* ---------- Forms ---------- */
.sx-form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.sx-form--wide { max-width: 880px; }
.sx-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sx-form-section { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; border-top: 1px solid var(--ps-border); }
.sx-form-section:first-child { padding-top: 0; border-top: 0; }
.sx-form-section__title { margin: 0; font-size: var(--ps-font-size-h3); font-weight: 600; }

.sx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sx-field > label,
.sx-label { margin: 0; font-size: var(--ps-font-size-sm); font-weight: 600; color: var(--ps-ink); }
.sx-required::after { content: " *"; color: var(--ps-danger); }
.sx-help { margin: 0; font-size: var(--ps-font-size-caption); color: var(--ps-muted); }
.sx-field-error { margin: 0; font-size: var(--ps-font-size-caption); color: var(--ps-danger-text); }

.sx-field .form-control,
.sx-field .form-select {
    min-height: var(--ps-size-input-height);
    font-size: var(--ps-font-size-sm);
    border-radius: var(--ps-radius-lg);
    border-color: var(--ps-border-strong);
}

.sx-field .form-control:focus,
.sx-field .form-select:focus { border-color: var(--ps-primary); box-shadow: var(--ps-focus-ring); }
.sx-field textarea.form-control { min-height: 96px; }

.sx-check-list { display: flex; flex-direction: column; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-lg); max-height: 280px; overflow: auto; }
.sx-check-list label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; font-size: var(--ps-font-size-sm); border-bottom: 1px solid var(--ps-border); cursor: pointer; }
.sx-check-list label:last-child { border-bottom: 0; }
.sx-check-list label:hover { background: var(--ps-gray-50); }

@media (max-width: 576px) {
    .sx-form-row { grid-template-columns: 1fr; }
}

/* ---------- Toggle ---------- */
.sx-toggle {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.sx-toggle.is-disabled { cursor: not-allowed; opacity: .6; }

.sx-toggle__input {
    position: absolute;
    width: 36px;
    height: 20px;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}

.sx-toggle__track {
    position: relative;
    flex: none;
    width: 36px;
    height: 20px;
    margin-top: 1px;
    border-radius: 999px;
    background: var(--ps-gray-300);
    transition: background-color .18s ease;
}

.sx-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: var(--ps-shadow-sm);
    transition: transform .18s ease;
}

.sx-toggle__input:checked + .sx-toggle__track { background: var(--ps-primary); }
.sx-toggle__input:checked + .sx-toggle__track .sx-toggle__thumb { transform: translateX(16px); }
.sx-toggle__input:focus-visible + .sx-toggle__track { box-shadow: var(--ps-focus-ring); }
.sx-toggle__text { display: flex; flex-direction: column; gap: 2px; }
.sx-toggle__label { font-size: var(--ps-font-size-sm); font-weight: 600; color: var(--ps-ink); line-height: 22px; }
.sx-toggle__desc { font-size: var(--ps-font-size-caption); color: var(--ps-muted); }

/* ---------- Stat tiles (Supervisor / Reports only) ---------- */
.sx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }

.sx-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-xl);
    min-width: 0;
}

.sx-stat__label { font-size: var(--ps-font-size-caption); font-weight: 600; color: var(--ps-muted); text-transform: uppercase; letter-spacing: .04em; }
.sx-stat__value { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--ps-ink); font-variant-numeric: tabular-nums; }
.sx-stat__meta { font-size: var(--ps-font-size-caption); color: var(--ps-muted); }
.sx-stat--danger .sx-stat__value { color: var(--ps-danger); }
.sx-stat--warning .sx-stat__value { color: var(--ps-warning-strong); }
.sx-stat--success .sx-stat__value { color: var(--ps-success); }

/* ---------- Drawer ---------- */
html.sx-scroll-lock,
html.sx-scroll-lock body { overflow: hidden; }

.sx-drawer-root { position: fixed; inset: 0; z-index: 1044; }

.sx-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(2px);
    animation: sx-fade-in .2s ease both;
}

.sx-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(var(--sx-drawer-width, 520px), 100vw);
    background: var(--ps-surface);
    box-shadow: var(--ps-shadow-lg);
    border-left: 1px solid var(--ps-border);
    outline: none;
    animation: sx-slide-in .26s cubic-bezier(.2, .8, .2, 1) both;
}

.sx-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ps-border);
}

.sx-drawer__titles { min-width: 0; }
.sx-drawer__title { margin: 0; font-size: var(--ps-font-size-h2); font-weight: 600; line-height: 1.35; color: var(--ps-ink); }
.sx-drawer__subtitle { margin: 4px 0 0; font-size: var(--ps-font-size-sm); color: var(--ps-muted); }
.sx-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 24px; overscroll-behavior: contain; }
.sx-drawer__body .sx-form { max-width: none; }

.sx-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--ps-border);
    background: var(--ps-surface-2);
}

@media (max-width: 576px) {
    .sx-drawer { width: 100vw; border-left: 0; }
    .sx-drawer__header, .sx-drawer__footer { padding-left: 16px; padding-right: 16px; }
    .sx-drawer__body { padding: 16px; }
    .sx-drawer__footer .btn { flex: 1 1 0; }
}

/* ---------- Confirm ---------- */
.sx-confirm-root {
    position: fixed;
    inset: 0;
    z-index: 1048;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sx-confirm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    animation: sx-fade-in .15s ease both;
}

.sx-confirm {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    width: min(440px, 100%);
    padding: 24px;
    background: var(--ps-surface);
    border-radius: var(--ps-radius-xl);
    box-shadow: var(--ps-shadow-lg);
    outline: none;
    animation: sx-pop-in .18s cubic-bezier(.2, .8, .2, 1) both;
}

.sx-confirm__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--ps-primary-soft);
    color: var(--ps-primary);
    font-size: 16px;
}

.sx-confirm__icon--danger { background: var(--ps-danger-soft); color: var(--ps-danger); }
.sx-confirm__content { min-width: 0; }
.sx-confirm__title { margin: 0 0 6px; font-size: var(--ps-font-size-h3); font-weight: 600; color: var(--ps-ink); }
.sx-confirm__message { margin: 0; font-size: var(--ps-font-size-sm); color: var(--ps-ink-soft); }
.sx-confirm__actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

@media (max-width: 400px) {
    .sx-confirm { grid-template-columns: 1fr; }
    .sx-confirm__actions .btn { flex: 1 1 0; }
}

/* ---------- Motion ---------- */
@keyframes sx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sx-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes sx-pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .sx-drawer, .sx-drawer__backdrop, .sx-confirm, .sx-confirm__backdrop { animation: none; }
    .sx-tab::after, .sx-toggle__track, .sx-toggle__thumb { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 576px) {
    .sx-setup__title, .sx-page-header__title { font-size: 20px; }
    .sx-tenant { min-width: 0; width: 100%; }
    .sx-page-header__actions { width: 100%; }
    .sx-search { max-width: none; flex-basis: 100%; }
    .sx-toolbar .form-select, .sx-toolbar .form-control { flex: 1 1 140px; min-width: 0; }
    .sx-card { padding: 16px; }
}

/* ---- Kit additions ---- */
.sx-page { display: flex; flex-direction: column; gap: 0; min-width: 0; padding-bottom: 32px; }
.sx-page > .sx-page-header { margin-bottom: 16px; }
.sx-tabs--page { margin-bottom: 16px; }
button.sx-tab { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.sx-tab__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    font-size: var(--ps-font-size-caption); font-weight: 600; font-variant-numeric: tabular-nums;
    background: var(--ps-gray-100); color: var(--ps-muted);
}
.sx-tab.is-active .sx-tab__count { background: var(--ps-primary-soft); color: var(--ps-primary-strong); }
.sx-stat__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-stat__icon { color: var(--ps-gray-400); font-size: 14px; }
.sx-stat--info .sx-stat__value { color: var(--ps-info); }
.sx-stat--primary .sx-stat__value { color: var(--ps-primary-strong); }
.sx-dl {
    display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    margin: 0; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-xl);
    background: var(--ps-surface); overflow: hidden;
}
.sx-dl__term, .sx-dl__desc { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--ps-border); font-size: var(--ps-font-size-sm); min-width: 0; }
.sx-dl__term { color: var(--ps-muted); font-weight: 500; }
.sx-dl__desc { color: var(--ps-ink); overflow-wrap: anywhere; }
.sx-dl > :nth-last-child(-n+2) { border-bottom: 0; }
.sx-dl--plain { border: 0; border-radius: 0; background: transparent; }
@media (max-width: 576px) {
    .sx-dl { grid-template-columns: minmax(0, 1fr); }
    .sx-dl__term { padding-bottom: 2px; border-bottom: 0; font-size: var(--ps-font-size-caption); }
    .sx-dl__desc { padding-top: 0; }
    .sx-dl > .sx-dl__term:nth-last-child(2) { border-bottom: 0; }
}
