/* Wensity surface layer.
 *
 * The kit ships React components for controls and blocks; the bulk of our pages is server-rendered
 * markup (tables of customers, lists, panels). This sheet gives that markup the kit's own look by
 * reading nothing but Wensity tokens — same radii, borders, shadows, type scale and spacing as the
 * components — so a server-rendered table and a <Table> island are visually the same surface.
 *
 * Cosmetic properties only: no display/position changes, so layouts cannot shift.
 * Loaded after the legacy sheets and before the kit: Wensity utilities still win where both apply.
 */

/* ── Type scale ─────────────────────────────────────────────────────────────── */
body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, .page-title, .crm-page-title, .dash-title {
    font-family: var(--font-display);
    letter-spacing: -0.011em;
    color: var(--foreground);
    font-weight: 600;
}
h1, .page-title { font-size: 1.5rem; line-height: 1.25; }
h2 {font-size: 1.25rem;}
h3 { font-size: 1.0625rem; line-height: 1.35; }
h4 { font-size: 0.9375rem; }
small, .text-muted, .muted, .subtext, .hint, .page-subtitle, .crm-page-sub {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.5;
}
a { color: var(--primitive-control-solid); text-decoration: none; }
a:hover { color: var(--primitive-control-solid-hover); }

/* ── Surfaces ───────────────────────────────────────────────────────────────── */
.card,
.panel,
.widget,
.box,
.crm-card,
.stat-card,
.metric-card,
.kpi-card,
.summary-card,
.settings-card,
.form-card,
.section-card,
.dash-card,
.dashboard-card,
.team-card,
.invoice-card,
.lead-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--primitive-radius-surface);
    box-shadow: var(--primitive-shadow-raised);
}
.card:hover, .crm-card:hover, .lead-card:hover, .team-card:hover {
    border-color: var(--border-strong);
}
.card-header, .panel-header, .card-head, .section-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.875rem;
    margin-bottom: 1rem;
}
.card-title, .panel-title, .section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
}

/* ── Page furniture ─────────────────────────────────────────────────────────── */
.page-head, .page-header, .crm-header, .dashboard-page-head, .module-head, .list-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}
.breadcrumb, .crumbs, .page-crumb { color: var(--muted-foreground); font-size: 0.8125rem; }

/* ── Tables: identical to the kit's <Table> ─────────────────────────────────── */
table:not(.wensity-table):not(.no-surface) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
table:not(.wensity-table):not(.no-surface) thead th {
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    padding: 0.625rem 0.875rem;
}
table:not(.wensity-table):not(.no-surface) thead th:first-child { border-top-left-radius: var(--primitive-radius-control-sm); }
table:not(.wensity-table):not(.no-surface) thead th:last-child { border-top-right-radius: var(--primitive-radius-control-sm); }
table:not(.wensity-table):not(.no-surface) tbody td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--primitive-border-subtle);
    color: var(--foreground);
    vertical-align: middle;
}
table:not(.wensity-table):not(.no-surface) tbody tr:last-child td { border-bottom: 0; }
table:not(.wensity-table):not(.no-surface) tbody tr:hover td { background: var(--primitive-surface-hover); }
table:not(.wensity-table):not(.no-surface) tfoot td {
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    padding: 0.625rem 0.875rem;
}
.table-wrap, .table-container, .table-responsive, .crm-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--primitive-radius-surface);
    overflow: hidden;
    background: var(--surface);
}

