/* ==========================================================================
   Marjos LMS — Design System
   --------------------------------------------------------------------------
   A single, token-driven stylesheet layered on top of UIkit 3.
   Visual language: British academic structure + Nigerian warmth.

   Sections
     1. Tokens
     2. Base & typography
     3. Application shell (sidebar / topbar / content)
     4. UIkit component overrides
     5. LMS components (cards, stats, tables, badges, empty states…)
     6. Utilities
     7. Print
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */

:root {
    /* -- Brand ------------------------------------------------------------ */
    --lms-ink:            #0e1f35;   /* deep navy — structure & navigation   */
    --lms-ink-700:        #16304f;
    --lms-ink-600:        #1e4066;
    --lms-ink-500:        #2b537f;

    --lms-green:          #0b6e4f;   /* rich school green — primary action   */
    --lms-green-600:      #0d7f5b;
    --lms-green-700:      #08573e;
    --lms-green-050:      #e7f2ed;

    --lms-terracotta:     #b95a39;   /* supporting accent                    */
    --lms-terracotta-050: #fbeee9;
    --lms-ochre:          #7d5610;
    --lms-gold:           #c9992f;   /* achievement / highlight, used rarely */
    --lms-gold-050:       #fbf3df;

    /* -- Surfaces --------------------------------------------------------- */
    --lms-page:           #faf7f1;   /* warm cream page background           */
    --lms-surface:        #ffffff;
    --lms-surface-alt:    #f4f0e7;
    --lms-surface-sunken: #efeade;

    /* -- Text ------------------------------------------------------------- */
    --lms-text:           #15202e;
    --lms-text-muted:     #56616f;
    --lms-text-faint:     #626c7a;
    --lms-text-invert:    #ffffff;

    /* -- Lines ------------------------------------------------------------ */
    --lms-border:         #e5dfd2;
    --lms-border-strong:  #cfc7b6;
    --lms-border-ink:     rgba(255, 255, 255, .14);

    /* -- Status ----------------------------------------------------------- */
    --lms-success:        #0b6e4f;
    --lms-success-050:    #e7f2ed;
    --lms-warning:        #7d5610;
    --lms-warning-050:    #fbf1dc;
    --lms-danger:         #a92c22;
    --lms-danger-050:     #fbeae8;
    --lms-info:           #1d4e89;
    --lms-info-050:       #e8eff8;
    --lms-neutral:        #56616f;
    --lms-neutral-050:    #eeeade;

    /* -- Typography ------------------------------------------------------- */
    --lms-font-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --lms-font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
    --lms-font-mono:    "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

    --lms-text-xs:   .75rem;    /* 12 */
    --lms-text-sm:   .8125rem;  /* 13 */
    --lms-text-base: .9375rem;  /* 15 */
    --lms-text-md:   1.0625rem; /* 17 */
    --lms-text-lg:   1.375rem;  /* 22 */
    --lms-text-xl:   1.75rem;   /* 28 */
    --lms-text-2xl:  2.25rem;   /* 36 */

    --lms-leading-tight: 1.2;
    --lms-leading:       1.6;

    /* -- Spacing (4px base) ----------------------------------------------- */
    --lms-space-1:  .25rem;
    --lms-space-2:  .5rem;
    --lms-space-3:  .75rem;
    --lms-space-4:  1rem;
    --lms-space-5:  1.25rem;
    --lms-space-6:  1.5rem;
    --lms-space-8:  2rem;
    --lms-space-10: 2.5rem;
    --lms-space-12: 3rem;

    /* -- Radius ----------------------------------------------------------- */
    --lms-radius-sm:   6px;
    --lms-radius:      10px;
    --lms-radius-lg:   14px;
    --lms-radius-pill: 999px;

    /* -- Elevation -------------------------------------------------------- */
    --lms-shadow-xs: 0 1px 2px rgba(14, 31, 53, .06);
    --lms-shadow-sm: 0 1px 3px rgba(14, 31, 53, .07), 0 1px 2px rgba(14, 31, 53, .04);
    --lms-shadow:    0 4px 12px rgba(14, 31, 53, .08), 0 1px 3px rgba(14, 31, 53, .05);
    --lms-shadow-lg: 0 12px 32px rgba(14, 31, 53, .12), 0 2px 8px rgba(14, 31, 53, .06);

    /* -- Focus ------------------------------------------------------------ */
    --lms-focus-ring:   0 0 0 3px rgba(11, 110, 79, .28);
    --lms-focus-colour: var(--lms-green);

    /* -- Layout ----------------------------------------------------------- */
    --lms-sidebar-w:   268px;
    --lms-topbar-h:    64px;
    --lms-container:   1360px;

    --lms-transition: 150ms cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   2. BASE & TYPOGRAPHY
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
    background-color: var(--lms-page);
    color: var(--lms-text);
    font-family: var(--lms-font-ui);
    font-size: var(--lms-text-base);
    line-height: var(--lms-leading);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.uk-h1, .uk-h2, .uk-h3, .uk-h4, .uk-h5, .uk-h6 {
    font-family: var(--lms-font-display);
    color: var(--lms-ink);
    font-weight: 600;
    line-height: var(--lms-leading-tight);
    letter-spacing: -.01em;
}

h1, .uk-h1 { font-size: var(--lms-text-2xl); }
h2, .uk-h2 { font-size: var(--lms-text-xl); }
h3, .uk-h3 { font-size: var(--lms-text-lg); }
h4, .uk-h4 { font-size: var(--lms-text-md); }
h5, .uk-h5 { font-size: var(--lms-text-base); }
h6, .uk-h6 { font-size: var(--lms-text-sm); }

a { color: var(--lms-green-700); text-decoration: none; }
a:hover { color: var(--lms-green); text-decoration: underline; }

code, kbd, samp, pre { font-family: var(--lms-font-mono); }

hr, .uk-hr { border-top-color: var(--lms-border); }

::selection { background: var(--lms-gold-050); color: var(--lms-ink); }

/* Visible focus for every interactive element. Pointer users don't see it;
   keyboard users always do. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--lms-focus-colour);
    outline-offset: 2px;
    border-radius: var(--lms-radius-sm);
}

/* Skip link — first tab stop on every page. */
.lms-skip-link {
    position: absolute;
    top: -60px;
    left: var(--lms-space-4);
    z-index: 1200;
    padding: var(--lms-space-2) var(--lms-space-4);
    background: var(--lms-ink);
    color: var(--lms-text-invert);
    border-radius: var(--lms-radius-sm);
    font-weight: 600;
    transition: top var(--lms-transition);
}
.lms-skip-link:focus { top: var(--lms-space-4); color: var(--lms-text-invert); text-decoration: none; }

/* ==========================================================================
   3. APPLICATION SHELL
   ========================================================================== */

.lms-shell { min-height: 100vh; }

/* -- Sidebar ------------------------------------------------------------- */

.lms-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--lms-sidebar-w);
    background: var(--lms-ink);
    color: rgba(255, 255, 255, .82);
}

