/* NSL UX V2 — evolutionary layer. Keeps the existing red/gold wave and light
   neobrutalist character while normalising interaction, rhythm and access. */

:root {
    --nsl-red-700: #a81717;
    --nsl-red-600: #cc1f1f;
    --nsl-red-50: #fff2f2;
    --nsl-gold-500: #f2a900;
    --nsl-gold-100: #fff2c7;
    --nsl-ink-950: #15171c;
    --nsl-ink-800: #2f333a;
    --nsl-ink-600: #5d6470;
    --nsl-line: #d9dde3;
    --nsl-canvas: #f5f5f3;
    --nsl-surface: #ffffff;
    --nsl-focus: #1457d9;
    --nsl-success: #147a43;
    --nsl-warning: #9a5b00;
    --nsl-danger: #b42318;
    --nsl-info: #175cd3;
    --nsl-space-1: .25rem;
    --nsl-space-2: .5rem;
    --nsl-space-3: .75rem;
    --nsl-space-4: 1rem;
    --nsl-space-5: 1.25rem;
    --nsl-space-6: 1.5rem;
    --nsl-space-8: 2rem;
    --nsl-space-10: 2.5rem;
    --nsl-radius-xs: 6px;
    --nsl-radius-sm: 10px;
    --nsl-radius-md: 14px;
    --nsl-radius-lg: 22px;
    --nsl-shadow-brutal-sm: 3px 3px 0 var(--nsl-ink-950);
    --nsl-shadow-brutal: 5px 5px 0 var(--nsl-ink-950);
    --nsl-shadow-soft: 0 14px 38px rgba(21, 23, 28, .09);
}

html { scroll-behavior: smooth; }

.nsl-ux {
    background: var(--nsl-canvas);
    color: var(--nsl-ink-950);
    font-family: var(--font-sans, 'Inter', 'Segoe UI', sans-serif);
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.nsl-ux::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 10%, rgba(242, 169, 0, .07), transparent 24rem),
        radial-gradient(circle at 95% 70%, rgba(204, 31, 31, .055), transparent 30rem);
}

.nsl-skip-link {
    position: fixed;
    z-index: 2147483647;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    border: 2px solid var(--nsl-ink-950);
    border-radius: var(--nsl-radius-xs);
    background: var(--nsl-gold-500);
    color: var(--nsl-ink-950);
    font-weight: 900;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .16s ease;
}
.nsl-skip-link:focus { transform: translateY(0); }

.nsl-route-progress {
    position: fixed;
    z-index: 2147483000;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--nsl-gold-500), var(--nsl-red-600));
    transform-origin: left;
    transform: scaleX(.16);
    opacity: 0;
}
.nsl-js .nsl-ux:not(.nsl-ready) .nsl-route-progress { opacity: 1; animation: nsl-route-loading 1.2s ease-in-out infinite; }
@keyframes nsl-route-loading { 50% { transform: scaleX(.72); } }