/* ── Form controls: the kit's field look ────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="tel"], input[type="url"], input[type="date"],
input[type="time"], input[type="datetime-local"], select, textarea, .form-control, .input, .field-input {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--foreground);
    background: var(--primitive-field-face);
    border: 1px solid var(--border-strong);
    border-radius: var(--primitive-radius-control-sm);
    box-shadow: var(--primitive-shadow-drop);
    transition: border-color var(--primitive-motion-fast) var(--primitive-ease),
                box-shadow var(--primitive-motion-fast) var(--primitive-ease);
}
input::placeholder, textarea::placeholder { color: var(--primitive-text-placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--primitive-ring); }
input:focus, input:focus-visible, select:focus, textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--primitive-control-solid);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primitive-control-solid) 22%, transparent);
}
input:disabled, select:disabled, textarea:disabled {
    background: var(--surface-muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
}
label, .form-label, .field-label {
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--foreground);
}
.form-hint, .field-hint { color: var(--muted-foreground); font-size: 0.75rem; }

/* ── Buttons: the kit's control geometry ─────────────────────────────────────── */
.btn, .button, .btn-primary, .btn-secondary, .btn-outline, .btn-ghost, .btn-danger,
.page-btn, .crm-btn, .tpl-btn, .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--primitive-control-height-md);
    padding: 0 0.875rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--primitive-radius-control);
    border: 1px solid transparent;
    transition: background-color var(--primitive-motion-fast) var(--primitive-ease),
                border-color var(--primitive-motion-fast) var(--primitive-ease),
                box-shadow var(--primitive-motion-fast) var(--primitive-ease),
                color var(--primitive-motion-fast) var(--primitive-ease);
    cursor: pointer;
}
.btn-primary, .btn.btn-primary, .button.primary {
    background: var(--primitive-control-solid);
    color: var(--primitive-control-solid-foreground);
    box-shadow: var(--primitive-shadow-drop);
}
.btn-primary:hover { background: var(--primitive-control-solid-hover); }
.btn-primary:active { background: var(--primitive-control-solid-active); }
.btn-secondary, .btn-outline, .btn.btn-secondary, .btn.btn-outline {
    background: var(--surface);
    color: var(--foreground);
    border-color: var(--border-strong);
    box-shadow: var(--primitive-shadow-drop);
}
.btn-secondary:hover, .btn-outline:hover { background: var(--primitive-surface-hover); }
.btn-ghost, .btn.btn-ghost {
    background: transparent;
    color: var(--primitive-text-secondary);
}
.btn-ghost:hover {background: var(--primitive-surface-hover);}
.btn-danger, .btn.btn-danger {
    background: var(--primitive-destructive);
    color: var(--primitive-destructive-foreground);
}
.btn-danger:hover { background: var(--primitive-destructive-hover); }
.btn:focus-visible, .button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primitive-control-solid) 26%, transparent);
}
.btn-sm, .btn.btn-sm { height: var(--primitive-control-height-sm); padding: 0 0.625rem; font-size: 0.8125rem; }
.btn-lg, .btn.btn-lg { height: var(--primitive-control-height-lg); padding: 0 1.125rem; font-size: 0.9375rem; }
.header-icon-btn {
    border-radius: var(--primitive-radius-control-sm);
    color: var(--primitive-text-secondary);
    transition: background-color var(--primitive-motion-fast) var(--primitive-ease),
                color var(--primitive-motion-fast) var(--primitive-ease);
}
.header-icon-btn:hover { background: var(--primitive-surface-hover); color: var(--foreground); }

/* ── Badges / pills / status ────────────────────────────────────────────────── */
.badge, .pill, .tag, .chip, .status-pill, .crm-pill, .sa-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    height: 1.375rem;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--primitive-radius-item);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--primitive-text-secondary);
}
.badge-primary, .badge.is-primary, .pill.primary {
    background: color-mix(in srgb, var(--primitive-control-solid) 12%, transparent);
    border-color: color-mix(in srgb, var(--primitive-control-solid) 30%, transparent);
    color: var(--primitive-control-solid);
}
.badge-success, .badge.is-success, .pill.success, .status-active, .status-paid, .status-connected {
    background: var(--primitive-success-surface);
    border-color: var(--primitive-success-border);
    color: var(--primitive-success);
}
.badge-warning, .badge.is-warning, .pill.warning, .status-pending, .status-trial, .status-due {
    background: var(--primitive-warning-surface);
    border-color: var(--primitive-warning-border);
    color: var(--primitive-warning);
}
.badge-danger, .badge.is-danger, .pill.danger, .status-failed, .status-canceled, .status-overdue {
    background: var(--primitive-destructive-surface);
    border-color: var(--primitive-destructive-border);
    color: var(--primitive-destructive);
}

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs, .tab-row, .subfilter-bar, .uh-subfilterbar {
    border-bottom: 1px solid var(--border);
}
.tab, .tabs button, .tab-btn, .subtab, .subfilter-btn {
    height: var(--primitive-control-height-md);
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primitive-text-secondary);
    border-radius: var(--primitive-radius-control-sm) var(--primitive-radius-control-sm) 0 0;
    transition: color var(--primitive-motion-fast) var(--primitive-ease),
                background-color var(--primitive-motion-fast) var(--primitive-ease);
}
.tab:hover, .subtab:hover, .subfilter-btn:hover { background: var(--primitive-surface-hover); color: var(--foreground); }
.tab.active, .tab.is-active, .subtab.active, .subfilter-btn.active {
    color: var(--foreground);
    background: var(--primitive-surface-selected);
}

