/* =========================================================================
   Live Future Admin — design system (Live Future navy-blue -> green palette,
   shared with the marketing site)
   ========================================================================= */

:root {
    --bg: #ffffff;
    --bg-subtle: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f5f9fc;
    --border: #e4eaf0;
    --border-strong: #d1dbe4;
    --text: #0c1c2e;
    --text-muted: #4c5c72;
    --text-faint: #83919e;
    --primary: #0a6bab;
    --primary-strong: #084c7d;
    --accent: #1e8a3c;
    --gold: #f59e0b;
    --danger: #e11d48;
    --danger-bg: #fdeaef;
    --warning-bg: #fff7e6;
    --success-bg: #e9f9f2;
    --ring: rgba(10, 107, 171, 0.35);

    --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.06), 0 6px 18px rgba(9, 30, 66, 0.08);
    --shadow-lg: 0 30px 60px -28px rgba(8, 32, 58, 0.35);

    --gradient: linear-gradient(135deg, #073b66 0%, #0b72b5 40%, #1e9e4b 75%, #8bc53f 100%);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Sora', var(--font-sans);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg: #0b1020;
        --bg-subtle: #0e1430;
        --surface: #121a33;
        --surface-2: #17203f;
        --border: #263156;
        --border-strong: #33406e;
        --text: #eef3fb;
        --text-muted: #a3b0c9;
        --text-faint: #79879f;
        --primary: #4fa8e8;
        --primary-strong: #7cc4f5;
        --accent: #6dd35a;
        --ring: rgba(79, 168, 232, 0.45);
        --danger-bg: #2a1420;
        --warning-bg: #2a2311;
        --success-bg: #0f2a22;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 30px 60px -25px rgba(0, 0, 0, 0.7);
        color-scheme: dark;
    }
}

:root[data-theme='dark'] {
    --bg: #0b1020;
    --bg-subtle: #0e1430;
    --surface: #121a33;
    --surface-2: #17203f;
    --border: #263156;
    --border-strong: #33406e;
    --text: #eef3fb;
    --text-muted: #a3b0c9;
    --text-faint: #79879f;
    --primary: #4fa8e8;
    --primary-strong: #7cc4f5;
    --accent: #6dd35a;
    --ring: rgba(79, 168, 232, 0.45);
    --danger-bg: #2a1420;
    --warning-bg: #2a2311;
    --success-bg: #0f2a22;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 30px 60px -25px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 0.4em;
    color: var(--text);
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.6em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; }

/* ---------- layout helpers ---------- */
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--gradient); color: #fff; box-shadow: 0 12px 26px -12px rgba(79, 70, 229, 0.6); }
.btn--primary:hover { color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 0.45rem 0.75rem; font-size: 0.82rem; border-radius: 8px; }
.btn--lg { padding: 0.85rem 1.2rem; font-size: 0.96rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- cards / KPI ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}
.kpi__value { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em; }
.kpi__label { font-size: 0.82rem; color: var(--text-muted); }
.kpi__delta { font-size: 0.76rem; font-weight: 600; }
.kpi__delta--up { color: var(--accent); }
.kpi__delta--warn { color: var(--gold); }

/* ---------- badges / status ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.24rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}
.badge--success { background: var(--success-bg); color: color-mix(in srgb, var(--accent) 80%, black); }
.badge--warning { background: var(--warning-bg); color: color-mix(in srgb, var(--gold) 65%, black); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- alerts ---------- */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.86rem;
    margin-bottom: 16px;
}
.alert--danger { background: var(--danger-bg); color: var(--danger); }
.alert--success { background: var(--success-bg); color: color-mix(in srgb, var(--accent) 75%, black); }
.alert--info { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.alert svg { flex: none; margin-top: 1px; }

/* ---------- forms (auth pages) ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--text-muted); font-weight: 500; }
.back-link:hover { color: var(--primary); }
.auth-card h2 { margin-top: 2px; }

/* ---------- auth tabs (admin / investor) ---------- */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
.auth-tabs__radio { position: absolute; opacity: 0; pointer-events: none; }
.auth-tabs__tab {
    grid-row: 1;
    text-align: center;
    padding: 0.6rem 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
}
.auth-tabs__tab:first-of-type { grid-column: 1; }
.auth-tabs__tab:last-of-type { grid-column: 2; }
#authtab-admin:checked ~ .auth-tabs__tab[for="authtab-admin"],
#authtab-investor:checked ~ .auth-tabs__tab[for="authtab-investor"] {
    color: var(--primary);
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
}
.auth-tabpane { grid-column: 1 / -1; margin-top: 22px; }
.auth-tabpane[data-pane="admin"] { display: none; }
.auth-tabpane[data-pane="investor"] { display: none; }
#authtab-admin:checked ~ .auth-tabpane[data-pane="admin"] { display: block; }
#authtab-investor:checked ~ .auth-tabpane[data-pane="investor"] { display: block; }