.nsl-ux :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--nsl-focus) !important;
    outline-offset: 3px !important;
}
.nsl-ux :where(button, a, input, select, textarea) { -webkit-tap-highlight-color: transparent; }
.nsl-ux :where(button, input, select, textarea) { min-height: 44px; }
.nsl-ux :where(input, select, textarea)::placeholder { color: #7b818b; opacity: 1; }
.nsl-ux :where(h1, h2, h3) { text-wrap: balance; letter-spacing: -.025em; }
.nsl-ux :where(p, li) { text-wrap: pretty; }
.nsl-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Brand header */
.nsl-ux .wavy-header {
    min-height: 138px;
    height: 138px;
    isolation: isolate;
}
.nsl-ux .header-logo,
.nsl-ux .brand {
    top: 18px !important;
    left: clamp(18px, 3vw, 44px) !important;
}
.nsl-ux .header-logo img,
.nsl-ux .brand img { max-height: 58px; width: auto; filter: drop-shadow(0 3px 2px rgba(0,0,0,.16)); }
.nsl-ux .header-controls {
    top: 16px !important;
    right: clamp(16px, 3vw, 44px) !important;
    gap: 8px !important;
}
.nsl-ux .lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px !important;
    padding: 4px !important;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 999px !important;
    background: rgba(21,23,28,.32) !important;
    backdrop-filter: blur(8px);
}
.nsl-ux .lang-link,
.nsl-ux .lang-switch a {
    display: inline-flex !important;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    opacity: .72 !important;
    transform: none !important;
}
.nsl-ux .lang-link:is(.active,.lang-active),
.nsl-ux .lang-switch a:is(.active,.lang-active) { background: #fff !important; color: var(--nsl-red-700) !important; opacity: 1 !important; }
.nsl-ux .header-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 7px 14px !important;
    border: 2px solid rgba(255,255,255,.92) !important;
    border-radius: 999px !important;
    background: rgba(21,23,28,.16);
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    line-height: 1.1;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}
.nsl-ux .header-link:hover { background: #fff !important; color: var(--nsl-red-700) !important; }

/* Page rhythm */
.nsl-ux :where(.container, .main-container, .wrap, .page-wrap) {
    width: min(100% - 32px, 1320px);
    margin-inline: auto;
}
.nsl-ux :where(.container, .main-container, .wrap) { padding-inline: 0; }
.nsl-ux .welcome { margin-bottom: clamp(20px, 3vw, 34px); }
.nsl-ux .welcome small,
.nsl-ux .eyebrow {
    color: var(--nsl-red-700) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: .11em !important;
    text-transform: uppercase;
}
.nsl-ux .welcome h1 { font-size: clamp(1.75rem, 4vw, 2.65rem) !important; line-height: 1.08; }
.nsl-ux .section-title { color: var(--nsl-ink-950); font-size: clamp(1.25rem, 3vw, 1.8rem); }
.nsl-ux .section-title::after {
    content: '';
    display: block;
    width: 52px;
    height: 5px;
    margin-top: 9px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--nsl-red-600) 0 62%, var(--nsl-gold-500) 62%);
}
.nsl-page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 4px 0 24px;
    padding: 0 0 18px;
    border-bottom: 2px solid var(--nsl-ink-950);
}
.nsl-page-intro__copy { max-width: 760px; }
.nsl-page-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 9px;
    padding: 4px 10px;
    border: 1px solid var(--nsl-red-700);
    border-radius: 999px;
    background: var(--nsl-red-50);
    color: var(--nsl-red-700);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nsl-page-intro h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.5rem); line-height: 1.06; }
.nsl-page-intro p { max-width: 66ch; margin: 8px 0 0; color: var(--nsl-ink-600); font-weight: 600; }
.nsl-page-intro__metric {
    flex: 0 0 auto;
    min-width: 136px;
    padding: 12px 16px;
    border: 2px solid var(--nsl-ink-950);
    border-radius: var(--nsl-radius-sm);
    background: var(--nsl-gold-100);
    box-shadow: var(--nsl-shadow-brutal-sm);
    text-align: center;
}
.nsl-page-intro__metric strong { display: block; font-size: 1.55rem; line-height: 1; }
.nsl-page-intro__metric span { display: block; margin-top: 5px; color: var(--nsl-ink-800); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }

/* Cards preserve the existing outlined/brutalist language with calmer motion. */
.nsl-ux :where(.card, .section-card, .box, .table-card, .controls-card, .kpi-card, .form-card) {
    border: 2px solid var(--nsl-ink-950);
    border-radius: var(--nsl-radius-md);
    background: var(--nsl-surface);
    box-shadow: var(--nsl-shadow-brutal-sm);
}
.nsl-ux .card { overflow: visible; }
.nsl-ux :where(.card, .kpi-card) { transition: transform .16s ease, box-shadow .16s ease; }
.nsl-ux :where(.card, .kpi-card):hover { transform: translate(-1px, -1px); box-shadow: var(--nsl-shadow-brutal); }
.nsl-ux .section-card { padding: clamp(20px, 4vw, 40px); }
.nsl-ux .kpi-grid { gap: 16px; }
.nsl-ux .kpi-card { position: relative; min-height: 132px; padding: 20px; overflow: hidden; }
.nsl-ux .kpi-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--nsl-gold-500); }
.nsl-ux .kpi-card:nth-child(2n)::before { background: var(--nsl-red-600); }
.nsl-ux .kpi-value { color: var(--nsl-ink-950); font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1; }
.nsl-ux .kpi-label { color: var(--nsl-ink-600); font-size: 11px; letter-spacing: .08em; }