/* ── Empty states, alerts, skeletons ───────────────────────────────────────── */
.empty, .empty-state, .no-data, .empty-box, .crm-empty, .notif-empty-dd {
    border: 1px dashed var(--border-strong);
    border-radius: var(--primitive-radius-surface);
    background: var(--surface-muted);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    padding: 2rem 1.25rem;
    text-align: center;
}
.alert, .alert-box, .notice, .banner {
    border-radius: var(--primitive-radius-control);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--foreground);
    font-size: 0.875rem;
    padding: 0.75rem 0.875rem;
}
.alert-error, .alert-danger { background: var(--primitive-destructive-surface); border-color: var(--primitive-destructive-border); color: var(--primitive-destructive); }
.alert-success { background: var(--primitive-success-surface); border-color: var(--primitive-success-border); color: var(--primitive-success); }
.alert-warning { background: var(--primitive-warning-surface); border-color: var(--primitive-warning-border); color: var(--primitive-warning); }
.skeleton, .skeleton-line, .loading-skeleton {
    background: linear-gradient(90deg, var(--surface-muted) 25%, var(--primitive-surface-hover) 37%, var(--surface-muted) 63%);
    background-size: 400% 100%;
    animation: wensity-shimmer 1.4s ease infinite;
    border-radius: var(--primitive-radius-control-sm);
}
@keyframes wensity-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Modals / drawers: kit surfaces ────────────────────────────────────────── */
.modal-content, .modal-box, .modal-card, .uh-modal, [role="dialog"].modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--primitive-radius-surface);
    box-shadow: var(--primitive-shadow-modal);
}
.modal-overlay, .modal-backdrop, .uh-modal-overlay {
    background: var(--primitive-backdrop);
    backdrop-filter: blur(2px);
}
.modal-header, .modal-footer { border-color: var(--border); }
.drawer, .side-drawer, .panel-drawer {
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--primitive-shadow-modal);
}

/* ── Avatars, KPI numbers, progress ────────────────────────────────────────── */
.avatar, .user-avatar, .profile-avatar, .avatar-circle {
    border-radius: 50%;
    border: 1px solid var(--border);
    box-shadow: var(--primitive-shadow-drop);
}
.kpi-value, .stat-value, .metric-value, .hero-metric-value {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
}
.kpi-label, .stat-label, .metric-label {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    font-weight: 500;
}
progress, .progress-bar, .progress-track {
    border-radius: var(--primitive-radius-pill, 999px);
    background: var(--surface-muted);
    overflow: hidden;
}
.progress-bar > span, .progress-fill { background: var(--primitive-control-solid); }

/* ── Page furniture used by the migrated pages ──────────────────────────────── */
.page-head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head__main { min-width: 0; }
.page-head__tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.btn-group {align-items: center;gap: 0.5rem;}
.btn-block { width: 100%; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.875rem; margin-bottom: 1.25rem; }
.kpi-card { display: flex; flex-direction: column; gap: 0.375rem; padding: 1.125rem 1.25rem; }
.kpi-card .kpi-value { font-size: 1.75rem; line-height: 1.1; }