.lms-sidebar--fixed {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 980;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.lms-sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--lms-space-3);
    padding: var(--lms-space-5) var(--lms-space-5);
    border-bottom: 1px solid var(--lms-border-ink);
    color: #fff;
    flex: 0 0 auto;
}
.lms-sidebar__brand:hover { text-decoration: none; color: #fff; }

.lms-sidebar__crest {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--lms-radius);
    background: linear-gradient(160deg, var(--lms-green-600), var(--lms-green-700));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
    font-family: var(--lms-font-display);
    font-weight: 700;
    font-size: var(--lms-text-md);
    color: #fff;
    letter-spacing: .02em;
}

.lms-sidebar__name {
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-md);
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
}
.lms-sidebar__org {
    display: block;
    font-size: var(--lms-text-xs);
    color: rgba(255, 255, 255, .6);
    line-height: 1.35;
    margin-top: 1px;
}

.lms-sidebar__scroll { flex: 1 1 auto; padding: var(--lms-space-4) var(--lms-space-3) var(--lms-space-6); }

.lms-nav { list-style: none; margin: 0; padding: 0; }

.lms-nav__heading {
    margin: var(--lms-space-5) 0 var(--lms-space-2);
    padding: 0 var(--lms-space-3);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
}
.lms-nav__heading:first-child { margin-top: 0; }

.lms-nav__link {
    display: flex;
    align-items: center;
    gap: var(--lms-space-3);
    padding: var(--lms-space-2) var(--lms-space-3);
    margin-bottom: 2px;
    min-height: 40px;
    border-radius: var(--lms-radius-sm);
    color: rgba(255, 255, 255, .78);
    font-size: var(--lms-text-base);
    font-weight: 500;
    transition: background var(--lms-transition), color var(--lms-transition);
}
.lms-nav__link:hover,
.lms-nav__link:focus {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    text-decoration: none;
}
.lms-nav__link[aria-current="page"] {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--lms-gold);
}
.lms-nav__link .uk-icon { flex: 0 0 auto; opacity: .85; }
.lms-nav__link[aria-current="page"] .uk-icon { opacity: 1; color: var(--lms-gold); }

.lms-nav__label { flex: 1 1 auto; min-width: 0; }

.lms-nav__count {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: var(--lms-radius-pill);
    background: rgba(255, 255, 255, .14);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.lms-sidebar__footer {
    flex: 0 0 auto;
    padding: var(--lms-space-4) var(--lms-space-5);
    border-top: 1px solid var(--lms-border-ink);
    font-size: var(--lms-text-xs);
    color: rgba(255, 255, 255, .5);
}

/* -- Main column --------------------------------------------------------- */

.lms-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    margin-left: var(--lms-sidebar-w);
}

/* -- Topbar -------------------------------------------------------------- */

.lms-topbar {
    position: sticky;
    top: 0;
    z-index: 960;
    display: flex;
    align-items: center;
    gap: var(--lms-space-4);
    min-height: var(--lms-topbar-h);
    padding: var(--lms-space-3) var(--lms-space-6);
    background: rgba(250, 247, 241, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--lms-border);
}

.lms-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid var(--lms-border-strong);
    border-radius: var(--lms-radius-sm);
    background: var(--lms-surface);
    color: var(--lms-ink);
    cursor: pointer;
}
.lms-topbar__toggle:hover { background: var(--lms-surface-alt); }

.lms-topbar__titles { flex: 1 1 auto; min-width: 0; }

.lms-topbar__title {
    margin: 0;
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-md);
    font-weight: 600;
    color: var(--lms-ink);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lms-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--lms-space-2);
    flex: 0 0 auto;
}

/* -- Breadcrumbs --------------------------------------------------------- */

.lms-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lms-space-1);
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    font-size: var(--lms-text-xs);
    color: var(--lms-text-faint);
}
.lms-breadcrumb li { display: flex; align-items: center; gap: var(--lms-space-1); }
.lms-breadcrumb li + li::before { content: "/"; color: var(--lms-border-strong); }
.lms-breadcrumb a { color: var(--lms-text-muted); }
.lms-breadcrumb a:hover { color: var(--lms-green-700); }
.lms-breadcrumb [aria-current="page"] { color: var(--lms-text); font-weight: 500; }

/* -- User menu ----------------------------------------------------------- */

.lms-usermenu {
    display: flex;
    align-items: center;
    gap: var(--lms-space-2);
    padding: var(--lms-space-1) var(--lms-space-2) var(--lms-space-1) var(--lms-space-1);
    border: 1px solid var(--lms-border-strong);
    border-radius: var(--lms-radius-pill);
    background: var(--lms-surface);
    color: var(--lms-text);
    cursor: pointer;
    min-height: 40px;
}
.lms-usermenu:hover { background: var(--lms-surface-alt); }

.lms-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    background: var(--lms-ink-600);
    color: #fff;
    font-size: var(--lms-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.lms-avatar--lg { width: 48px; height: 48px; flex-basis: 48px; font-size: var(--lms-text-md); }
.lms-avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }
.lms-avatar--green { background: var(--lms-green); }
.lms-avatar--terracotta { background: var(--lms-terracotta); }

.lms-usermenu__meta { display: none; text-align: left; line-height: 1.2; }
.lms-usermenu__name { font-size: var(--lms-text-sm); font-weight: 600; color: var(--lms-ink); }
.lms-usermenu__role { font-size: 11px; color: var(--lms-text-faint); }

.lms-dropdown-user {
    padding: var(--lms-space-2);
    min-width: 232px;
}
.lms-dropdown-user__head {
    padding: var(--lms-space-3);
    border-bottom: 1px solid var(--lms-border);
    margin-bottom: var(--lms-space-2);
}
.lms-dropdown-user__email {
    display: block;
    font-size: var(--lms-text-sm);
    font-weight: 600;
    color: var(--lms-ink);
    word-break: break-all;
}
.lms-dropdown-user__item {
    display: flex;
    align-items: center;
    gap: var(--lms-space-2);
    padding: var(--lms-space-2) var(--lms-space-3);
    border-radius: var(--lms-radius-sm);
    color: var(--lms-text);
    font-size: var(--lms-text-base);
}
.lms-dropdown-user__item:hover { background: var(--lms-surface-alt); color: var(--lms-text); text-decoration: none; }
.lms-dropdown-user__item--danger { color: var(--lms-danger); }
.lms-dropdown-user__item--danger:hover { background: var(--lms-danger-050); color: var(--lms-danger); }