.topbar__title { color: var(--text-muted); font-size: 0.92rem; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span:first-child { font-size: 0.84rem; font-weight: 600; }
.field input,
.field select {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.68rem 0.8rem;
}
.field input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.field .validation-message { color: var(--danger); font-size: 0.78rem; }

.field-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 0.86rem; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.otp-input {
    width: 100%;
    text-align: center;
    letter-spacing: 0.5em;
    font-family: var(--font-display);
    font-size: 1.3rem;
    padding: 0.7rem 0.5rem 0.7rem 0.9rem;
}

.demo-box {
    margin-top: 26px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
}
.demo-box > p:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.demo-box table { font-size: 0.78rem; }
.demo-box td { padding: 3px 0; }
.demo-box td:first-child { color: var(--text-faint); width: 40%; }
.demo-box td:last-child { font-family: 'Sora', monospace; color: var(--text); }
.demo-box__pass { margin: 10px 0 0; font-size: 0.78rem; color: var(--text-muted); }
.demo-box code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.82em;
}

/* ---------- empty state / coming soon / not found ---------- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    max-width: 480px;
    margin-inline: auto;
}
.empty-state__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    margin: 0 auto 18px;
}
.empty-state h1 { font-size: 1.3rem; }

/* ---------- misc ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head p { color: var(--text-muted); margin-top: 4px; }

/* ---------- data table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
.data-table th, .data-table td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-faint); background: var(--surface-2); position: sticky; top: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .pos { color: var(--accent); }
.data-table .neg { color: var(--danger); }
.data-table a { color: var(--primary); font-weight: 600; }

/* ---------- section header ---------- */
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin: 26px 0 12px; }
.muted-note { font-size: 0.82rem; color: var(--text-faint); margin-bottom: 12px; }