/* Search field with a leading icon, inside a page header */
.field-search { position: relative; display: flex; align-items: center; }
.field-search__icon { position: absolute; left: 0.625rem; width: 16px; height: 16px; color: var(--muted-foreground); pointer-events: none; }
.search-input { height: var(--primitive-control-height-md); padding: 0 0.75rem 0 2rem; min-width: 15rem; }
.field-label--muted { font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 600; }
.field-input { height: var(--primitive-control-height-md); padding: 0 0.625rem; width: 100%; }
.field-input--sm { height: var(--primitive-control-height-sm); font-size: 0.8125rem; }
textarea.field-input { height: auto; padding: 0.5rem 0.625rem; line-height: 1.5; }
.dropzone {
    display: block;
    border: 1px dashed var(--border-strong);
    border-radius: var(--primitive-radius-control);
    background: var(--surface-muted);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--primitive-motion-fast) var(--primitive-ease),
                background-color var(--primitive-motion-fast) var(--primitive-ease);
}
.dropzone:hover { border-color: var(--primitive-control-solid); background: color-mix(in srgb, var(--primitive-control-solid) 5%, var(--surface)); }

/* Table cells */
.cell-entity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.cell-entity__name { font-weight: 550; color: var(--foreground); }
.cell-entity__meta { font-size: 0.8125rem; color: var(--muted-foreground); }
.cell-stack { display: flex; flex-direction: column; gap: 0.25rem; }
.cell-muted { color: var(--muted-foreground); font-size: 0.8125rem; }
th.is-right, td.is-right { text-align: right; }
tr.is-clickable { cursor: pointer; }
.table-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted-foreground); }
.avatar--md { width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9375rem; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primitive-text-secondary);
    border-radius: var(--primitive-radius-control-sm);
    cursor: pointer;
    transition: background-color var(--primitive-motion-fast) var(--primitive-ease),
                color var(--primitive-motion-fast) var(--primitive-ease);
}
.icon-btn:hover { background: var(--primitive-surface-hover); color: var(--foreground); }
.icon-btn--accent { color: var(--primitive-control-solid); }
.icon-btn--danger { color: var(--primitive-destructive); }
.icon-btn--danger:hover { background: var(--primitive-destructive-surface); color: var(--primitive-destructive); }

/* Expanded drawers inside a table */
.drawer-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; }
.drawer-grid--2 { grid-template-columns: 1fr 1fr; gap: 0.875rem; }
.drawer-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.625rem; }
.drawer-title--sm { font-size: 0.8125rem; margin-bottom: 0.875rem; }
.drawer-card { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--primitive-radius-control); padding: 0.875rem; }
.drawer-card.is-centered { text-align: center; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-bottom: 0.875rem; }
.note-meta { display: flex; gap: 0.375rem; margin-top: 0.5rem; }
.empty-note { font-size: 0.8125rem; color: var(--muted-foreground); font-style: italic; }
.text-meta { font-size: 0.8125rem; color: var(--muted-foreground); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.875rem; }
.mb-sm { margin-bottom: 0.625rem; }
.mb-md { margin-bottom: 1.25rem; }
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 0.625rem; }