/* -- Content ------------------------------------------------------------- */

.lms-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--lms-container);
    margin: 0 auto;
    padding: var(--lms-space-6);
}

.lms-footer {
    padding: var(--lms-space-5) var(--lms-space-6);
    border-top: 1px solid var(--lms-border);
    font-size: var(--lms-text-xs);
    color: var(--lms-text-faint);
    text-align: center;
}

/* -- Responsive ---------------------------------------------------------- */

@media (max-width: 1199px) {
    .lms-main { margin-left: 0; }
    .lms-sidebar--fixed { display: none; }
    .lms-topbar__toggle { display: flex; }
}

@media (min-width: 640px) {
    .lms-usermenu__meta { display: block; }
}

@media (max-width: 639px) {
    .lms-topbar { padding: var(--lms-space-2) var(--lms-space-4); gap: var(--lms-space-2); }
    .lms-content { padding: var(--lms-space-4); }
    .lms-breadcrumb { display: none; }
}

/* ==========================================================================
   4. UIKIT COMPONENT OVERRIDES
   Existing views are UIkit markup; restyling here means no markup churn.
   ========================================================================== */

/* -- Buttons ------------------------------------------------------------- */

.uk-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--lms-space-2);
    min-height: 40px;
    padding: 0 var(--lms-space-4);
    border: 1px solid transparent;
    border-radius: var(--lms-radius-sm);
    font-family: var(--lms-font-ui);
    font-size: var(--lms-text-base);
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    transition: background var(--lms-transition), border-color var(--lms-transition),
                color var(--lms-transition), box-shadow var(--lms-transition);
}
.uk-button:hover, .uk-button:focus { text-decoration: none; }
.uk-button:disabled, .uk-button.uk-disabled { opacity: .5; cursor: not-allowed; }

.uk-button-small { min-height: 32px; padding: 0 var(--lms-space-3); font-size: var(--lms-text-sm); }
.uk-button-large { min-height: 48px; padding: 0 var(--lms-space-6); font-size: var(--lms-text-md); }

.uk-button-default {
    background: var(--lms-surface);
    color: var(--lms-ink);
    border-color: var(--lms-border-strong);
    box-shadow: var(--lms-shadow-xs);
}
.uk-button-default:hover,
.uk-button-default:focus { background: var(--lms-surface-alt); color: var(--lms-ink); border-color: var(--lms-border-strong); }

