:root {
    /* Orivex-quality system — light shell, blue brand only */
    --bg: #f1f5f9;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --card-alt: #f8fafc;
    --sidebar: #ffffff;
    --sidebar-soft: #f8fafc;
    --sidebar-ink: #0f172a;
    --sidebar-muted: #64748b;
    --text: #0f172a;
    --text-soft: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --primary: #2563eb;
    --primary-deep: #1d4ed8;
    --primary-hover: #3b82f6;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --primary-ring: rgba(37, 99, 235, 0.18);
    --brand: #2563eb;
    --brand-hover: #3b82f6;
    --brand-dark: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, 0.1);
    --brand-ring: rgba(37, 99, 235, 0.18);
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --info: #2563eb;
    --info-soft: #eff6ff;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.05);
    --shadow-mid: 0 8px 28px rgba(15, 23, 42, 0.08);
    --shadow-hard: 0 18px 48px rgba(15, 23, 42, 0.12);
    --shadow-btn: 0 12px 28px rgba(37, 99, 235, 0.22);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sidebar-w: 268px;
    --topbar-h: 64px;
    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --ink-inverse: #ffffff;
    --glow: 0 0 40px rgba(37, 99, 235, 0.08);
    --field: #f8fafc;
    --surface: #ffffff;
    --page: #f1f5f9;
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
}

::selection {
    background: rgba(37, 99, 235, 0.16);
    color: #0f172a;
}

html {
    scroll-behavior: smooth;
}

body {
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    color: #0a0a0a;
    font-weight: 800;
    font-size: 0.88rem;
    transition: top 0.18s var(--ease);
}

.skip-link:focus {
    top: 12px;
    outline: none;
}

.sr-only {
    position: absolute;
    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: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

main {
    min-height: calc(100vh - 160px);
}

.container {
    width: min(1320px, 94vw);
    margin: 0 auto;
}

/* Public header/footer */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-wrap {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #14203f;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #19a6ce);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-nav a {
    padding: 9px 14px;
    border-radius: 999px;
    color: #304261;
    font-weight: 700;
}

.main-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.site-footer {
    margin-top: 28px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-wrap {
    padding: 30px 0;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto auto;
    align-items: center;
}

.footer-wrap h3 {
    margin: 0 0 8px;
}

.footer-wrap p {
    margin: 4px 0;
    color: var(--text-soft);
}

.cloudflare-trust {
    display: grid;
    gap: 7px;
}

.cloudflare-trust img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 7px;
}

.cloudflare-trust > span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.cloudflare-trust > span .material-symbols-rounded {
    color: var(--success);
    font-size: 15px;
}

.cloudflare-trust-footer {
    width: 190px;
}

.cloudflare-trust-sidebar {
    width: 100%;
    margin-bottom: 12px;
    padding: 9px;
    border: 1px solid rgba(216, 222, 234, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
}

.cloudflare-trust-sidebar img {
    border-radius: 5px;
}

.cloudflare-trust-sidebar > span {
    color: #aeb8c9;
}

.cloudflare-trust-auth {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    width: 180px;
    padding: 8px;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0.92;
}

.cloudflare-trust-auth:hover,
.cloudflare-trust-auth:focus-within {
    opacity: 1;
}

.cloudflare-trust-auth > span {
    font-size: 0.64rem;
}

/* App shell */
body.app-shell-page {
    background: var(--bg);
    overflow: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-sidebar {
    background: var(--sidebar);
    color: var(--sidebar-ink);
    padding: 0;
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    z-index: 70;
    display: flex;
    flex-direction: column;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    min-height: var(--topbar-h);
    border-bottom: 1px solid var(--line);
    color: var(--sidebar-ink);
    flex-shrink: 0;
}

.app-logo .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: none;
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-deep));
}

.app-logo-text {
    display: grid;
    gap: 2px;
    line-height: 1.2;
    min-width: 0;
}

.app-logo-text strong {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--sidebar-ink);
}

.app-logo-text small {
    color: var(--sidebar-muted);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: none;
    font-weight: 600;
}

.sidebar-search {
    margin: 12px 12px 8px;
    flex-shrink: 0;
}