/* Modals driven by the legacy openModal() helper */
.modal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--primitive-radius-surface); box-shadow: var(--primitive-shadow-modal); max-width: 32rem; width: 100%; }
.modal-panel--wide { max-width: 50rem; }
.modal-head {padding: 1rem 1.25rem;border-bottom: 1px solid var(--border);}
.modal-body { padding: 1.25rem; }
.modal-foot { padding: 0.875rem 1.25rem; border-top: 1px solid var(--border); }
.modal-foot.is-right { text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.modal-close {border: 0;font-size: 1.25rem;color: var(--muted-foreground);border-radius: var(--primitive-radius-control-sm);padding: 0.25rem;}
.modal-close:hover { color: var(--foreground); background: var(--primitive-surface-hover); }
.modal-close--abs { position: absolute; top: 1rem; right: 1rem; }
.pagination {align-items: center;gap: 0.75rem;padding: 0.875rem 0.25rem;}
.pagination__controls { display: flex; gap: 0.375rem; }

.field-search.is-grow { flex: 1; min-width: 15rem; }
.field-select { height: var(--primitive-control-height-md); padding: 0 2rem 0 0.625rem; font-size: 0.875rem; color: var(--foreground); }
.icon-btn--success { color: var(--primitive-success); }
.icon-btn--success:hover { background: var(--primitive-success-surface); color: var(--primitive-success); }
.icon-btn--whatsapp { color: #25d366; }
.icon-btn--whatsapp:hover { background: rgba(37, 211, 102, 0.12); color: #1da851; }
.icon-btn--danger { color: var(--primitive-destructive); }
.status-pill-btn { height: 1.75rem; padding: 0 0.625rem; border-radius: var(--primitive-radius-item); border: 1px solid var(--border); background: var(--surface-muted); font-size: 0.8125rem; font-weight: 500; }
.contacts-filters-form, .filters-form, .toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.75rem 0; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }

/* ── Dashboard home: the hero and its cards read from the kit, not their own palette ── */
.admin-dashboard-hero,
.admin-dashboard-hero--premium {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--primitive-radius-surface);
    box-shadow: var(--primitive-shadow-raised);
    color: var(--foreground);
}
.admin-dashboard-hero__glow { opacity: 0.5; }
.admin-dashboard-hero__eyebrow {
    color: var(--primitive-control-solid);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.admin-dashboard-hero__name {font-family: var(--font-display);font-weight: 600;}
.admin-dashboard-hero__metric {
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle, var(--border));
    border-radius: var(--primitive-radius-control);
    padding: 0.75rem 0.875rem;
}
.admin-dashboard-hero__metric-kicker,
.admin-dashboard-hero__metric-label { color: var(--muted-foreground); font-size: 0.75rem; }
.admin-dashboard-hero__metric-value,
.client-hero-metric__value {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
}
.admin-dashboard-hero__bar {background: var(--surface-muted);border-radius: 999px;}
.admin-dashboard-hero__bar--green { background: var(--primitive-control-solid); }
.admin-dashboard-hero__vline { background: var(--border); }

.client-hero-metric,
.client-dash-triple-card,
.client-dash-ads-card,
.client-dash-email-kpi,
.admin-dashboard-insights__card,
.admin-dashboard-spotlight__card,
.admin-ga-card,
.admin-dash-geo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--primitive-radius-surface);
    box-shadow: var(--primitive-shadow-raised);
}
.client-hero-metric--link:hover,
.admin-dashboard-spotlight__card:hover { border-color: var(--border-strong); }
.client-hero-metric__bar {background: var(--surface-muted);}
.client-hero-metric__bar > span, .client-hero-metric__fill { background: var(--primitive-control-solid); }
.admin-dashboard-spotlight__btn,
.client-dash-inbox-list__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: var(--primitive-control-height-sm);
    padding: 0 0.625rem;
    border-radius: var(--primitive-radius-control-sm);
    background: var(--primitive-control-solid);
    color: var(--primitive-control-solid-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
}
.admin-dashboard-spotlight__btn:hover, .client-dash-inbox-list__cta:hover { background: var(--primitive-control-solid-hover); }
.client-dash-note-card__badge, .admin-dashboard-insights__icon { color: var(--primitive-control-solid); }
.client-dash-inbox-list__empty {
    border: 1px dashed var(--border-strong);
    border-radius: var(--primitive-radius-control);
    background: var(--surface-muted);
    color: var(--muted-foreground);
    padding: 1.25rem;
    text-align: center;
}
.um-av-outer, .admin-dashboard-hero__avatar-outer { border-radius: 50%; box-shadow: var(--primitive-shadow-drop); }
.admin-dashboard-hero__illustration, .admin-dashboard-hero__art { opacity: 0.9; }

/* ── Polish pass: one radius language, styled scrollbars, nested surfaces ───── */

/* Controls all use the kit's control radius; only true pills stay fully round. */
button:not(.header-icon-btn):not(.icon-btn):not([class*="pill"]):not([class*="tab"]):not([class*="badge"]),
input[type="submit"], input[type="button"] {
    border-radius: var(--primitive-radius-control);
}
.btn, .button, .field-input, .field-select, .search-input, select, textarea { border-radius: var(--primitive-radius-control); }
.btn-sm, .field-input--sm { border-radius: var(--primitive-radius-control-sm); }
.send-btn, .chat-send-btn, .ai-send-btn, .composer-send {
    border-radius: var(--primitive-radius-control);
    background: var(--primitive-control-solid);
    color: var(--primitive-control-solid-foreground);
}
.send-btn:hover, .chat-send-btn:hover, .ai-send-btn:hover, .composer-send:hover { background: var(--primitive-control-solid-hover); }