.uk-button-primary {
    background: var(--lms-green);
    color: #fff;
    border-color: var(--lms-green);
    box-shadow: var(--lms-shadow-xs);
}
.uk-button-primary:hover,
.uk-button-primary:focus { background: var(--lms-green-700); color: #fff; border-color: var(--lms-green-700); }

.uk-button-secondary {
    background: var(--lms-ink);
    color: #fff;
    border-color: var(--lms-ink);
}
.uk-button-secondary:hover,
.uk-button-secondary:focus { background: var(--lms-ink-700); color: #fff; border-color: var(--lms-ink-700); }

.uk-button-danger {
    background: var(--lms-danger);
    color: #fff;
    border-color: var(--lms-danger);
}
.uk-button-danger:hover,
.uk-button-danger:focus { background: #8e2019; color: #fff; border-color: #8e2019; }

.uk-button-text {
    min-height: 0;
    padding: 0;
    background: none;
    border: 0;
    color: var(--lms-green-700);
    font-weight: 600;
}
.uk-button-text::before { display: none; }
.uk-button-text:hover { color: var(--lms-green); text-decoration: underline; }

.uk-button-link { color: var(--lms-green-700); }

/* Ghost button — quiet action inside cards/toolbars. */
.lms-button-ghost {
    background: transparent;
    color: var(--lms-text-muted);
    border-color: transparent;
    box-shadow: none;
}
.lms-button-ghost:hover { background: var(--lms-surface-alt); color: var(--lms-ink); }

.uk-icon-button {
    width: 38px;
    height: 38px;
    background: var(--lms-surface);
    border: 1px solid var(--lms-border-strong);
    color: var(--lms-text-muted);
    border-radius: var(--lms-radius-sm);
}
.uk-icon-button:hover { background: var(--lms-surface-alt); color: var(--lms-ink); }

/* -- Forms --------------------------------------------------------------- */

.uk-form-label {
    display: block;
    margin-bottom: var(--lms-space-1);
    font-size: var(--lms-text-sm);
    font-weight: 600;
    color: var(--lms-ink);
}

.uk-input, .uk-select, .uk-textarea {
    width: 100%;
    padding: var(--lms-space-2) var(--lms-space-3);
    background: var(--lms-surface);
    border: 1px solid var(--lms-border-strong);
    border-radius: var(--lms-radius-sm);
    color: var(--lms-text);
    font-family: var(--lms-font-ui);
    font-size: var(--lms-text-base);
    transition: border-color var(--lms-transition), box-shadow var(--lms-transition);
}
.uk-input, .uk-select:not([multiple]):not([size]) { height: 40px; }
.uk-textarea { padding-top: var(--lms-space-2); line-height: var(--lms-leading); }

.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
    outline: none;
    border-color: var(--lms-green);
    box-shadow: var(--lms-focus-ring);
    background: var(--lms-surface);
}
.uk-input:disabled, .uk-select:disabled, .uk-textarea:disabled,
.uk-input[readonly], .uk-textarea[readonly] {
    background: var(--lms-surface-sunken);
    color: var(--lms-text-muted);
    border-color: var(--lms-border);
}
.uk-input::placeholder, .uk-textarea::placeholder { color: var(--lms-text-faint); }

.uk-input.uk-form-small, .uk-select.uk-form-small, .uk-textarea.uk-form-small {
    font-size: var(--lms-text-sm);
    padding: var(--lms-space-1) var(--lms-space-2);
}
.uk-input.uk-form-small, .uk-select.uk-form-small:not([multiple]):not([size]) { height: 34px; }

.uk-select:not([multiple]):not([size]) {
    padding-right: var(--lms-space-8);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2714%27%20height%3D%278%27%20viewBox%3D%270%200%2014%208%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M1%201l6%206%206-6%27%20stroke%3D%27%2356616f%27%20stroke-width%3D%271.6%27%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right var(--lms-space-3) center;
}

.uk-checkbox, .uk-radio {
    width: 18px;
    height: 18px;
    border: 1px solid var(--lms-border-strong);
    background-color: var(--lms-surface);
}
.uk-checkbox { border-radius: 4px; }
.uk-checkbox:checked, .uk-radio:checked,
.uk-checkbox:indeterminate { background-color: var(--lms-green); border-color: var(--lms-green); }
.uk-checkbox:focus, .uk-radio:focus { border-color: var(--lms-green); box-shadow: var(--lms-focus-ring); }

.uk-form-icon { color: var(--lms-text-faint); width: 38px; }
.uk-form-icon:not(.uk-form-icon-flip) ~ .uk-input { padding-left: 38px; }

/* Invalid state, driven by the .lms-field--error wrapper or aria-invalid. */
.uk-input[aria-invalid="true"], .uk-select[aria-invalid="true"], .uk-textarea[aria-invalid="true"] {
    border-color: var(--lms-danger);
    background: var(--lms-danger-050);
}
.uk-input[aria-invalid="true"]:focus,
.uk-select[aria-invalid="true"]:focus,
.uk-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(169, 44, 34, .2); }

/* iOS Safari zooms the page whenever a focused control's text is below 16px.
   Below the phone breakpoint every control is held at 16px; the tighter
   desktop type scale is untouched. */
@media (max-width: 767px) {
    .uk-input, .uk-select, .uk-textarea,
    .uk-input.uk-form-small, .uk-select.uk-form-small, .uk-textarea.uk-form-small {
        font-size: 16px;
    }
}

/* Text field carrying an overlaid inline button (PIN + Generate); keeps the
   typed value clear of the control. */
.lms-input-action { padding-right: 104px; }

/* -- Cards --------------------------------------------------------------- */

.uk-card {
    border-radius: var(--lms-radius-lg);
}
.uk-card-default {
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    box-shadow: var(--lms-shadow-sm);
    color: var(--lms-text);
}
.uk-card-secondary { background: var(--lms-ink); color: rgba(255, 255, 255, .86); }
.uk-card-primary { background: var(--lms-green); color: rgba(255, 255, 255, .92); }
.uk-card-secondary .uk-card-title, .uk-card-primary .uk-card-title { color: #fff; }

.uk-card-body { padding: var(--lms-space-6); }
.uk-card-small > .uk-card-body { padding: var(--lms-space-4); }
.uk-card-header { padding: var(--lms-space-4) var(--lms-space-6); border-bottom: 1px solid var(--lms-border); }
.uk-card-small > .uk-card-header { padding: var(--lms-space-3) var(--lms-space-4); }
.uk-card-footer { padding: var(--lms-space-4) var(--lms-space-6); border-top: 1px solid var(--lms-border); }
.uk-card-title { font-size: var(--lms-text-md); margin-bottom: 0; }

/* -- Tables -------------------------------------------------------------- */

.uk-table { font-size: var(--lms-text-base); margin-bottom: 0; }
.uk-table th {
    padding: var(--lms-space-3) var(--lms-space-4);
    font-family: var(--lms-font-ui);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lms-text-muted);
    border-bottom: 1px solid var(--lms-border-strong);
    white-space: nowrap;
}
.uk-table td { padding: var(--lms-space-3) var(--lms-space-4); vertical-align: middle; }
.uk-table-small th, .uk-table-small td { padding: var(--lms-space-2) var(--lms-space-3); }
.uk-table-divider > :not(:first-child) > tr,
.uk-table-divider > :first-child > tr:not(:first-child),
.uk-table-divider > tbody > tr + tr { border-top: 1px solid var(--lms-border); }
.uk-table-striped > tr:nth-of-type(odd), .uk-table-striped tbody tr:nth-of-type(odd) {
    background: var(--lms-surface-alt);
    border-top: 0; border-bottom: 0;
}
.uk-table-hover > tr:hover, .uk-table-hover tbody tr:hover { background: var(--lms-green-050); }
.uk-table tfoot td, .uk-table tfoot th {
    border-top: 2px solid var(--lms-border-strong);
    font-weight: 600;
    color: var(--lms-ink);
}

/* -- Labels / badges ----------------------------------------------------- */

.uk-label {
    display: inline-flex;
    align-items: center;
    gap: var(--lms-space-1);
    padding: 2px var(--lms-space-2);
    border-radius: var(--lms-radius-pill);
    background: var(--lms-neutral-050);
    color: var(--lms-text-muted);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    letter-spacing: .01em;
    text-transform: none;
    line-height: 1.5;
}
.uk-label-success { background: var(--lms-success-050); color: var(--lms-success); }
.uk-label-warning { background: var(--lms-warning-050); color: var(--lms-warning); }
.uk-label-danger  { background: var(--lms-danger-050);  color: var(--lms-danger); }

.uk-badge {
    background: var(--lms-green);
    color: #fff;
    font-size: var(--lms-text-xs);
    font-weight: 600;
}

/* -- Alerts -------------------------------------------------------------- */

.uk-alert {
    padding: var(--lms-space-4) var(--lms-space-5);
    padding-right: var(--lms-space-10);
    border-radius: var(--lms-radius);
    border: 1px solid transparent;
    background: var(--lms-info-050);
    color: var(--lms-text);
    margin-bottom: var(--lms-space-4);
}
.uk-alert > :last-child { margin-bottom: 0; }
.uk-alert-primary { background: var(--lms-info-050); border-color: rgba(29, 78, 137, .2); color: var(--lms-info); }
.uk-alert-success { background: var(--lms-success-050); border-color: rgba(11, 110, 79, .2); color: var(--lms-success); }
.uk-alert-warning { background: var(--lms-warning-050); border-color: rgba(169, 118, 26, .24); color: var(--lms-warning); }
.uk-alert-danger  { background: var(--lms-danger-050);  border-color: rgba(169, 44, 34, .2);  color: var(--lms-danger); }

/* -- Subnav (term pills) ------------------------------------------------- */

.uk-subnav-pill {
    gap: var(--lms-space-2);
    margin-left: 0;
}
.uk-subnav-pill > * { padding-left: 0; }
.uk-subnav > * > :first-child {
    padding: var(--lms-space-2) var(--lms-space-4);
    border-radius: var(--lms-radius-pill);
    background: var(--lms-surface);
    border: 1px solid var(--lms-border-strong);
    color: var(--lms-text-muted);
    font-size: var(--lms-text-sm);
    font-weight: 600;
    text-transform: none;
    transition: background var(--lms-transition), color var(--lms-transition), border-color var(--lms-transition);
}
.uk-subnav > * > :first-child:hover { background: var(--lms-surface-alt); color: var(--lms-ink); }
.uk-subnav-pill > .uk-active > a,
.uk-subnav > .uk-active > a {
    background: var(--lms-ink);
    border-color: var(--lms-ink);
    color: #fff;
}
.uk-subnav > .uk-disabled > a { opacity: .45; pointer-events: none; }

/* -- Dropdown / modal / offcanvas ---------------------------------------- */

.uk-dropdown, .uk-navbar-dropdown {
    padding: var(--lms-space-4);
    border-radius: var(--lms-radius);
    border: 1px solid var(--lms-border);
    box-shadow: var(--lms-shadow-lg);
    background: var(--lms-surface);
    color: var(--lms-text);
}
.uk-dropdown-nav > li > a { color: var(--lms-text); border-radius: var(--lms-radius-sm); padding: var(--lms-space-1) var(--lms-space-2); }
.uk-dropdown-nav > li > a:hover { color: var(--lms-ink); background: var(--lms-surface-alt); }

.uk-modal-dialog { border-radius: var(--lms-radius-lg); box-shadow: var(--lms-shadow-lg); }
.uk-modal-body { padding: var(--lms-space-6); }
.uk-modal-title { font-family: var(--lms-font-display); font-size: var(--lms-text-lg); color: var(--lms-ink); }

.uk-offcanvas-bar {
    width: var(--lms-sidebar-w);
    padding: 0;
    background: var(--lms-ink);
    left: -var(--lms-sidebar-w);
    overflow-y: auto;
}
.uk-offcanvas-bar .lms-sidebar { width: 100%; min-height: 100%; }

/* -- Accordion ----------------------------------------------------------- */

.uk-accordion-title {
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-md);
    color: var(--lms-ink);
}
.uk-accordion-title:hover { color: var(--lms-green-700); }