.sidebar-search input {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--field, #f8fafc);
    color: var(--text);
    padding: 0 12px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.sidebar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.sidebar-search input::placeholder {
    color: var(--sidebar-muted);
}

.sidebar-nav {
    display: grid;
    gap: 14px;
    padding: 8px 12px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-title {
    margin: 6px 8px 4px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    color: var(--sidebar-muted);
    padding: 9px 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.side-link-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
    line-height: 1.15;
}

.side-link-copy strong {
    overflow: hidden;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-link-copy small {
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-link:hover .side-link-copy small,
.side-link.is-active .side-link-copy small {
    color: #64748b;
}

.nav-group.is-filtered-out,
.side-link.is-filtered-out {
    display: none;
}

.sidebar-empty-search {
    margin: 8px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--sidebar-muted);
    font-size: 0.78rem;
    text-align: center;
}

.side-link:hover {
    background: #f8fafc;
    color: #1e293b;
}

.side-link.is-active {
    background: var(--primary-soft);
    box-shadow: none;
    color: var(--primary-deep);
}

.side-link-logout {
    margin-top: 4px;
    color: #b91c1c;
}

.side-link-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    border: 1px solid var(--line);
    color: #64748b;
    box-shadow: none;
    flex-shrink: 0;
}

.nav-icon-symbol {
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.side-link.is-active .nav-icon {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.22);
    color: var(--primary-deep);
}

.side-link.is-active .nav-icon-symbol {
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    background: var(--sidebar);
    position: relative;
    z-index: 2;
}

.app-sidebar .sidebar-nav {
    /* Keep nav scrollable so footer never clips menu items */
    overscroll-behavior: contain;
}

.sidebar-account-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.sidebar-account-link:hover {
    background: #f1f5f9;
}

.sidebar-account-link strong,
.sidebar-account-link small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-link strong {
    color: var(--text);
    font-size: 0.8rem;
}

.sidebar-account-link small {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.68rem;
}

.sidebar-account-link > .material-symbols-rounded {
    color: #94a3b8;
    font-size: 18px;
}

.sidebar-account-link--student {
    align-items: start;
    padding: 10px;
}

.sidebar-account-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sidebar-stat-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.sidebar-stat-inline em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 750;
    color: var(--primary-deep);
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    padding: 2px 7px;
    line-height: 1.3;
}

/* Legacy class kept so older markup does not break if cached */
.sidebar-student-card {
    display: none;
}

.app-area {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr;
    background: var(--bg);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-topbar {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    padding: 0 22px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb-wrap {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.breadcrumb-wrap strong {
    color: var(--ink);
}

.topbar-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    color: #43557b;
    background: #fff;
    font-size: 0.84rem;
    font-weight: 700;
}

.topbar-user {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px 4px 5px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.topbar-account {
    position: relative;
}

.notification-menu { position: relative; }
.notification-trigger {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #344054; cursor: pointer;
}
.notification-trigger:hover, .notification-menu.is-open .notification-trigger { border-color: rgba(37, 99, 235, 0.35); background: var(--primary-soft); color: var(--primary-deep); }
.notification-trigger .material-symbols-rounded { font-size: 21px; }
.notification-count {
    position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center;
    padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 900;
}
.notification-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; width: min(390px, calc(100vw - 28px));
    border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 20px 48px rgba(16, 24, 40, 0.18);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: 0.18s ease; overflow: hidden;
}
.notification-menu.is-open .notification-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.notification-dropdown-title { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.notification-dropdown-title strong, .notification-dropdown-title small { display: block; }
.notification-dropdown-title strong { font-size: 0.92rem; }
.notification-dropdown-title small { margin-top: 3px; color: var(--text-soft); font-size: 0.7rem; }
.notification-dropdown-title > span { align-self: center; padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep); font-size: 0.66rem; font-weight: 900; }
.notification-list { max-height: 420px; overflow-y: auto; }
.notification-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 13px 15px; border-bottom: 1px solid #edf0f5; }
.notification-item:hover { background: #f8faff; }
.notification-item-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary-deep); font-size: 19px; }
.notification-item.is-important .notification-item-icon { background: #fff5df; color: #b36b00; }
.notification-item.is-critical .notification-item-icon { background: #fff0f0; color: #c53535; }
.notification-item strong, .notification-item small, .notification-item em { display: block; }
.notification-item strong { color: #1d2939; font-size: 0.8rem; }
.notification-item small { margin-top: 3px; color: #667085; font-size: 0.72rem; line-height: 1.35; }
.notification-item em { margin-top: 5px; color: #98a2b3; font-size: 0.64rem; font-style: normal; font-weight: 700; }
.notification-empty { padding: 28px; color: #98a2b3; text-align: center; }
.notification-empty .material-symbols-rounded { font-size: 30px; }
.notification-empty p { margin: 5px 0 0; font-size: 0.78rem; }

.account-chevron {
    color: #667085;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.topbar-account.is-open .account-chevron {
    transform: rotate(180deg);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: 0.18s ease;
}

.topbar-account.is-open .account-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 8px 9px 12px;
    border-bottom: 1px solid var(--line);
}

.account-dropdown-head strong,
.account-dropdown-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown-head strong {
    font-size: 0.86rem;
}

.account-dropdown-head small {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.72rem;
}

.account-dropdown > a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: 8px;
}

.account-dropdown > a:hover {
    background: #f5f7fb;
}

.account-dropdown > a > .material-symbols-rounded {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 18px;
}

.account-dropdown > a strong,
.account-dropdown > a small {
    display: block;
}

.account-dropdown > a strong {
    font-size: 0.82rem;
}

.account-dropdown > a small {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.7rem;
}

.account-dropdown > a.account-logout > .material-symbols-rounded {
    background: #fff1f1;
    color: #c83d3d;
}

.page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.account-summary-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, #172033, #243759);
    color: #fff;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.account-large-avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    font-size: 1.5rem;
    font-weight: 900;
}

.account-summary-card h3 {
    margin: 0;
}

.account-summary-card > p {
    margin: 5px 0 20px;
    color: #b9c4d6;
    font-size: 0.82rem;
}

.account-facts {
    display: grid;
    gap: 9px;
    text-align: left;
}

.account-facts span {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.account-facts small {
    color: #9fadc3;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-facts strong {
    font-size: 0.8rem;
}

.account-form {
    margin: 0;
}

.account-section-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.account-section-head > .material-symbols-rounded {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.account-section-head h3,
.account-section-head p {
    margin: 0;
}

.account-section-head p {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.account-security-head {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.field-help {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 0.72rem;
}

.account-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Corporate ERP dashboard */
.erp-command-banner {
    display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 16px; padding: 24px 26px;
    border: 1px solid #253b61; border-radius: 14px;
    background: radial-gradient(circle at 88% 20%, rgba(64, 130, 246, 0.3), transparent 30%), linear-gradient(135deg, #121c2f, #203559);
    color: #fff; box-shadow: 0 16px 34px rgba(20, 39, 75, 0.16);
}
.erp-banner-kicker, .module-label { display: block; margin-bottom: 5px; color: #4f79c7; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.erp-command-banner .erp-banner-kicker { color: #8bb9ff; }
.erp-command-banner h3 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.65rem); }
.erp-command-banner p { max-width: 760px; margin: 7px 0 0; color: #c0cbdd; font-size: 0.86rem; }
.erp-banner-status { min-width: 190px; display: grid; gap: 5px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); }
.erp-banner-status span { display: flex; align-items: center; gap: 7px; color: #c7d2e5; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.erp-banner-status strong { font-size: 1rem; }
.erp-banner-status small { color: #9cabc2; font-size: .68rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.status-dot.is-live { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.erp-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.erp-kpi-card { position: relative; min-width: 0; display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(16,24,40,.04); overflow: hidden; }
.erp-kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #2563eb; }
.erp-kpi-card.is-green::before { background: #1ea672; } .erp-kpi-card.is-orange::before { background: #ea8e1a; } .erp-kpi-card.is-red::before { background: #df4c4c; }
.erp-kpi-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: #eef4ff; color: #2563eb; }
.erp-kpi-card.is-green .erp-kpi-icon { background: #eafaf4; color: #15805a; } .erp-kpi-card.is-orange .erp-kpi-icon { background: #fff6e8; color: #b66a0c; } .erp-kpi-card.is-red .erp-kpi-icon { background: #fff0f0; color: #bf3f3f; }
.erp-kpi-card small, .erp-kpi-card strong, .erp-kpi-card p { display: block; }
.erp-kpi-card small { color: #667085; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.erp-kpi-card strong { margin-top: 3px; color: #101828; font-size: 1.55rem; line-height: 1; }
.erp-kpi-card p { margin: 5px 0 0; color: #98a2b3; font-size: .7rem; }
.erp-kpi-card > a { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #edf0f5; color: #475467; font-size: .7rem; font-weight: 800; }
.erp-kpi-card > a .material-symbols-rounded { font-size: 16px; }
.erp-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(300px,.75fr); gap: 14px; margin-bottom: 16px; }
.erp-module { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(16,24,40,.04); }
.erp-module-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 15px; }
.erp-module-head h3, .erp-module-head p { margin: 0; }
.erp-module-head h3 { color: #1d2939; font-size: 1rem; }
.erp-module-head p { margin-top: 4px; color: #667085; font-size: .76rem; }
.erp-module-head > a { color: #2563eb; font-size: .72rem; font-weight: 800; }
.module-count { padding: 5px 9px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: .68rem; font-weight: 800; }
.erp-chart-wrap { height: 280px; }
.erp-donut-layout { display: grid; gap: 15px; }
.erp-donut-wrap { height: 180px; }
.erp-chart-legend { display: grid; gap: 8px; }
.erp-chart-legend span { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; background: #98a2b3; }
.legend-dot.is-published { background: #2563eb; } .legend-dot.is-draft { background: #f59e0b; }
.erp-chart-legend em { color: #667085; font-size: .75rem; font-style: normal; } .erp-chart-legend strong { font-size: .8rem; }
.communication-module { margin-bottom: 18px; }
.communication-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(330px,.8fr); gap: 18px; }
.announcement-composer { display: grid; gap: 12px; padding-right: 18px; border-right: 1px solid var(--line); }
.composer-image-field { position: relative; min-height: 150px; border: 1px dashed #aebfe0; border-radius: 11px; background: #f7f9fd; overflow: hidden; }
.composer-image-field input { position: absolute; opacity: 0; pointer-events: none; }
.composer-image-field label { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 4px; color: #526581; text-align: center; cursor: pointer; }
.composer-image-field label .material-symbols-rounded { margin: 0 auto 3px; color: #2563eb; font-size: 30px; }
.composer-image-field label strong { color: #263b5c; font-size: .82rem; } .composer-image-field label small { font-size: .68rem; }
.composer-image-field img { position: absolute; inset: 0; width: 100%; height: 100%; display: none; object-fit: cover; }
.composer-image-field.has-image img { display: block; }
.composer-image-field.has-image label { place-content: end start; padding: 14px; color: #fff; background: linear-gradient(transparent 45%,rgba(11,20,36,.82)); text-align: left; }
.composer-image-field.has-image label .material-symbols-rounded, .composer-image-field.has-image label strong, .composer-image-field.has-image label small { color: #fff; margin-left: 0; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.composer-actions > span { display: flex; align-items: center; gap: 6px; color: #667085; font-size: .7rem; }
.composer-actions > span .material-symbols-rounded { color: #2563eb; font-size: 17px; }
.announcement-admin-list { max-height: 720px; display: grid; align-content: start; gap: 9px; overflow-y: auto; }
.announcement-admin-item { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e4e8ef; border-radius: 10px; background: #fbfcfe; }
.announcement-admin-item > img, .announcement-placeholder { width: 62px; height: 54px; border-radius: 8px; object-fit: cover; }
.announcement-placeholder { display: grid; place-items: center; background: #eef4ff; color: #2563eb; }
.announcement-admin-item h4 { margin: 4px 0 3px; color: #1d2939; font-size: .78rem; }
.announcement-admin-item p { display: -webkit-box; margin: 0; overflow: hidden; color: #667085; font-size: .68rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.announcement-meta { color: #98a2b3; font-size: .62rem; font-weight: 700; text-transform: capitalize; }
.announcement-meta em { margin-right: 6px; color: #2563eb; font-style: normal; font-weight: 900; }
.announcement-meta em.priority-important { color: #b66a0c; } .announcement-meta em.priority-critical { color: #c53535; }
.icon-action { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #667085; cursor: pointer; }
.icon-action:hover { color: #c53535; border-color: #efb7b7; } .icon-action .material-symbols-rounded { font-size: 17px; }
.student-story-section { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.student-story-rail { display: grid; grid-auto-columns: minmax(300px,36%); grid-auto-flow: column; gap: 12px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
.student-story-card { min-width: 0; display: grid; grid-template-columns: 128px minmax(0,1fr); border: 1px solid #e1e6ee; border-radius: 11px; background: #fbfcfe; overflow: hidden; scroll-snap-align: start; }
.student-story-card.is-important { border-color: #f1d29c; } .student-story-card.is-critical { border-color: #efb7b7; }
.student-story-media { position: relative; min-height: 150px; display: grid; place-items: center; background: linear-gradient(145deg,#1e3a8a,#2563eb); color: #fff; }
.student-story-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.student-story-media > .material-symbols-rounded { font-size: 36px; }
.student-story-media em { position: absolute; top: 9px; left: 9px; padding: 4px 7px; border-radius: 999px; background: rgba(15,27,47,.82); color: #fff; font-size: .58rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.student-story-content { min-width: 0; padding: 13px; }
.student-story-content small { color: #98a2b3; font-size: .62rem; font-weight: 700; }
.student-story-content h3 { margin: 6px 0; color: #1d2939; font-size: .88rem; line-height: 1.3; }
.student-story-content p { display: -webkit-box; margin: 0; overflow: hidden; color: #667085; font-size: .7rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.student-story-content a { display: inline-flex; align-items: center; gap: 4px; margin-top: 9px; color: var(--primary-deep); font-size: .68rem; font-weight: 900; }
.student-story-content a .material-symbols-rounded { font-size: 15px; }
.student-performance-chart { margin: 0; }
.student-chart-wrap { height: 220px; }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-deep));
}

.user-meta {
    display: grid;
    line-height: 1.2;
}

.user-meta strong {
    font-size: 0.86rem;
}

.user-meta small {
    font-size: 0.76rem;
    color: var(--text-soft);
}

.sidebar-toggle {
    border: 1px solid var(--line);
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: #fff;
    display: none;
    place-items: center;
    font-size: 1rem;
    cursor: pointer;
}

.app-main {
    padding: 22px 24px 32px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-main .section {
    padding: 0;
}

.app-main .container {
    width: 100%;
    margin: 0;
}

/* Common sections/components */
.section {
    padding: 56px 0;
}

.section.alt {
    background: linear-gradient(180deg, #f9fcff, #f2f7ff);
}

.section-head h2 {
    margin: 0;
    font-size: 1.9rem;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--text-soft);
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: center;
}

.btn {
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 16px;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn.full {
    width: 100%;
}

.btn-sm {
    padding: 8px 11px;
    font-size: 0.8rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}

.btn-outline {
    color: var(--text);
    background: #fff;
    border-color: var(--line-strong);
}

.btn-outline:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.btn.is-loading,
.btn[disabled],
button[disabled].btn {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.btn .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-head h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.8vw, 2.05rem);
}

.dashboard-head p {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.title-with-icon {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.title-with-icon .material-symbols-rounded {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(140deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.title-with-icon.sm {
    font-size: 1.05rem;
}

.title-with-icon.sm .material-symbols-rounded {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 16px;
}

.card-grid {
    margin-top: 16px;
    display: grid;
    gap: 14px;
}

.card-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.action-card,
.feature-card,
.info-card,
.form-card,
.table-card,
.chart-card,
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.metric-card {
    padding: 15px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    display: none;
}

.metric-card h3,
.analytics-number-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7deea;
    background: #f8fafc;
    color: #1d2939;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.metric-card h3 {
    margin: 0 0 8px;
    min-height: 42px;
    min-width: 64px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    box-shadow: none;
}

.table-wrap .analytics-number-box {
    min-height: 30px;
    min-width: 56px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.analytics-number-box.is-attempt {
    border-color: #bed3fa;
    background: linear-gradient(180deg, #f0f6ff 0%, #dfeafd 100%);
    color: #1d3d80;
}

.analytics-number-box.is-average {
    border-color: #b7e7db;
    background: linear-gradient(180deg, #eefcf8 0%, #d9f6ec 100%);
    color: #155d46;
}

.analytics-number-box.is-best {
    border-color: #d8c6f1;
    background: linear-gradient(180deg, #f7f1ff 0%, #eadfff 100%);
    color: #55308b;
}

.analytics-number-box.is-worst {
    border-color: #f0d4bd;
    background: linear-gradient(180deg, #fff7f1 0%, #ffe9db 100%);
    color: #8f4a1e;
}

.analytics-number-box.is-pass {
    border-color: #b7e6cf;
    background: linear-gradient(180deg, #effcf5 0%, #dcf6e8 100%);
    color: #165d43;
}

.analytics-number-box.is-rate {
    border-color: #ebc0d7;
    background: linear-gradient(180deg, #fff0f6 0%, #ffe1ed 100%);
    color: #7c2b56;
}

.ai-suggestions-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #d7e4f4;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.ai-suggestions-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.ai-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ai-logo-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid #e4e9f2;
    background: #fff;
    overflow: hidden;
}

.ai-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ai-brand-lockup strong {
    display: block;
    color: #10224a;
    font-size: 1.03rem;
}

.ai-brand-lockup small {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-weight: 700;
    line-height: 1.35;
}

.ai-chip {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid #ffd4bd;
    background: #fff3eb;
    color: #a14318;
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.ai-suggestion {
    min-height: 156px;
    padding: 13px;
    border: 1px solid #dbe6f6;
    border-radius: 8px;
    background: #fff;
}

.ai-suggestion > span {
    display: inline-flex;
    margin-bottom: 9px;
    color: #31507e;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-suggestion h3 {
    margin: 0 0 7px;
    color: #10224a;
    font-size: 0.98rem;
    line-height: 1.25;
}

.ai-suggestion p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 650;
}

.ai-suggestion.is-risk {
    border-color: #f2c5bc;
    background: #fff7f4;
}

.ai-suggestion.is-success {
    border-color: #bee6d0;
    background: #f4fff9;
}

.ai-suggestion.is-focus {
    border-color: #c8d8fb;
    background: #f5f8ff;
}

.exam-ai-cell {
    display: grid;
    gap: 4px;
    min-width: 260px;
    max-width: 420px;
    padding: 10px;
    border: 1px solid #dbe6f6;
    border-radius: 12px;
    background: #f8fbff;
}

.exam-ai-cell strong {
    color: #10224a;
    font-size: 0.88rem;
}

.exam-ai-cell span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
}

.exam-ai-cell.is-risk {
    border-color: #f2c5bc;
    background: #fff7f4;
}

.exam-ai-cell.is-success {
    border-color: #bee6d0;
    background: #f4fff9;
}

.exam-ai-cell.is-focus {
    border-color: #c8d8fb;
    background: #f5f8ff;
}

.metric-card p {
    margin: 0;
    color: var(--text-soft);
    font-weight: 700;
}

.result-metrics .metric-card {
    border-color: transparent;
}

.result-metrics .metric-card::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
}

.result-metrics .metric-score {
    background: linear-gradient(135deg, #dceeff, #c9e2ff);
}

.result-metrics .metric-correct {
    background: linear-gradient(135deg, #d9f7e8, #c2efd9);
}

.result-metrics .metric-wrong {
    background: linear-gradient(135deg, #ffe2df, #ffd0ca);
}

.result-metrics .metric-status.is-pass {
    background: linear-gradient(135deg, #dcf8ea, #c6eed8);
}

.result-metrics .metric-status.is-fail {
    background: linear-gradient(135deg, #ffe6e3, #ffd5cf);
}

.result-metrics .metric-card h3,
.result-metrics .metric-card p {
    color: #14223f;
}

.result-metrics .metric-card h3 {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 6px 12px rgba(33, 51, 86, 0.1);
}

.result-metrics .metric-status.is-fail h3,
.result-metrics .metric-status.is-fail p {
    color: #7f1f28;
}

.action-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hard);
}

.action-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #2563eb);
    box-shadow: 0 10px 22px rgba(33, 78, 184, 0.28);
}

.action-card-icon .material-symbols-rounded {
    font-size: 21px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.action-card-content {
    min-width: 0;
}

.action-card h3,
.action-card-content h3 {
    margin: 0 0 6px;
    color: #1b2f60;
    font-size: 1.04rem;
}

.action-card p,
.action-card-content p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.action-card-arrow {
    color: #516692;
    font-size: 20px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
    transition: transform 0.2s ease;
}

.action-card:hover .action-card-arrow {
    transform: translateX(2px);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-tabs,
.dashboard-tab-list {
    margin-top: 14px;
}

.dashboard-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 6px;
    box-shadow: var(--shadow-soft);
}

.dashboard-tab {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    padding: 0 14px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.dashboard-tab:hover {
    background: #f2f4f7;
    color: #1d2939;
}

.dashboard-tab.is-active {
    background: #1d4ed8;
    color: #fff;
}

.dashboard-tab:focus-visible {
    outline-color: rgba(31, 70, 152, 0.35);
}

.dashboard-panel {
    display: none;
}

.dashboard-panel.is-active {
    display: block;
}

.dashboard-summary-grid.dashboard-panel.is-active,
.student-task-grid.dashboard-panel.is-active {
    display: grid;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.dashboard-summary-grid .metric-card h3 {
    min-width: auto;
    border: 0;
    background: transparent;
    padding: 0;
    min-height: auto;
    color: #101828;
    font-size: 1.55rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.36fr);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}

.dashboard-primary,
.dashboard-secondary,
.student-side-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.student-task-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.36fr);
    gap: 14px;
    align-items: start;
}

.priority-panel {
    margin-top: 0;
}

.section-subhead {
    margin-top: 18px;
}

.section-subhead h3 {
    margin: 0;
    font-size: 1.05rem;
}

.section-subhead p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h3 {
    margin: 0;
    color: #182230;
    font-size: 1.02rem;
}

.panel-head p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.panel-head > a {
    color: var(--primary-deep);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.ops-card,
.quick-actions-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

.ops-card.compact {
    padding: 14px;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ops-item {
    border: 1px solid #e3e8f1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 12px;
}

.ops-label {
    display: block;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ops-item strong {
    display: block;
    margin-top: 7px;
    color: #101828;
    font-size: 1.45rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ops-item small {
    display: block;
    margin-top: 7px;
    color: var(--text-soft);
    font-weight: 650;
}

.alert-list,
.timeline-list {
    display: grid;
    gap: 8px;
}

.alert-item,
.timeline-item {
    border: 1px solid #e3e8f1;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 10px;
}

.alert-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.alert-item strong,
.timeline-item strong {
    display: block;
    color: #1d2939;
    font-size: 0.9rem;
}

.alert-item small,
.timeline-item small,
.timeline-item span {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 650;
}

.alert-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef4ff;
    color: #2563eb;
}

.alert-icon.warn {
    background: #fff6e8;
    color: #a15c07;
}

.alert-icon.risk {
    background: #fff0f0;
    color: #b42318;
}

.alert-icon .material-symbols-rounded {
    font-size: 18px;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.quick-action-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid #e3e8f1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: #344054;
    padding: 8px 10px;
    font-size: 0.84rem;
    font-weight: 800;
}

.quick-action:hover {
    border-color: #b8c7e0;
    background: #fff;
    color: var(--primary-deep);
}

.quick-action .material-symbols-rounded {
    color: #667085;
    font-size: 18px;
}

.empty-state {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.form-card {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.form-card.panel-card {
    box-shadow: var(--shadow-soft);
}

.form-card.compact {
    padding: 12px 14px;
}

.form-shell {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: clamp(22px, 3vw, 30px);
}

.form-shell h2 {
    margin: 0 0 7px;
}

.form-shell p {
    margin: 0 0 14px;
    color: var(--text-soft);
}

.form-row {
    display: grid;
    gap: 12px;
}

.form-row.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.input-group {
    display: grid;
    gap: 6px;
}

.input-group label {
    font-size: 0.89rem;
    color: #293857;
    font-weight: 700;
}

.input-group input,
.input-group select,
.input-group textarea {
    border: 1px solid #cad6eb;
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 0.96rem;
    outline: none;
    padding: 11px 12px;
    width: 100%;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #7e9de7;
    box-shadow: 0 0 0 3px rgba(76, 113, 219, 0.16);
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px 16px;
}

.toggle-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #2d3f63;
}

.align-end {
    align-content: end;
}

.table-card,
.chart-card {
    margin-top: 14px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.table-card h3,
.chart-card h3 {
    margin: 0 0 10px;
}

.table-card .panel-head h3,
.chart-card .panel-head h3 {
    margin: 0;
}

.scorecard-actions {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scorecard-list {
    display: grid;
    gap: 10px;
}

.solution-item {
    border: 1px solid #dbe6f7;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.solution-item > summary {
    list-style: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
}

.solution-item > summary::-webkit-details-marker {
    display: none;
}

.solution-item > summary::after {
    content: "expand_more";
    font-family: "Material Symbols Rounded";
    font-size: 20px;
    color: #4a5f89;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.solution-item[open] > summary::after {
    content: "expand_less";
}

.solution-item.correct > summary {
    background: #f2fbf7;
}

.solution-item.wrong > summary {
    background: #fff6f1;
}

.solution-item.unanswered > summary {
    background: #f6f9ff;
}

.solution-index {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #e8efff;
    color: #234390;
    font-size: 0.8rem;
    font-weight: 800;
}

.solution-question {
    color: #1d2f55;
    font-weight: 700;
    line-height: 1.35;
}

.solution-question-media-wrap {
    border: 1px solid #d9e5f8;
    border-radius: 10px;
    background: #f9fbff;
    padding: 8px;
}

.solution-question-media {
    width: 100%;
    max-width: 440px;
    max-height: 240px;
    border-radius: 8px;
    object-fit: contain;
}

.solution-body {
    border-top: 1px solid #e6eefb;
    padding: 12px;
    display: grid;
    gap: 12px;
}

.solution-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.solution-answer-box {
    border: 1px solid #d7e2f5;
    border-radius: 10px;
    background: #f9fbff;
    padding: 10px;
}

.solution-answer-box strong {
    display: block;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #50638f;
}

.solution-answer-box p {
    margin: 6px 0 0;
    color: #1f3158;
}

.solution-inline-media {
    margin-top: 8px;
    width: 100%;
    max-width: 260px;
    max-height: 150px;
    border-radius: 8px;
    border: 1px solid #d8e3f6;
    object-fit: contain;
    background: #fff;
}

.solution-options {
    display: grid;
    gap: 8px;
}

.solution-option {
    border: 1px solid #dce5f7;
    border-radius: 10px;
    padding: 9px 10px;
    background: #fff;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.solution-option.is-selected {
    border-color: #95afe5;
    background: #f2f6ff;
}

.solution-option.is-correct {
    border-color: #88d4b6;
    background: #ecf9f3;
}

.solution-option.is-selected.is-correct {
    border-color: #66c196;
    background: #e4f7ef;
}

.solution-option-key {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #2563eb);
}

.solution-option-text {
    color: #23385f;
    display: grid;
    gap: 6px;
}

.solution-option-media {
    width: 100%;
    max-width: 260px;
    max-height: 150px;
    border-radius: 8px;
    border: 1px solid #d8e3f6;
    object-fit: contain;
    background: #fff;
}

.solution-option-tag {
    border-radius: 999px;
    border: 1px solid #bfd1ec;
    background: #f4f8ff;
    color: #214173;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 4px 8px;
    white-space: nowrap;
}

.solution-explanation {
    border: 1px dashed #c7d8f2;
    border-radius: 10px;
    background: #f7faff;
    padding: 10px;
}

.solution-explanation strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #35527f;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.solution-explanation p {
    margin: 0;
    color: #304a74;
}

.solution-explanation-media {
    margin-top: 8px;
    width: 100%;
    max-width: 360px;
    max-height: 220px;
    border-radius: 8px;
    border: 1px solid #d1dff5;
    object-fit: contain;
    background: #fff;
}

.chart-grid {
    margin-top: 14px;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-canvas-wrap {
    min-height: 280px;
    position: relative;
}

.chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #dce5f3;
}

.table-toolbar {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #3c4f78;
    font-size: 0.88rem;
}

.list-pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #5b6d8e;
    font-size: 0.86rem;
}

.pagination-size,
.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-size select {
    min-width: 58px;
    padding: 7px 26px 7px 10px;
    border: 1px solid #dce5f3;
    border-radius: 8px;
    background-color: #fff;
    color: #273b61;
    font-weight: 700;
}

.pagination-links a,
.pagination-current,
.pagination-disabled,
.pagination-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    color: #425577;
    text-decoration: none;
}

.pagination-current {
    color: #0f3d91;
    font-weight: 900;
}

.pagination-disabled {
    color: #9aa9c0;
}

@media (max-width: 720px) {
    .list-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 740px;
    background: #fff;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #ebf0f8;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.muted {
    color: var(--text-soft);
}

th {
    color: #384c73;
    background: #f7faff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.table-card-actions {
    margin-top: 10px;
}

.table-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #bfceea;
    background: #f4f8ff;
    color: #233f76;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: 0.18s ease;
}

.table-action:hover {
    background: #e8f0ff;
    border-color: #8fa7da;
    color: #1b3368;
}

.table-action .material-symbols-rounded {
    font-size: 16px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 4px 10px;
}

.pill.ok {
    background: #e7f8f0;
    color: #157d54;
}

.pill.warn {
    background: #fff2e3;
    color: #9a5e0d;
}

.alert {
    border-radius: 11px;
    padding: 11px 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.alert-error {
    background: #ffefef;
    border: 1px solid #f4caca;
    color: #9c3434;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #bfebd4;
    color: #0f7c50;
}

.alert[data-toasted="1"] {
    display: none !important;
}

.app-toast-stack {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 1200;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 24px));
}

.app-toast {
    border: 1px solid #d8e3f6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(17, 31, 69, 0.17);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    opacity: 0;
    transform: translateY(-6px);
    transition: 0.2s ease;
}

.app-toast.is-on {
    opacity: 1;
    transform: translateY(0);
}

.app-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
}

.app-toast.success .app-toast-icon {
    background: linear-gradient(145deg, #1b9a6b, #22c287);
}

.app-toast.error .app-toast-icon {
    background: linear-gradient(145deg, #cf3f3f, #e96a6a);
}

.app-toast.partial .app-toast-icon {
    background: linear-gradient(145deg, #d37b13, #f0a23c);
}

.app-toast .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.app-toast p {
    margin: 0;
    color: #233455;
    font-size: 0.9rem;
    font-weight: 700;
}

.stack-cards {
    display: grid;
    gap: 12px;
}

.bulk-version-list {
    display: grid;
    gap: 9px;
}

.bulk-version-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #d5e2f5;
    border-radius: 10px;
    background: #f7fbff;
    padding: 10px 12px;
}

.bulk-version-item strong {
    display: block;
    margin-bottom: 2px;
}

.bulk-version-item small {
    color: var(--text-soft);
}

.bulk-version-item .stats {
    text-align: right;
    font-size: 0.82rem;
    color: #364d78;
}

.stat-card-wrap {
    display: grid;
    gap: 14px;
}

.stat-card {
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.quick-links {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.student-hero {
    margin-bottom: 14px;
}

.student-hero-card {
    border-radius: var(--radius-lg);
    border: 1px solid #c3d4f4;
    background: linear-gradient(125deg, #315ed8 0%, #224cb3 48%, #2ca2c7 100%);
    color: #fff;
    padding: clamp(20px, 3.3vw, 34px);
    box-shadow: var(--shadow-hard);
}

.student-hero-card h3 {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.student-hero-card p {
    margin: 0;
    max-width: 700px;
    color: rgba(239, 246, 255, 0.92);
}

.student-hero-card .hero-actions {
    margin-top: 18px;
}

.student-dashboard-page {
    padding-bottom: 40px;
}

body.role-student.has-mobile-nav .student-dashboard-page {
    padding-bottom: 92px;
}

.student-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
    gap: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.12), transparent 44%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--ink);
    padding: clamp(18px, 2.5vw, 24px);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.student-hero-copy h2 {
    margin: 6px 0 8px;
    color: var(--ink);
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.student-hero-copy p {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-weight: 600;
}

.student-kicker {
    display: inline-flex;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.student-hero-actions .btn-outline {
    background: #fff;
    color: var(--primary-deep);
    border-color: var(--line);
}

.student-hero-status {
    align-self: stretch;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.student-hero-status span,
.student-hero-status small {
    color: var(--muted);
    font-weight: 700;
}

.student-hero-status strong {
    color: var(--ink);
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    line-height: 1;
}

.learning-progress-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.learning-progress-strip article {
    display: grid;
    gap: 7px;
    min-height: 112px;
    border: 1px solid #dbe4f2;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: var(--shadow-soft);
}

.learning-progress-strip .material-symbols-rounded {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef5ff;
    color: #244ea7;
    font-size: 19px;
    line-height: 1;
}

.learning-progress-strip strong {
    color: #101828;
    font-size: 1.35rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.learning-progress-strip small {
    color: var(--text-soft);
    font-weight: 800;
}

.student-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.34fr);
    gap: 14px;
    align-items: start;
}

.student-main-flow {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.continue-card,
.exam-card,
.designed-empty,
.result-row-card {
    border-radius: 8px;
}

.continue-card {
    border: 1px solid #d7e3f4;
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.continue-exam-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #dfe8f5;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    padding: 14px;
}

.continue-exam-body h3 {
    margin: 0 0 5px;
    color: #13294f;
    font-size: 1.18rem;
}

.continue-exam-body p,
.continue-meta span {
    margin: 0;
    color: var(--text-soft);
    font-weight: 750;
}

.continue-meta {
    display: grid;
    gap: 5px;
}

.continue-meta strong {
    color: #173a83;
    font-size: 1.15rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-chip.live {
    background: #e7f8f0;
    color: #126b49;
}

.status-chip.upcoming {
    background: #eef4ff;
    color: #244ea7;
}

.status-chip.completed {
    background: #f1ecff;
    color: #59409b;
}

.status-chip.expired {
    background: #f2f4f7;
    color: #667085;
}

.progress-rail {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.92);
}

.progress-rail span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #20a779, #2f69d9);
}

.exam-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.exam-card {
    display: grid;
    gap: 12px;
    min-height: 254px;
    border: 1px solid #dbe4f2;
    background: #fff;
    padding: 15px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.exam-card:hover {
    transform: translateY(-2px);
    border-color: #b9c9e6;
    box-shadow: var(--shadow-hard);
}

.exam-card-top,
.exam-card-actions,
.attempt-progress > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.exam-card-top > span:last-child {
    color: #5f6f8c;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.exam-card h3 {
    margin: 0;
    color: #14233f;
    font-size: 1.08rem;
    line-height: 1.26;
}

.exam-card-meta {
    display: grid;
    gap: 7px;
}

.exam-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 750;
}

.exam-card-meta .material-symbols-rounded {
    color: #3865c8;
    font-size: 17px;
    line-height: 1;
}

.attempt-progress {
    display: grid;
    gap: 7px;
}

.attempt-progress span,
.exam-card-actions small {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

.attempt-progress strong {
    color: #1d2939;
    font-size: 0.86rem;
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    color: #7b8798;
    border-color: #d8dee8;
    background: #eef1f5;
    box-shadow: none;
    transform: none;
}

.designed-empty {
    display: grid;
    justify-items: start;
    gap: 8px;
    border: 1px dashed #cbd7ea;
    background: #f8fbff;
    padding: 18px;
}

.designed-empty.wide {
    grid-column: 1 / -1;
}

.designed-empty.small {
    padding: 14px;
}

.designed-empty .material-symbols-rounded {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef4ff;
    color: #2563eb;
    font-size: 21px;
}

.designed-empty h3 {
    margin: 0;
    color: #1d2939;
    font-size: 1rem;
}

.designed-empty p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.student-ai-card {
    margin-top: 0;
}

.compact-ai-grid {
    grid-template-columns: 1fr;
}

.compact-ai-grid .ai-suggestion {
    min-height: auto;
}

.premium-timeline .timeline-item {
    position: relative;
    padding-left: 16px;
}

.premium-timeline .timeline-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #20a779;
}

.dashboard-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.44fr);
    gap: 14px;
    margin-top: 14px;
}

.result-card-list,
.ai-exam-list {
    display: grid;
    gap: 10px;
}

.result-row-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #dfe8f5;
    background: #fff;
    padding: 11px;
    transition: 0.18s ease;
}

.result-row-card:hover {
    border-color: #aec0df;
    background: #f8fbff;
}

.result-row-card strong {
    color: #1d2939;
}

.result-row-card span:not(.pill) {
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 750;
}

.result-row-card em {
    color: #173a83;
    font-style: normal;
    font-weight: 900;
}

.ai-exam-list .exam-ai-cell {
    min-width: 0;
    max-width: none;
}

.ai-exam-list .exam-ai-cell a {
    color: var(--primary-deep);
    font-size: 0.82rem;
    font-weight: 900;
}

.student-mobile-nav {
    display: none;
}

.assignment-field {
    display: none;
}

.assignment-field.is-visible {
    display: grid;
}

/* Auth */
body.auth-page {
    background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
}

.auth-wrap {
    min-height: calc(100vh - 142px);
    display: grid;
    align-items: stretch;
}

.auth-page .auth-wrap {
    min-height: 100vh;
    padding: 24px 0 34px;
}

.auth-grid {
    width: min(1260px, 95vw);
    margin: 22px auto;
    background: #fff;
    border-radius: 24px;
    border: 1px solid #d8e2f3;
    box-shadow: 0 24px 52px rgba(26, 46, 98, 0.11);
    overflow: hidden;
    display: grid;
    align-items: stretch;
}

.auth-page .auth-grid {
    margin: 0 auto;
}

.split-login {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-panel {
    padding: clamp(24px, 4vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.auth-panel-shell {
    width: min(100%, 430px);
}

.auth-panel-shell-wide {
    width: min(100%, 580px);
}

.auth-kicker {
    display: inline-block;
    margin-bottom: 11px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef3ff;
    color: #2c4a80;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    line-height: 1.1;
}

.auth-panel p {
    margin: 0 0 16px;
    color: var(--text-soft);
}

.auth-form-card {
    box-shadow: var(--shadow-soft);
}

.auth-links {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.auth-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c4d3ee;
    border-radius: 999px;
    background: #f3f8ff;
    color: #22407b;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 7px 12px;
    transition: 0.18s ease;
}

.auth-link-pill:hover {
    background: #e9f1ff;
    border-color: #93acdf;
    color: #1a3364;
}

.auth-link-pill .material-symbols-rounded {
    font-size: 16px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.auth-actions {
    display: grid;
    gap: 10px;
}

.otp-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.otp-digit {
    width: 100%;
    height: 46px;
    border: 1px solid #cad6eb;
    border-radius: 10px;
    text-align: center;
    font-size: 1.08rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1a2c4f;
    background: #fff;
    outline: none;
}

.otp-digit:focus {
    border-color: #7e9de7;
    box-shadow: 0 0 0 3px rgba(76, 113, 219, 0.16);
}

.auth-simple .small {
    width: min(760px, 94vw);
}

.auth-image {
    position: relative;
    min-height: 520px;
    padding: 24px;
    background-color: #eff6ff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-origin: content-box;
    background-clip: content-box;
}

.auth-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 24, 58, 0.16), rgba(8, 24, 58, 0.02));
}

.auth-image-left {
    background-position: left center;
}

.auth-image-brand::after,
.auth-image-illustration::after {
    display: none;
}

.auth-image-brand {
    background-color: #edf6ff;
}

.auth-image-illustration {
    background-color: #f7fbff;
}

.login-reference-card {
    width: min(1320px, 92vw);
    min-height: min(820px, calc(100vh - 56px));
    padding: 24px;
    gap: 34px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
    overflow: visible;
}

body.login-auth-page {
    background: #f1f5f9;
}

.login-showcase {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border-radius: 16px;
    background-color: #0f172a;
    background-size: cover;
    background-position: center;
}

.login-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.78) 0%, rgba(37, 99, 235, 0.52) 55%, rgba(29, 78, 216, 0.45) 100%),
        linear-gradient(0deg, rgba(15, 23, 42, 0.28), transparent 42%);
}

.login-showcase-content {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100% - 56px));
    padding: clamp(28px, 4vw, 48px);
    color: #fff;
}

.login-showcase-content h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4.2vw, 4rem);
    line-height: 1.14;
    letter-spacing: 0;
}

.login-showcase-content p {
    margin: 14px 0 0;
    max-width: 440px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.02rem;
    font-weight: 650;
}

.login-form-panel {
    padding: clamp(28px, 5vw, 72px);
    background: #fff;
}

.login-panel-shell {
    width: min(100%, 520px);
}

.login-brand-lockup {
    margin-bottom: 28px;
}

.login-brand-lockup img {
    display: block;
    width: min(190px, 52vw);
    height: auto;
    object-fit: contain;
}

.login-panel-shell h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: clamp(1.8rem, 3.2vw, 2.45rem);
    line-height: 1.12;
}

.login-panel-shell > p {
    margin: 0 0 16px;
    max-width: 480px;
    color: #667085;
    font-size: 1.04rem;
    line-height: 1.65;
}

.login-panel-shell .login-trust-row {
    margin: 0 0 22px;
}

.login-form {
    display: grid;
    gap: 14px;
    padding-top: 26px;
    border-top: 1px solid #ececec;
}

.login-input-group {
    display: grid;
    gap: 7px;
}

.login-input-group label {
    color: #667085;
    font-size: 0.85rem;
    font-weight: 650;
}

.login-input-group input {
    width: 100%;
    height: 52px;
    border: 1px solid #e1e1e1;
    border-radius: 11px;
    background: #fff;
    color: #080808;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
    padding: 0 15px;
}

.login-input-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.login-reference-card .auth-links {
    justify-content: flex-end;
    margin: -2px 0 8px;
}

.login-forgot-link {
    color: #2d2826;
    font-size: 0.88rem;
    font-weight: 800;
}

.login-forgot-link:hover,
.login-switch a:hover {
    color: #2563eb;
}

.login-submit {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.login-submit:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}

.topic-multi-select {
    min-height: 110px;
}

.login-switch {
    margin: 8px 0 0;
    color: #667085;
    text-align: center;
    font-size: 0.95rem;
}

.login-switch a {
    color: #111;
    font-weight: 900;
}

/* Exam studio (Orivex-inspired) */
.exam-stage {
    position: relative;
}

.exam-stage.exam-studio {
    max-width: 1280px;
    margin: 0 auto;
}

/* ─── Pre-exam instructions gate ─── */
body.exam-preflight-mode .app-sidebar,
body.exam-preflight-mode .global-mobile-nav,
body.exam-preflight-mode .scroll-top-btn {
    display: none !important;
}

body.exam-preflight-mode .app-shell {
    grid-template-columns: 1fr;
}

body.exam-preflight-mode .app-main {
    padding: 16px 12px 28px;
    max-width: none;
}

.exam-preflight-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.exam-preflight-card {
    display: grid;
    gap: 16px;
    padding: 22px 20px 20px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.16), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 36px rgba(37, 99, 235, 0.1);
    position: relative;
    z-index: 2;
}

.exam-preflight-hero h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.2;
}

.exam-preflight-hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.45;
}

.exam-preflight-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.exam-preflight-stats > div {
    display: grid;
    gap: 4px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: #fff;
    text-align: center;
}

.exam-preflight-stats span {
    color: #3b82f6;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.exam-preflight-stats strong {
    color: var(--ink);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.exam-preflight-meta {
    display: grid;
    gap: 10px;
}

.exam-preflight-meta > div {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.exam-preflight-meta .material-symbols-rounded {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 22px;
}

.exam-preflight-meta strong {
    display: block;
    color: var(--ink);
    font-size: 0.9rem;
}

.exam-preflight-meta p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
}

.exam-preflight-rules {
    padding: 14px 16px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.exam-preflight-rules h2 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--primary-deep);
}

.exam-preflight-rules ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #1e3a5f;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
}

.exam-preflight-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--ink-soft);
    cursor: pointer;
}

.exam-preflight-check input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.exam-preflight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.exam-preflight-actions .btn {
    min-height: 48px;
    flex: 1 1 160px;
    justify-content: center;
}

.exam-preflight-actions .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.exam-preflight-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-align: center;
}

/* Fullscreen re-enter banner */
.exam-fs-banner {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 0 10px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.28);
    color: var(--primary-deep);
    font-size: 0.86rem;
    font-weight: 700;
}

.exam-fs-banner[hidden] {
    display: none !important;
}

.exam-fs-banner p {
    margin: 0;
}

.exam-fs-banner .material-symbols-rounded {
    font-size: 20px;
}

/* Immersive exam shell (native FS + mobile fallback) */
html.exam-immersive,
body.exam-immersive.exam-live-mode {
    background: var(--bg) !important;
}

body.exam-immersive.exam-live-mode .app-sidebar,
body.exam-immersive.exam-live-mode .global-mobile-nav,
body.exam-immersive.exam-live-mode .scroll-top-btn,
body.exam-immersive.exam-live-mode .sidebar-toggle {
    display: none !important;
}

body.exam-immersive.exam-live-mode .app-shell {
    grid-template-columns: 1fr !important;
    height: 100dvh;
    max-height: 100dvh;
}

body.exam-immersive.exam-live-mode .app-area {
    height: 100dvh;
    max-height: 100dvh;
}

body.exam-immersive.exam-live-mode .app-topbar {
    display: none !important;
}

body.exam-immersive.exam-live-mode .topbar-chip,
body.exam-immersive.exam-live-mode .notification-menu,
body.exam-immersive.exam-live-mode .topbar-search,
body.exam-immersive.exam-live-mode .sidebar-search {
    display: none !important;
}

body.exam-immersive.exam-live-mode .app-area {
    grid-template-rows: 1fr !important;
}

body.exam-immersive.exam-live-mode .app-main {
    padding: 6px 10px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: none;
    margin: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.exam-immersive.exam-live-mode .exam-sticky-strip {
    top: 0;
}

body.exam-immersive.exam-live-mode .exam-stage.exam-studio {
    max-width: none;
}

/* When browser is truly fullscreen, hide remaining chrome */
:fullscreen body .app-topbar,
:-webkit-full-screen body .app-topbar {
    display: none !important;
}

body:fullscreen .app-topbar,
body:-webkit-full-screen .app-topbar,
html:fullscreen .app-topbar,
html:-webkit-full-screen .app-topbar {
    display: none !important;
}

html:fullscreen .app-main,
html:-webkit-full-screen .app-main {
    padding-top: 10px !important;
}

@media (max-width: 640px) {
    .exam-preflight-stats {
        grid-template-columns: 1fr 1fr;
    }

    .exam-preflight-card {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .exam-preflight-actions {
        flex-direction: column-reverse;
    }

    .exam-preflight-actions .btn {
        width: 100%;
    }
}

.exam-stage::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.exam-studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    align-items: start;
}

/* Compact sticky Q# + timer — stays out of question body */
.exam-sticky-strip {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.exam-sticky-strip .exam-step-chip {
    min-height: 40px;
    flex: 0 1 auto;
    white-space: nowrap;
}

.exam-sticky-strip .timer {
    min-height: 40px;
    flex: 0 0 auto;
    margin-left: auto;
}

/* Title / meta card — scrolls away (not sticky) so questions stay visible */
.exam-top,
.exam-top-info {
    position: relative;
    top: auto;
    z-index: 2;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.exam-top-meta h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-top-meta h2::before {
    content: "";
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.exam-top-meta p,
.exam-top-meta-line {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.35;
}

.exam-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Keep exam content above watermark */
.exam-live-container,
.exam-stage .container,
.exam-sticky-strip,
.exam-top,
.question-card,
.exam-palette,
.exam-nav-bar,
.exam-progress-strip {
    position: relative;
    z-index: 5;
}

body.exam-mode .site-watermark-layer,
body.exam-mode .exam-watermark-layer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999 !important;
    pointer-events: none !important;
    opacity: var(--watermark-opacity, 0.22) !important;
    background-size: min(65vw, 480px) auto !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    display: block !important;
}

.timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--primary-deep);
    border-radius: 12px;
    background: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.18);
    padding: 8px 14px;
}

.timer .material-symbols-rounded {
    font-size: 20px;
}

.timer.is-warn {
    color: #b45309;
    background: var(--warning-soft);
    border-color: rgba(217, 119, 6, 0.28);
}

.timer.is-critical {
    color: #b91c1c;
    background: var(--danger-soft);
    border-color: rgba(220, 38, 38, 0.28);
    animation: timer-pulse 1s ease infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.question-stack {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.exam-progress-strip {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exam-progress-strip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-size: 0.8rem;
    font-weight: 800;
}

.exam-progress-strip strong {
    color: var(--primary-deep);
}

.exam-palette {
    position: sticky;
    top: 88px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 14px;
}

.exam-palette h3 {
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.exam-palette > p {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 0.75rem;
}

.exam-palette-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.exam-palette-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.15s var(--ease);
}

.exam-palette-btn:hover {
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--primary-deep);
}

.exam-palette-btn.is-answered {
    background: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.exam-palette-btn.is-flagged {
    background: #eef4ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.exam-palette-btn.is-current {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.exam-palette-legend {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.72rem;
    color: var(--text-soft);
    font-weight: 650;
}

.exam-palette-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-palette-legend i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #f8fafc;
    display: inline-block;
}

.exam-palette-legend .lg-answered { background: #ecfdf5; border-color: #86efac; }
.exam-palette-legend .lg-flagged { background: #eef4ff; border-color: #93c5fd; }
.exam-palette-legend .lg-current { outline: 2px solid var(--primary); }

.question-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 16px;
    scroll-margin-top: 100px;
}

.question-card.is-flagged {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.question-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.question-card h3 {
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.flag-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text-soft);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.flag-review-btn .material-symbols-rounded {
    font-size: 16px;
}

.flag-review-btn.is-on {
    background: #eef4ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.flag-review-btn.is-on .material-symbols-rounded {
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.question-media-wrap {
    margin: 0 0 12px;
}

.question-media {
    width: 100%;
    max-width: 460px;
    max-height: 260px;
    border-radius: 10px;
    border: 1px solid #dbe6f6;
    object-fit: contain;
    background: #f8fbff;
}

.option-grid {
    display: grid;
    gap: 10px;
}

.option-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.option-item:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #fff;
}

.option-item.is-selected,
.option-item:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.45);
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}

.option-item input {
    margin-top: 3px;
}

.option-item-body {
    display: grid;
    gap: 6px;
    width: 100%;
}

.option-item-text {
    color: #1e293b;
    font-weight: 650;
}

.option-media {
    width: 100%;
    max-width: 300px;
    max-height: 170px;
    border-radius: 8px;
    border: 1px solid #dbe6f6;
    object-fit: contain;
    background: #f8fbff;
}

.exam-submit-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.exam-submit-wrap .submit-hint {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 650;
}

/* Site-wide + exam watermark — ONE centered logo (not tiled) */
.site-watermark-layer,
.exam-watermark-layer,
.exam-security-watermark {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none !important;
    z-index: 990 !important;
    background-image: url('../img/watermark.png') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: min(54vw, 420px) auto !important;
    opacity: var(--watermark-opacity, 0.18) !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    display: block !important;
}

body.orivex-login-page .site-watermark-layer,
body.orivex-signup-page .site-watermark-layer,
body.orivex-forgot-page .site-watermark-layer,
body.orivex-admin-login-page .site-watermark-layer,
body.auth-page .site-watermark-layer {
    background-size: min(58vw, 380px) auto !important;
    opacity: var(--watermark-opacity, 0.22) !important;
}

body.exam-mode .site-watermark-layer,
body.exam-mode .exam-watermark-layer {
    z-index: 999 !important;
    background-size: min(65vw, 480px) auto !important;
    opacity: var(--watermark-opacity, 0.24) !important;
}

@media (max-width: 720px) {
    .site-watermark-layer,
    .exam-watermark-layer,
    .exam-security-watermark {
        background-size: min(78vw, 320px) auto !important;
        opacity: var(--watermark-opacity, 0.20) !important;
    }

    body.orivex-login-page .site-watermark-layer,
    body.auth-page .site-watermark-layer {
        background-size: min(80vw, 300px) auto !important;
        opacity: var(--watermark-opacity, 0.22) !important;
    }
}

@media (max-width: 430px) {
    .site-watermark-layer,
    .exam-watermark-layer,
    .exam-security-watermark {
        background-size: min(88vw, 270px) auto !important;
        opacity: var(--watermark-opacity, 0.22) !important;
    }
}
        opacity: var(--watermark-opacity, 0.20) !important;
    }
}

.screen-alert {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    background: #1f2937;
    color: #fff;
    border-radius: 10px;
    font-size: 0.84rem;
    padding: 9px 12px;
    opacity: 0;
    transform: translateY(12px);
    transition: 0.26s ease;
}

.screen-alert.is-on {
    opacity: 1;
    transform: translateY(0);
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 23, 51, 0.48);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.confirm-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%);
    width: min(460px, 92vw);
    background: #fff;
    border: 1px solid #d6e1f3;
    border-radius: 14px;
    box-shadow: 0 24px 52px rgba(15, 33, 76, 0.3);
    z-index: 995;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.confirm-modal h4 {
    margin: 0 0 8px;
    font-size: 1.04rem;
}

.confirm-modal p {
    margin: 0;
    color: #455778;
    font-size: 0.92rem;
}

.confirm-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.confirm-backdrop.is-open,
.confirm-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Utility */
.hero {
    border-radius: 20px;
    padding: 60px 0;
    color: #fff;
    background: linear-gradient(135deg, #1d2f79, #1a8fc1);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    align-items: center;
}

.tag {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.hero h1 {
    margin: 0 0 10px;
    line-height: 1.16;
    font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
    margin: 0;
    max-width: 620px;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-card {
    border-radius: 14px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-card h3 {
    margin-top: 0;
}

.hero-card ul {
    margin: 0;
    padding-left: 17px;
    display: grid;
    gap: 7px;
}

.side-link:focus-visible,
.topbar-user:focus-visible,
.notification-trigger:focus-visible,
.sidebar-toggle:focus-visible,
.btn:focus-visible,
.login-submit:focus-visible,
.login-forgot-link:focus-visible,
.login-switch a:focus-visible,
.quick-action:focus-visible,
.icon-action:focus-visible,
.option-item:focus-within {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.input-group input:focus-visible,
.input-group select:focus-visible,
.input-group textarea:focus-visible,
.login-input-group input:focus-visible,
.otp-digit:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 1320px) {
    .card-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-suggestion-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .compact-ai-grid {
        grid-template-columns: 1fr;
    }

    .learning-progress-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .erp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .communication-layout {
        grid-template-columns: 1fr;
    }

    .announcement-composer {
        padding-right: 0;
        padding-bottom: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .student-story-rail {
        grid-auto-columns: minmax(310px, 55%);
    }

    .app-shell {
        grid-template-columns: 250px 1fr;
    }

    .card-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-row.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-layout,
    .student-task-grid {
        grid-template-columns: 1fr;
    }

    .student-dashboard-grid,
    .dashboard-lower-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 310px);
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: 18px 0 40px rgba(10, 20, 45, 0.35);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(9, 18, 42, 0.35);
        z-index: 65;
    }

    .app-topbar {
        padding: 0 14px;
    }

    .topbar-chip {
        display: none;
    }

    .sidebar-toggle {
        display: grid;
    }

    .app-main {
        padding: 16px 12px 24px;
    }

    .role-student .app-main {
        padding-bottom: 82px;
    }

    .dashboard-head {
        flex-direction: column;
    }

    .dashboard-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .student-dashboard-hero,
    .continue-exam-body {
        grid-template-columns: 1fr;
    }

    .student-mobile-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        border: 1px solid #d8e3f6;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
        padding: 6px;
        backdrop-filter: blur(12px);
    }

    .student-mobile-nav a {
        display: grid;
        justify-items: center;
        gap: 2px;
        min-width: 0;
        color: #475467;
        font-size: 0.7rem;
        font-weight: 900;
    }

    .student-mobile-nav .material-symbols-rounded {
        color: var(--primary);
        font-size: 20px;
        line-height: 1;
    }

    .student-mobile-nav a.is-active {
        color: var(--primary-deep);
    }

    .exam-studio-layout {
        grid-template-columns: 1fr;
    }

    .exam-palette {
        position: static;
        order: -1;
    }

    .exam-palette-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .erp-command-banner,
    .composer-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .erp-banner-status {
        width: 100%;
    }

    .erp-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .student-story-rail {
        grid-auto-columns: minmax(290px, 88%);
    }

    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-summary-card {
        text-align: left;
    }

    .account-large-avatar {
        margin-left: 0;
    }
    .hero-grid,
    .split,
    .split-login,
    .card-grid.two,
    .card-grid.three,
    .chart-grid,
    .quick-links,
    .form-row.two,
    .form-row.three,
    .form-row.four {
        grid-template-columns: 1fr;
    }

    .footer-wrap {
        grid-template-columns: 1fr;
    }

    .cloudflare-trust-footer {
        width: min(210px, 100%);
    }

    .cloudflare-trust-auth {
        position: static;
        width: min(220px, calc(100% - 24px));
        margin: 0 auto 18px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .ai-suggestions-head {
        flex-direction: column;
    }

    .dashboard-summary-grid,
    .ops-grid,
    .quick-action-grid,
    .quick-action-grid.two-col {
        grid-template-columns: 1fr;
    }

    .learning-progress-strip,
    .exam-card-grid {
        grid-template-columns: 1fr;
    }

    .result-row-card {
        grid-template-columns: 1fr auto;
    }

    .result-row-card .pill {
        width: fit-content;
    }

    .ai-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .auth-image {
        min-height: 230px;
        padding: 16px;
        background-position: center;
    }

    .login-auth-page .auth-wrap {
        padding: 12px 0 18px;
    }

    .login-reference-card {
        width: min(96vw, 620px);
        min-height: auto;
        padding: 10px;
        gap: 0;
        border-radius: 14px;
    }

    .login-showcase {
        min-height: 220px;
        border-radius: 13px;
        background-position: center top;
    }

    .login-showcase-content {
        width: 100%;
        padding: 22px;
    }

    .login-showcase-content h1 {
        max-width: 340px;
        font-size: clamp(1.65rem, 7vw, 2.2rem);
    }

    .login-showcase-content p {
        max-width: 300px;
        font-size: 0.9rem;
    }

    .login-form-panel {
        padding: 22px 14px 14px;
    }

    .login-brand-lockup {
        margin-bottom: 14px;
    }

    .login-brand-lockup img {
        width: min(160px, 58vw);
    }

    .auth-panel-shell,
    .auth-panel-shell-wide {
        width: 100%;
    }

    .topbar-user .user-meta {
        display: none;
    }

    .account-chevron {
        display: none;
    }

    .account-dropdown {
        position: fixed;
        top: 68px;
        right: 12px;
        width: min(290px, calc(100vw - 24px));
    }

    .notification-dropdown {
        position: fixed;
        top: 68px;
        right: 12px;
    }

    .exam-top {
        position: sticky;
        top: 0;
        border-radius: 0 0 14px 14px;
        margin-inline: -12px;
    }

    .solution-item > summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .solution-answer-grid,
    .solution-option {
        grid-template-columns: 1fr;
    }

    .solution-option-key {
        width: 28px;
        height: 28px;
    }
}

/* --- UX polish layer (password, auth admin, density, global mobile nav) --- */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px !important;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.password-toggle:hover {
    background: #f1f5f9;
    color: var(--primary-deep);
}

.password-toggle .material-symbols-rounded {
    font-size: 20px;
}

.login-input-group.password-field label + .password-field-wrap,
.input-group.password-field .password-field-wrap {
    position: relative;
}

.password-field-wrap {
    position: relative;
}

.password-field-wrap input {
    width: 100%;
    padding-right: 48px;
}

.cloudflare-trust-auth {
    opacity: 0.55;
    transform: scale(0.92);
    transform-origin: bottom right;
}

.cloudflare-trust-sidebar {
    display: none;
}

.admin-auth-card {
    width: min(440px, 94vw);
    margin: 48px auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-hard);
    padding: clamp(24px, 4vw, 36px);
}

.admin-auth-card .login-brand-lockup {
    margin-bottom: 18px;
}

.admin-auth-card h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.admin-auth-card > p {
    margin: 0 0 20px;
    color: var(--text-soft);
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.workflow-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.workflow-step {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.workflow-step:hover {
    border-color: rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.workflow-step strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.workflow-step span {
    color: var(--text-soft);
    font-size: 0.76rem;
    line-height: 1.35;
}

.workflow-step .step-no {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.7rem;
    font-weight: 900;
}

.student-dashboard-hero {
    border-radius: 18px !important;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.12), transparent 44%),
        linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
    color: var(--ink) !important;
}

.student-kicker {
    color: var(--primary) !important;
}

.status-chip.live {
    background: #ecfdf5 !important;
    color: #047857 !important;
}

.status-chip.upcoming {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.continue-card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.alert {
    border-radius: 12px;
}

.alert[data-toasted="1"] {
    /* keep inline for no-js; toast still shows for progressive enhancement */
}

body.role-student .app-main {
    padding-bottom: 28px;
}

body.role-student.has-mobile-nav .app-main {
    padding-bottom: 88px;
}

.student-mobile-nav {
    display: none;
}

.app-toast-stack {
    z-index: 120;
}

.erp-kpi-card.is-blue .erp-kpi-icon { background: var(--info-soft); color: var(--info); }
.erp-kpi-card.is-green .erp-kpi-icon { background: var(--success-soft); color: var(--success); }
.erp-kpi-card.is-orange .erp-kpi-icon { background: var(--primary-soft); color: var(--primary-deep); }
.erp-kpi-card.is-red .erp-kpi-icon { background: var(--danger-soft); color: var(--danger); }

.erp-kpi-card a {
    color: var(--primary-deep);
}

.form-card.panel-card {
    border-radius: 14px;
}

.progress-rail span {
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-deep)) !important;
}

@media (max-width: 1100px) {
    .workflow-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    body.role-student .student-mobile-nav.global-mobile-nav {
        display: grid;
    }

    body.exam-mode .student-mobile-nav {
        display: none !important;
    }

    body.exam-mode .app-main {
        padding-bottom: 24px !important;
    }
}

@media (max-width: 720px) {
    .workflow-strip {
        grid-template-columns: 1fr;
    }

    .exam-palette-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .login-reference-card {
        min-height: auto;
        padding: 12px;
    }

    .login-showcase {
        min-height: 220px;
    }
}

/* --- Exam single-question mode --- */
.exam-single-stack {
    min-height: 280px;
}

.exam-single-stack .question-card[hidden] {
    display: none !important;
}

.exam-single-stack .question-card.is-active {
    animation: exam-card-in 0.28s var(--ease);
}

@keyframes exam-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.q-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    margin-right: 6px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.78rem;
    font-weight: 900;
    vertical-align: middle;
}

.exam-step-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.exam-step-chip strong {
    color: var(--text);
}

.exam-progress-bar-wrap {
    flex: 1 1 140px;
    min-width: 120px;
    display: flex;
    align-items: center;
}

.exam-progress-bar {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.exam-progress-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-deep));
    transition: width 0.25s var(--ease);
}

.exam-nav-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    position: sticky;
    bottom: 12px;
    z-index: 8;
}

.exam-nav-center {
    display: flex;
    justify-content: center;
    flex: 1 1 auto;
}

.exam-submit-secondary {
    margin-top: 12px;
}

body.exam-mode .app-main {
    padding-bottom: 24px;
}

/* --- Students admin tabs --- */
.students-workspace {
    display: grid;
    gap: 14px;
}

.students-workspace .dashboard-tab-list {
    margin-top: 0;
}

.students-workspace .dashboard-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
}

.students-workspace .dashboard-tab .material-symbols-rounded {
    font-size: 18px;
}

.students-workspace .dashboard-tab em {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475467;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.students-workspace .dashboard-tab.is-active em {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.dashboard-tab-panels {
    display: grid;
    gap: 14px;
}

.dashboard-tab-panel[hidden] {
    display: none !important;
}

.dashboard-tab-panel.is-active {
    display: block;
    animation: exam-card-in 0.24s var(--ease);
}

.students-create-card,
.students-filter-card,
.students-export-card {
    margin-bottom: 0;
}

.students-bulk-grid {
    align-items: start;
}

@media (max-width: 820px) {
    .students-workspace .dashboard-tab {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0 10px;
    }
}

/* --- Student home v2 — MAX multi-colour grade --- */
body.role-student.app-shell-page {
    background:
        radial-gradient(1000px 480px at -5% -15%, rgba(236, 72, 153, 0.22), transparent 52%),
        radial-gradient(900px 420px at 0% -10%, rgba(59, 130, 246, 0.28), transparent 55%),
        radial-gradient(800px 400px at 100% 0%, rgba(16, 185, 129, 0.22), transparent 50%),
        radial-gradient(700px 380px at 80% 100%, rgba(245, 158, 11, 0.2), transparent 48%),
        radial-gradient(600px 300px at 40% 60%, rgba(168, 85, 247, 0.12), transparent 45%),
        linear-gradient(160deg, #dbeafe 0%, #e0e7ff 35%, #fce7f3 70%, #ecfdf5 100%) !important;
}

body.role-student .app-area {
    background: transparent;
}

body.role-student .app-main {
    background: transparent;
}

body.role-student .app-sidebar {
    background:
        linear-gradient(180deg, #ffffff 0%, #eef2ff 50%, #ecfdf5 100%) !important;
    border-right: 1px solid rgba(99, 102, 241, 0.2) !important;
}

body.role-student .app-topbar {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(238, 242, 255, 0.96), rgba(236, 253, 245, 0.94)) !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.18) !important;
}

body.role-student .side-link.is-active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(168, 85, 247, 0.14)) !important;
    color: #4f46e5 !important;
}

body.role-student .global-mobile-nav {
    background: linear-gradient(180deg, #ffffff, #eef2ff) !important;
    border-top: 1px solid rgba(99, 102, 241, 0.22) !important;
    box-shadow: 0 -8px 28px rgba(79, 70, 229, 0.12) !important;
}

body.role-student .global-mobile-nav a.is-active {
    color: #7c3aed !important;
}

.student-dashboard-page.student-home-v2 {
    padding-bottom: 40px;
}

.student-home-stack {
    display: grid;
    gap: 22px;
}

/* ─── Strict module separation ─── */
.student-home-modules .sd-module {
    display: grid;
    gap: 14px;
    padding: 16px 16px 18px;
    border-radius: 22px;
    border: 2px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.72);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 14px 36px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.student-home-modules .sd-module-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 2px 2px;
}

.student-home-modules .sd-module-no {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.student-home-modules .sd-module-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4338ca;
    background: #e0e7ff;
}

.student-home-modules .sd-module-welcome {
    border-color: rgba(168, 85, 247, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 243, 255, 0.9));
}

.student-home-modules .sd-module-welcome .sd-module-tag {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
}

.student-home-modules .sd-module-performance {
    border-color: rgba(37, 99, 235, 0.35);
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(224, 231, 255, 0.88));
    padding-bottom: 16px;
}

.student-home-modules .sd-module-performance .sd-module-tag {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
}

.student-home-modules .sd-module-performance .student-command-banner {
    margin: 0;
}

.student-home-modules .sd-module-summary {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(220, 252, 231, 0.85));
}

.student-home-modules .sd-module-summary .sd-module-tag {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.student-home-modules .sd-module-summary .student-kpi-row {
    margin: 0;
}

.student-home-modules .sd-module-next {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.88));
}

.student-home-modules .sd-module-next .sd-module-tag {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
}

.student-home-modules .sd-module-next .student-next-action {
    margin: 0;
}

.student-home-modules .sd-module-notices {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(180deg, #fff, #eef2ff);
}

.student-home-modules .sd-module-notices .sd-module-tag {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.student-home-modules .sd-module-exams {
    border-color: rgba(37, 99, 235, 0.32);
    background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
}

.student-home-modules .sd-module-exams .sd-module-tag {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff;
}

.student-home-modules .sd-module-results {
    border-color: rgba(5, 150, 105, 0.32);
    background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%);
}

.student-home-modules .sd-module-results .sd-module-tag {
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
}

.student-home-modules .sd-module-schedule {
    border-color: rgba(14, 165, 233, 0.32);
    background: linear-gradient(180deg, #fff 0%, #e0f2fe 100%);
}

.student-home-modules .sd-module-schedule .sd-module-tag {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
}

.student-home-modules .sd-module-trends {
    border-color: rgba(6, 182, 212, 0.32);
    background: linear-gradient(180deg, #fff 0%, #cffafe 100%);
}

.student-home-modules .sd-module-trends .sd-module-tag {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
    color: #fff;
}

.student-home-modules .sd-module-guidance {
    border-color: rgba(234, 88, 12, 0.3);
    background: linear-gradient(180deg, #fff 0%, #ffedd5 100%);
}

.student-home-modules .sd-module-guidance .sd-module-tag {
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    color: #fff;
}

/* Nested student-module inside sd-module: remove double card chrome */
.student-home-modules .sd-module.student-module {
    /* keep sd-module chrome only */
}

.student-home-modules .sd-module .student-dash-head,
.student-home-modules .sd-module .student-command-banner,
.student-home-modules .sd-module .student-next-action {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.student-home-modules .student-home-layout {
    gap: 22px;
    margin-top: 0;
}

.student-home-modules .student-home-main,
.student-home-modules .student-home-side {
    gap: 22px;
}

/* Avoid double padding from old student-module when used with sd-module */
.student-home-modules .sd-module.student-module.student-exams-panel,
.student-home-modules .sd-module.student-module.student-results-panel,
.student-home-modules .sd-module.student-module.side-card {
    padding: 16px 16px 18px;
}

.student-home-modules .sd-module .student-module-head {
    margin-bottom: 4px;
}

.student-dash-head {
    margin-bottom: 0;
    align-items: flex-end;
    padding: 16px 18px;
    border-radius: 20px;
    border: 2px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(120deg, #2563eb, #a855f7, #ec4899, #10b981) border-box;
    box-shadow: 0 14px 36px rgba(168, 85, 247, 0.18);
    position: relative;
    z-index: 2;
}

.student-dash-head .page-eyebrow {
    color: #fff !important;
    background: linear-gradient(135deg, #ec4899, #a855f7, #2563eb);
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.3);
}

.student-dash-head h2 {
    color: #0f172a;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, #2563eb 0%, #a855f7 30%, #ec4899 55%, #f59e0b 78%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: saturate(1.2);
}

.student-dash-head p {
    max-width: 56ch;
    color: #475569;
    font-weight: 650;
}

.student-dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.student-dash-actions .btn-primary {
    background: linear-gradient(135deg, #ec4899, #a855f7 45%, #2563eb) !important;
    border-color: transparent !important;
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.35) !important;
    color: #fff !important;
}

.student-dash-actions .btn-outline:nth-of-type(1),
.student-dash-actions a.btn-outline:nth-child(2) {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
    border-color: #60a5fa !important;
    color: #1d4ed8 !important;
}

.student-dash-actions a.btn-outline:nth-child(3) {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border-color: #fbbf24 !important;
    color: #b45309 !important;
}

.student-dash-actions .btn-outline:hover {
    filter: brightness(1.04);
}

/* Command banner — neon multi-colour hero */
.student-command-banner {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
    gap: 16px;
    align-items: stretch;
    padding: 24px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 22px;
    background:
        radial-gradient(circle at 95% 8%, rgba(251, 191, 36, 0.55), transparent 32%),
        radial-gradient(circle at 8% 90%, rgba(52, 211, 153, 0.45), transparent 36%),
        radial-gradient(circle at 55% 100%, rgba(236, 72, 153, 0.4), transparent 38%),
        radial-gradient(circle at 70% 20%, rgba(167, 139, 250, 0.45), transparent 34%),
        linear-gradient(125deg, #1e3a8a 0%, #6d28d9 28%, #db2777 58%, #0891b2 100%);
    box-shadow:
        0 20px 48px rgba(109, 40, 217, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    position: relative;
    z-index: 2;
    color: #fff;
    overflow: hidden;
}

.student-command-banner::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.student-command-copy {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.student-command-copy .erp-banner-kicker {
    margin-bottom: 2px;
    color: #fde68a !important;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.student-command-copy h3 {
    margin: 0;
    color: #fff !important;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
}

.student-command-copy p {
    margin: 0 0 8px;
    max-width: 58ch;
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.student-command-copy .hero-progress {
    max-width: 360px;
    height: 10px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    overflow: hidden;
}

.student-command-copy .hero-progress span {
    background: linear-gradient(90deg, #fde047, #34d399, #38bdf8) !important;
    box-shadow: 0 0 12px rgba(253, 224, 71, 0.55);
}

.student-command-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: center;
    position: relative;
    z-index: 1;
}

.student-command-stats > div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.student-command-stats > div:nth-child(1) { background: rgba(56, 189, 248, 0.22); }
.student-command-stats > div:nth-child(2) { background: rgba(52, 211, 153, 0.22); }
.student-command-stats > div:nth-child(3) { background: rgba(251, 191, 36, 0.22); }
.student-command-stats > div:nth-child(4) { background: rgba(167, 139, 250, 0.24); }

.student-command-stats span {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.student-command-stats strong {
    color: #fff !important;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-shadow: 0 1px 8px rgba(15, 23, 42, 0.2);
}

/* KPI strip — bold saturated cards */
.student-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    z-index: 2;
}

.student-kpi-row article,
.student-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 16px 16px 16px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.student-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--primary);
}

.student-kpi.is-live {
    background: linear-gradient(145deg, #6ee7b7 0%, #34d399 45%, #10b981 100%);
    border-color: #059669;
    box-shadow: 0 14px 32px rgba(16, 185, 129, 0.35);
    color: #064e3b;
}
.student-kpi.is-upcoming {
    background: linear-gradient(145deg, #7dd3fc 0%, #38bdf8 45%, #2563eb 100%);
    border-color: #1d4ed8;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.35);
    color: #0c4a6e;
}
.student-kpi.is-done {
    background: linear-gradient(145deg, #c4b5fd 0%, #a78bfa 45%, #7c3aed 100%);
    border-color: #6d28d9;
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.35);
    color: #3b0764;
}
.student-kpi.is-pending {
    background: linear-gradient(145deg, #fde68a 0%, #fbbf24 45%, #f59e0b 100%);
    border-color: #d97706;
    box-shadow: 0 14px 32px rgba(245, 158, 11, 0.35);
    color: #78350f;
}

.student-kpi.is-live::before { background: #fff; width: 6px; }
.student-kpi.is-upcoming::before { background: #fff; width: 6px; }
.student-kpi.is-done::before { background: #fff; width: 6px; }
.student-kpi.is-pending::before { background: #fff; width: 6px; }

.student-kpi .material-symbols-rounded {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-deep);
    font-size: 24px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
}

.student-kpi.is-live .material-symbols-rounded {
    background: #fff;
    color: #047857;
}

.student-kpi.is-upcoming .material-symbols-rounded {
    background: #fff;
    color: #1d4ed8;
}

.student-kpi.is-done .material-symbols-rounded {
    background: #fff;
    color: #6d28d9;
}

.student-kpi.is-pending .material-symbols-rounded {
    background: #fff;
    color: #b45309;
}

.student-kpi strong {
    display: block;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.student-kpi small {
    color: rgba(15, 23, 42, 0.78);
    font-size: 0.78rem;
    font-weight: 800;
}

/* Up next CTA strip */
.student-next-action {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
    position: relative;
    z-index: 2;
}

.student-next-action.is-live {
    border-color: #10b981;
    border-width: 2px;
    background:
        radial-gradient(circle at 100% 0%, rgba(52, 211, 153, 0.45), transparent 38%),
        radial-gradient(circle at 0% 100%, rgba(251, 191, 36, 0.25), transparent 40%),
        linear-gradient(120deg, #ffffff 0%, #d1fae5 45%, #6ee7b7 160%);
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.28);
}

.student-next-action.is-upcoming {
    border-color: #3b82f6;
    border-width: 2px;
    background:
        radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.45), transparent 38%),
        radial-gradient(circle at 0% 100%, rgba(167, 139, 250, 0.28), transparent 40%),
        linear-gradient(120deg, #ffffff 0%, #dbeafe 45%, #93c5fd 160%);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.24);
}

.student-next-action .btn-primary {
    background: linear-gradient(135deg, #059669, #34d399 50%, #22d3ee) !important;
    border: 0 !important;
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.4) !important;
    color: #fff !important;
}

.student-next-action .next-label {
    color: #db2777 !important;
}

.student-next-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.student-next-main h3 {
    margin: 2px 0 4px;
    color: var(--ink);
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.student-next-main p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.next-label {
    margin: 0 !important;
    color: var(--primary) !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-next-meta {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.student-next-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.student-next-meta .material-symbols-rounded {
    font-size: 18px;
    color: var(--primary);
}

/* Shared module chrome */
.student-module {
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
    padding: 16px 18px;
    position: relative;
    z-index: 2;
}

.student-module.student-exams-panel {
    border-color: rgba(37, 99, 235, 0.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1), transparent 40%),
        #fff;
}

.student-module.student-results-panel {
    border-color: rgba(16, 185, 129, 0.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.1), transparent 40%),
        #fff;
}

.student-module.study-tips-card {
    border-color: rgba(245, 158, 11, 0.28);
    background:
        radial-gradient(circle at 100% 0%, rgba(251, 191, 36, 0.16), transparent 42%),
        #fff;
}

.student-module.student-chart-card {
    border-color: rgba(14, 165, 233, 0.24);
    background:
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.14), transparent 42%),
        #fff;
}

.student-dash-head,
.student-home-stack > .alert {
    position: relative;
    z-index: 2;
}

.student-module-head .module-label {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.12);
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
}

.student-exams-panel .module-label { color: #1d4ed8 !important; background: rgba(37, 99, 235, 0.12); }
.student-results-panel .module-label { color: #047857 !important; background: rgba(16, 185, 129, 0.12); }
.study-tips-card .module-label { color: #b45309 !important; background: rgba(245, 158, 11, 0.14); }
.student-chart-card .module-label { color: #0369a1 !important; background: rgba(14, 165, 233, 0.12); }

.student-module-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.student-module-head .module-label {
    display: block;
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.student-module-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

.student-module-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.student-notice-strip {
    display: grid;
    gap: 0;
}

.student-notice-head {
    align-items: flex-start;
}

.student-notice-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 28%);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.student-notice-card {
    display: grid;
    gap: 6px;
    align-content: start;
    min-height: 132px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}

.student-notice-card.is-important {
    border-color: rgba(37, 99, 235, 0.28);
    background: var(--info-soft);
}

.student-notice-card.is-critical {
    border-color: rgba(220, 38, 38, 0.28);
    background: var(--danger-soft);
}

.student-notice-card em {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--muted);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.student-notice-card.is-important em {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-deep);
}

.student-notice-card.is-critical em {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.student-notice-card strong {
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.3;
}

.student-notice-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-notice-card small {
    color: var(--muted-2);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-notice-card a {
    color: var(--primary-deep);
    font-size: 0.78rem;
    font-weight: 800;
}

/* Main + side layout */
.student-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 14px;
    align-items: start;
}

.student-home-main,
.student-home-side {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.student-exams-panel,
.student-results-panel,
.student-home-side .side-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.student-exams-head {
    margin-bottom: 14px;
}

.exam-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.exam-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #e0e7ff;
    color: #4338ca;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.exam-filter-chip[data-exam-filter="live"] { background: #d1fae5; color: #047857; }
.exam-filter-chip[data-exam-filter="upcoming"] { background: #dbeafe; color: #1d4ed8; }
.exam-filter-chip[data-exam-filter="completed"] { background: #ede9fe; color: #5b21b6; }

.exam-filter-chip:hover {
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.16);
    filter: brightness(1.03);
}

.exam-filter-chip em {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: inherit;
    font-style: normal;
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.exam-filter-chip.is-active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}

.exam-filter-chip.is-active[data-exam-filter="live"] {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.32);
}

.exam-filter-chip.is-active[data-exam-filter="upcoming"] {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.exam-filter-chip.is-active[data-exam-filter="completed"] {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.exam-filter-chip.is-active em {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Exam cards — vivid status grade */
.student-home-v2 .exam-card {
    min-height: 0;
    border: 2px solid #a78bfa;
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.12), transparent 40%),
        linear-gradient(180deg, #ffffff 0%, #ede9fe 160%);
    box-shadow: 0 12px 26px rgba(168, 85, 247, 0.16);
    padding: 14px;
    gap: 10px;
}

.student-home-v2 .exam-card:hover {
    transform: translateY(-3px);
    border-color: #c026d3;
    box-shadow: 0 18px 34px rgba(192, 38, 211, 0.22);
}

.student-home-v2 .exam-card.is-live {
    border-color: #10b981;
    background:
        radial-gradient(circle at 100% 0%, rgba(52, 211, 153, 0.35), transparent 42%),
        linear-gradient(165deg, #ffffff 0%, #d1fae5 50%, #6ee7b7 180%);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.28);
}

.student-home-v2 .exam-card.is-upcoming {
    border-color: #3b82f6;
    background:
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.35), transparent 42%),
        linear-gradient(165deg, #ffffff 0%, #dbeafe 50%, #7dd3fc 180%);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.student-home-v2 .exam-card.is-completed {
    border-color: #a855f7;
    background:
        radial-gradient(circle at 100% 0%, rgba(167, 139, 250, 0.35), transparent 42%),
        linear-gradient(165deg, #ffffff 0%, #ede9fe 50%, #d8b4fe 180%);
    box-shadow: 0 14px 30px rgba(168, 85, 247, 0.24);
}

.student-home-v2 .exam-card .btn-primary {
    background: linear-gradient(135deg, #db2777, #7c3aed) !important;
    border: 0 !important;
    box-shadow: 0 8px 18px rgba(219, 39, 119, 0.3) !important;
}

.student-home-v2 .exam-card.is-live .btn-primary {
    background: linear-gradient(135deg, #059669, #14b8a6) !important;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.32) !important;
}

.student-home-v2 .exam-card h3 {
    color: var(--ink);
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.student-home-v2 .exam-card-meta span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.student-home-v2 .exam-card-meta .material-symbols-rounded {
    color: var(--primary);
}

.student-home-v2 .exam-card-grid {
    gap: 10px;
}

.exam-type-pill {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.exam-best-note {
    display: block;
    margin-top: 4px;
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-weight: 800;
}

.student-home-v2 .progress-rail {
    background: #e2e8f0;
}

.student-home-v2 .progress-rail span {
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-deep));
}

/* Results list */
.student-result-list {
    display: grid;
    gap: 8px;
}

.student-result-list .result-row-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 2px solid #6ee7b7;
    border-radius: 14px;
    background: linear-gradient(90deg, #a7f3d0 0%, #ecfdf5 40%, #ffffff 100%);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.12);
}

.student-result-list .result-row-card:hover {
    border-color: #10b981;
    background: linear-gradient(90deg, #6ee7b7 0%, #d1fae5 45%, #fff 100%);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.22);
    transform: translateY(-2px);
}

.student-result-list .result-row-card .pill.ok {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #064e3b;
    border: 0;
}

.student-result-list .result-row-card .pill.warn {
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    color: #fff;
    border: 0;
}

.student-result-list .result-row-score em {
    color: #7c3aed;
    background: linear-gradient(90deg, #7c3aed, #db2777);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-row-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.result-row-main strong {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-row-main small,
.result-row-score small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.result-row-score {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.result-row-score em {
    font-style: normal;
    font-weight: 900;
    color: var(--primary-deep);
    font-variant-numeric: tabular-nums;
}

.result-row-arrow {
    color: var(--muted-2);
}

/* Side panels */
.student-home-side .side-card {
    padding: 16px 18px;
}

.student-timeline .timeline-item {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 10px 12px 10px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    margin-bottom: 8px;
}

.student-timeline .timeline-item:last-child {
    margin-bottom: 0;
}

.student-timeline .timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.student-timeline .timeline-item strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.student-timeline .timeline-item span {
    color: var(--primary-deep);
    font-size: 0.76rem;
    font-weight: 800;
}

.student-timeline .timeline-item small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.student-chart-wrap {
    height: 200px;
}

.study-tip-list {
    display: grid;
    gap: 8px;
}

.study-tip {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.study-tip > span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.study-tip strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.study-tip p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.study-tip.is-risk {
    background: var(--danger-soft);
    border-color: #fecaca;
}

.study-tip.is-success {
    background: var(--success-soft);
    border-color: #a7f3d0;
}

.study-tip.is-focus {
    background: var(--info-soft);
    border-color: #bfdbfe;
}

.exam-tip-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.exam-tip-link {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed var(--line);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.exam-tip-link:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: var(--info-soft);
}

.exam-tip-link strong {
    color: var(--ink);
    font-size: 0.82rem;
}

.exam-tip-link span {
    color: var(--muted);
    font-size: 0.76rem;
}

.exam-tip-link.is-risk { border-color: #fecaca; }
.exam-tip-link.is-success { border-color: #a7f3d0; }
.exam-tip-link.is-focus { border-color: #bfdbfe; }

.exam-filter-empty[hidden] {
    display: none !important;
}

/* Status chips — semantic, soft fills */
.student-home-v2 .status-chip.live {
    background: linear-gradient(135deg, #4ade80, #10b981, #14b8a6);
    color: #022c22;
    border: 0;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
    font-weight: 900;
}

.student-home-v2 .status-chip.upcoming {
    background: linear-gradient(135deg, #38bdf8, #3b82f6, #6366f1);
    color: #fff;
    border: 0;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
    font-weight: 900;
}

.student-home-v2 .status-chip.completed {
    background: linear-gradient(135deg, #e879f9, #a855f7, #7c3aed);
    color: #fff;
    border: 0;
    box-shadow: 0 6px 14px rgba(168, 85, 247, 0.4);
    font-weight: 900;
}

.student-home-v2 .status-chip.expired {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #1e293b;
    border: 0;
}

.student-home-v2 .exam-filter-chip {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.student-home-v2 .module-count {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    border: 0;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* Opaque card surfaces so single watermark stays behind content */
.student-home-v2 .exam-card,
.student-home-v2 .result-row-card,
.student-home-v2 .side-card,
.student-home-v2 .student-module,
.student-home-v2 .student-kpi,
.student-home-v2 .student-next-action,
.student-home-v2 .student-command-banner {
    isolation: isolate;
}

.student-home-v2 .progress-rail span {
    background: linear-gradient(90deg, #f59e0b, #10b981, #2563eb) !important;
}

.student-home-v2 .study-tip.is-risk {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-color: #f87171;
}

.student-home-v2 .study-tip.is-success {
    background: linear-gradient(135deg, #ecfdf5, #a7f3d0);
    border-color: #34d399;
}

.student-home-v2 .study-tip.is-focus {
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
    border-color: #60a5fa;
}

.student-home-v2 .student-timeline .timeline-item {
    background: linear-gradient(90deg, #eff6ff, #fff);
    border-color: #93c5fd;
}

.student-home-v2 .student-timeline .timeline-item::before {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.student-home-v2 .student-notice-card {
    background: linear-gradient(180deg, #fff 0%, #eef2ff 160%);
    border-color: #c7d2fe;
}

.student-home-v2 .student-notice-card.is-important {
    background: linear-gradient(180deg, #fff 0%, #dbeafe 160%);
    border-color: #60a5fa;
}

.student-home-v2 .student-notice-card.is-critical {
    background: linear-gradient(180deg, #fff 0%, #fee2e2 160%);
    border-color: #f87171;
}

/* Override Orivex flattening of student banner text colours */
body.role-student .student-command-copy h3,
body.role-student .student-command-stats strong {
    color: #fff !important;
}

body.role-student .student-command-copy p,
body.role-student .student-command-stats span {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.role-student .student-command-copy .erp-banner-kicker {
    color: #fde68a !important;
}

/* Legacy hero class keep-alive for other pages */
.student-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.12), transparent 44%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-soft);
}

.hero-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hero-stat-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.hero-stat-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-stat-grid strong {
    color: var(--ink);
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.hero-progress {
    height: 8px;
}

@media (max-width: 1100px) {
    .student-command-banner,
    .student-home-layout,
    .student-next-action,
    .student-home-hero {
        grid-template-columns: 1fr;
    }

    .student-dash-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .student-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-notice-rail {
        grid-auto-columns: minmax(220px, 80%);
    }

    .student-result-list .result-row-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .result-row-arrow {
        display: none;
    }

    .student-command-banner,
    .student-module,
    .student-home-side .side-card {
        padding: 14px;
    }

    .student-command-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .student-kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .student-dash-actions {
        width: 100%;
    }

    .student-dash-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* =============================================================================
   Premium UX polish layer — Success Space v3
   ============================================================================= */

.app-topbar.is-elevated {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-bottom-color: #dbe3ef;
}

.app-main {
    animation: page-enter 0.32s var(--ease);
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbars (WebKit) */
.app-sidebar,
.sidebar-nav,
.notification-list,
.table-wrap,
.announcement-admin-list {
    scrollbar-width: thin;
    scrollbar-color: #c5d0e0 transparent;
}

.app-sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.notification-list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.app-sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.notification-list::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: #c5d0e0;
    border-radius: 999px;
}

/* Sidebar search with shortcut chip */
.sidebar-search {
    position: relative;
}

.sidebar-search input {
    padding-right: 48px;
}

.sidebar-search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    font-family: inherit;
    line-height: 1;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.side-link {
    position: relative;
}

.side-link.is-active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.05));
}

.side-link.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
}

/* Topbar polish */
.topbar-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}

.topbar-search-btn:hover,
.topbar-search-btn:focus-visible {
    border-color: rgba(37, 99, 235, 0.35);
    background: var(--primary-soft);
    color: var(--primary-deep);
    outline: none;
}

.topbar-search-btn .material-symbols-rounded {
    font-size: 20px;
}

.topbar-search-btn kbd {
    margin-left: 4px;
    padding: 2px 6px;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    font-family: inherit;
}

.topbar-user:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: #fbfcfe;
}

.notification-trigger,
.topbar-user,
.sidebar-toggle {
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

/* Cards & interactive surfaces */
.erp-kpi-card,
.erp-module,
.metric-card,
.form-card,
.table-card,
.exam-card,
.workflow-step,
.action-card,
.student-notice-card,
.student-home-hero,
.student-command-banner,
.student-kpi,
.student-next-action,
.student-module {
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.erp-kpi-card:hover,
.exam-card:hover,
.workflow-step:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-mid);
    border-color: #d0dbeb;
}

.erp-kpi-card > a {
    transition: color 0.15s var(--ease);
}

.erp-kpi-card:hover > a {
    color: var(--primary);
}

.table-wrap {
    border-radius: inherit;
}

.table-wrap table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 var(--line);
}

/* Input polish */
.input-group input,
.input-group select,
.input-group textarea {
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.input-group input:hover,
.input-group select:hover,
.input-group textarea:hover {
    border-color: #c5d0e0;
}

.btn {
    transition: transform 0.16s var(--ease), filter 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), color 0.16s var(--ease);
}

.btn-primary:active,
.login-submit:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* Empty states */
.designed-empty {
    border: 1px dashed #c9d5e8;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fc 100%);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
}

.designed-empty .material-symbols-rounded {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 28px;
}

/* Command palette */
.cmdk-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s var(--ease), visibility 0.18s var(--ease);
}

.cmdk-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.cmdk {
    position: fixed;
    top: min(18vh, 140px);
    left: 50%;
    z-index: 210;
    width: min(560px, calc(100vw - 28px));
    transform: translate(-50%, -8px) scale(0.98);
    border: 1px solid #d7e0ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s var(--ease);
}

.cmdk.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.cmdk-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.cmdk-head .material-symbols-rounded {
    color: var(--primary);
    font-size: 22px;
}

.cmdk-head input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    outline: none;
}

.cmdk-head input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.cmdk-esc {
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 800;
}

.cmdk-list {
    max-height: min(52vh, 380px);
    overflow-y: auto;
    padding: 8px;
}

.cmdk-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.cmdk-item:hover,
.cmdk-item.is-active {
    background: var(--primary-soft);
}

.cmdk-item-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 18px;
}

.cmdk-item.is-active .cmdk-item-icon,
.cmdk-item:hover .cmdk-item-icon {
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary-deep);
}

.cmdk-item strong,
.cmdk-item small {
    display: block;
}

.cmdk-item strong {
    font-size: 0.88rem;
    font-weight: 750;
    color: #0f172a;
}

.cmdk-item small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.cmdk-item em {
    color: #94a3b8;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
}

.cmdk-empty {
    padding: 28px 16px;
    color: #94a3b8;
    text-align: center;
    font-size: 0.86rem;
}

.cmdk-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 650;
}

.cmdk-foot span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cmdk-foot kbd {
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    font-family: inherit;
}

/* Scroll to top */
.scroll-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid #d7e0ee;
    border-radius: 12px;
    background: #fff;
    color: var(--primary-deep);
    box-shadow: var(--shadow-mid);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s var(--ease), background 0.15s var(--ease);
}

.scroll-top-btn.is-on {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--primary-soft);
}

body.has-mobile-nav .scroll-top-btn {
    bottom: 78px;
}

/* Table live filter */
.table-live-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(240px, 100%);
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.table-live-filter .material-symbols-rounded {
    color: #94a3b8;
    font-size: 18px;
}

.table-live-filter input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.86rem;
    outline: none;
}

.table-row-hidden {
    display: none !important;
}

.table-filter-meta {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 650;
}

/* Confirm modal polish */
.confirm-backdrop {
    backdrop-filter: blur(4px);
}

.confirm-modal {
    border-radius: 16px !important;
    box-shadow: var(--shadow-hard) !important;
    padding: 22px !important;
}

.confirm-modal h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-modal.is-open {
    animation: modal-pop 0.2s var(--ease);
}

@keyframes modal-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Toast polish */
.app-toast {
    border-radius: 12px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16) !important;
}

/* Auth polish */
.login-showcase-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding-bottom: clamp(28px, 5vw, 48px);
}

.login-feature-list {
    display: grid;
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.login-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    font-weight: 650;
}

.login-feature-list .material-symbols-rounded {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 16px;
}

.login-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.login-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e6ebf3;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 750;
}

.login-trust-pill .material-symbols-rounded {
    font-size: 15px;
    color: var(--primary);
}

.auth-stepper {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
}

.auth-stepper span {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
}

.auth-stepper span.is-on {
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-deep));
}

.auth-meta-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #dbe7fb;
    border-radius: 12px;
    background: #f5f9ff;
    color: #3b4f74;
    font-size: 0.8rem;
    line-height: 1.4;
}

.auth-meta-note .material-symbols-rounded {
    color: var(--primary);
    font-size: 18px;
    margin-top: 1px;
}

/* Dashboard density */
.dashboard-head h2 {
    letter-spacing: -0.02em;
}

.workflow-step .step-no {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.status-dot.is-live {
    animation: pulse-dot 1.6s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.08); }
}

/* Admin mobile nav */
.admin-mobile-nav {
    display: none;
}

body.role-admin.has-mobile-nav .app-main {
    padding-bottom: 88px;
}

@media (max-width: 980px) {
    .topbar-search-btn span.topbar-search-label {
        display: none;
    }

    .topbar-search-btn {
        width: 40px;
        min-height: 40px;
        padding: 0;
        justify-content: center;
    }

    .topbar-search-btn kbd {
        display: none;
    }

    .sidebar-search-kbd {
        display: none;
    }

    body.role-admin .admin-mobile-nav.global-mobile-nav {
        display: grid;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 80;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        border: 1px solid #d8e3f6;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
        padding: 6px;
        backdrop-filter: blur(12px);
    }

    .admin-mobile-nav a {
        display: grid;
        justify-items: center;
        gap: 2px;
        min-width: 0;
        color: #475467;
        font-size: 0.62rem;
        font-weight: 900;
        padding: 6px 2px;
        border-radius: 10px;
    }

    .admin-mobile-nav .material-symbols-rounded {
        color: var(--primary);
        font-size: 20px;
        line-height: 1;
    }

    .admin-mobile-nav a.is-active {
        color: var(--primary-deep);
        background: var(--primary-soft);
    }

    body.role-admin.has-mobile-nav .scroll-top-btn {
        bottom: 78px;
    }
}

@media (max-width: 820px) {
    .login-feature-list {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-main,
    .erp-kpi-card,
    .exam-card,
    .workflow-step,
    .side-link,
    .cmdk,
    .scroll-top-btn,
    .status-dot.is-live {
        animation: none !important;
        transition: none !important;
    }
}

body.cmdk-open {
    overflow: hidden;
}

.table-toolbar .table-live-filter,
.panel-head .table-live-filter,
.erp-module-head .table-live-filter {
    margin-left: auto;
}

.panel-head,
.erp-module-head,
.table-toolbar {
    flex-wrap: wrap;
    gap: 10px;
}

.login-form {
    margin-top: 4px;
}

/* =============================================================================
   Page-dense polish — exams / bank / studio / ops
   ============================================================================= */

.page-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.page-kpi-strip article {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.page-kpi-strip article.is-live {
    border-color: rgba(5, 150, 105, 0.28);
    background: linear-gradient(180deg, #fff, #ecfdf5);
}

.page-kpi-strip small {
    display: block;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-kpi-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.workflow-strip-tight {
    margin-bottom: 16px;
}

.workflow-step.is-current {
    border-color: rgba(37, 99, 235, 0.4);
    background: linear-gradient(180deg, #fff, #eef4ff);
}

.page-context-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #d7e3f8;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fbff, #eef4ff);
}

.page-context-banner > .material-symbols-rounded {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: var(--primary-deep);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.page-context-banner strong,
.page-context-banner p {
    margin: 0;
}

.page-context-banner p {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.page-context-banner .dashboard-actions {
    margin-left: auto;
}

.form-section {
    padding: 4px 0 16px;
    border-bottom: 1px solid #edf0f5;
    margin-bottom: 16px;
}

.form-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 8px;
}

.form-section-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.form-section-head.compact-head {
    margin-bottom: 14px;
}

.form-section-head > .material-symbols-rounded {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 20px;
}

.form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.form-section-head p {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 0.76rem;
}

.policy-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.policy-chip {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.policy-chip:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #f5f9ff;
}

.policy-chip input {
    margin-top: 3px;
}

.policy-chip strong,
.policy-chip small {
    display: block;
}

.policy-chip strong {
    font-size: 0.86rem;
}

.policy-chip small {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
}

.form-sticky-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), #fff 40%);
    z-index: 2;
}

.table-submeta {
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
}

.table-datetime {
    font-size: 0.84rem;
    font-weight: 700;
}

tr.is-row-active {
    background: #f5f9ff;
}

.question-cell-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.35;
    font-size: 0.86rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
}

.meta-chip .material-symbols-rounded {
    font-size: 14px;
}

.option-key-pill {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.78rem;
    font-weight: 900;
}

.difficulty-pill {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: capitalize;
    background: #f1f5f9;
    color: #475569;
}

.difficulty-pill.is-easy { background: #ecfdf5; color: #047857; }
.difficulty-pill.is-medium { background: #eff6ff; color: #1d4ed8; }
.difficulty-pill.is-hard { background: #fef2f2; color: #b91c1c; }

.tool-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.tool-tab {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    padding: 9px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-tab .material-symbols-rounded {
    font-size: 18px;
}

.tool-tab.is-active {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.tool-panel[hidden] {
    display: none !important;
}

/* ─── Question workflow structured workspace ─── */
.page-questions .questions-workspace {
    display: grid;
    gap: 16px;
    margin-top: 4px;
}

.page-questions .questions-paper-card {
    margin-top: 0;
}

.page-questions .questions-paper-card .panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.page-questions .questions-paper-card .panel-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
}

.page-questions .id-pill {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.page-questions .marks-pill {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.page-questions .questions-pager {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.page-questions .questions-tools-card {
    display: grid;
    gap: 0;
    padding: 16px 18px 18px;
}

.page-questions .questions-tools-head {
    margin-bottom: 12px;
}

.page-questions .questions-tools-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.page-questions .questions-tools-head .form-help {
    margin: 4px 0 0;
}

.page-questions .questions-tool-tabs {
    width: 100%;
    margin-bottom: 14px;
}

.page-questions .questions-tool-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
    gap: 14px;
    align-items: start;
}

.page-questions .questions-tool-form,
.page-questions .questions-tool-aside {
    min-width: 0;
}

.page-questions .questions-tool-form--single {
    max-width: 960px;
}

.page-questions .tool-form-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
    margin-bottom: 12px;
}

.page-questions .tool-form-section:last-child {
    margin-bottom: 0;
}

.page-questions .tool-form-section h4 {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.page-questions .tool-form-section > .form-help {
    margin: -4px 0 0;
}

.page-questions .csv-columns-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-questions .csv-columns-box span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.page-questions .check-line {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 650;
}

.page-questions .check-line input {
    margin-top: 3px;
}

.page-questions .tool-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.page-questions .media-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.page-questions .option-composer-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.page-questions .option-composer-key {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.86rem;
    font-weight: 900;
}

.page-questions .option-composer-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 10px;
    min-width: 0;
}

.page-questions .compact-filter-row {
    gap: 10px;
}

.page-questions .topic-multi-select {
    min-height: 140px;
    background: #fff;
}

.page-questions .input-group input[type="file"] {
    padding: 8px 10px;
    background: #fff;
    font-size: 0.84rem;
}

.page-questions .tool-form-section .input-group textarea {
    min-height: 84px;
    background: #fff;
}

.page-questions .tool-form-section .input-group input,
.page-questions .tool-form-section .input-group select {
    background: #fff;
}

.page-questions .questions-tool-aside .designed-empty {
    margin-top: 4px;
}

@media (max-width: 980px) {
    .page-questions .questions-tool-grid {
        grid-template-columns: 1fr;
    }

    .page-questions .option-composer-fields {
        grid-template-columns: 1fr;
    }

    .page-questions .media-pair,
    .page-questions .compact-filter-row.form-row.four {
        grid-template-columns: 1fr 1fr;
    }

    .page-questions .dashboard-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-questions .dashboard-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .page-questions .dashboard-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .page-questions .exam-select-bar .form-row.two {
        grid-template-columns: 1fr;
    }

    .page-questions .exam-select-bar .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .page-questions .page-context-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px;
    }

    .page-questions .page-context-banner .dashboard-actions {
        margin-left: 0;
    }

    .page-questions .questions-paper-card .panel-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .page-questions .questions-paper-card .panel-head > div:first-child {
        min-width: 0;
    }

    .page-questions .questions-paper-card .dashboard-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .page-questions .questions-paper-card .dashboard-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }

    .page-questions .questions-paper-card .table-live-filter {
        margin-left: 0 !important;
        width: 100%;
        order: 5;
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 0 12px;
        border: 1.5px solid var(--line);
        border-radius: 12px;
        background: var(--bg-soft);
    }

    .page-questions .questions-paper-card .table-live-filter input {
        flex: 1;
        min-width: 0;
        border: 0;
        background: transparent;
        outline: none;
        font: inherit;
        font-size: 16px;
        min-height: 42px;
    }

    .page-questions .questions-paper-card .table-filter-meta {
        width: 100%;
        order: 6;
        margin-left: 0;
        font-size: 0.75rem;
    }

    .page-questions .questions-tools-card {
        padding: 14px;
    }
}

/* Paper questions table → mobile cards */
@media (max-width: 760px) {
    .page-questions .questions-paper-card {
        padding: 12px;
        overflow: hidden;
    }

    .page-questions .questions-paper-card .table-wrap {
        overflow: visible;
        margin: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .page-questions .questions-paper-card .table-wrap table {
        min-width: 0 !important;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .page-questions .questions-paper-card .table-wrap thead {
        display: none;
    }

    .page-questions .questions-paper-card .table-wrap tbody {
        display: grid;
        gap: 10px;
    }

    .page-questions .questions-paper-card .table-wrap tr.paper-q-row,
    .page-questions .questions-paper-card .table-wrap tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
        align-items: center;
        padding: 14px;
        margin: 0;
        border: 1px solid rgba(37, 99, 235, 0.14);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    }

    .page-questions .questions-paper-card .table-wrap td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 0.88rem !important;
        min-width: 0;
        width: 100%;
    }

    .page-questions .questions-paper-card .table-wrap td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    /* Full-width question stem */
    .page-questions .questions-paper-card .table-wrap td[data-label="Question"] {
        grid-column: 1 / -1;
        order: 1;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="ID"] {
        order: 2;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="Correct"] {
        order: 3;
        align-items: flex-end;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="Marks"] {
        order: 4;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="Version"] {
        order: 5;
        align-items: flex-end;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="Action"] {
        grid-column: 1 / -1;
        order: 6;
        padding-top: 8px !important;
        margin-top: 2px;
        border-top: 1px dashed var(--line) !important;
    }

    .page-questions .questions-paper-card .table-wrap td[data-label="Action"]::before {
        display: none;
    }

    .page-questions .questions-paper-card .question-cell-text {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
        font-weight: 650;
        color: var(--ink);
        font-size: 0.92rem;
    }

    .page-questions .questions-paper-card .table-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .page-questions .questions-paper-card .table-actions form {
        margin: 0;
        min-width: 0;
    }

    .page-questions .questions-paper-card .table-action {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--bg-soft);
        padding: 8px 10px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .page-questions .questions-paper-card .table-action.is-danger {
        background: #fef2f2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .page-questions .questions-paper-card .table-action span:not(.material-symbols-rounded) {
        display: inline;
    }

    .page-questions .questions-paper-card .id-pill {
        min-width: 44px;
        height: 32px;
    }

    .page-questions .questions-tool-tabs {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .page-questions .tool-tab {
        justify-content: center;
        min-height: 44px;
        width: 100%;
    }

    .page-questions .tool-form-section {
        padding: 12px;
    }

    .page-questions .tool-form-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    /* Empty state row */
    .page-questions .questions-paper-card .table-wrap tr:has(.designed-empty) {
        display: block;
        padding: 8px;
    }

    .page-questions .questions-paper-card .table-wrap tr:has(.designed-empty) td {
        display: block;
    }

    .page-questions .questions-paper-card .table-wrap tr:has(.designed-empty) td::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-questions .media-pair,
    .page-questions .compact-filter-row.form-row.four,
    .page-questions .form-row.four,
    .page-questions .form-row.two {
        grid-template-columns: 1fr;
    }

    .page-questions .option-composer-row {
        grid-template-columns: 1fr;
    }

    .page-questions .option-composer-key {
        width: 32px;
        height: 32px;
    }

    .page-questions .questions-tools-head h3 {
        font-size: 1rem;
    }

    .page-questions .section {
        padding-left: 0;
        padding-right: 0;
    }

    .page-questions .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

.exam-manual-form {
    max-width: 920px;
}

.stack-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stack-cards-grid > * {
    min-width: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    justify-content: flex-end;
}

.select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #475467;
}

.table-action.is-danger {
    color: #b91c1c;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.table-action.is-danger:hover {
    background: #fef2f2;
}

/* Exam studio denser polish */
body.exam-mode .app-main {
    padding-bottom: 28px;
}

.exam-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.exam-secure-badge .material-symbols-rounded {
    font-size: 15px;
}

.exam-kbd-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 650;
}

.exam-mobile-hint {
    display: none;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .exam-mobile-hint {
        display: block;
        margin: 8px 0 0;
        padding: 8px 10px;
        border-radius: 10px;
        background: var(--info-soft);
        border: 1px solid rgba(37, 99, 235, 0.16);
        color: var(--primary-deep);
        font-size: 0.78rem;
    }

    .desktop-only-hint {
        display: none !important;
    }
}

.exam-kbd-hint .material-symbols-rounded {
    font-size: 16px;
    color: var(--primary);
}

.exam-kbd-hint kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid #d7e0ee;
    border-radius: 5px;
    background: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    font-family: inherit;
}

.option-item-body {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
}

.option-key {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 900;
    border: 1px solid var(--line);
}

.option-item.is-selected .option-key {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--primary-deep);
}

.option-item-text {
    padding-top: 6px;
    line-height: 1.4;
}

.exam-palette-tip {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.35;
}

.exam-palette-tip .material-symbols-rounded {
    color: var(--primary);
    font-size: 18px;
}

.exam-palette-tip p {
    margin: 0;
}

.exam-studio-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
}

@media (max-width: 1100px) {
    .page-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stack-cards-grid {
        grid-template-columns: 1fr;
    }

    .policy-chip-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .page-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-context-banner {
        flex-wrap: wrap;
    }

    .page-context-banner .dashboard-actions {
        margin-left: 0;
        width: 100%;
    }

    .exam-kbd-hint {
        display: none;
    }
}

.option-item-body .option-media {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.option-item:has(input:checked) .option-key {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--primary-deep);
}

/* =============================================================================
   Device-responsive shell + mobile exam studio
   Phones · phablets · tablets · safe-area · touch targets
   ============================================================================= */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* iOS dynamic viewport height */
@supports (height: 100dvh) {
    .app-shell,
    .app-area,
    .app-sidebar {
        height: 100dvh;
        min-height: 100dvh;
    }
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
}

.app-main {
    min-width: 0;
    overflow-x: clip;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    min-width: 560px;
}

/* Cardized mobile tables skip forced min-width */
@media (max-width: 760px) {
    .page-questions .questions-paper-card .table-wrap table {
        min-width: 0;
    }
}

/* Touch-friendly controls */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .side-link,
    .tool-tab,
    .exam-filter-chip,
    .table-action,
    .flag-review-btn,
    .exam-palette-btn {
        min-height: 44px;
    }

    .option-item {
        min-height: 52px;
        padding: 14px 12px;
    }

    .input-group input,
    .input-group select,
    .input-group textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
        min-height: 44px;
    }
}

/* Tablets */
@media (max-width: 1100px) {
    .app-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .erp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .exam-studio-layout {
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 12px;
    }
}

/* Large phones / small tablets */
@media (max-width: 980px) {
    .app-main {
        padding: 14px 12px calc(88px + env(safe-area-inset-bottom, 0px));
    }

    body.exam-mode .app-main {
        padding: 10px 10px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .dashboard-actions .btn {
        min-height: 42px;
    }

    .global-mobile-nav {
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .page-context-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-context-banner .dashboard-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .exam-select-bar .form-row.two {
        grid-template-columns: 1fr;
    }

    .exam-select-bar .align-end {
        align-items: stretch;
    }

    .exam-select-bar .align-end .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile exam studio — fully writable on phones */
@media (max-width: 900px) {
    body.exam-mode .app-sidebar {
        display: none !important;
    }

    body.exam-mode .sidebar-toggle {
        display: none !important;
    }

    body.exam-mode .app-shell {
        grid-template-columns: 1fr;
    }

    body.exam-mode .app-topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        min-height: 52px;
        padding-left: 10px;
        padding-right: 10px;
    }

    body.exam-mode .topbar-chip,
    body.exam-mode .notification-menu,
    body.exam-mode .topbar-user span:not(.user-avatar) {
        display: none !important;
    }

    body.exam-mode .student-mobile-nav,
    body.exam-mode .admin-mobile-nav,
    body.exam-mode .global-mobile-nav {
        display: none !important;
    }

    body.exam-mode .scroll-top-btn {
        display: none !important;
    }

    .exam-stage.exam-studio {
        max-width: none;
        margin: 0;
        padding-bottom: 0;
    }

    .exam-stage .container,
    .exam-live-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Hide app chrome during live exam so questions get full height */
    body.exam-mode.exam-live-mode .app-topbar {
        display: none !important;
    }

    body.exam-mode.exam-live-mode .app-area {
        grid-template-rows: 1fr !important;
    }

    body.exam-mode.exam-live-mode .app-main {
        padding-top: 8px !important;
    }

    /* Only the slim strip sticks — title card does NOT */
    .exam-sticky-strip {
        top: 0;
        position: sticky;
        z-index: 50;
        margin: 0 0 8px;
        padding: 6px 8px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    }

    .exam-sticky-strip .timer {
        min-height: 38px;
        font-size: 0.92rem;
        padding: 6px 10px;
        flex: 0 0 auto;
    }

    .exam-sticky-strip .exam-step-chip {
        min-height: 38px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .exam-top,
    .exam-top-info {
        position: relative !important;
        top: auto !important;
        z-index: 2;
        margin-bottom: 8px;
        padding: 10px 12px;
        border-radius: 12px;
        gap: 8px;
    }

    .exam-top-meta h2 {
        font-size: 0.98rem;
        line-height: 1.25;
    }

    .exam-top-meta h2::before {
        width: 24px;
        height: 24px;
        border-radius: 7px;
    }

    .exam-top-meta p,
    .exam-top-meta-line {
        font-size: 0.72rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .exam-top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .timer {
        min-height: 40px;
        font-size: 0.95rem;
        padding: 6px 10px;
    }

    .exam-step-chip {
        min-height: 40px;
        font-size: 0.78rem;
    }

    .exam-kbd-hint {
        display: none !important;
    }

    .exam-progress-strip {
        gap: 6px;
        margin-top: 0;
        margin-bottom: 8px;
    }

    .exam-progress-strip span {
        min-height: 28px;
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .exam-studio-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .exam-main-column {
        order: 1;
        min-width: 0;
    }

    /* Question map BELOW the question so it never covers the stem */
    .exam-palette {
        order: 2;
        position: relative;
        top: auto;
        padding: 10px 12px;
        border-radius: 12px;
        margin-top: 4px;
    }

    .exam-palette h3 {
        font-size: 0.82rem;
        margin-bottom: 2px;
    }

    .exam-palette > p,
    .exam-palette-legend,
    .exam-palette-tip {
        display: none;
    }

    .exam-palette-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 6px;
        max-height: 96px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .exam-palette-btn {
        min-height: 40px;
        aspect-ratio: 1;
        border-radius: 10px;
        font-size: 0.8rem;
        touch-action: manipulation;
    }

    .question-stack {
        margin-top: 0;
    }

    .exam-single-stack {
        min-height: 0;
    }

    .question-card {
        padding: 14px 12px;
        border-radius: 12px;
        /* slim sticky strip only (~56px) */
        scroll-margin-top: 64px;
        background: #fff;
        z-index: 6;
    }

    .question-card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .question-card h3 {
        font-size: 1rem;
        line-height: 1.45;
        word-break: break-word;
        color: #0f172a;
        /* ensure full question text is never clipped */
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
        max-height: none;
    }

    .flag-review-btn {
        align-self: flex-start;
        min-height: 40px;
        padding: 8px 12px;
    }

    .exam-mobile-hint {
        margin: 0 0 8px;
        font-size: 0.74rem;
    }

    .question-media {
        max-width: 100%;
        max-height: 220px;
    }

    .option-grid {
        gap: 8px;
    }

    .option-item {
        min-height: 52px;
        padding: 12px;
        border-radius: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .option-item input {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .option-key {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .option-item-text {
        font-size: 0.95rem;
        line-height: 1.4;
        word-break: break-word;
    }

    .option-media {
        max-width: 100%;
        max-height: 160px;
    }

    /* Fixed bottom exam controls for thumb reach */
    .exam-nav-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        margin: 0;
        border-radius: 16px 16px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.12);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
    }

    .exam-nav-bar .btn {
        flex: 1 1 0;
        min-height: 46px;
        justify-content: center;
        font-size: 0.9rem;
        touch-action: manipulation;
    }

    .exam-nav-center {
        order: 3;
        flex: 1 1 100%;
    }

    .exam-nav-center .btn {
        width: 100%;
    }

    .exam-submit-secondary {
        margin-top: 10px;
        margin-bottom: 8px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .exam-submit-secondary .btn {
        width: 100%;
        min-height: 46px;
        justify-content: center;
    }

    .exam-submit-secondary .submit-hint {
        font-size: 0.76rem;
    }
}

/* Compact phones + iPhone widths */
@media (max-width: 480px) {
    .dashboard-head h2,
    .student-dash-head h2 {
        font-size: 1.28rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .dashboard-actions,
    .student-dash-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .dashboard-actions .btn,
    .student-dash-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .erp-kpi-grid,
    .student-kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .student-kpi {
        min-height: 72px;
        padding: 12px;
        gap: 8px;
    }

    .student-kpi .material-symbols-rounded {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .student-kpi strong {
        font-size: 1.15rem;
    }

    .student-kpi small {
        font-size: 0.68rem;
    }

    .student-command-banner {
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
    }

    .student-command-copy h3 {
        font-size: 1.05rem;
    }

    .student-command-copy p {
        font-size: 0.8rem;
    }

    .student-command-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .student-command-stats strong {
        font-size: 1.05rem;
    }

    .student-next-action {
        padding: 12px;
        gap: 10px;
    }

    .student-next-action .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .student-next-cta {
        width: 100%;
    }

    .student-next-meta {
        font-size: 0.74rem;
    }

    .timer {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .exam-palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
        max-height: 112px;
    }

    .exam-palette-btn {
        min-height: 36px;
        font-size: 0.74rem;
    }

    .exam-nav-bar .btn .material-symbols-rounded {
        font-size: 18px;
    }

    .table-wrap table {
        min-width: 480px;
    }

    .form-card,
    .panel-card,
    .table-card,
    .student-module {
        border-radius: 12px;
        padding: 12px;
    }

    .orivex-login-form-inner,
    .orivex-login-title {
        padding-left: 0;
    }

    .app-topbar {
        padding-left: 10px;
        padding-right: 10px;
        gap: 8px;
    }

    .topbar-search,
    .topbar-chip {
        display: none !important;
    }

    .global-mobile-nav a {
        font-size: 0.62rem;
        gap: 1px;
        padding: 4px 2px;
    }

    .global-mobile-nav .material-symbols-rounded {
        font-size: 20px;
    }

    body.role-student.has-mobile-nav .app-main,
    body.role-admin.has-mobile-nav .app-main {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
}

/* iPhone SE / narrow (≤390) */
@media (max-width: 390px) {
    .student-kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .student-command-stats {
        grid-template-columns: 1fr 1fr;
    }

    .exam-card-grid {
        grid-template-columns: 1fr !important;
    }

    .student-home-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Landscape phones during exam */
@media (max-width: 900px) and (orientation: landscape) {
    .exam-top,
    .exam-top-info {
        position: relative !important;
        top: auto !important;
    }

    .exam-sticky-strip {
        padding: 4px 8px;
    }

    .exam-sticky-strip .timer,
    .exam-sticky-strip .exam-step-chip {
        min-height: 34px;
        font-size: 0.8rem;
    }

    .exam-palette-grid {
        max-height: 64px;
        grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    }

    .exam-nav-bar {
        padding-top: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .exam-nav-bar .btn {
        min-height: 40px;
    }

    body.exam-mode .app-main {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Auth pages mobile padding */
@media (max-width: 720px) {
    body.orivex-login-page,
    body.orivex-signup-page,
    body.orivex-forgot-page,
    body.orivex-admin-login-page {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .orivex-login-grid {
        min-height: 100dvh;
    }

    .orivex-login-form-col {
        padding: 20px 16px 28px;
    }

    .orivex-login-submit {
        min-height: 48px;
        width: 100%;
    }

    .orivex-input-wrap input {
        font-size: 16px;
        min-height: 48px;
    }
}

/* Prevent horizontal drag from fixed UI */
body.exam-mode {
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

body.exam-mode .question-card,
body.exam-mode .option-item {
    -webkit-user-select: none;
    user-select: none;
}

body.exam-mode .question-card h3,
body.exam-mode .option-item-text {
    -webkit-user-select: text;
    user-select: text;
}

/* =============================================================================
   iPhone / iOS Safari — force reliable responsive shell (all versions)
   Fixes: clipped modules, horizontal scroll, sticky cover, bottom-nav overlap
   ============================================================================= */

/* Detect iOS touch + small screens aggressively */
@supports (-webkit-touch-callout: none) {
    html {
        height: -webkit-fill-available;
    }

    body.app-shell-page {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: -webkit-fill-available;
        overflow: hidden;
        overscroll-behavior: none;
    }

    body.app-shell-page .app-shell,
    body.app-shell-page .app-area {
        height: 100%;
        max-height: -webkit-fill-available;
        min-height: 0;
    }

    body.app-shell-page .app-main {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.app-shell-page.exam-live-mode .app-main,
    body.app-shell-page.exam-mode .app-main {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.app-shell-page.exam-live-mode .app-topbar {
        display: none !important;
    }
}

@media (max-width: 980px) {
    /* Kill horizontal page scroll on phones */
    html,
    body,
    .app-shell,
    .app-area,
    .app-main,
    .container,
    .section,
    .student-home-stack,
    .questions-workspace {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .app-main .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    .app-main .section {
        padding: 0 0 12px !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Student dashboard modules — full-width single-column cards */
    .student-home-modules .sd-module {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 12px !important;
        border-radius: 16px !important;
        overflow: hidden;
    }

    .student-home-stack {
        gap: 14px !important;
        width: 100%;
        box-sizing: border-box;
        padding: 0 2px;
    }

    .student-dash-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        align-items: start !important;
        width: 100%;
        box-sizing: border-box;
        padding: 12px !important;
    }

    .student-dash-head h2 {
        font-size: 1.35rem !important;
        line-height: 1.2 !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Fix gradient text clipping on iOS */
    .student-dash-head h2 {
        -webkit-text-fill-color: #1d4ed8;
        background: none;
        color: #1d4ed8;
    }

    .student-dash-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .student-dash-actions .btn {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
        box-sizing: border-box;
    }

    .student-command-banner {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 14px !important;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .student-command-copy h3 {
        font-size: 1.1rem !important;
        line-height: 1.25 !important;
        word-break: break-word;
    }

    .student-command-copy p {
        font-size: 0.82rem !important;
    }

    .student-command-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .student-kpi-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100%;
    }

    .student-kpi {
        min-height: 76px !important;
        padding: 10px !important;
        gap: 8px !important;
        width: 100%;
        box-sizing: border-box;
    }

    .student-kpi .material-symbols-rounded {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }

    .student-kpi strong {
        font-size: 1.2rem !important;
    }

    .student-kpi small {
        font-size: 0.68rem !important;
        line-height: 1.2;
    }

    .student-next-action {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
        width: 100%;
        box-sizing: border-box;
    }

    .student-next-cta,
    .student-next-cta .btn {
        width: 100% !important;
    }

    .student-next-cta .btn {
        min-height: 48px !important;
        justify-content: center !important;
    }

    .student-home-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100%;
    }

    .student-home-main,
    .student-home-side {
        display: grid !important;
        gap: 14px !important;
        width: 100%;
        min-width: 0;
    }

    .exam-card-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100%;
    }

    .student-home-v2 .exam-card {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }

    .exam-filter-chips {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100%;
    }

    .exam-filter-chip {
        justify-content: center !important;
        width: 100%;
        min-height: 42px !important;
        box-sizing: border-box;
    }

    .student-module-head,
    .student-exams-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .student-result-list .result-row-card {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        gap: 8px !important;
        width: 100%;
        box-sizing: border-box;
    }

    .result-row-arrow {
        display: none !important;
    }

    .student-notice-rail {
        grid-auto-columns: minmax(78%, 78%) !important;
        width: 100%;
    }

    /* Bottom mobile nav safe for all iPhones incl. home indicator */
    .global-mobile-nav {
        left: 8px !important;
        right: 8px !important;
        bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
        z-index: 90 !important;
        box-sizing: border-box;
    }

    /* Forms / admin tables on phone */
    .form-row.two,
    .form-row.three,
    .form-row.four,
    .page-kpi-strip,
    .erp-kpi-grid,
    .erp-dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dashboard-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .dashboard-actions .btn {
        width: 100% !important;
        min-height: 46px !important;
        justify-content: center !important;
    }

    .table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .input-group input,
    .input-group select,
    .input-group textarea,
    .orivex-input-wrap input {
        font-size: 16px !important; /* prevent iOS focus zoom */
        min-height: 44px;
    }

    /* Login / auth full width */
    .orivex-login-form-col,
    .orivex-login-form-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box;
    }
}

/* Extra-narrow iPhones (SE / Mini) */
@media (max-width: 390px) {
    .student-kpi-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .student-command-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .student-dash-head h2 {
        font-size: 1.2rem !important;
    }

    .sd-module-bar {
        flex-wrap: wrap;
    }
}

/* Live exam on iPhone — question never under chrome */
@media (max-width: 980px) {
    body.exam-mode .exam-sticky-strip {
        position: sticky !important;
        top: 0 !important;
        z-index: 60 !important;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px !important;
    }

    body.exam-mode .exam-top,
    body.exam-mode .exam-top-info {
        position: static !important;
        width: 100%;
        box-sizing: border-box;
    }

    body.exam-mode .question-card {
        position: relative;
        z-index: 5;
        width: 100%;
        box-sizing: border-box;
        overflow: visible !important;
        scroll-margin-top: 58px !important;
    }

    body.exam-mode .question-card h3 {
        overflow: visible !important;
        display: block !important;
        white-space: normal !important;
        word-break: break-word !important;
        -webkit-line-clamp: unset !important;
        max-height: none !important;
    }

    body.exam-mode .exam-palette {
        position: static !important;
        order: 3 !important;
        width: 100%;
        box-sizing: border-box;
    }

    body.exam-mode .exam-main-column {
        order: 1 !important;
        width: 100%;
        min-width: 0;
    }

    body.exam-mode .exam-nav-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 100 !important;
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.exam-mode .site-watermark-layer,
    body.exam-mode .exam-watermark-layer {
        opacity: var(--watermark-opacity, 0.20) !important;
        z-index: 999 !important;
        background-size: min(80vw, 320px) auto !important;
        pointer-events: none !important;
        display: block !important;
    }
}

.student-standalone-page .student-module {
    margin-top: 16px;
}

.student-standalone-page .student-exams-head,
.student-standalone-page .student-module-head {
    align-items: flex-start;
}

.student-standalone-page .exam-filter-chips {
    margin-top: 4px;
}

@media (max-width: 720px) {
    .student-standalone-page .toggle-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .student-standalone-page .toggle-row .btn {
        width: 100%;
        justify-content: center;
    }
}

.orivex-profile-wrap {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 1120px;
}

.student-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    color: #e8eefc;
    background:
        radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.22), transparent 28%),
        radial-gradient(circle at 8% 86%, rgba(167, 139, 250, 0.2), transparent 26%),
        linear-gradient(135deg, #0b1220 0%, #15233d 52%, #1e3a5f 100%);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.student-hero-glow {
    position: absolute;
    inset: auto -40px -80px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 68%);
    pointer-events: none;
}

.student-hero-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 22px;
    padding: 28px 28px 20px;
}

.student-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #9fb3d9;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.16);
}

.student-hero-copy h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.student-hero-copy h2 em {
    font-style: normal;
    color: #93c5fd;
}

.student-hero-lead {
    max-width: 42ch;
    margin: 10px 0 0;
    color: #c5d4ee;
    font-size: 0.98rem;
    line-height: 1.5;
}

.student-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.student-hero-chips li {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
}

.student-hero-chips span {
    color: #93a4c3;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.student-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.student-hero-actions .btn-primary {
    background: #fff !important;
    border-color: #fff !important;
    color: #0f172a !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2) !important;
}

.student-hero-actions .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-weight: 700;
    text-decoration: none;
}

.student-hero-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.student-hero-panel {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(8, 15, 30, 0.35);
    backdrop-filter: blur(10px);
}

.student-hero-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-hero-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
}

.student-hero-identity strong {
    display: block;
    color: #fff;
    font-size: 0.98rem;
}

.student-hero-identity small {
    color: #9db0d0;
    font-size: 0.78rem;
    font-weight: 700;
}

.student-hero-meter-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: #9db0d0;
    font-size: 0.76rem;
    font-weight: 700;
}

.student-hero-meter-top strong {
    color: #fff;
    font-size: 1.05rem;
}

.student-hero .progress-rail {
    background: rgba(255, 255, 255, 0.12);
}

.student-hero .progress-rail span {
    background: linear-gradient(90deg, #60a5fa, #34d399);
}

.student-hero-next {
    display: grid;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.student-hero-next span {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.16);
    color: #6ee7b7;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.student-hero-next strong {
    color: #fff;
    font-size: 0.92rem;
}

.student-hero-next small {
    color: #9db0d0;
}

.student-hero-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.16);
}

.student-hero-stats > div {
    padding: 14px 18px 16px;
}

.student-hero-stats > div + div {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.student-hero-stats dt {
    margin: 0 0 4px;
    color: #93a4c3;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-hero-stats dd {
    margin: 0;
    color: #fff;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

@media (max-width: 860px) {
    .student-hero-main {
        grid-template-columns: 1fr;
        padding: 22px 18px 16px;
    }

    .student-hero-stats {
        grid-template-columns: 1fr 1fr;
    }

    .student-hero-stats > div:nth-child(3),
    .student-hero-stats > div:nth-child(4) {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .student-hero-stats > div:nth-child(odd) {
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .student-hero {
        border-radius: 22px;
    }

    .student-hero-actions,
    .student-hero-actions .btn,
    .student-hero-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }
}