/* Nested surfaces: inner radius follows outer minus padding, and they sit on the muted tone. */
.admin-dashboard-insights__card .stat-tile,
.admin-dashboard-insights__card [class*="stat"],
.admin-dashboard-insights__card [class*="tile"],
.dash-glance [class*="tile"] {
    border-radius: var(--primitive-radius-control-sm);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    box-shadow: none;
}

/* Scrollbars: thin and neutral, so panels stop showing a raw OS scrollbar. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); background-clip: content-box; }

/* Chart baselines are axes, not data: keep them neutral so they never read as a series. */
[class*="baseline"], [class*="grid-line"], [class*="axis-line"] {
    border-color: var(--border);
    background-color: var(--border);
}

.is-center { text-align: center; }
.mt-xs { margin-top: 0.25rem; }
.row-inline { display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap; }
.field-hint--strong { font-weight: 600; }
.text-danger { color: var(--primitive-destructive); }

/* Drive: the dropzone is a centred block, and its actions are real buttons. */
.dropzone, .drive-dropzone, [class*="dropzone"] { text-align: center; }
.dropzone > * { margin-left: auto; margin-right: auto; }
.dropzone h3, .dropzone strong, .dropzone b { text-align: center; display: block; }
.drive-text-btn, .link-btn, .text-btn, .new-folder-btn, .drive-action, .drv-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: var(--primitive-control-height-sm);
    padding: 0 0.625rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--primitive-radius-control-sm);
    background: var(--surface);
    color: var(--foreground);
    font-size: 0.8125rem;
    font-weight: 500;
}
.drive-text-btn:hover, .link-btn:hover, .text-btn:hover, .new-folder-btn:hover, .drive-action:hover, .drv-btn-ghost:hover { background: var(--primitive-surface-hover); }
/* Storage card leads the row from the kit's KPI grid, not a wider lane. */
.kpi-grid > :first-child { grid-column: auto; }

/* Utilities the migrated views asked for. */
.is-left { text-align: left; }
.text-muted { color: var(--muted-foreground); }
/* An empty state inside a table cell is a row message, not a card. */
td.empty, td > .empty:only-child {
    border: 0;
    background: transparent;
    padding: 1.5rem 1rem;
    display: block;
    text-align: center;
}