/* -- Pagination ---------------------------------------------------------- */

.uk-pagination { gap: var(--lms-space-1); margin-left: 0; }
.uk-pagination > * { padding-left: 0; }
.uk-pagination > * > * {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--lms-space-2);
    border: 1px solid var(--lms-border-strong);
    border-radius: var(--lms-radius-sm);
    background: var(--lms-surface);
    color: var(--lms-text-muted);
    font-size: var(--lms-text-sm);
    font-weight: 600;
}
.uk-pagination > * > a:hover { background: var(--lms-surface-alt); color: var(--lms-ink); text-decoration: none; }
.uk-pagination > .uk-active > * { background: var(--lms-ink); border-color: var(--lms-ink); color: #fff; }
.uk-pagination > .uk-disabled > * { opacity: .45; background: var(--lms-surface-sunken); }

/* -- Progress ------------------------------------------------------------ */

.uk-progress { height: 8px; border-radius: var(--lms-radius-pill); background: var(--lms-surface-sunken); }
.uk-progress::-webkit-progress-bar { background: var(--lms-surface-sunken); border-radius: var(--lms-radius-pill); }
.uk-progress::-webkit-progress-value { background: var(--lms-green); border-radius: var(--lms-radius-pill); }
.uk-progress::-moz-progress-bar { background: var(--lms-green); border-radius: var(--lms-radius-pill); }

/* -- Notification toasts ------------------------------------------------- */

.uk-notification-message {
    border-radius: var(--lms-radius);
    box-shadow: var(--lms-shadow-lg);
    background: var(--lms-surface);
    border-left: 4px solid var(--lms-info);
    color: var(--lms-text);
    font-size: var(--lms-text-base);
    padding: var(--lms-space-4);
}
.uk-notification-message-primary { border-left-color: var(--lms-info); color: var(--lms-text); }
.uk-notification-message-success { border-left-color: var(--lms-success); color: var(--lms-text); }
.uk-notification-message-warning { border-left-color: var(--lms-warning); color: var(--lms-text); }
.uk-notification-message-danger  { border-left-color: var(--lms-danger);  color: var(--lms-text); }

/* -- Text helpers UIkit provides, retoned ------------------------------- */

.uk-text-meta, .uk-text-muted { color: var(--lms-text-muted) !important; font-size: var(--lms-text-sm); }
.uk-text-primary { color: var(--lms-green-700) !important; }
.uk-text-success { color: var(--lms-success) !important; }
.uk-text-danger  { color: var(--lms-danger) !important; }
.uk-text-warning { color: var(--lms-warning) !important; }
.uk-heading-bullet { font-family: var(--lms-font-display); }
.uk-heading-bullet::before { border-left-color: var(--lms-gold); }
.uk-heading-line > ::before, .uk-heading-line > ::after { border-bottom-color: var(--lms-border-strong); }

/* ==========================================================================
   5. LMS COMPONENTS
   ========================================================================== */

/* -- Page header --------------------------------------------------------- */

.lms-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--lms-space-4);
    margin-bottom: var(--lms-space-6);
}
.lms-page-header__text { min-width: 0; flex: 1 1 320px; }
.lms-page-header__title {
    margin: 0;
    font-size: var(--lms-text-xl);
    font-family: var(--lms-font-display);
    color: var(--lms-ink);
}
.lms-page-header__lede {
    margin: var(--lms-space-1) 0 0;
    color: var(--lms-text-muted);
    font-size: var(--lms-text-base);
    max-width: 68ch;
}
.lms-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lms-space-2);
    flex: 0 0 auto;
}

/* -- Section ------------------------------------------------------------- */

.lms-section { margin-bottom: var(--lms-space-8); }
.lms-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--lms-space-3);
    margin-bottom: var(--lms-space-4);
}
.lms-section__title {
    margin: 0;
    font-size: var(--lms-text-md);
    font-family: var(--lms-font-display);
    color: var(--lms-ink);
}
.lms-section__hint { margin: 2px 0 0; font-size: var(--lms-text-sm); color: var(--lms-text-muted); }

/* -- Surface (generic panel) --------------------------------------------- */

.lms-panel {
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    border-radius: var(--lms-radius-lg);
    box-shadow: var(--lms-shadow-sm);
}
.lms-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--lms-space-3);
    padding: var(--lms-space-4) var(--lms-space-5);
    border-bottom: 1px solid var(--lms-border);
}
.lms-panel__title { margin: 0; font-size: var(--lms-text-md); font-family: var(--lms-font-display); color: var(--lms-ink); }
.lms-panel__body { padding: var(--lms-space-5); }
.lms-panel__body--flush { padding: 0; }
.lms-panel__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--lms-space-3);
    padding: var(--lms-space-4) var(--lms-space-5);
    border-top: 1px solid var(--lms-border);
    background: var(--lms-surface-alt);
    border-radius: 0 0 var(--lms-radius-lg) var(--lms-radius-lg);
}

/* -- Stat cards ---------------------------------------------------------- */

.lms-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--lms-space-4);
}