/* ---------- unilevel tree ---------- */
.uni-tree { list-style: none; padding: 0; margin: 0; }
.uni-tree ul { list-style: none; margin: 0; padding-left: 24px; border-left: 1px dashed var(--border-strong); }
.uni-node { padding: 4px 0; }
.uni-card { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.uni-card b { font-family: var(--font-display); }
.uni-card .uni-meta { font-size: 0.76rem; color: var(--text-faint); }
.uni-card .avatar { width: 26px; height: 26px; font-size: 0.7rem; }

/* ---------- toolbar / config ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.toolbar .field { margin-bottom: 0; }
.config-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--gradient); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.76rem; flex: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

/* ---------- mobile sidebar (cross-component: checkbox lives in MainLayout, .sidebar in
   NavMenu — CSS isolation scopes .razor.css per component, so this override must be global) ---------- */
.sidebar-toggle-cb:checked ~ .sidebar {
    transform: none !important;
}

/* =====================================================================
   App shell — shared by the admin console (MainLayout) and the investor
   portal (PortalLayout). Global (not per-component .razor.css) so both
   layouts pick up identical chrome. Class names are shell-specific.
   ===================================================================== */
.app-shell { display: flex; min-height: 100dvh; background: var(--bg-subtle); }
.sidebar-toggle-cb { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.app-shell__scrim { display: none; position: fixed; inset: 0; background: rgba(8, 10, 22, 0.5); z-index: 40; cursor: pointer; }
.sidebar-toggle-cb:checked ~ .app-shell__scrim { display: block; }
.app-shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-shell__content { flex: 1; padding: clamp(16px, 2.4vw, 30px); max-width: 1400px; width: 100%; margin-inline: auto; }

.sidebar {
    --sidebar-w: 264px;
    width: var(--sidebar-w);
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}
.sidebar__brand { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sidebar__logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; color: var(--text); text-decoration: none; font-size: 0.98rem; }
.sidebar__logo b { color: var(--accent); }
.sidebar__logo-mark { display: block; border-radius: 8px; object-fit: contain; }
.sidebar__scroll { flex: 1; overflow-y: auto; padding: 14px 12px 24px; }
.sidebar__group + .sidebar__group { margin-top: 18px; }
.sidebar__group-title { padding: 6px 10px; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.sidebar__link { display: flex; align-items: center; gap: 10px; padding: 0.6rem 0.65rem; border-radius: 10px; color: var(--text-muted); font-size: 0.89rem; font-weight: 500; text-decoration: none; }
.sidebar__link:hover { background: var(--surface-2); color: var(--text); }
.sidebar__link.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.sidebar__link span:first-of-type { flex: 1; }
.sidebar__badge { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; }

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px clamp(14px, 2vw, 24px);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 999px; background: var(--danger); border: 2px solid var(--surface); }
.topbar__search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 0.55rem 0.8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-faint); }
.topbar__search input { border: none; background: transparent; outline: none; width: 100%; font: inherit; color: var(--text); }
.topbar__search input::placeholder { color: var(--text-faint); }
.topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.popover-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 0.35rem 0.6rem 0.35rem 0.35rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--text); }
.avatar--lg { width: 38px; height: 38px; font-size: 0.9rem; }
.user-chip__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-chip__meta b { font-size: 0.83rem; font-family: var(--font-display); }
.user-chip__meta small { font-size: 0.72rem; color: var(--text-faint); }
.popover { position: absolute; top: calc(100% + 10px); right: -4px; width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 14px); box-shadow: var(--shadow-lg); padding: 10px; z-index: 60; }
.popover__title { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; padding: 4px 6px 8px; }
.popover__item { display: flex; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.popover__item:hover { background: var(--surface-2); }
.popover__item .ic-muted { color: var(--primary); margin-top: 2px; flex: none; }
.popover__item b { display: block; font-size: 0.82rem; }
.popover__item span { display: block; font-size: 0.76rem; color: var(--text-faint); margin-top: 2px; }
.popover__foot { margin-top: 6px; padding: 8px 6px 2px; font-size: 0.72rem; color: var(--text-faint); border-top: 1px dashed var(--border); }
.popover__user { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 6px; }
.popover__user b { display: block; font-size: 0.86rem; }
.popover__user small { display: block; color: var(--text-faint); font-size: 0.76rem; }
.popover__link { display: flex; align-items: center; gap: 9px; width: 100%; padding: 0.6rem; border-radius: 10px; border: none; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.popover__link:hover { background: var(--surface-2); }
.popover__link--danger { color: var(--danger); }
.hide-desktop { display: inline-grid; }
.hide-mobile { display: none; }

@media (min-width: 980px) {
    .sidebar { position: sticky; top: 0; height: 100dvh; transform: none; }
    .hide-desktop { display: none; }
    .hide-mobile { display: flex; }
}

/* ---------- DataTable (search / sort / filter / paginate) ---------- */
.dt__toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.dt__search { display: flex; align-items: center; gap: 8px; padding: 0.5rem 0.7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); flex: 1; min-width: 200px; max-width: 340px; color: var(--text-faint); }
.dt__search input { border: none; outline: none; background: transparent; font: inherit; color: var(--text); width: 100%; }
.dt__filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.dt__filter select { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.dt__th--sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.dt__th--sortable:hover { color: var(--primary); }
.dt__caret { font-size: 0.7em; margin-left: 4px; color: var(--primary); }
.dt__pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 0.82rem; color: var(--text-muted); }
.dt__pager-btns { display: flex; align-items: center; gap: 10px; }

/* ---------- Master Configuration: referral level rows ---------- */
.level-list { display: flex; flex-direction: column; gap: 10px; }
.level-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.level-row__tag { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; padding-bottom: 0.7rem; min-width: 64px; color: var(--primary); }
.level-row__field { margin-bottom: 0; flex: 1; min-width: 220px; max-width: 320px; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.68rem 2rem 0.68rem 0.8rem; }
.input-affix input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.input-affix__suffix { position: absolute; right: 0.8rem; color: var(--text-faint); font-weight: 600; pointer-events: none; }

/* ---------- M17 roles & permissions ---------- */
.role-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.role-list__item {
    display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); cursor: pointer; text-align: left; width: 100%;
}
.role-list__item:hover { border-color: var(--primary); }
.role-list__item.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.role-list__item b { font-family: var(--font-display); margin-right: 6px; }
.perm-matrix th.num, .perm-matrix td.num { text-align: center; }
.perm-matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.perm-matrix input[type=checkbox]:disabled { cursor: not-allowed; }
.perm-matrix__group td { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.perm-matrix td .uni-meta { margin-left: 6px; }