/* Controls */
.nsl-ux :where(.btn, .btn-brutal, .btn-nsl-brutal, .btn-submit-brutal, .btn-action, .ai-search-btn) {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 17px;
    border: 2px solid var(--nsl-ink-950);
    border-radius: var(--nsl-radius-sm);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .13s ease, box-shadow .13s ease, background-color .13s ease, color .13s ease;
}
.nsl-ux :where(.btn, .btn-brutal, .btn-nsl-brutal, .btn-submit-brutal, .btn-action, .ai-search-btn):not(:disabled):hover {
    transform: translate(-2px, -2px) !important;
    box-shadow: 4px 4px 0 var(--nsl-ink-950) !important;
}
.nsl-ux :where(.btn, .btn-brutal, .btn-nsl-brutal, .btn-submit-brutal, .btn-action, .ai-search-btn):not(:disabled):active {
    transform: translate(1px, 1px) !important;
    box-shadow: 1px 1px 0 var(--nsl-ink-950) !important;
}
.nsl-ux :where(button, .btn)[disabled], .nsl-ux [aria-disabled="true"] { cursor: not-allowed !important; filter: grayscale(.35); opacity: .55; }
.nsl-ux :where(.btn-primary, .btn-brutal, .btn-nsl-brutal.primary, .btn-nsl-brutal.active, .ai-search-btn),
.nsl-ux label:where(.btn, .btn-brutal, .btn-nsl-brutal, .btn-primary) {
    background: var(--nsl-ink-950);
    color: #ffffff !important;
}
.nsl-ux :where(.btn-red, .btn-submit-brutal) { background: var(--nsl-red-600); color: #fff; }
.nsl-ux :where(.btn-outline, .btn-link) { background: #fff; color: var(--nsl-ink-950); }

/* Forms */
.nsl-ux :where(.form-control, .edit-input, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
    width: 100%;
    border: 2px solid #9ca3ad;
    border-radius: var(--nsl-radius-sm);
    background: #fff;
    color: var(--nsl-ink-950);
    font: inherit;
    font-weight: 600;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.nsl-ux :where(.form-control, .edit-input, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) { min-height: 46px; padding: 10px 13px; }
.nsl-ux textarea { min-height: 112px; padding: 12px 13px; resize: vertical; }
.nsl-ux :where(.form-control, .edit-input, input, select, textarea):focus { border-color: var(--nsl-focus) !important; box-shadow: 0 0 0 4px rgba(20,87,217,.13); }
.nsl-ux :where(label:not(.btn):not(.btn-brutal):not(.btn-nsl-brutal), .form-label, .edit-group label) { color: var(--nsl-ink-800); font-size: 12px; font-weight: 850; letter-spacing: .025em; }
.nsl-ux input[type="file"] { max-width: 100%; padding: 7px; border: 2px dashed #9ca3ad; border-radius: var(--nsl-radius-sm); background: #fafafa; }
.nsl-ux input[type="checkbox"], .nsl-ux input[type="radio"] { width: 19px; height: 19px; accent-color: var(--nsl-red-600); }

/* Tabs, filters and search */
.nsl-ux :where(.tabs, .nsl-tabs) { gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.nsl-ux :where(.tabs button, .nsl-tab-btn, .activity-filter-btn) { min-height: 42px; white-space: nowrap; }
.nsl-ux :where(.controls-card, .filters-bar, .action-bar) { gap: 12px; }
.nsl-ux .controls-card { padding: 14px; }
.nsl-ux :where(.search-box, .search-bar-wrapper) { min-width: min(100%, 260px); }
.nsl-ux .search-bar-wrapper { transform: none !important; }

/* Tables */
.nsl-ux :where(.table-container, .table-responsive) { border-radius: var(--nsl-radius-md); scrollbar-width: thin; }
.nsl-ux :where(.nsl-table, .school-table, .activity-table) { background: #fff; }
.nsl-ux :where(.nsl-table, .school-table, .activity-table) th {
    background: var(--nsl-ink-950) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    letter-spacing: .065em;
    text-transform: uppercase;
}
.nsl-ux :where(.nsl-table, .school-table, .activity-table) td { border-color: var(--nsl-line) !important; }
.nsl-ux :where(.nsl-table, .school-table, .activity-table) tbody tr { transition: background-color .12s ease; }
.nsl-ux :where(.nsl-table, .school-table, .activity-table) tbody tr:hover { background: #fff8e4 !important; }

/* Candidate cards and data */
.nsl-ux .grid { gap: clamp(16px, 2vw, 24px); }
.nsl-ux .nsl-grid-card {
    border-radius: var(--nsl-radius-md);
    box-shadow: var(--nsl-shadow-brutal-sm);
}
.nsl-ux .nsl-grid-card:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--card-hover-color, var(--nsl-red-600)); }
.nsl-ux .avatar { background: #eceff2; }
.nsl-ux .info-row { gap: 16px; align-items: baseline; }
.nsl-ux .info-value { text-align: right; overflow-wrap: anywhere; }

/* Sharkie stays expressive, but no longer overpowers the actual workspace. */
.nsl-app .ai-hero-section {
    margin-bottom: 26px !important;
    padding: clamp(24px, 4vw, 34px) !important;
    border-width: 3px !important;
    border-radius: var(--nsl-radius-lg) !important;
    box-shadow: 6px 6px 0 var(--nsl-ink-950) !important;
}
.nsl-app .ai-hero-section h2 { margin-bottom: 8px !important; font-size: clamp(1.35rem, 3vw, 1.75rem) !important; }
.nsl-app .ai-hero-section p { margin-bottom: 18px !important; }
.nsl-app .ai-hero-section .search-bar-wrapper { width: min(100%, 700px); }
.nsl-role-school .table-responsive { overflow-x: auto; }
.nsl-role-school .school-table { min-width: 880px; }

/* Status uses shape plus text, never colour alone. */
.nsl-ux :where(.badge, .status-badge, .role-badge) {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}
.nsl-ux :where(.badge-success, .status-done) { background: #eaf8ef; color: var(--nsl-success); }
.nsl-ux :where(.badge-warning, .status-pending) { background: #fff5df; color: var(--nsl-warning); }
.nsl-ux :where(.badge-danger, .status-failed) { background: #fff0ee; color: var(--nsl-danger); }
.nsl-ux .badge-neutral { background: #f0f2f4; color: var(--nsl-ink-600); }

/* Dialogs and feedback */
.nsl-ux :where(.modal-content, #modalContent) { border: 2px solid var(--nsl-ink-950); border-radius: var(--nsl-radius-md); box-shadow: 8px 8px 0 var(--nsl-ink-950); }
.nsl-ux .close-btn { min-height: 40px; }
.nsl-ux .toast { border: 2px solid var(--nsl-ink-950); border-radius: var(--nsl-radius-sm); box-shadow: var(--nsl-shadow-brutal-sm); }
.nsl-ux :where(.notif, .noti-item) { border-radius: var(--nsl-radius-sm); }
.nsl-ux .noti-dropdown { width: min(340px, calc(100vw - 24px)); }

/* Auth and concise forms */
.nsl-auth :where(.auth-card, .login-card, .form-card),
.nsl-form-page .form-card { width: min(100%, 560px); }
.nsl-auth :where(.auth-card, .login-card) { box-shadow: 6px 6px 0 var(--nsl-ink-950); }
.nsl-auth .nsl-tabs { flex-wrap: nowrap !important; justify-content: flex-start; overflow-y: hidden; padding-bottom: 3px; scrollbar-width: none; }
.nsl-auth .nsl-tabs::-webkit-scrollbar { display: none; }
.nsl-auth .nsl-tab-btn { flex: 1 0 auto; }
.nsl-form-page :where(.form-card, .card) { padding: clamp(22px, 4vw, 34px); }

/* Small screens */
@media (max-width: 760px) {
    .nsl-ux .wavy-header { height: 174px; min-height: 174px; }
    .nsl-ux .header-logo,
    .nsl-ux .brand { top: 14px !important; left: 16px !important; }
    .nsl-ux .header-logo img,
    .nsl-ux .brand img { max-height: 44px !important; }
    .nsl-ux .header-controls {
        inset: 68px 12px auto 12px !important;
        display: flex !important;
        max-width: none;
        justify-content: flex-end !important;
        flex-flow: row wrap !important;
        transform: none !important;
    }
    .nsl-ux .header-link { min-height: 36px; padding: 7px 11px !important; }
    .nsl-ux :where(.container, .main-container, .wrap, .page-wrap) { width: min(100% - 24px, 1320px); }
    .nsl-ux :where(.section-card, .card, .box) { padding: 16px; }
    .nsl-ux .row2 { grid-template-columns: 1fr !important; }
    .nsl-ux :where(.controls-card, .filters-bar, .action-bar) { align-items: stretch !important; }
    .nsl-ux :where(.controls-card, .filters-bar, .action-bar) > * { width: 100%; }
    .nsl-ux .noti-dropdown { position: fixed; top: 164px; right: 12px; left: 12px; width: auto; }
    .nsl-ux .iv-row { grid-template-columns: 1fr !important; }
    .nsl-ux .info-row { align-items: flex-start; flex-direction: column; gap: 2px; }
    .nsl-ux .info-value { text-align: left; }
    .nsl-ux .nsl-table td { min-height: 52px; padding-left: 46% !important; overflow-wrap: anywhere; }
    .nsl-ux .nsl-table td::before { width: 40%; white-space: normal; }
    .nsl-page-intro { align-items: stretch; flex-direction: column; }
    .nsl-page-intro__metric { align-self: flex-start; min-width: 124px; }
    .nsl-app .ai-hero-section .search-bar-wrapper { align-items: stretch !important; flex-direction: column; border-radius: var(--nsl-radius-md) !important; }
    .nsl-app .ai-hero-section .search-bar-wrapper input { border-radius: var(--nsl-radius-sm) !important; text-align: left; }
}

@media (max-width: 430px) {
    .nsl-ux .wavy-header { height: 205px; min-height: 205px; }
    .nsl-ux .header-controls { top: 64px !important; justify-content: flex-start !important; }
    .nsl-ux .lang-switch { width: 100%; justify-content: center; }
    .nsl-ux .header-link { flex: 1 1 auto; }
    .nsl-ux :where(.btn, .btn-brutal, .btn-nsl-brutal, .btn-submit-brutal, .btn-action, .ai-search-btn) { width: 100%; }
    .nsl-auth .nsl-tabs { gap: 3px; }
    .nsl-auth .nsl-tab-btn { min-width: 0; padding-inline: 8px !important; font-size: 10px !important; letter-spacing: -.01em; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .nsl-ux *, .nsl-ux *::before, .nsl-ux *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
    .nsl-ux :where(.card, .section-card, .box, .btn, button, input, select, textarea) { border: 2px solid CanvasText !important; }
}