.lms-stat {
    position: relative;
    display: block;
    padding: var(--lms-space-5);
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    border-radius: var(--lms-radius-lg);
    box-shadow: var(--lms-shadow-sm);
    color: var(--lms-text);
    overflow: hidden;
    transition: transform var(--lms-transition), box-shadow var(--lms-transition), border-color var(--lms-transition);
}
.lms-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--lms-border-strong);
}
a.lms-stat:hover {
    text-decoration: none;
    color: var(--lms-text);
    transform: translateY(-2px);
    box-shadow: var(--lms-shadow);
    border-color: var(--lms-border-strong);
}
.lms-stat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: var(--lms-space-3);
    border-radius: var(--lms-radius-sm);
    background: var(--lms-surface-alt);
    color: var(--lms-text-muted);
}
.lms-stat__label {
    margin: 0;
    font-size: var(--lms-text-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lms-text-muted);
}
.lms-stat__value {
    margin: var(--lms-space-1) 0 0;
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-2xl);
    font-weight: 600;
    line-height: 1.1;
    color: var(--lms-ink);
    font-variant-numeric: tabular-nums;
}
.lms-stat__hint { margin: var(--lms-space-2) 0 0; font-size: var(--lms-text-xs); color: var(--lms-text-faint); }

.lms-stat--green::before  { background: var(--lms-green); }
.lms-stat--green .lms-stat__icon { background: var(--lms-green-050); color: var(--lms-green); }
.lms-stat--ink::before    { background: var(--lms-ink-600); }
.lms-stat--ink .lms-stat__icon { background: var(--lms-info-050); color: var(--lms-info); }
.lms-stat--gold::before   { background: var(--lms-gold); }
.lms-stat--gold .lms-stat__icon { background: var(--lms-gold-050); color: var(--lms-ochre); }
.lms-stat--terracotta::before { background: var(--lms-terracotta); }
.lms-stat--terracotta .lms-stat__icon { background: var(--lms-terracotta-050); color: var(--lms-terracotta); }

.lms-stat--locked { opacity: .62; cursor: not-allowed; }

/* -- Quick actions ------------------------------------------------------- */

.lms-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--lms-space-3);
}
.lms-action {
    display: flex;
    align-items: flex-start;
    gap: var(--lms-space-3);
    padding: var(--lms-space-4);
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    border-radius: var(--lms-radius);
    color: var(--lms-text);
    transition: border-color var(--lms-transition), box-shadow var(--lms-transition), background var(--lms-transition);
}
.lms-action:hover {
    text-decoration: none;
    color: var(--lms-text);
    border-color: var(--lms-green);
    background: var(--lms-green-050);
    box-shadow: var(--lms-shadow-sm);
}
.lms-action__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: var(--lms-radius-sm);
    background: var(--lms-ink);
    color: #fff;
}
.lms-action__title { display: block; font-weight: 600; color: var(--lms-ink); font-size: var(--lms-text-base); }
.lms-action__hint { display: block; margin-top: 2px; font-size: var(--lms-text-xs); color: var(--lms-text-muted); line-height: 1.45; }

/* -- Toolbar (search + filters above a table) ---------------------------- */

.lms-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lms-space-3);
    padding: var(--lms-space-4) var(--lms-space-5);
    border-bottom: 1px solid var(--lms-border);
}
.lms-toolbar__search { flex: 1 1 260px; min-width: 0; }
.lms-toolbar__filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lms-space-2); }

/* -- Data table wrapper -------------------------------------------------- */

/* Tables scroll horizontally rather than squashing — but a minimum width is
   opt-in per table. A blanket minimum pushes columns out of view when a narrow
   table sits in a half-width column, which reads as missing data.

   The layered backgrounds are pure-CSS scroll shadows: a soft shadow shows on
   an edge only while there is more table in that direction, so a phone user can
   see the row continues rather than reading it as clipped data. */
.lms-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    background:
        linear-gradient(to right, var(--lms-surface) 30%, rgba(255, 255, 255, 0)) left center,
        linear-gradient(to left, var(--lms-surface) 30%, rgba(255, 255, 255, 0)) right center,
        radial-gradient(farthest-side at 0 50%, rgba(14, 31, 53, .16), rgba(14, 31, 53, 0)) left center,
        radial-gradient(farthest-side at 100% 50%, rgba(14, 31, 53, .16), rgba(14, 31, 53, 0)) right center;
    background-repeat: no-repeat;
    background-size: 44px 100%, 44px 100%, 15px 100%, 15px 100%;
    background-attachment: local, local, scroll, scroll;
}
.lms-table-wrap--md > .uk-table   { min-width: 640px; }
.lms-table-wrap--wide > .uk-table { min-width: 860px; }

.lms-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--lms-space-1);
    white-space: nowrap;
}
.lms-table-actions form { display: inline-flex; margin: 0; }

/* Identity cell: avatar + name + secondary line. */
.lms-identity { display: flex; align-items: center; gap: var(--lms-space-3); min-width: 0; }
.lms-identity__body { min-width: 0; }
.lms-identity__name { display: block; font-weight: 600; color: var(--lms-ink); line-height: 1.3; }
.lms-identity__meta { display: block; font-size: var(--lms-text-xs); color: var(--lms-text-muted); line-height: 1.4; }

/* -- Status dot ---------------------------------------------------------- */

.lms-status { display: inline-flex; align-items: center; gap: var(--lms-space-2); font-size: var(--lms-text-sm); font-weight: 600; }
.lms-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lms-status--active  { color: var(--lms-success); }
.lms-status--expired { color: var(--lms-danger); }
.lms-status--idle    { color: var(--lms-text-muted); }
.lms-status--warning { color: var(--lms-warning); }

/* -- Legend -------------------------------------------------------------- */

.lms-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lms-space-2) var(--lms-space-5);
    padding: var(--lms-space-3) var(--lms-space-5);
    border-top: 1px solid var(--lms-border);
    background: var(--lms-surface-alt);
    font-size: var(--lms-text-xs);
    color: var(--lms-text-muted);
}
.lms-legend__item { display: inline-flex; align-items: center; gap: var(--lms-space-2); }

/* -- Empty state --------------------------------------------------------- */

.lms-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--lms-space-12) var(--lms-space-6);
    color: var(--lms-text-muted);
}
.lms-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--lms-space-4);
    border-radius: 50%;
    background: var(--lms-surface-alt);
    color: var(--lms-text-faint);
}
.lms-empty__title { margin: 0; font-family: var(--lms-font-display); font-size: var(--lms-text-md); color: var(--lms-ink); }
.lms-empty__text { margin: var(--lms-space-2) 0 0; max-width: 46ch; font-size: var(--lms-text-sm); }
.lms-empty__actions { margin-top: var(--lms-space-5); display: flex; flex-wrap: wrap; gap: var(--lms-space-2); justify-content: center; }