/* A block button must win over .btn's auto width (equal-specificity order is not enough). */
.btn.btn-block { width: 100%; display: flex; justify-content: center; align-items: center; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.dropzone__icon { color: var(--primitive-control-solid); }
.dropzone__title { font-weight: 550; color: var(--foreground); font-size: 0.875rem; }
.dropzone__hint { color: var(--muted-foreground); font-size: 0.75rem; word-break: break-all; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   AI composer — the only place that styles it. The Wensity component draws the box, its dotted
   controls and its animated edge; we (a) keep the edge glow in our blue, (b) put our mic inside the
   toolbar next to Send, (c) express every ink and surface through the shared Wensity tokens so the
   box is white + blue under [data-theme=light] and near-black + blue under [data-theme=dark].
   The kit ships dark-mode utility variants, which Tailwind v4 resolves from the OS colour-scheme — that
   is exactly the bug a dark-OS customer hit (a black box on our light page). We never rely on them:
   the token rules below outvote those utilities, so theming comes only from our switch.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

/* Host is a passthrough — only the component draws a box. */
.axai-composer { position: relative; display: flex; align-items: center; }
.axai-composer .axai-composer-island { position: relative; flex: 1 1 auto; min-width: 0;
    background: none; border: 0; box-shadow: none; padding: 0; }

/* Legacy chrome of the retired composer stays in the DOM but never shows. */
.axai-composer .axai-dot,
.axai-composer .axai-voice,
.axai-composer .axai-composer-label,
.axai-composer .axai-send { display: none; }

/* ── THEME-AWARE SURFACE — every colour reads from our [data-theme] tokens ───────────────────── */
.axai-composer-island {
    color-scheme: normal;
    color: var(--foreground);
    --axai-blue: var(--primitive-control-solid);
    --axai-line: var(--border);
    --axai-ink: var(--foreground);
    --axai-mut: var(--muted-foreground);
}
/* The kit draws its own literal radius/radial-gradient PLUS an inner black-tint gradient overlay
   that turned our light composer grey. That overlay node is deleted in the component; here we also
   force the box's own paint off and repaint it from the theme tokens, so the surface is pure WHITE
   on light (--surface:#ffffff) and near-black on dark (--surface:#111113) with no OS read. */
.axai-composer-island div.group {
    background-image: none;               /* no kit radial, no gradient tint can show */
    background-color: var(--surface);     /* #ffffff light / #111113 dark */
    border-color: var(--border);
    box-shadow: var(--primitive-shadow-raised);
}
.axai-composer-island div.group:hover,
.axai-composer-island div.group:focus-within { border-color: var(--border-strong); }
.axai-composer-island > div:not(.lmi-border) {
    background-color: transparent; box-shadow: none;
}
.axai-composer-island textarea {
    background-color: transparent; color: var(--foreground); caret-color: var(--foreground);
}
.axai-composer-island textarea::placeholder { color: var(--muted-foreground); }
.axai-composer-island span,
.axai-composer-island label,
.axai-composer-island p { color: var(--muted-foreground); }
.axai-composer-island button:not([aria-label="Send message"]):not(.axai-ic) {
    background-color: transparent; color: var(--muted-foreground); border-color: transparent;
}
.axai-composer-island button:not([aria-label="Send message"]):not(.axai-ic):hover { color: var(--foreground); }
.axai-composer-island [aria-label="Send message"] { background-color: #0069ff; color: #ffffff; }

/* ── The kit's 1px animated edge, in our blue (declared LAST so nothing flattens it) ── */
.axai-composer-island .lmi-border {
    background: conic-gradient(from var(--lmi-angle, 0deg),
        transparent 52%,
        color-mix(in srgb, #0069ff 35%, transparent) 72%,
        color-mix(in srgb, #0069ff 80%, var(--surface)) 88%,
        #0069ff 96%,
        transparent 100%);
    animation: lmi-spin 4s linear infinite;
    opacity: 0.95;
}
@keyframes lmi-spin { to { --lmi-angle: 360deg; } }

/* The kit defaults to max-w-3xl; the dashboard mic is anchored to the form,
   so the actual surface must fill that same form at every viewport width. */
.axai-composer-island .ai-composer { display: block; width: 100%; }
.axai-composer-island .ai-composer__lmi { max-width: none; }

/* ── Our mic, inside the toolbar, immediately beside Send ── */
.axai-composer-island [aria-label="Send message"] { margin-right: 0; }
/* The mic now renders INSIDE the island's own toolbar (class .axai-ic on the button),
   immediately LEFT of Send in normal flow — no absolute anchoring to the form. */
.axai-composer .axai-composer-island .axai-ic {
    position: static; z-index: auto;
    width: 36px; height: 36px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--muted-foreground); cursor: pointer;
}
.axai-composer .axai-composer-island .axai-ic:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
.axai-composer .axai-composer-island .axai-ic:disabled { opacity: .45; cursor: not-allowed; }
.axai-composer .axai-composer-island .axai-ic.is-recording { color: var(--primitive-destructive); }

/* ── AiAgent island (src/islands/components/wensity/ai-agent-ui.tsx) ──────────────
   The island host is a bare <span>, so it must be told to fill the Activity card's
   body. Everything else — the header, step rows, bodies, diff/terminal/search
   surfaces — is Tailwind utilities on the component itself, using the shared token
   vocabulary (bg-surface / bg-muted / text-muted-foreground / border / primitive-* inks) with
   our control blue #0069ff for primary accents. Theme-aware via [data-theme]: no dark: variants
   and no OS colour-scheme read. */
.axagent-island { display: block; width: 100%; }
.axagent-island .axagent-mount { display: block; width: 100%; }
.axagent-island .axagent-root { width: 100%; }