/* -- Form layout --------------------------------------------------------- */

.lms-fieldset { border: 0; margin: 0 0 var(--lms-space-8); padding: 0; }
.lms-fieldset:last-of-type { margin-bottom: 0; }
.lms-fieldset__legend {
    display: block;
    width: 100%;
    padding: 0 0 var(--lms-space-2);
    margin-bottom: var(--lms-space-4);
    border-bottom: 1px solid var(--lms-border);
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-md);
    font-weight: 600;
    color: var(--lms-ink);
}
.lms-fieldset__hint { margin: calc(var(--lms-space-2) * -1) 0 var(--lms-space-4); font-size: var(--lms-text-sm); color: var(--lms-text-muted); }

.lms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--lms-space-4) var(--lms-space-5);
}
.lms-grid--1 { grid-template-columns: 1fr; }
.lms-grid__full { grid-column: 1 / -1; }

.lms-field { min-width: 0; }
.lms-field__hint { margin: var(--lms-space-1) 0 0; font-size: var(--lms-text-xs); color: var(--lms-text-muted); }
.lms-field__error {
    display: flex;
    align-items: flex-start;
    gap: var(--lms-space-1);
    margin: var(--lms-space-1) 0 0;
    font-size: var(--lms-text-xs);
    font-weight: 600;
    color: var(--lms-danger);
}
.lms-required { color: var(--lms-danger); font-weight: 700; }

.lms-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--lms-space-3);
    margin-top: var(--lms-space-8);
    padding-top: var(--lms-space-5);
    border-top: 1px solid var(--lms-border);
}
.lms-form-actions__group { display: flex; flex-wrap: wrap; gap: var(--lms-space-2); }

/* Password field with a reveal control. */
.lms-password { position: relative; }
.lms-password .uk-input { padding-right: 44px; }
.lms-password__toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: var(--lms-text-faint);
    cursor: pointer;
    border-radius: var(--lms-radius-sm);
}
.lms-password__toggle:hover { color: var(--lms-ink); }

/* Button busy state, set by lms.js on submit. */
.uk-button[data-busy="true"] { pointer-events: none; opacity: .72; }
.uk-button[data-busy="true"]::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: lms-spin .6s linear infinite;
}
@keyframes lms-spin { to { transform: rotate(360deg); } }

/* -- Authentication / public shell --------------------------------------- */

.lms-auth { display: flex; min-height: 100vh; background: var(--lms-page); }

.lms-auth__brand {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 44%;
    max-width: 560px;
    padding: var(--lms-space-12) var(--lms-space-10);
    background:
        radial-gradient(1100px 520px at 12% 8%, rgba(11, 110, 79, .42), transparent 62%),
        radial-gradient(760px 480px at 92% 96%, rgba(201, 153, 47, .22), transparent 60%),
        var(--lms-ink);
    color: rgba(255, 255, 255, .84);
    position: relative;
    overflow: hidden;
}
/* Restrained woven texture — a nod to Nigerian textile without literal motifs. */
.lms-auth__brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 14px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 14px);
    pointer-events: none;
}
.lms-auth__brand > * { position: relative; z-index: 1; }

.lms-auth__brand-title {
    font-family: var(--lms-font-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.15;
    color: #fff;
    margin: var(--lms-space-8) 0 var(--lms-space-4);
    max-width: 18ch;
}
.lms-auth__brand-lede { font-size: var(--lms-text-md); max-width: 40ch; color: rgba(255, 255, 255, .78); }

.lms-auth__points { list-style: none; margin: var(--lms-space-8) 0 0; padding: 0; }
.lms-auth__point {
    display: flex;
    gap: var(--lms-space-3);
    padding: var(--lms-space-3) 0;
    border-top: 1px solid var(--lms-border-ink);
    font-size: var(--lms-text-base);
    color: rgba(255, 255, 255, .78);
}
.lms-auth__point .uk-icon { color: var(--lms-gold); flex: 0 0 auto; margin-top: 2px; }

.lms-auth__foot { font-size: var(--lms-text-xs); color: rgba(255, 255, 255, .5); }

.lms-auth__panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--lms-space-8) var(--lms-space-4) var(--lms-space-10);
}
.lms-auth__card { width: 100%; max-width: 440px; }

.lms-auth__mark {
    display: inline-flex;
    align-items: center;
    gap: var(--lms-space-3);
    margin-bottom: var(--lms-space-6);
    color: var(--lms-ink);
}
.lms-auth__mark:hover { text-decoration: none; }

@media (min-width: 960px) {
    .lms-auth__brand { display: flex; }
}

/* -- Public portal ------------------------------------------------------- */

.lms-public { min-height: 100vh; display: flex; flex-direction: column; background: var(--lms-page); }
.lms-public__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--lms-space-3) var(--lms-space-4);
    padding: var(--lms-space-4) var(--lms-space-6);
    background: var(--lms-ink);
    color: #fff;
}

@media (max-width: 639px) {
    .lms-public__bar { padding: var(--lms-space-3) var(--lms-space-4); }
}
.lms-public__body { flex: 1 1 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--lms-space-8) var(--lms-space-4); }
.lms-public__narrow { max-width: 520px; margin: 0 auto; }

/* PIN entry: monospaced, generously tracked, large touch target. */
.lms-pin-input {
    height: 60px !important;
    font-family: var(--lms-font-mono);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: .5em;
    text-indent: .5em;
    text-align: center;
    color: var(--lms-ink);
}
.lms-pin-input::placeholder { letter-spacing: .35em; font-size: 1.2rem; color: var(--lms-border-strong); }

.lms-steps { list-style: none; counter-reset: lms-step; margin: 0; padding: 0; }
.lms-step {
    display: flex;
    gap: var(--lms-space-3);
    padding: var(--lms-space-3) 0;
    font-size: var(--lms-text-sm);
    color: var(--lms-text-muted);
}
.lms-step::before {
    counter-increment: lms-step;
    content: counter(lms-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: var(--lms-ink);
    color: #fff;
    font-size: var(--lms-text-xs);
    font-weight: 700;
}

/* Autocomplete suggestion list. */
.lms-suggest {
    position: relative;
    margin-top: var(--lms-space-1);
    border: 1px solid var(--lms-border-strong);
    border-radius: var(--lms-radius);
    background: var(--lms-surface);
    box-shadow: var(--lms-shadow);
    max-height: 260px;
    overflow-y: auto;
    z-index: 20;
}
.lms-suggest__item {
    display: flex;
    align-items: center;
    gap: var(--lms-space-3);
    width: 100%;
    padding: var(--lms-space-3) var(--lms-space-4);
    border: 0;
    background: none;
    text-align: left;
    font-size: var(--lms-text-base);
    color: var(--lms-text);
    cursor: pointer;
}
.lms-suggest__item + .lms-suggest__item { border-top: 1px solid var(--lms-border); }
.lms-suggest__item:hover,
.lms-suggest__item[aria-selected="true"] { background: var(--lms-green-050); }
.lms-suggest__empty { padding: var(--lms-space-4); font-size: var(--lms-text-sm); color: var(--lms-text-muted); }

/* -- Academic record (result document) ----------------------------------- */

.lms-record {
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    border-radius: var(--lms-radius-lg);
    box-shadow: var(--lms-shadow-sm);
    overflow: hidden;
}
.lms-record__head {
    padding: var(--lms-space-6);
    background:
        radial-gradient(700px 300px at 8% 0%, rgba(11, 110, 79, .35), transparent 65%),
        var(--lms-ink);
    color: rgba(255, 255, 255, .82);
}
.lms-record__school { font-family: var(--lms-font-display); font-size: var(--lms-text-lg); color: #fff; margin: 0; }
.lms-record__sub { margin: var(--lms-space-1) 0 0; font-size: var(--lms-text-sm); color: rgba(255, 255, 255, .66); }

.lms-record__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--lms-space-4);
    padding: var(--lms-space-5) var(--lms-space-6);
    border-bottom: 1px solid var(--lms-border);
    background: var(--lms-surface-alt);
}
.lms-record__meta-label {
    display: block;
    font-size: var(--lms-text-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lms-text-muted);
}
.lms-record__meta-value { display: block; margin-top: 2px; font-weight: 600; color: var(--lms-ink); }

/* -- Rating chips (behavioural traits) ----------------------------------- */

.rating-label {
    display: inline-flex;
    align-items: center;
    padding: 3px var(--lms-space-3);
    border-radius: var(--lms-radius-pill);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .01em;
    border: 1px solid transparent;
}
.rating-no      { background: var(--lms-danger-050);     color: var(--lms-danger);     border-color: rgba(169, 44, 34, .22); }
.rating-minimal { background: var(--lms-warning-050);    color: var(--lms-warning);    border-color: rgba(169, 118, 26, .24); }
.rating-ok      { background: var(--lms-info-050);       color: var(--lms-info);       border-color: rgba(29, 78, 137, .2); }
.rating-high    { background: var(--lms-success-050);    color: var(--lms-success);    border-color: rgba(11, 110, 79, .22); }
.rating-excel   { background: var(--lms-gold-050);       color: var(--lms-ochre);      border-color: rgba(169, 118, 26, .3); }
.rating-default { background: var(--lms-neutral-050);    color: var(--lms-text-muted); border-color: var(--lms-border-strong); }

/* -- Term block on the result page --------------------------------------- */

.term-traits-comments-card-header {
    display: flex;
    align-items: center;
    gap: var(--lms-space-2);
    font-family: var(--lms-font-display);
    font-size: var(--lms-text-md);
    color: var(--lms-ink);
    margin: 0;
}

/* -- Misc ---------------------------------------------------------------- */

.lms-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--lms-space-1);
    padding: 2px var(--lms-space-2);
    border-radius: var(--lms-radius-sm);
    background: var(--lms-surface-alt);
    border: 1px solid var(--lms-border);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    color: var(--lms-text-muted);
}
.chip { /* legacy hook used by create-result.js row markup */
    display: inline-flex;
    align-items: center;
    padding: 2px var(--lms-space-2);
    border-radius: var(--lms-radius-sm);
    background: var(--lms-surface-alt);
    border: 1px solid var(--lms-border);
    font-size: var(--lms-text-xs);
    font-weight: 600;
    color: var(--lms-text-muted);
}
button.chip { cursor: pointer; min-height: 30px; }

.lms-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--lms-space-4); }
.lms-kv__label { display: block; font-size: var(--lms-text-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--lms-text-muted); }
.lms-kv__value { display: block; margin-top: 2px; color: var(--lms-ink); font-weight: 600; }

.lms-flash { margin-bottom: var(--lms-space-5); }

/* ==========================================================================
   6. UTILITIES
   ========================================================================== */

.lms-stack > * + * { margin-top: var(--lms-space-4); }
.lms-stack-sm > * + * { margin-top: var(--lms-space-2); }
.lms-stack-lg > * + * { margin-top: var(--lms-space-6); }

.lms-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lms-space-2); }
.lms-cluster--between { justify-content: space-between; }

.lms-truncate { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lms-nums { font-variant-numeric: tabular-nums; }
.lms-text-muted { color: var(--lms-text-muted); }
.lms-text-sm { font-size: var(--lms-text-sm); }
.lms-text-xs { font-size: var(--lms-text-xs); }

.lms-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* -- Touch targets ----------------------------------------------------- */

/* On a touch pointer the dense desktop controls are lifted to a comfortable
   tap size. Pointer-precise devices keep the compact scale. */
@media (pointer: coarse) {
    .uk-button-small { min-height: 40px; }
    .uk-icon-button { width: 44px; height: 44px; }
    button.chip { min-height: 40px; }
    .uk-pagination > * > * { min-width: 40px; height: 40px; }
    .lms-suggest__item { padding-top: var(--lms-space-3); padding-bottom: var(--lms-space-3); }
    .lms-dropdown-user__item,
    .uk-dropdown-nav > li > a { padding-top: var(--lms-space-2); padding-bottom: var(--lms-space-2); }
}

/* -- Very narrow: stack the primary page actions ---------------------- */

@media (max-width: 479px) {
    .lms-page-header__actions { width: 100%; }
    .lms-page-header__actions > .uk-button { flex: 1 1 100%; }
}

/* ==========================================================================
   7. PRINT
   ========================================================================== */

@media print {
    .lms-sidebar,
    .lms-topbar,
    .lms-footer,
    .lms-public__bar,
    .uk-offcanvas-container,
    .lms-no-print,
    .uk-notification { display: none !important; }

    .lms-main { margin-left: 0; }
    .lms-content, .lms-public__body { padding: 0; max-width: none; }

    body { background: #fff; color: #000; font-size: 11pt; }

    .uk-card, .lms-panel, .lms-record {
        border: 1px solid #999 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .lms-record__head { background: #fff !important; color: #000 !important; }
    .lms-record__school, .lms-record__sub { color: #000 !important; }

    a[href]::after { content: ""; }
    table { break-inside: auto; }
    tr { break-inside: avoid; break-after: auto; }
    thead { display: table-header-group; }
}
