:root {
    color-scheme: light;
    --nx-font-ui: "SF Pro Text", "SF Pro Display", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --nx-font-title: "SF Pro Display", "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --nx-bg: #f3f5fa;
    --nx-bg-deep: #e8edf6;
    --nx-surface: rgba(255, 255, 255, 0.9);
    --nx-surface-soft: rgba(247, 250, 255, 0.86);
    --nx-line: rgba(146, 161, 188, 0.36);
    --nx-text: #121828;
    --nx-muted: #5b6678;
    --nx-brand: #0a69ff;
    --nx-brand-strong: #0a4db5;
    --nx-accent: #00a28f;
    --nx-success: #0f8f63;
    --nx-warn: #b98105;
    --nx-danger: #c32828;
    --nx-radius: 16px;
    --nx-radius-sm: 10px;
    --nx-shadow-soft: 0 12px 28px rgba(15, 23, 40, 0.1);
    --nx-shadow-strong: 0 20px 56px rgba(15, 23, 40, 0.14);
    --nx-fast: 150ms ease;
    --nx-base: 220ms ease;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 18px;
    --text-xl: 21px;
    --text-2xl: 26px;
    --text-3xl: 32px;
    --text-4xl: 40px;
    --text-6xl: 56px;
    --leading-tight: 1.15;
    --leading-relaxed: 1.6;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
    --shadow-sm: 0 6px 14px rgba(15, 23, 40, 0.08);
    --shadow-md: 0 12px 24px rgba(15, 23, 40, 0.11);
    --shadow-lg: 0 18px 34px rgba(15, 23, 40, 0.13);
    --shadow-xl: 0 28px 58px rgba(15, 23, 40, 0.16);
    --transition-fast: var(--nx-fast);
    --transition-base: var(--nx-base);
    --color-bg-primary: #fff;
    --color-bg-secondary: #eceff6;
    --color-text-primary: var(--nx-text);
    --color-text-secondary: var(--nx-muted);
    --color-text-tertiary: #788397;
    --color-border-light: var(--nx-line);
    --color-border-medium: rgba(118, 135, 164, 0.45);
    --color-primary-300: rgba(10, 105, 255, 0.36);
    --color-primary-500: var(--nx-brand);
    --color-primary-600: var(--nx-brand-strong);
    --color-primary-700: #063d96;
    --color-success-600: var(--nx-success);
    --color-success-800: #0a6547;
    --color-error-600: var(--nx-danger);
    --color-error-800: #8f1d1d;
    --color-neutral-900: #101625;
    --gradient-primary: linear-gradient(135deg, #0a69ff 0%, #33a6ff 100%);
    --gradient-accent: linear-gradient(135deg, #009a88 0%, #11bca3 100%);
    --gradient-premium: linear-gradient(135deg, rgba(10, 105, 255, 0.1) 0%, rgba(17, 188, 163, 0.1) 100%);
    --nx-navy-950: #050b1a;
    --nx-navy-900: #0a1327;
    --nx-navy-860: #111f3d;
    --nx-electric-500: #2f8cff;
    --nx-electric-400: #58a7ff;
    --nx-glass-light: rgba(255, 255, 255, 0.72);
    --nx-glass-dark: rgba(14, 24, 48, 0.68);
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --nx-bg: #070f20;
    --nx-bg-deep: #050a16;
    --nx-surface: rgba(15, 25, 46, 0.88);
    --nx-surface-soft: rgba(18, 31, 57, 0.84);
    --nx-line: rgba(120, 145, 190, 0.26);
    --nx-text: #e7eefb;
    --nx-muted: #9aabcb;
    --nx-brand: #2f8cff;
    --nx-brand-strong: #58a7ff;
    --nx-accent: #17bfa9;
    --color-bg-primary: #111e39;
    --color-bg-secondary: #0d182f;
    --color-text-primary: #e7eefb;
    --color-text-secondary: #9aabcb;
    --color-border-light: rgba(120, 145, 190, 0.28);
    --color-border-medium: rgba(120, 145, 190, 0.42);
    --gradient-primary: linear-gradient(135deg, #2f8cff 0%, #58a7ff 100%);
    --gradient-accent: linear-gradient(135deg, #129d8a 0%, #19ccb2 100%);
    --gradient-premium: linear-gradient(135deg, rgba(47, 140, 255, 0.2) 0%, rgba(23, 191, 169, 0.18) 100%);
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: var(--nx-font-ui);
    color: var(--nx-text);
    line-height: 1.56;
    letter-spacing: 0.01em;
    background:
        radial-gradient(circle at 12% -10%, rgba(10, 105, 255, 0.16), transparent 42%),
        radial-gradient(circle at 95% 0%, rgba(0, 162, 143, 0.14), transparent 36%),
        linear-gradient(180deg, #eef2f9 0%, var(--nx-bg) 45%, var(--nx-bg-deep) 100%);
    overflow-x: clip;
    transition: background 220ms ease, color 180ms ease;
}

body[data-theme="dark"] {
    background:
        radial-gradient(circle at 12% -12%, rgba(47, 140, 255, 0.22), transparent 44%),
        radial-gradient(circle at 94% 0%, rgba(23, 191, 169, 0.16), transparent 36%),
        linear-gradient(180deg, #09122a 0%, var(--nx-bg) 45%, var(--nx-bg-deep) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.32) 0, rgba(255, 255, 255, 0.32) 1px, transparent 1px, transparent 24px);
    opacity: 0.34;
}

body[data-theme="dark"]::before {
    background: repeating-linear-gradient(120deg, rgba(102, 133, 191, 0.08) 0, rgba(102, 133, 191, 0.08) 1px, transparent 1px, transparent 24px);
    opacity: 0.48;
}

main.admin-content > *,
.teacher-main > *,
.student-main > *,
.parent-main > *,
.hub-section > *,
.teacher-section > *,
.student-section > *,
.parent-section > *,
.cards > *,
.content-grid > *,
.hub-quick-grid > *,
.nx-grid > * {
    min-width: 0;
}

a {
    color: var(--nx-brand-strong);
    text-decoration: none;
    transition: color var(--nx-fast);
}

a:hover {
    color: var(--nx-brand);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 10px;
    font-family: var(--nx-font-title);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(26px, 2.6vw, 40px);
}

h2 {
    font-size: clamp(21px, 2vw, 31px);
}

h3 {
    font-size: clamp(17px, 1.5vw, 23px);
}

p {
    margin: 0 0 12px;
    color: var(--nx-muted);
}

img {
    display: block;
    max-width: 100%;
}

input,
select,
textarea {
    max-width: 100%;
}

ul,
ol {
    margin: 0;
    padding-left: 20px;
}

li {
    margin-bottom: 6px;
}

code,
pre {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

:focus-visible {
    outline: 3px solid rgba(10, 105, 255, 0.22);
    outline-offset: 2px;
}

.text-muted {
    color: var(--nx-muted) !important;
}

.u-mt-8 {
    margin-top: 8px !important;
}

.u-mt-12 {
    margin-top: 12px !important;
}

.u-ml-8 {
    margin-left: 8px !important;
}

.u-ml-auto {
    margin-left: auto !important;
}

.u-inline {
    display: inline-flex !important;
}

.u-nowrap {
    white-space: nowrap !important;
}

.u-m-0 {
    margin: 0 !important;
}

.u-m0-lh-155 {
    margin: 0 !important;
    line-height: 1.55 !important;
}

.u-mt-10 {
    margin-top: 10px !important;
}

.u-mt-16 {
    margin-top: 16px !important;
}

.u-mt-n6 {
    margin-top: -6px !important;
}

.u-mt8 {
    margin-top: 8px !important;
}

.u-mt8-indent {
    margin: 8px 0 0 18px !important;
}

.u-mb-0 {
    margin-bottom: 0 !important;
}

.u-mb-8 {
    margin: 0 0 8px !important;
}

.u-mb-12 {
    margin-bottom: 12px !important;
}

.u-mx-6 {
    margin-left: 6px !important;
    margin-right: 6px !important;
}

.u-my-12 {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

.u-items-start {
    align-items: flex-start !important;
}

.u-panel-soft {
    border: 1px solid #dbe4f0 !important;
    border-radius: 12px !important;
    padding: 12px !important;
    background: #fff !important;
}

.u-block-muted {
    display: block !important;
    color: #64748b !important;
}

.u-list-reset-8 {
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
}

.u-list-reset-10 {
    margin: 0 0 10px !important;
    padding: 0 !important;
    border: 0 !important;
}

.u-list-indent {
    margin: 0 !important;
    padding-left: 18px !important;
}

.u-list-indent-8 {
    margin: 0 0 8px !important;
    padding-left: 18px !important;
}

.u-bb-0 {
    border-bottom: 0 !important;
}

.u-cursor-pointer {
    cursor: pointer !important;
}

.u-box-top-14 {
    margin: 14px 0 0 !important;
    padding: 14px !important;
}

.u-box-top-14-sm {
    margin: 10px 0 0 !important;
    padding: 14px !important;
}

.u-flex-wrap-gap-8-mt12 {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 12px !important;
}

.u-block-mt12 {
    display: block !important;
    margin-top: 12px !important;
}

.u-box-border-10 {
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
}

.u-box-border-12 {
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
}

.u-ctl-90 {
    width: 90px !important;
    min-width: 90px !important;
    height: 34px !important;
}

.u-ctl-92 {
    width: 92px !important;
    min-width: 92px !important;
    height: 34px !important;
}

.u-ctl-96 {
    width: 96px !important;
    min-width: 96px !important;
    height: 34px !important;
}

.u-ctl-118 {
    width: 118px !important;
    min-width: 118px !important;
    height: 34px !important;
}

.u-ctl-120 {
    width: 120px !important;
    min-width: 120px !important;
    height: 34px !important;
}

.u-ctl-128 {
    width: 128px !important;
    min-width: 128px !important;
    height: 34px !important;
}

.u-ctl-148 {
    width: 148px !important;
    min-width: 148px !important;
    height: 34px !important;
}

.u-ctl-260 {
    width: 260px !important;
    min-width: 220px !important;
    height: 34px !important;
}

.u-ctl-min120-h34 {
    min-width: 120px !important;
    height: 34px !important;
}

.u-ctl-min128-h34 {
    min-width: 128px !important;
    height: 34px !important;
}

.u-ctl-min136-h34 {
    min-width: 136px !important;
    height: 34px !important;
}

.u-ctl-min148-h34 {
    min-width: 148px !important;
    height: 34px !important;
}

.u-ctl-min152-h34 {
    min-width: 152px !important;
    height: 34px !important;
}

.u-ctl-min166-h34 {
    min-width: 166px !important;
    height: 34px !important;
}

.u-flex-center-gap8 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.u-flex-gap6-center-wrap {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.u-flex-wrap-gap6 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.u-flex-wrap-gap6-mb8 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
}

.u-flex-wrap-gap8 {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.u-flex-wrap-gap8-center-mt10 {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    margin-top: 10px !important;
}

.u-flex-wrap-gap8-end {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

.u-flex-wrap-gap8-mt12 {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 12px !important;
}

.u-grid-cols-150 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
}

.u-grid-cols-160 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
}

.u-grid-cols-220 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

.u-grid-220-mt10 {
    margin-top: 10px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 10px !important;
}

.u-inline-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    color: #334155 !important;
    font-weight: 700 !important;
    padding: 0 8px !important;
    min-height: 34px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #fff !important;
}

.u-m0-minw220 {
    margin: 0 !important;
    min-width: 220px !important;
}

.u-maxw-120 {
    max-width: 120px !important;
}

.u-maxw-130 {
    max-width: 130px !important;
}

.u-mb-6 {
    margin-bottom: 6px !important;
}

.u-mb-10 {
    margin: 0 0 10px !important;
}

.u-minw-280 {
    min-width: 280px !important;
}

.u-ml-10 {
    margin-left: 10px !important;
}

.u-ml16-p0 {
    margin: 0 0 0 16px !important;
    padding: 0 !important;
}

.u-mt10-fw600 {
    margin: 10px 0 0 !important;
    font-weight: 600 !important;
}

.u-mt10-fw700 {
    margin: 10px 0 0 !important;
    font-weight: 700 !important;
}

.u-mt8-mb6 {
    margin: 8px 0 6px !important;
}

.u-px-4 {
    padding: 0 4px !important;
}

.u-self-center-text12-nowrap {
    align-self: center !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

.u-size-auto {
    width: auto !important;
    min-height: auto !important;
}

.u-text-0f172a-800 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.u-text-12-bold {
    font-size: 12px !important;
    font-weight: 700 !important;
}

.u-text-12-mt2 {
    font-size: 12px !important;
    margin-top: 2px !important;
}

.u-text-1f2937-700-mb8 {
    color: #1f2937 !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
}

.u-text-22344b-700 {
    color: #22344b !important;
    font-weight: 700 !important;
}

.u-text-334155-600 {
    color: #334155 !important;
    font-weight: 600 !important;
}

.u-text-sm-secondary {
    font-size: var(--text-sm) !important;
    color: var(--color-text-secondary) !important;
}

.u-text-tertiary-normal {
    color: var(--color-text-tertiary) !important;
    font-weight: normal !important;
}

.u-tone-danger-soft {
    background: rgba(244, 63, 94, 0.12) !important;
    color: #be123c !important;
}

.u-tone-info-soft {
    background: rgba(37, 99, 235, 0.12) !important;
    color: #1d4ed8 !important;
}

.u-tone-info-soft-14 {
    background: rgba(37, 99, 235, 0.14) !important;
    color: #1d4ed8 !important;
}

.u-tone-success-soft {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #047857 !important;
}

.u-w-100 {
    width: 100% !important;
}

.u-w-220 {
    width: 220px !important;
}

.u-maxw-160 {
    max-width: 160px !important;
}

.u-maxw-180 {
    max-width: 180px !important;
}

.u-d-inline {
    display: inline !important;
}

.u-inline-flex-gap8-center {
    display: inline-flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.u-flex-wrap-gap8-end-mb12 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: flex-end !important;
    margin-bottom: 12px !important;
}

.u-block-maxw-100 {
    display: block !important;
    max-width: 100% !important;
}

.u-link-primary-under {
    color: #3b5bef !important;
    text-decoration: underline !important;
}

.u-hidden {
    display: none !important;
}

.u-media-card {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 10px !important;
    background: #fff !important;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
    gap: 16px;
    min-height: 100vh;
    padding: 16px;
}

.admin-content {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 12px;
}

main.admin-content {
    width: min(1320px, calc(100% - 32px));
    margin: 16px auto;
}

.admin-layout > .admin-content {
    margin: 0;
    width: 100%;
}

.sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--nx-line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 255, 0.86) 100%);
    backdrop-filter: blur(10px);
    box-shadow: var(--nx-shadow-soft);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(126, 140, 166, 0.42);
    border-radius: 999px;
}

.sidebar-menu,
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu {
    margin-top: 8px;
    display: grid;
    gap: 4px;
}

.sidebar-item {
    margin: 0;
}

.sidebar-item-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-item-row > a,
.sidebar-item-row > .sidebar-group-label {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-menu a,
.sidebar-group-label,
.sidebar-scope {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #334056;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    transition: all var(--nx-fast);
}

.sidebar-link-text {
    min-width: 0;
}

.sidebar-group-label {
    color: #2f4261;
}

.sidebar-scope {
    justify-content: space-between;
    margin: 8px 2px 4px;
    font-size: 12px;
    color: #4a5a75;
    border: 1px solid rgba(10, 105, 255, 0.14);
    background: rgba(10, 105, 255, 0.06);
}

.sidebar-menu a:hover {
    background: rgba(10, 105, 255, 0.09);
    color: var(--nx-brand-strong);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(10, 105, 255, 0.18) 0%, rgba(0, 162, 143, 0.12) 100%);
    border: 1px solid rgba(10, 105, 255, 0.2);
    color: #0e2f66;
}

.sidebar-toggle {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #5a6b88;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--nx-fast);
}

.sidebar-toggle:hover {
    border-color: rgba(10, 105, 255, 0.2);
    background: rgba(10, 105, 255, 0.1);
    color: #0f4ab1;
}

.sidebar-toggle-glyph {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform var(--nx-fast);
}

.sidebar-item.is-open > .sidebar-item-row .sidebar-toggle-glyph {
    transform: rotate(90deg);
}

.sidebar-submenu {
    display: none;
    margin-top: 3px;
    margin-left: 10px;
    padding-left: 9px;
    border-left: 1px dashed rgba(91, 109, 139, 0.36);
    gap: 2px;
}

.sidebar-submenu.open {
    display: grid;
}

.sidebar-submenu a {
    padding: 6px 8px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 550;
}

.sidebar-icon-badge,
.module-icon-badge,
.module-icon-badge-sm {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(10, 105, 255, 0.16) 0%, rgba(0, 162, 143, 0.14) 100%);
    color: #0f4ab1;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
}

.sidebar-icon-badge.is-group {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
}

.sidebar-icon-badge.is-child {
    min-width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 11px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 13px;
    border-bottom: 1px solid rgba(160, 172, 193, 0.35);
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(124, 145, 180, 0.3);
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-brand-text {
    display: grid;
    line-height: 1.2;
}

.sidebar-brand-text strong {
    font-size: 14px;
    letter-spacing: 0.1em;
}

.sidebar-brand-text span {
    font-size: 12px;
    color: var(--nx-muted);
}

.sidebar-brand {
    justify-content: space-between;
}

.sidebar-brand-main {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(131, 150, 181, 0.34);
    background: rgba(255, 255, 255, 0.72);
    color: #304766;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: all var(--nx-fast);
}

.sidebar-collapse-btn:hover {
    border-color: rgba(10, 105, 255, 0.32);
    background: rgba(10, 105, 255, 0.12);
    color: #1248a2;
}

.sidebar-collapse-glyph {
    font-size: 12px;
    line-height: 1;
}

.admin-layout.sidebar-collapsed {
    grid-template-columns: 86px minmax(0, 1fr);
}

.admin-layout.sidebar-collapsed .sidebar {
    padding-inline: 8px;
}

.admin-layout.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

.admin-layout.sidebar-collapsed .sidebar-brand-main {
    justify-content: center;
}

.admin-layout.sidebar-collapsed .sidebar-brand-text,
.admin-layout.sidebar-collapsed .sidebar-scope,
.admin-layout.sidebar-collapsed .sidebar-link-text,
.admin-layout.sidebar-collapsed .sidebar-toggle,
.admin-layout.sidebar-collapsed .sidebar-submenu {
    display: none !important;
}

.admin-layout.sidebar-collapsed .sidebar-menu a,
.admin-layout.sidebar-collapsed .sidebar-group-label {
    justify-content: center;
    padding-inline: 8px;
}

.admin-layout.sidebar-collapsed .sidebar-icon-badge {
    margin: 0;
}

.nx-shell-btn {
    appearance: none;
    border: 1px solid rgba(131, 149, 180, 0.36);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.82);
    color: #274062;
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--nx-fast);
}

.nx-shell-btn:hover {
    border-color: rgba(10, 105, 255, 0.34);
    background: rgba(10, 105, 255, 0.12);
    color: #1248a2;
}

.nx-density-toggle {
    margin-left: auto;
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 999px;
    border-color: rgba(126, 144, 173, 0.34);
    background: rgba(255, 255, 255, 0.74);
    color: #415473;
}

.nx-density-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.nx-density-head-title {
    margin: 0;
    color: #304968;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nx-density-section > .nx-section-body {
    display: grid;
    gap: 12px;
}

.nx-density-section.is-collapsed > .nx-section-body {
    display: none;
}

.nx-density-section.is-collapsed > .nx-density-head {
    margin-bottom: 0;
}

.nx-density-panel {
    border-radius: 18px;
    border: 1px solid rgba(130, 148, 180, 0.28);
    background: linear-gradient(160deg, rgba(252, 253, 255, 0.94) 0%, rgba(246, 249, 255, 0.9) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 40, 0.07);
    padding: 14px;
    display: grid;
    gap: 10px;
}

.nx-density-panel-head {
    display: grid;
    gap: 4px;
}

.nx-density-panel-title {
    color: #1e3355;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nx-density-panel-sub {
    color: #60718a;
    font-size: 12px;
}

.nx-density-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nx-density-item {
    appearance: none;
    border: 1px solid rgba(128, 146, 176, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #2e4769;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--nx-fast);
}

.nx-density-item:hover {
    border-color: rgba(10, 105, 255, 0.34);
    background: rgba(10, 105, 255, 0.12);
    color: #1248a2;
}

body[data-density-mode="focus"] .teacher-hero-actions > :nth-child(n+4),
body[data-density-mode="focus"] .student-hero-actions > :nth-child(n+4),
body[data-density-mode="focus"] .parent-hero-actions > :nth-child(n+4) {
    display: none;
}

.topbar,
.teacher-topbar,
.student-topbar,
.parent-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--nx-line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.93) 0%, rgba(248, 251, 255, 0.86) 100%);
    box-shadow: var(--nx-shadow-soft);
    backdrop-filter: blur(8px);
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body.nx-command-open {
    overflow: hidden;
}

.teacher-topbar,
.student-topbar,
.parent-topbar {
    position: sticky;
    top: 14px;
    z-index: 30;
}

.topbar-title {
    display: grid;
    gap: 2px;
}

.topbar-title-text {
    font-size: clamp(17px, 1.5vw, 23px);
    font-weight: 780;
    color: var(--nx-text);
}

.topbar-sub {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nx-muted);
    font-weight: 720;
}

.topbar-user,
.teacher-user,
.student-user,
.parent-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-logout-form {
    margin: 0;
    display: inline-flex;
}

.topbar-user-meta,
.teacher-user-meta,
.student-user-meta,
.parent-user-meta {
    display: grid;
    gap: 1px;
    text-align: right;
}

.topbar-user-name,
.teacher-user-name,
.student-user-name,
.parent-user-name {
    font-size: 13px;
    font-weight: 700;
}

.topbar-user-role,
.teacher-user-sub,
.student-user-sub,
.parent-user-sub {
    font-size: 11px;
    color: var(--nx-muted);
}

.teacher-shell,
.student-shell,
.parent-shell {
    min-height: 100vh;
    width: min(1360px, calc(100% - 24px));
    margin: 12px auto;
    display: grid;
    align-content: start;
    gap: 12px;
}

.teacher-content,
.student-content,
.parent-content {
    display: grid;
    gap: 12px;
}

.teacher-nav,
.student-nav,
.parent-nav {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: auto;
    padding: 2px;
}

.teacher-nav a,
.student-nav a,
.parent-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(155, 168, 190, 0.42);
    background: rgba(255, 255, 255, 0.7);
    color: #314056;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 640;
}

.teacher-nav a:hover,
.student-nav a:hover,
.parent-nav a:hover {
    border-color: rgba(10, 105, 255, 0.4);
    background: rgba(10, 105, 255, 0.12);
    color: #1148a7;
}

.teacher-footer,
.student-footer,
.parent-footer {
    margin-top: 2px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--nx-line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--nx-muted);
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.card,
.detail-card,
.nexia-card,
.nx-card {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.94) 0%, rgba(249, 251, 255, 0.88) 100%);
    box-shadow: var(--nx-shadow-soft);
    padding: clamp(12px, 1.6vw, 20px);
    animation: nx-rise 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.card h1,
.card h2,
.card h3,
.card h4,
.detail-card h1,
.detail-card h2,
.detail-card h3,
.detail-card h4,
.nx-card h1,
.nx-card h2,
.nx-card h3,
.nx-card h4,
.card p,
.detail-card p,
.nx-card p {
    overflow-wrap: anywhere;
}

#admin-summary .stats-grid .card,
#admin-quick-actions .hub-quick-card {
    position: relative;
    overflow: hidden;
    border-width: 1px;
}

#admin-summary .stats-grid .card::before,
#admin-quick-actions .hub-quick-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
}

#admin-summary .stats-grid .card:nth-child(4n + 1),
#admin-quick-actions .hub-quick-card:nth-child(4n + 1) {
    border-color: rgba(10, 105, 255, 0.34);
}

#admin-summary .stats-grid .card:nth-child(4n + 1)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 1)::before {
    background: linear-gradient(90deg, #0a69ff 0%, #34a5ff 100%);
}

#admin-summary .stats-grid .card:nth-child(4n + 2),
#admin-quick-actions .hub-quick-card:nth-child(4n + 2) {
    border-color: rgba(0, 162, 143, 0.34);
}

#admin-summary .stats-grid .card:nth-child(4n + 2)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 2)::before {
    background: linear-gradient(90deg, #00a28f 0%, #16c2a8 100%);
}

#admin-summary .stats-grid .card:nth-child(4n + 3),
#admin-quick-actions .hub-quick-card:nth-child(4n + 3) {
    border-color: rgba(67, 115, 188, 0.34);
}

#admin-summary .stats-grid .card:nth-child(4n + 3)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 3)::before {
    background: linear-gradient(90deg, #3f63be 0%, #6f8fd8 100%);
}

#admin-summary .stats-grid .card:nth-child(4n + 4),
#admin-quick-actions .hub-quick-card:nth-child(4n + 4) {
    border-color: rgba(185, 129, 5, 0.34);
}

#admin-summary .stats-grid .card:nth-child(4n + 4)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 4)::before {
    background: linear-gradient(90deg, #b98105 0%, #d79e1f 100%);
}

.cards,
.stats-grid,
.content-grid,
.hub-quick-grid,
.usr-kpi-grid,
.asm-kpi-grid,
.pdr-stats-grid,
.student-kpi-grid,
.parent-kpi-grid,
.nexia-chart-grid,
.qb-grid,
.qb-grid-2,
.pdr-grid-2,
.grid,
.grid-2,
.features-grid,
.hero-container,
.nx-grid {
    display: grid;
    gap: 12px;
}

.cards,
.stats-grid,
.content-grid,
.hub-quick-grid,
.usr-kpi-grid,
.asm-kpi-grid,
.pdr-stats-grid,
.student-kpi-grid,
.parent-kpi-grid,
.qb-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.grd-kpi-grid,
.atd-kpi-grid,
.exm-kpi-grid,
.pm-kpi-grid,
.wa-kpi-grid,
.theme-studio-kpi-grid,
.tgt-kpi-grid,
.health-kpi-grid,
.sbj-kpi-grid,
.sec-kpi-grid,
.cls-kpi-grid,
.bak-kpi-grid,
.scm-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
}

.cls-class-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
}

.nexia-chart-grid,
.pdr-grid-2,
.grid-2,
.hero-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hub-section,
.teacher-section,
.student-section,
.parent-section,
.pm-shell,
.asm-shell,
.usr-shell,
.ttb-shell,
.atd-shell,
.grd-shell,
.exm-shell,
.cls-shell,
.wa-shell,
.scm-shell,
.qb-page,
.pdr-shell,
.teacher-dashboard,
.student-dashboard,
.parent-dashboard,
.acc-shell,
.sec-shell,
.health-shell,
.bak-shell,
.sbj-shell,
.tgt-shell,
.set-shell,
.acd-shell {
    display: grid;
    gap: 12px;
}

.hub-section-head,
.teacher-section-head,
.student-section-head,
.parent-section-head,
.pdr-panel-head,
.qb-card-head,
.usr-table-head,
.asm-panel-head,
.ttb-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.hub-badge,
.pill,
.nx-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(123, 142, 173, 0.38);
    background: rgba(255, 255, 255, 0.74);
    color: #2d3b52;
    font-size: 12px;
    font-weight: 700;
}

.pill-soft,
.is-inactive {
    border-color: rgba(128, 140, 162, 0.34);
    background: rgba(112, 128, 159, 0.11);
    color: #49576d;
}

.pill-ok,
.is-ok,
.is-active,
.usr-status.is-active {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.15);
    color: #0a6d4a;
}

.pill-warn,
.is-warn {
    border-color: rgba(185, 129, 5, 0.38);
    background: rgba(185, 129, 5, 0.14);
    color: #8f6204;
}

.pill-bad,
.is-bad,
.is-danger,
.is-blocked,
.usr-status.is-blocked {
    border-color: rgba(195, 40, 40, 0.36);
    background: rgba(195, 40, 40, 0.14);
    color: #9d2525;
}

.alert,
.exam-alert,
.sx-alert {
    border: 1px solid;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 650;
}

.alert-success,
.exam-alert.success {
    border-color: rgba(15, 143, 99, 0.4);
    background: rgba(15, 143, 99, 0.13);
    color: #0c6f4d;
}

.alert-error,
.exam-alert.error {
    border-color: rgba(195, 40, 40, 0.38);
    background: rgba(195, 40, 40, 0.12);
    color: #972424;
}

button,
.btn,
.nx-btn,
.topbar-logout,
.teacher-logout,
.student-logout,
.parent-logout {
    appearance: none;
    border: 1px solid rgba(137, 154, 182, 0.45);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    color: #223248;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform var(--nx-fast), box-shadow var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

button:hover,
.btn:hover,
.nx-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 20px rgba(15, 23, 40, 0.12);
}

.btn-primary,
.nx-btn-primary,
.asm-btn-primary,
.qb-btn-primary,
.msg-btn-primary,
.pm-btn-primary,
.ttb-btn-primary,
.ann-btn-primary,
.cal-btn-primary,
.doc-btn-primary,
.cls-btn-primary,
.grd-btn-primary,
.exm-btn-primary,
.atd-btn-primary,
.usr-btn-primary,
.sx-btn-primary,
.exam-btn-primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #0856d4 0%, #0a8ef6 100%);
    box-shadow: 0 12px 22px rgba(8, 86, 212, 0.26);
}

.btn-secondary,
.nx-btn-secondary,
.pdr-btn-secondary,
.exam-btn-secondary {
    border-color: rgba(10, 105, 255, 0.28);
    color: #0f4ab1;
    background: rgba(10, 105, 255, 0.12);
}

.btn-ghost,
.nx-btn-ghost,
.sx-btn-ghost {
    border-color: rgba(139, 155, 183, 0.45);
    background: rgba(255, 255, 255, 0.7);
    color: #273447;
}

.btn-danger,
.nx-btn-danger,
.sx-btn-danger,
.exam-btn-danger {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #b52626 0%, #dd4b39 100%);
    box-shadow: 0 12px 22px rgba(181, 38, 38, 0.24);
}

.btn-sm,
.nx-btn-sm {
    padding: 7px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 18px;
    font-size: 14px;
}

.nx-atom-btn,
.nx-btn {
    border-radius: clamp(12px, 1.1vw, 14px);
}

.nx-atom-input,
.nx-input {
    border-radius: clamp(12px, 1.1vw, 14px);
}

.nx-atom-card,
.nx-card {
    border-radius: clamp(20px, 1.8vw, 24px);
}

.nx-bento {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.nx-bento > * {
    min-width: 0;
    grid-column: span 4;
}

.nx-bento > .is-wide {
    grid-column: span 6;
}

.nx-bento > .is-full {
    grid-column: 1 / -1;
}

.nx-command-palette[hidden] {
    display: none !important;
}

.nx-command-palette {
    position: fixed;
    inset: 0;
    z-index: 1800;
}

.nx-command-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 16, 34, 0.52);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.nx-command-panel {
    position: relative;
    width: min(760px, calc(100% - 28px));
    margin: 8vh auto 0;
    border: 1px solid rgba(135, 154, 188, 0.38);
    border-radius: 24px;
    background: var(--nx-glass-light);
    box-shadow: 0 32px 70px rgba(10, 20, 42, 0.33);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.nx-command-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 0;
}

.nx-command-kbd {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(132, 150, 183, 0.34);
    background: rgba(255, 255, 255, 0.72);
    color: #335178;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nx-command-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(132, 150, 183, 0.36);
    background: rgba(255, 255, 255, 0.78);
    color: #2f4668;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.nx-command-input-wrap {
    display: block;
    padding: 10px 14px 12px;
    margin: 0;
}

.nx-command-input-wrap input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(133, 151, 183, 0.42);
    background: rgba(255, 255, 255, 0.86);
    color: #162744;
    padding: 13px 14px;
    font-size: 15px;
    font-weight: 600;
}

.nx-command-list {
    list-style: none;
    margin: 0;
    padding: 0 10px 12px;
    max-height: min(54vh, 560px);
    overflow: auto;
    display: grid;
    gap: 6px;
}

.nx-command-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: #1f3353;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
    text-align: left;
}

.nx-command-item:hover,
.nx-command-item.is-active {
    border-color: rgba(10, 105, 255, 0.34);
    background: rgba(10, 105, 255, 0.14);
    color: #103f94;
}

.nx-command-item-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.nx-command-item-title {
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.nx-command-item-meta {
    color: #587191;
    font-size: 11px;
    font-weight: 600;
}

.nx-command-item-path {
    color: #587191;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .teacher-topbar,
body[data-theme="dark"] .student-topbar,
body[data-theme="dark"] .parent-topbar,
body[data-theme="dark"] .card,
body[data-theme="dark"] .detail-card,
body[data-theme="dark"] .nx-card,
body[data-theme="dark"] .sheet {
    border-color: rgba(120, 145, 190, 0.28);
    background: linear-gradient(160deg, rgba(13, 23, 43, 0.92) 0%, rgba(10, 20, 38, 0.9) 100%);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .sidebar-menu a,
body[data-theme="dark"] .sidebar-group-label,
body[data-theme="dark"] .topbar-title-text,
body[data-theme="dark"] .topbar-user-name,
body[data-theme="dark"] .teacher-user-name,
body[data-theme="dark"] .student-user-name,
body[data-theme="dark"] .parent-user-name,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4 {
    color: #dfe8fb;
}

body[data-theme="dark"] p,
body[data-theme="dark"] .text-muted,
body[data-theme="dark"] .topbar-sub,
body[data-theme="dark"] .topbar-user-role,
body[data-theme="dark"] .teacher-user-sub,
body[data-theme="dark"] .student-user-sub,
body[data-theme="dark"] .parent-user-sub {
    color: #9aabcb !important;
}

body[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .toolbar-input,
body[data-theme="dark"] .nx-input {
    border-color: rgba(120, 145, 190, 0.42);
    background: rgba(14, 24, 46, 0.82);
    color: #dbe7fd;
}

body[data-theme="dark"] thead th {
    background: linear-gradient(180deg, rgba(15, 27, 53, 0.96) 0%, rgba(12, 22, 43, 0.96) 100%);
    color: #a5b7da;
    border-bottom-color: rgba(120, 145, 190, 0.34);
}

body[data-theme="dark"] tbody td {
    border-bottom-color: rgba(120, 145, 190, 0.2);
    color: #d4e0f7;
}

body[data-theme="dark"] tbody tr:hover {
    background: rgba(47, 140, 255, 0.08);
}

body[data-theme="dark"] button,
body[data-theme="dark"] .btn,
body[data-theme="dark"] .nx-btn,
body[data-theme="dark"] .nx-shell-btn,
body[data-theme="dark"] .topbar-logout,
body[data-theme="dark"] .teacher-logout,
body[data-theme="dark"] .student-logout,
body[data-theme="dark"] .parent-logout {
    border-color: rgba(120, 145, 190, 0.42);
    background: rgba(16, 30, 56, 0.86);
    color: #d7e6ff;
}

body[data-theme="dark"] .nx-command-backdrop {
    background: rgba(2, 6, 14, 0.72);
}

body[data-theme="dark"] .nx-command-panel {
    border-color: rgba(120, 145, 190, 0.38);
    background: var(--nx-glass-dark);
}

body[data-theme="dark"] .nx-command-input-wrap input,
body[data-theme="dark"] .nx-command-item,
body[data-theme="dark"] .nx-command-close,
body[data-theme="dark"] .nx-command-kbd {
    border-color: rgba(120, 145, 190, 0.36);
    background: rgba(16, 29, 55, 0.8);
    color: #d8e6fe;
}

body[data-theme="dark"] .nx-command-item-meta,
body[data-theme="dark"] .nx-command-item-path {
    color: #a4b8de;
}

.hub-inline-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(10, 105, 255, 0.3);
    background: rgba(10, 105, 255, 0.1);
    color: #0f4ab1;
    font-size: 12px;
    font-weight: 700;
}

label {
    display: inline-block;
    margin-bottom: 6px;
    color: #2c3a4f;
    font-size: 12px;
    font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea,
.toolbar-input,
.nx-input {
    width: 100%;
    border: 1px solid rgba(144, 159, 185, 0.45);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.86);
    color: #111927;
    padding: 10px 12px;
    font-size: 13px;
    transition: border-color var(--nx-fast), box-shadow var(--nx-fast);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus,
.toolbar-input:focus,
.nx-input:focus {
    outline: none;
    border-color: rgba(10, 105, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(10, 105, 255, 0.14);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group,
.nx-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.form-grid,
.ttb-form-grid,
.pm-form-grid,
.grd-form-grid,
.cls-form-grid,
.atd-form-grid,
.grd-filter-grid,
.atd-filter-grid,
.exm-filter-grid,
.asm-filter-grid,
.toolbar-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.grd-filter-grid .form-group,
.atd-filter-grid .form-group,
.exm-filter-grid .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.grd-form-full,
.atd-form-full,
.exm-form-full {
    grid-column: 1 / -1;
}

.toolbar-form,
.inline-form,
.student-inline-form,
.parent-child-row,
.ttb-form-actions,
.asm-form-actions,
.atd-form-actions,
.grd-form-actions,
.cls-form-actions,
.pm-form-actions,
.profile-actions,
.hub-actions,
.hero-cta,
.cta-buttons,
.row-actions,
.teacher-hero-actions,
.student-hero-actions,
.parent-hero-actions,
.pdr-hero-actions,
.qb-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-help {
    color: var(--nx-muted);
    font-size: 12px;
}

.table-scroll,
.qb-table-wrap,
.pdr-table-wrap,
.asm-table-wrap,
.usr-table-wrap,
.student-table-wrap,
.nx-table-wrap {
    overflow: auto;
    border: 1px solid rgba(149, 164, 189, 0.36);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
}

table,
.admin-table,
.qb-table,
.nexia-table,
.asm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 11px 12px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #42526a;
    background: linear-gradient(180deg, #f7f9fe 0%, #edf1fb 100%);
    border-bottom: 1px solid rgba(150, 165, 189, 0.4);
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(150, 165, 189, 0.24);
    color: #1f2d41;
    font-size: 13px;
}

tbody tr:hover {
    background: rgba(10, 105, 255, 0.05);
}

.nexia-chart-track,
.score-meter,
.student-meter,
.sx-progress,
.pdr-risk-line > div {
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    background: rgba(126, 146, 176, 0.24);
}

.nexia-chart-fill,
.score-meter-bar,
.student-meter-bar,
.sx-progress > span,
.pdr-risk-line i,
[data-bar-width] {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0a69ff, #33a6ff);
}

.nexia-chart-fill.tone-success,
.score-meter-bar.ok,
.student-meter-bar.ok {
    background: linear-gradient(90deg, #089c68, #0fc187);
}

.nexia-chart-fill.tone-danger,
.score-meter-bar.bad,
.student-meter-bar.bad {
    background: linear-gradient(90deg, #bc2f2f, #e45a4a);
}

.nexia-chart-fill.tone-warn,
.score-meter-bar.warn,
.student-meter-bar.warn {
    background: linear-gradient(90deg, #b57d07, #e6a617);
}

.teacher-chip,
.student-chip,
.parent-chip,
.msg-chip,
.ann-chip,
.pm-pill,
.ttb-pill,
.exm-pill,
.sbj-pill,
.grd-pill,
.atd-pill,
.cls-pill,
.acc-pill,
.sx-pill,
.exam-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(129, 146, 175, 0.34);
    background: rgba(255, 255, 255, 0.78);
    color: #314764;
    font-size: 12px;
    font-weight: 700;
}

.acc-shell,
.sec-shell,
.health-shell,
.bak-shell,
.sbj-shell,
.tgt-shell {
    display: grid;
    gap: 12px;
}

.acc-hero-grid,
.sec-hero-grid,
.health-hero-grid,
.bak-hero-grid,
.sbj-hero-grid,
.tgt-hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.acc-meta,
.sec-meta,
.health-meta,
.bak-meta,
.sbj-meta,
.tgt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acc-main-grid {
    grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
    align-items: start;
}

.acc-aside {
    display: grid;
    gap: 12px;
    align-content: start;
}

.acc-panel,
.sec-panel,
.health-panel,
.bak-action-card,
.sbj-panel-card,
.tgt-panel-card {
    min-width: 0;
}

.acc-panel-head,
.sec-panel-head,
.health-panel-head,
.bak-table-head,
.sbj-panel-head,
.tgt-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.acc-toolbar {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.acc-toolbar .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.acc-toolbar-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.acc-groups {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.acc-group {
    border: 1px solid rgba(149, 164, 189, 0.34);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    padding: 10px;
    min-width: 0;
}

.acc-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.acc-group-list {
    display: grid;
    gap: 6px;
}

.acc-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(149, 164, 189, 0.28);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.9);
}

.acc-item-main,
.acc-item-meta {
    min-width: 0;
}

.acc-item-main {
    display: grid;
    gap: 2px;
}

.acc-item-title,
.acc-item-code {
    overflow-wrap: anywhere;
}

.acc-item-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.acc-submit-row {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sec-main-grid,
.health-grid,
.bak-action-grid,
.tgt-import-grid,
.sbj-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.sec-meta-grid,
.health-info-grid,
.sbj-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.bak-owner-row,
.health-owner-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bak-owner-row > * ,
.health-owner-filter-row > * {
    min-width: 0;
}

.sbj-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.sbj-head-tools,
.tgt-head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sbj-head-tools .sbj-search,
.tgt-head-tools .tgt-search {
    width: min(280px, 100%);
}

.sec-user-agent,
.tgt-table td,
.sbj-table td {
    overflow-wrap: anywhere;
}

.set-shell {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.set-shell > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.set-shell > .set-section {
    grid-column: span 6;
    display: grid;
    gap: 10px;
    align-content: start;
}

.set-owner-filter,
.set-hero,
.set-kpi-card,
.set-config-form,
.set-audit-card,
.set-card,
.set-note {
    --set-accent: #2563eb;
    --set-border: rgba(88, 116, 168, 0.34);
    position: relative;
    overflow: hidden;
    border-style: solid;
    border-width: 1px;
    border-color: var(--set-border);
    border-color: color-mix(in srgb, var(--set-accent) 28%, #c7d2e2);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 250, 255, 0.9) 100%);
}

.set-owner-filter::before,
.set-hero::before,
.set-kpi-card::before,
.set-config-form::before,
.set-audit-card::before,
.set-card::before,
.set-note::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--set-accent) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.set-owner-filter {
    --set-accent: #0a69ff;
    --set-border: rgba(10, 105, 255, 0.34);
}

.set-hero {
    --set-accent: #0ea5e9;
    --set-border: rgba(14, 165, 233, 0.34);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.set-hero-main {
    display: grid;
    gap: 8px;
}

.set-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(10, 105, 255, 0.3);
    background: rgba(10, 105, 255, 0.1);
    color: #1148a7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.set-hero h1,
.set-hero p {
    margin: 0;
}

.set-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.set-hero-actions {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 180px;
}

.set-owner-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.set-owner-filter-row .set-input {
    flex: 1 1 260px;
    min-width: 180px;
}

.set-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.set-kpi-card {
    display: grid;
    gap: 4px;
    align-content: start;
}

.set-kpi-card span {
    color: #4d5e79;
    font-size: 12px;
    font-weight: 700;
}

.set-kpi-card strong {
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.1;
    color: #12213a;
}

.set-kpi-card small {
    color: #5d6b82;
    font-size: 12px;
}

.set-kpi-card:nth-child(4n + 1) {
    --set-accent: #2563eb;
    --set-border: rgba(37, 99, 235, 0.34);
}

.set-kpi-card:nth-child(4n + 2) {
    --set-accent: #0ea5e9;
    --set-border: rgba(14, 165, 233, 0.34);
}

.set-kpi-card:nth-child(4n + 3) {
    --set-accent: #16a34a;
    --set-border: rgba(22, 163, 74, 0.34);
}

.set-kpi-card:nth-child(4n + 4) {
    --set-accent: #f59e0b;
    --set-border: rgba(245, 158, 11, 0.34);
}

.set-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.set-badge,
.set-pill {
    white-space: nowrap;
}

.set-config-form {
    --set-accent: #16a34a;
    --set-border: rgba(22, 163, 74, 0.34);
    display: grid;
    gap: 12px;
}

.set-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.set-field {
    margin-bottom: 0;
}

.set-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: -2px;
}

.set-check input {
    margin: 0;
}

.set-actions-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.set-audit-card {
    --set-accent: #f59e0b;
    --set-border: rgba(245, 158, 11, 0.34);
    display: grid;
    gap: 10px;
}

.set-audit-table-wrap {
    min-width: 0;
}

.set-audit-table th,
.set-audit-table td {
    white-space: nowrap;
}

.set-audit-table td:nth-child(3),
.set-audit-table td:nth-child(4) {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.set-empty {
    margin: 0;
}

.set-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
}

.set-card {
    display: grid;
    gap: 10px;
    align-content: start;
}

.set-card p {
    margin: 0;
}

.set-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.set-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(136, 154, 182, 0.42);
    background: rgba(255, 255, 255, 0.78);
    color: #2a3950;
    font-size: 12px;
    font-weight: 700;
    transition: transform var(--nx-fast), box-shadow var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.set-link:hover {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #1249ab;
}

.set-link-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #0856d4 0%, #0a8ef6 100%);
    color: #fff;
    box-shadow: 0 9px 18px rgba(8, 86, 212, 0.22);
}

.set-link-primary:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #084dbd 0%, #0b84e3 100%);
}

.set-note {
    --set-accent: #b98105;
    --set-border: rgba(185, 129, 5, 0.34);
}

.msg-shell,
.ann-shell,
.acd-shell {
    display: grid;
    gap: 12px;
}

.msg-index-shell,
.ann-index-shell,
.acd-index-shell {
    display: grid;
    gap: 12px;
}

.msg-shell > *,
.ann-shell > *,
.acd-shell > * {
    min-width: 0;
}

.msg-hero,
.ann-hero,
.acd-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.msg-hero-main,
.ann-hero-main,
.acd-hero-main {
    display: grid;
    gap: 8px;
}

.msg-hero-meta,
.msg-hero-meta-row,
.ann-hero-meta-row,
.acd-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.msg-hero-actions,
.ann-hero-actions,
.acd-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-eyebrow,
.ann-eyebrow,
.acd-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(10, 105, 255, 0.3);
    background: rgba(10, 105, 255, 0.1);
    color: #1148a7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.msg-kpi-grid,
.ann-kpi-grid,
.acd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.ann-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.msg-kpi-card,
.ann-kpi-card,
.acd-kpi-card {
    display: grid;
    gap: 4px;
    align-content: start;
}

.msg-kpi-card span,
.ann-kpi-card span,
.acd-kpi-card span {
    color: #4d5e79;
    font-size: 12px;
    font-weight: 700;
}

.msg-kpi-card strong,
.ann-kpi-card strong,
.acd-kpi-card strong {
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.1;
    color: #12213a;
}

.msg-kpi-card small,
.ann-kpi-card small,
.acd-kpi-card small {
    color: #5d6b82;
    font-size: 12px;
}

.msg-owner-filter-row,
.acd-owner-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-owner-filter-row .msg-input,
.acd-owner-row .acd-input {
    flex: 1 1 260px;
    min-width: 180px;
}

.msg-toolbar,
.ann-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.msg-search-wrap,
.ann-search-wrap {
    min-width: 0;
}

.msg-toolbar-actions,
.ann-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.msg-tabbar,
.ann-tabbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-tab,
.ann-tab {
    appearance: none;
    border: 1px solid rgba(138, 154, 181, 0.46);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: #273447;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.msg-tab:hover,
.ann-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.36);
}

.msg-tab.is-active,
.ann-tab.is-active {
    border-color: rgba(10, 105, 255, 0.36);
    background: rgba(10, 105, 255, 0.12);
    color: #1048aa;
}

.msg-panel,
.ann-panel {
    display: none;
}

.msg-panel.is-active,
.ann-panel.is-active {
    display: grid;
    gap: 12px;
}

.msg-table-head,
.ann-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ann-table-card {
    display: grid;
    gap: 10px;
}

.msg-check-all,
.ann-check-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #304158;
}

.msg-col-actions,
.ann-col-actions {
    white-space: nowrap;
}

.msg-col-actions,
.ann-col-actions,
.acd-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-main-text,
.ann-main-text {
    font-weight: 700;
    color: #1f2d41;
}

.msg-sub-text,
.ann-sub-text {
    color: var(--nx-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.msg-empty-state,
.ann-empty-state,
.msg-filter-empty,
.ann-filter-empty,
.acd-empty-note {
    margin: 0;
    color: var(--nx-muted);
}

.msg-table-wrap,
.ann-table-wrap,
.acd-table-wrap {
    min-width: 0;
}

.msg-table,
.ann-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.msg-chip.is-unread,
.ann-chip.is-unread {
    border-color: rgba(10, 105, 255, 0.34);
    background: rgba(10, 105, 255, 0.14);
    color: #1148a7;
}

.msg-chip.is-read,
.ann-chip.is-read {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.13);
    color: #0a6d4a;
}

.msg-chip.is-sent {
    border-color: rgba(95, 110, 138, 0.34);
    background: rgba(95, 110, 138, 0.13);
    color: #3f4e66;
}

.msg-chip.is-outline,
.ann-chip.is-outline {
    border-color: rgba(123, 142, 173, 0.38);
    background: rgba(255, 255, 255, 0.74);
    color: #2d3b52;
}

.msg-chip.is-danger-soft {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.12);
    color: #9a2727;
}

.msg-compose-layout,
.ann-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 12px;
    align-items: start;
}

.msg-compose-form,
.ann-create-form {
    display: grid;
    gap: 12px;
}

.msg-field,
.ann-field {
    margin-bottom: 0;
}

.msg-field-row,
.ann-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-template-list,
.ann-template-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-template-btn,
.ann-template-btn {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.msg-compose-actions,
.ann-create-actions,
.acd-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-preview-block,
.ann-preview-block {
    border: 1px solid rgba(150, 165, 189, 0.3);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.88);
    padding: 8px 10px;
    display: grid;
    gap: 3px;
}

.msg-preview-block span,
.ann-preview-block span {
    color: var(--nx-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.msg-preview-body,
.ann-preview-body {
    min-height: 160px;
    white-space: pre-wrap;
    border: 1px solid rgba(150, 165, 189, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    padding: 10px;
    color: #1f2d41;
}

.msg-preview-foot,
.ann-preview-foot {
    color: var(--nx-muted);
    font-size: 12px;
}

.msg-recipient-select,
.ann-student-select {
    min-height: 220px;
}

.ann-target-card,
.ann-target-block {
    display: grid;
    gap: 10px;
}

.ann-check-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ann-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(149, 164, 189, 0.32);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    padding: 8px 10px;
}

.msg-show-grid,
.ann-show-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.ann-show-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.msg-status-list,
.ann-status-list,
.ann-target-list {
    display: grid;
    gap: 8px;
}

.msg-status-list > div,
.ann-status-list > div,
.ann-target-item,
.msg-person-row {
    border: 1px solid rgba(150, 165, 189, 0.3);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.88);
    padding: 8px 10px;
    display: grid;
    gap: 2px;
}

.msg-body-content,
.ann-body-content {
    white-space: pre-wrap;
    color: #1f2d41;
}

.acd-toolbar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.acd-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.acd-filter-actions {
    grid-column: 1 / -1;
}

.acd-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.acd-col-full {
    grid-column: 1 / -1;
}

.acd-link {
    appearance: none;
    border: 1px solid rgba(136, 154, 182, 0.42);
    background: rgba(255, 255, 255, 0.76);
    color: #2a3950;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.acd-link:hover {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #1249ab;
}

.acd-link-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #0856d4 0%, #0a8ef6 100%);
    color: #fff;
}

.acd-link-primary:hover {
    color: #fff;
}

.acd-link-danger {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.12);
    color: #9a2727;
}

.acd-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(138, 154, 181, 0.4);
    background: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 700;
}

.acd-status.is-active {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.13);
    color: #0a6d4a;
}

.acd-status.is-inactive {
    border-color: rgba(128, 140, 162, 0.34);
    background: rgba(112, 128, 159, 0.11);
    color: #49576d;
}

.pm-shell,
.ttb-shell,
.scm-shell,
.msg-shell,
.acd-shell,
.usr-shell,
.acc-shell,
.sec-shell {
    --nx-shell-accent: #2563eb;
}

.asm-shell,
.exm-shell,
.ann-shell,
.wa-shell {
    --nx-shell-accent: #7c3aed;
}

.atd-shell,
.grd-shell,
.cls-shell,
.health-shell {
    --nx-shell-accent: #16a34a;
}

.bak-shell,
.tgt-shell {
    --nx-shell-accent: #f59e0b;
}

.sbj-shell {
    --nx-shell-accent: #0ea5e9;
}

:where(.msg-shell, .ann-shell, .acd-shell) :where(.nx-card, .detail-card, .card, .nexia-card) {
    border-color: color-mix(in srgb, var(--nx-shell-accent, #2563eb) 24%, #c7d2e2);
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--nx-shell-accent, #2563eb) 58%, #fff 42%),
        var(--nx-shadow-soft);
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) > * {
    min-width: 0;
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where(.nx-card, .detail-card, .card, .nexia-card) {
    border-color: rgba(139, 159, 190, 0.38);
    border-color: color-mix(in srgb, var(--nx-shell-accent, #2563eb) 24%, #c7d2e2);
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--nx-shell-accent, #2563eb) 58%, #fff 42%),
        var(--nx-shadow-soft);
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where([class$="-kpi-card"], .hub-quick-card, .stat-card) {
    --nx-card-accent: var(--nx-shell-accent, #2563eb);
    border-color: color-mix(in srgb, var(--nx-card-accent) 28%, #c7d2e2);
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--nx-card-accent) 62%, #fff 38%),
        var(--nx-shadow-soft);
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where([class$="-kpi-card"], .hub-quick-card, .stat-card):nth-child(4n + 1) {
    --nx-card-accent: #2563eb;
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where([class$="-kpi-card"], .hub-quick-card, .stat-card):nth-child(4n + 2) {
    --nx-card-accent: #0ea5e9;
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where([class$="-kpi-card"], .hub-quick-card, .stat-card):nth-child(4n + 3) {
    --nx-card-accent: #16a34a;
}

:where(
    .pm-shell,
    .asm-shell,
    .usr-shell,
    .ttb-shell,
    .atd-shell,
    .grd-shell,
    .exm-shell,
    .cls-shell,
    .wa-shell,
    .scm-shell,
    .acc-shell,
    .sec-shell,
    .health-shell,
    .bak-shell,
    .sbj-shell,
    .tgt-shell
) :where([class$="-kpi-card"], .hub-quick-card, .stat-card):nth-child(4n + 4) {
    --nx-card-accent: #f59e0b;
}

.atd-hero-grid,
.grd-hero-grid,
.exm-hero-grid,
.ttb-hero-grid,
.wa-hero-grid,
.scm-hero-grid,
.cls-hero-grid,
.pm-hero-grid,
.asm-hero-grid,
.usr-hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.atd-meta,
.grd-meta,
.exm-meta,
.ttb-meta,
.wa-meta,
.scm-meta,
.cls-meta,
.pm-meta,
.asm-meta,
.usr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exm-note {
    margin: 10px 0 0;
    color: var(--nx-muted);
    line-height: 1.55;
}

.atd-hero-actions,
.grd-hero-actions,
.exm-hero-actions,
.ttb-hero-actions,
.wa-hero-actions,
.scm-hero-actions,
.cls-hero-actions,
.pm-hero-actions,
.asm-hero-actions,
.usr-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.atd-form-layout,
.grd-form-layout,
.scm-layout,
.wa-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.ttb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 12px;
    align-items: start;
}

.std-create-form {
    display: grid;
    gap: 14px;
}

.std-create-form h3 {
    margin: 8px 0 0;
}

.std-create-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    align-items: start;
}

.std-contract-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.std-create-form .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.std-form-full {
    grid-column: 1 / -1;
}

.std-guardian-stack {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.std-guardian-card {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.std-guardian-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.std-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 980px) {
    .std-create-grid,
    .std-contract-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .std-guardian-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .std-create-grid,
    .std-contract-grid,
    .std-guardian-stack {
        grid-template-columns: 1fr;
    }

    .std-form-actions > * {
        width: 100%;
    }
}

[class$="-card-head"],
[class$="-table-head"],
[class$="-panel-head"],
[class$="-board-head"],
[class$="-section-head"] {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

[class$="-table-tools"],
[class$="-board-tools"] {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

[class$="-table-tools"] input[type="search"],
[class$="-board-tools"] input[type="search"] {
    width: min(280px, 100%);
    min-width: 180px;
}

[class$="-empty"] {
    color: var(--nx-muted);
}

.home-body {
    background:
        radial-gradient(circle at 80% -10%, rgba(10, 105, 255, 0.2), transparent 45%),
        radial-gradient(circle at 10% 10%, rgba(0, 162, 143, 0.15), transparent 35%),
        linear-gradient(180deg, #eff3fa 0%, #e7ebf3 100%);
}

.hero {
    min-height: 92vh;
    display: grid;
    align-items: center;
    padding: clamp(34px, 6vw, 82px) 16px;
}

.hero-container {
    width: min(1200px, 100%);
    margin: 0 auto;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.05;
    margin-bottom: 14px;
    color: #0f1e3a;
}

.hero-content p {
    font-size: clamp(17px, 2vw, 22px);
    margin-bottom: 18px;
    color: #415169;
}

.hero-features-list {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2a3950;
    font-size: 14px;
}

.hero-feature-item::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--gradient-primary);
    box-shadow: 0 0 0 4px rgba(10, 105, 255, 0.14);
}

.hero-card {
    border: 1px solid rgba(140, 158, 189, 0.34);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(246, 251, 255, 0.84) 100%);
    box-shadow: var(--shadow-xl);
    padding: 24px;
}

.features-section,
.cta-section {
    padding: clamp(42px, 7vw, 90px) 16px;
}

.container,
.features-header,
.cta-container,
.footer-content {
    width: min(1200px, 100%);
    margin: 0 auto;
}

.features-header,
.cta-container {
    text-align: center;
    margin-bottom: 22px;
}

.feature-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: var(--gradient-primary);
    color: #fff;
    margin-bottom: 10px;
}

.feature-card-title {
    font-size: 19px;
    color: #1f2f47;
    margin-bottom: 8px;
}

.feature-card-description {
    margin: 0;
    color: #546278;
    font-size: 14px;
}

#admin-quick-actions .hub-quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

#admin-quick-actions .hub-quick-card {
    padding: 14px;
}

#admin-quick-actions .hub-quick-card h3 {
    margin-bottom: 6px;
    font-size: 16px;
}

#admin-quick-actions .hub-quick-card p {
    margin-bottom: 8px;
    font-size: 12px;
}

#admin-quick-actions .hub-actions {
    gap: 6px;
}

#admin-quick-actions .hub-action-btn {
    padding: 6px 10px;
    min-height: 30px;
    font-size: 12px;
    border-radius: 10px;
    font-weight: 650;
}

.footer {
    background: #101625;
    color: #f3f5ff;
    padding: 36px 16px;
}

.footer-logo {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.footer-contact {
    margin-top: 14px;
    display: grid;
    gap: 6px;
}

.footer-contact-label {
    color: rgba(255, 255, 255, 0.64);
}

.footer-contact-value {
    color: #fff;
    font-weight: 650;
}

.footer-divider {
    margin: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at 15% 10%, rgba(10, 105, 255, 0.16), transparent 42%),
        radial-gradient(circle at 85% 90%, rgba(17, 188, 163, 0.14), transparent 35%),
        linear-gradient(180deg, #eceff6 0%, #e2e7f1 100%);
}

.login-page,
.login-container {
    width: min(460px, 100%);
}

.login-card {
    border: 1px solid rgba(140, 158, 189, 0.38);
    border-radius: 22px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.88) 100%);
    box-shadow: var(--nx-shadow-strong);
    padding: clamp(20px, 4vw, 30px);
    display: grid;
    gap: 12px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(8, 86, 212, 0.2);
}

.login-brand-title {
    font-size: 24px;
    font-weight: 820;
    letter-spacing: 0.08em;
    color: #0d3f9a;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form-group {
    display: grid;
    gap: 6px;
}

.login-form-label {
    font-weight: 700;
    font-size: 12px;
}

.login-submit {
    width: 100%;
}

.login-divider {
    border-top: 1px solid rgba(149, 164, 189, 0.34);
    margin: 3px 0;
}

.login-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.exam-app {
    background:
        radial-gradient(circle at 8% -5%, rgba(10, 105, 255, 0.18), transparent 36%),
        radial-gradient(circle at 95% 0%, rgba(0, 162, 143, 0.16), transparent 31%),
        linear-gradient(180deg, #ecf2ff 0%, #eff6fb 46%, #e8eef7 100%);
}

.exam-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.35) 0, rgba(255, 255, 255, 0.35) 1px, transparent 1px, transparent 18px);
    opacity: 0.32;
}

.exam-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 24px));
    margin: 12px auto 30px;
    display: grid;
    gap: 12px;
}

.sx-stack {
    display: grid;
    gap: 12px;
}

.sx-card {
    border: 1px solid rgba(149, 164, 189, 0.36);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--nx-shadow-soft);
}

.sx-head {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.sx-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 12px;
}

.sx-main,
.sx-side {
    padding: 14px;
}

.sx-command {
    position: sticky;
    top: 10px;
    z-index: 20;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.sx-timer {
    font-size: 30px;
    font-weight: 900;
    color: #113d8f;
}

.sx-question {
    border: 1px solid rgba(149, 164, 189, 0.36);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.92);
    margin-top: 10px;
}

.sx-option {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 9px;
    border: 1px solid rgba(149, 164, 189, 0.36);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
}

.sx-option.on {
    border-color: rgba(10, 105, 255, 0.62);
    background: rgba(10, 105, 255, 0.13);
}

.sx-palette {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.report-page-body,
.report-pdf-body {
    background: #edf1f8;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(149, 164, 189, 0.38);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(9px);
}

.sheet {
    width: min(1060px, calc(100% - 24px));
    margin: 12px auto 22px;
    border-radius: 18px;
    border: 1px solid rgba(149, 164, 189, 0.34);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: var(--nx-shadow-strong);
    padding: 18px;
    display: grid;
    gap: 12px;
}

.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 9px;
}

.meta > div,
.meta .item {
    border: 1px solid rgba(149, 164, 189, 0.32);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.92);
    padding: 8px;
    display: grid;
    gap: 2px;
}

.meta strong {
    font-size: 11px;
    color: var(--nx-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.meta span {
    color: #1b2a3f;
    font-weight: 700;
}

.profile-header,
.school-hero,
.teacher-hero,
.student-hero,
.parent-hero,
.pdr-hero,
.pm-hero,
.asm-hero,
.usr-hero,
.qb-page-header {
    display: grid;
    gap: 10px;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
    border: 1px solid var(--nx-line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(11, 83, 197, 0.11) 0%, rgba(12, 163, 145, 0.09) 100%);
    box-shadow: var(--nx-shadow-soft);
    padding: 16px;
}

.qb-page-header {
    grid-template-columns: minmax(0, 1fr);
}

.qb-page-header .qb-header-actions {
    width: 100%;
    justify-content: flex-start;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 24px rgba(15, 23, 40, 0.14);
    background: rgba(10, 105, 255, 0.12);
    color: #1148a7;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.profile-info {
    min-width: 0;
}

.profile-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-meta span,
.profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(10, 105, 255, 0.25);
    background: rgba(10, 105, 255, 0.1);
    color: #14489f;
    font-size: 12px;
    font-weight: 700;
}

.health-kicker {
    font-size: 12px;
    color: var(--nx-muted);
    letter-spacing: 0.04em;
}

.school-hero-kpis,
.school-hero-kpi,
.school-metric-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.school-hero-kpi {
    padding: 8px 10px;
    border-radius: 11px;
    border: 1px solid var(--nx-line);
    background: rgba(255, 255, 255, 0.74);
    display: grid;
    gap: 2px;
}

.school-hero-kpi strong {
    font-size: 12px;
}

.school-dashboard {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.school-dashboard > * {
    min-width: 0;
}

.school-hero-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
}

.school-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    overflow: hidden;
    font-size: 28px;
}

.school-hero-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.school-hero-side {
    display: grid;
    gap: 12px;
    min-width: 280px;
}

.school-hero-lead {
    margin: 8px 0 0;
    color: var(--nx-muted);
    line-height: 1.55;
    max-width: 68ch;
}

.school-status-stack,
.school-tabs,
.school-module-meta,
.school-module-chip-cloud,
.school-form-actions,
.school-note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.school-tabs {
    align-items: center;
}

.school-tab,
.school-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    background: var(--nx-surface-soft);
    color: var(--nx-text);
    text-decoration: none;
    font-weight: 600;
}

.school-tab:hover,
.school-chip-link:hover,
.school-action-link:hover,
.school-module-link:hover {
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--nx-brand-strong);
}

.school-section-intro,
.school-mini-note,
.school-kpi-sub,
.school-pulse-sub,
.school-module-code,
.school-module-source {
    color: var(--nx-muted);
}

.school-section-intro,
.school-pulse-sub {
    margin: 0;
    line-height: 1.55;
}

.school-kpi-card,
.school-actions-card,
.school-profile-card,
.school-logo-card,
.school-identity-card,
.school-form-card {
    display: grid;
    gap: 12px;
}

.school-kpi-card span {
    color: var(--nx-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.school-kpi-card strong,
.school-pulse-value {
    font-size: 30px;
    line-height: 1.1;
}

.school-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.school-action-link,
.school-module-link {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    background: var(--nx-surface-soft);
    color: var(--nx-text);
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.school-action-link:hover,
.school-module-link:hover {
    transform: translateY(-1px);
}

.school-action-link strong,
.school-module-link {
    font-weight: 700;
}

.school-action-link span {
    font-size: 12px;
    color: var(--nx-muted);
}

.school-checklist,
.school-note-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.school-check-item,
.school-note-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--nx-line);
    background: var(--nx-surface-soft);
}

.school-check-item.is-ready {
    border-color: rgba(23, 148, 97, 0.26);
    background: rgba(23, 148, 97, 0.08);
}

.school-check-item.is-missing {
    border-color: rgba(201, 123, 30, 0.24);
    background: rgba(201, 123, 30, 0.08);
}

.school-pulse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.school-pulse-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    border-left: 4px solid transparent;
}

.school-pulse-card.risk-ok {
    border-left-color: #179461;
}

.school-pulse-card.risk-high {
    border-left-color: #c0392b;
}

.school-pulse-card.risk-unknown {
    border-left-color: #d4941f;
}

.school-pulse-head,
.school-module-head,
.school-module-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.school-module-title-row {
    justify-content: flex-start;
    align-items: center;
}

.school-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
}

.school-module-card,
.school-module-links,
.school-side-stack,
.school-detail-stack,
.school-detail-body {
    display: grid;
    gap: 12px;
}

.school-module-head {
    min-width: 0;
}

.school-module-source {
    font-size: 12px;
    white-space: nowrap;
}

.school-module-link.is-primary {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.24);
    color: var(--nx-brand-strong);
}

.school-detail-card {
    border: 1px solid var(--nx-line);
    border-radius: 18px;
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-soft);
    overflow: hidden;
}

.school-detail-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 15px 16px;
    font-weight: 700;
    color: var(--nx-text);
}

.school-detail-card > summary::-webkit-details-marker {
    display: none;
}

.school-detail-card[open] > summary {
    border-bottom: 1px solid var(--nx-line);
    background: var(--nx-surface-soft);
}

.school-detail-grid,
.school-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.school-field-full {
    grid-column: 1 / -1;
}

.school-empty {
    padding: 12px;
    border: 1px dashed rgba(123, 142, 173, 0.4);
    border-radius: 14px;
    background: var(--nx-surface-soft);
    color: var(--nx-muted);
}

.school-modules-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.school-modules-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.school-modules-table th,
.school-modules-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(149, 164, 189, 0.24);
    text-align: left;
    vertical-align: middle;
}

.school-modules-table th {
    color: var(--nx-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.school-logo-preview {
    display: block;
    max-width: 160px;
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--nx-line);
    background: var(--nx-surface-soft);
    padding: 8px;
}

@media (max-width: 980px) {
    .school-hero-main,
    .school-pulse-grid,
    .school-detail-grid,
    .school-form-grid {
        grid-template-columns: 1fr;
    }

    .school-hero-side {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .school-module-head,
    .school-pulse-head,
    .school-note-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .school-tab,
    .school-chip-link {
        width: 100%;
        justify-content: center;
    }

    .school-action-grid,
    .school-module-grid {
        grid-template-columns: 1fr;
    }
}

.ai-pdf-index-page .hub-quick-card,
.ai-pdf-index-page .detail-card,
.ai-pdf-questions-page .hub-quick-card,
.ai-pdf-questions-page .detail-card {
    min-width: 0;
}

.ai-pdf-index-page .hub-quick-card p,
.ai-pdf-index-page .health-kicker,
.ai-pdf-index-page .alert,
.ai-pdf-questions-page .profile-meta,
.ai-pdf-questions-page .profile-meta span,
.ai-pdf-questions-page .profile-badge,
.ai-pdf-questions-page .health-kicker,
.ai-pdf-questions-page .hub-quick-card p,
.ai-pdf-questions-page .hub-quick-card li,
.ai-pdf-questions-page .hub-quick-card code,
.ai-pdf-questions-page .detail-card p,
.ai-pdf-questions-page .detail-card li,
.ai-pdf-questions-page .alert code {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ai-pdf-index-page .ai-pdf-generate-form {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ai-pdf-index-page .ai-pdf-generate-form .toolbar-input,
.ai-pdf-index-page .ai-pdf-generate-form .toolbar-select {
    min-width: 0 !important;
    max-width: 100%;
}

.ai-pdf-index-page .ai-pdf-generate-form > * {
    flex: 0 1 auto;
    max-width: 100%;
}

.ai-pdf-questions-page,
.ai-pdf-questions-page > *,
.ai-pdf-questions-page .profile-header,
.ai-pdf-questions-page .hub-section,
.ai-pdf-questions-page .toolbar-form {
    min-width: 0;
    max-width: 100%;
}

.ai-pdf-questions-page {
    overflow-x: hidden;
}

.ai-pdf-questions-page .ai-pdf-job-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ai-pdf-questions-page .ai-pdf-job-table {
    min-width: 1400px;
}

.ai-pdf-questions-page .ai-pdf-job-table td {
    white-space: nowrap;
}

.ai-pdf-questions-page .ai-pdf-job-table td.ai-pdf-job-error {
    min-width: 220px;
    max-width: 360px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.qb-form {
    display: grid;
    gap: 12px;
}

.qb-field {
    min-width: 0;
}

.qb-field input,
.qb-field select,
.qb-field textarea {
    width: 100%;
    max-width: 100%;
}

.qb-grid.qb-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qb-grid.qb-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qb-create-page .qb-symbol-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.qb-create-page .qb-symbol-toolbar button {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(129, 147, 178, 0.42);
    background: rgba(255, 255, 255, 0.88);
    color: #223248;
    font-size: 12px;
    font-weight: 600;
}

.qb-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.qb-summary-card {
    gap: 4px;
    min-width: 0;
}

.qb-summary-card span {
    font-size: 12px;
    color: var(--nx-muted);
}

.qb-summary-card strong {
    font-size: 28px;
    line-height: 1;
}

.qb-summary-card small {
    color: var(--nx-muted);
}

.qb-filter-card {
    overflow: hidden;
}

.qb-filter-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.qb-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.qb-search-field {
    grid-column: span 2;
}

.qb-table-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.qb-table-main p {
    margin: 0;
    color: var(--nx-muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

.qb-quality-cell {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.qb-quality-badge {
    width: fit-content;
    border-width: 1px;
}

.qb-quality-badge-ready {
    border-color: rgba(23, 148, 97, 0.28);
    background: rgba(23, 148, 97, 0.12);
    color: #116947;
}

.qb-quality-badge-watch {
    border-color: rgba(201, 123, 30, 0.28);
    background: rgba(201, 123, 30, 0.12);
    color: #8b5a13;
}

.qb-quality-badge-critical {
    border-color: rgba(189, 57, 57, 0.28);
    background: rgba(189, 57, 57, 0.12);
    color: #9b2f2f;
}

.qb-inline-note {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.14);
    color: #314155;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.qb-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.qb-pagination-meta {
    color: var(--nx-muted);
    font-size: 13px;
}

.asm-quality-panel {
    gap: 12px;
}

.asm-quality-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
}

.asm-quality-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(149, 164, 189, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    min-width: 0;
}

.asm-quality-card p {
    margin: 0;
    color: var(--nx-muted);
    overflow-wrap: anywhere;
}

.asm-quality-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.asm-quality-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.asm-quality-score.is-good {
    border-color: rgba(23, 148, 97, 0.28);
    background: rgba(23, 148, 97, 0.12);
    color: #116947;
}

.asm-quality-score.is-warn,
.asm-quality-score.is-neutral {
    border-color: rgba(201, 123, 30, 0.28);
    background: rgba(201, 123, 30, 0.12);
    color: #8b5a13;
}

.asm-quality-score.is-bad {
    border-color: rgba(189, 57, 57, 0.28);
    background: rgba(189, 57, 57, 0.12);
    color: #9b2f2f;
}

.asm-action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asm-compose-form {
    display: grid;
    gap: 16px;
}

.asm-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.asm-create-shell .form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
    align-content: start;
}

.asm-create-shell .form-group input,
.asm-create-shell .form-group select,
.asm-create-shell .form-group textarea {
    width: 100%;
    max-width: 100%;
}

.asm-subcard {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(149, 164, 189, 0.26);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.asm-subcard h2 {
    margin: 0;
    font-size: 18px;
}

.asm-create-shell .asm-note,
.asm-create-shell .asm-help {
    margin: 0;
}

.asm-create-shell .form-group > label:has(input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.asm-create-shell .u-hidden {
    display: none !important;
}

.asm-manual-source .form-group {
    max-width: 100%;
}

.asm-manual-source textarea {
    min-height: 168px;
}

.asm-live-summary {
    gap: 14px;
}

.asm-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.asm-summary-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(149, 164, 189, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.asm-summary-item span,
.asm-summary-item small {
    color: var(--nx-muted);
}

.asm-summary-item strong {
    font-size: 24px;
    line-height: 1;
}

.asm-status-card {
    display: grid;
    gap: 8px;
}

.asm-status-card p {
    margin: 0;
}

.asm-status-card.is-success {
    border-color: rgba(28, 167, 82, 0.28);
    background: rgba(236, 252, 243, 0.9);
}

.asm-status-card.is-warn {
    border-color: rgba(232, 150, 24, 0.32);
    background: rgba(255, 247, 233, 0.92);
}

.asm-status-card.is-error {
    border-color: rgba(214, 77, 77, 0.32);
    background: rgba(255, 240, 240, 0.92);
}

.asm-form-full {
    grid-column: 1 / -1;
}

.asm-benchmark-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 16px;
}

.asm-benchmark-preset-list {
    display: grid;
    gap: 12px;
}

.asm-benchmark-code {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(149, 164, 189, 0.22);
    background: rgba(9, 17, 32, 0.96);
    color: #dce7f7;
    font-size: 12px;
    line-height: 1.55;
    overflow: auto;
    max-height: 360px;
    white-space: pre-wrap;
    word-break: break-word;
}

.asm-benchmark-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.asm-benchmark-inspect-grid,
.asm-benchmark-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.asm-benchmark-card {
    gap: 10px;
}

.asm-benchmark-paths {
    display: grid;
    gap: 8px;
}

.asm-benchmark-paths code {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(149, 164, 189, 0.22);
    background: rgba(255, 255, 255, 0.74);
    color: var(--nx-text);
    overflow-wrap: anywhere;
}

.asm-inline-upload {
    display: grid;
    gap: 10px;
}

.asm-inline-config {
    display: grid;
    gap: 10px;
}

.asm-inline-config textarea {
    width: 100%;
    min-height: 92px;
}

.asm-case-toggle {
    display: flex;
    align-items: end;
}

.asm-case-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.asm-inline-upload input[type="file"] {
    width: 100%;
    max-width: 100%;
}

.asm-benchmark-issues {
    margin: 0;
    padding-left: 18px;
    color: var(--nx-danger, #b42318);
    display: grid;
    gap: 6px;
}

@media (max-width: 980px) {
    .asm-benchmark-grid,
    .asm-benchmark-card-grid,
    .asm-benchmark-inspect-grid,
    .asm-benchmark-pack-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.asm-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.asm-board-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asm-search {
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 320px;
}

.asm-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
    gap: 12px;
    align-items: start;
}

.asm-answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.asm-answer-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(149, 164, 189, 0.26);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
}

.asm-answer-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.asm-answer-select {
    width: 100%;
}

.asm-review-shell .form-group,
.asm-calibration-shell .form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.asm-review-shell .form-group input,
.asm-review-shell .form-group select,
.asm-review-shell .form-group textarea,
.asm-calibration-shell .form-group input,
.asm-calibration-shell .form-group select,
.asm-calibration-shell .form-group textarea {
    width: 100%;
    max-width: 100%;
}

.exm-compose-form {
    display: grid;
    gap: 16px;
}

.exm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.exm-create-shell .form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
    align-content: start;
}

.exm-create-shell .form-group input,
.exm-create-shell .form-group select,
.exm-create-shell .form-group textarea,
.exm-search {
    width: 100%;
    max-width: 100%;
}

.exm-view-shell,
.exm-board-card,
.exm-info-card {
    display: grid;
    gap: 12px;
}

.exm-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.exm-board-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.exm-search {
    min-width: min(320px, 100%);
}

.exm-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.exm-info-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(149, 164, 189, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    min-width: 0;
}

.exm-info-item span {
    color: var(--nx-muted);
    font-size: 12px;
}

.exm-info-item strong {
    overflow-wrap: anywhere;
}

.exm-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.exm-status.is-final {
    border-color: rgba(23, 148, 97, 0.28);
    background: rgba(23, 148, 97, 0.12);
    color: #116947;
}

.exm-status.is-draft {
    border-color: rgba(201, 123, 30, 0.28);
    background: rgba(201, 123, 30, 0.12);
    color: #8b5a13;
}

.exm-question-table th,
.exm-question-table td {
    vertical-align: top;
}

.exm-question-table td:nth-child(4),
.exm-question-table td:nth-child(5) {
    min-width: 220px;
    white-space: normal;
}

.exm-empty {
    margin: 0;
}

.exm-link {
    color: var(--nx-ink);
    font-weight: 700;
    text-decoration: none;
}

.exm-link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .qb-search-field {
        grid-column: span 1;
    }

    .asm-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .asm-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .asm-review-layout {
        grid-template-columns: 1fr;
    }

    .exm-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .asm-form-grid {
        grid-template-columns: 1fr;
    }

    .asm-summary-grid {
        grid-template-columns: 1fr;
    }
}

.qb-create-page .qb-symbol-drawer {
    margin-top: 10px;
    border: 1px solid rgba(143, 160, 189, 0.38);
    border-radius: 12px;
    background: rgba(248, 251, 255, 0.88);
}

.qb-create-page .qb-symbol-drawer > summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #1f3252;
}

.qb-create-page .qb-symbol-drawer[open] > summary {
    border-bottom: 1px solid rgba(143, 160, 189, 0.32);
}

.qb-create-page .qb-symbol-catalog {
    padding: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.qb-create-page .qb-symbol-group {
    border: 1px solid rgba(145, 162, 189, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
}

.qb-create-page .qb-symbol-group h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #1f3252;
}

.qb-create-page .qb-symbol-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
}

.qb-create-page .qb-symbol-grid button {
    width: 100%;
    padding: 6px 4px;
}

.qb-order-shell {
    margin-top: 12px;
    border: 1px solid rgba(149, 164, 189, 0.42);
    border-radius: 11px;
    background: rgba(249, 252, 255, 0.9);
    padding: 10px;
}

.qb-order-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 7px;
}

.qb-order-item {
    border: 1px solid rgba(149, 164, 189, 0.42);
    border-radius: 9px;
    background: #fff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: grab;
}

.qb-order-item.is-over {
    border-color: rgba(10, 105, 255, 0.42);
    box-shadow: 0 0 0 2px rgba(10, 105, 255, 0.18);
}

.qb-order-item.is-dragging {
    opacity: 0.6;
}

.qb-order-index {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(149, 164, 189, 0.42);
    background: rgba(245, 248, 253, 0.95);
    color: #3a4b64;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qb-order-empty {
    border: 1px dashed rgba(149, 164, 189, 0.58);
    border-radius: 9px;
    background: rgba(248, 251, 255, 0.94);
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 10px;
}

.leaf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.leaf-toolbar .qb-btn {
    min-height: 34px;
}

.leaf-sheet {
    border: 1px solid rgba(149, 164, 189, 0.42);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.leaf-head {
    border-bottom: 1px solid rgba(149, 164, 189, 0.34);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.leaf-head-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #334155;
    margin-bottom: 8px;
}

.leaf-head-top span {
    font-weight: 700;
    color: #0f172a;
}

.leaf-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
}

.leaf-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.leaf-submeta {
    margin-top: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.leaf-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    position: relative;
}

.leaf-body::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #cbd5e1;
    transform: translateX(-9px);
}

.leaf-question {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
    break-inside: avoid;
}

.leaf-question:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.leaf-question-title {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.leaf-question-image {
    display: block;
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    margin: 0 0 8px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
}

.leaf-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.leaf-options li {
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.leaf-open-lines {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.leaf-open-lines span {
    display: block;
    border-bottom: 1px solid #cbd5e1;
    height: 14px;
}

/* Portal modernization layer */
.manager-body,
.teacher-body,
.student-body,
.parent-body {
    --portal-brand: #0b5be4;
    --portal-brand-soft: rgba(11, 91, 228, 0.12);
    --portal-brand-line: rgba(11, 91, 228, 0.3);
    --portal-accent: #0aa58f;
    --portal-surface: rgba(255, 255, 255, 0.9);
    --portal-surface-soft: rgba(248, 251, 255, 0.88);
    --portal-surface-deep: rgba(244, 248, 255, 0.96);
    --portal-muted: #5a6980;
}

.manager-body {
    --portal-brand: #0a69ff;
    --portal-brand-soft: rgba(10, 105, 255, 0.13);
    --portal-brand-line: rgba(10, 105, 255, 0.3);
}

.teacher-body {
    --portal-brand: #0f63f2;
    --portal-brand-soft: rgba(15, 99, 242, 0.12);
    --portal-brand-line: rgba(15, 99, 242, 0.3);
    --portal-accent: #0ea089;
    background:
        radial-gradient(circle at 4% -12%, rgba(15, 99, 242, 0.18), transparent 42%),
        radial-gradient(circle at 95% 4%, rgba(14, 160, 137, 0.13), transparent 38%),
        linear-gradient(180deg, #eff3fb 0%, #edf2fa 50%, #e6edf8 100%);
}

.student-body {
    --portal-brand: #315eea;
    --portal-brand-soft: rgba(49, 94, 234, 0.12);
    --portal-brand-line: rgba(49, 94, 234, 0.3);
    --portal-accent: #00a185;
    background:
        radial-gradient(circle at 8% -9%, rgba(49, 94, 234, 0.18), transparent 40%),
        radial-gradient(circle at 94% 2%, rgba(0, 161, 133, 0.13), transparent 34%),
        linear-gradient(180deg, #edf2fc 0%, #ebf1fa 48%, #e4ecf8 100%);
}

.parent-body {
    --portal-brand: #2469dc;
    --portal-brand-soft: rgba(36, 105, 220, 0.12);
    --portal-brand-line: rgba(36, 105, 220, 0.3);
    --portal-accent: #099e84;
    background:
        radial-gradient(circle at 6% -10%, rgba(36, 105, 220, 0.17), transparent 40%),
        radial-gradient(circle at 94% 0%, rgba(9, 158, 132, 0.13), transparent 36%),
        linear-gradient(180deg, #eef3fc 0%, #ecf2fb 46%, #e6eef9 100%);
}

.teacher-shell,
.student-shell,
.parent-shell {
    position: relative;
    isolation: isolate;
    width: min(1460px, calc(100% - 28px));
    margin: 14px auto;
    gap: 16px;
}

.teacher-shell::before,
.student-shell::before,
.parent-shell::before {
    content: "";
    position: absolute;
    inset: -8px 0 auto;
    height: 220px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 12%, var(--portal-brand-soft), transparent 54%),
        radial-gradient(circle at 84% 10%, rgba(10, 162, 143, 0.12), transparent 52%);
}

.teacher-topbar,
.student-topbar,
.parent-topbar {
    top: 14px;
    z-index: 40;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 22px;
    border-color: rgba(130, 148, 180, 0.36);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 249, 255, 0.9) 100%);
    box-shadow: 0 16px 42px rgba(15, 23, 40, 0.1);
    backdrop-filter: blur(14px);
}

.teacher-brand,
.student-brand,
.parent-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 11px 5px 5px;
    border-radius: 999px;
    border: 1px solid rgba(131, 148, 179, 0.36);
    background: rgba(255, 255, 255, 0.8);
    color: #13233a;
    font-weight: 700;
    white-space: nowrap;
}

.teacher-brand:hover,
.student-brand:hover,
.parent-brand:hover {
    border-color: var(--portal-brand-line);
    background: rgba(255, 255, 255, 0.98);
}

.teacher-brand-mark,
.student-brand-mark,
.parent-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--portal-brand) 0%, var(--portal-accent) 100%);
    box-shadow: 0 10px 22px rgba(10, 24, 48, 0.2);
}

.teacher-brand-text,
.student-brand-text,
.parent-brand-text {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.teacher-nav,
.student-nav,
.parent-nav {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    margin-inline: 4px;
    padding: 2px 4px;
    scrollbar-width: none;
}

.teacher-nav::-webkit-scrollbar,
.student-nav::-webkit-scrollbar,
.parent-nav::-webkit-scrollbar {
    display: none;
}

.teacher-nav a,
.student-nav a,
.parent-nav a {
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(140, 157, 185, 0.34);
    background: rgba(255, 255, 255, 0.75);
    color: #2a3b56;
    font-size: 11.5px;
    font-weight: 680;
    line-height: 1.15;
}

.teacher-nav a:hover,
.student-nav a:hover,
.parent-nav a:hover {
    border-color: var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #144ca7;
}

.teacher-user,
.student-user,
.parent-user {
    gap: 8px;
}

.teacher-user-meta,
.student-user-meta,
.parent-user-meta {
    gap: 0;
}

.teacher-user-name,
.student-user-name,
.parent-user-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #15243d;
}

.teacher-user-sub,
.student-user-sub,
.parent-user-sub {
    font-size: 11px;
    color: var(--portal-muted);
}

.teacher-pill {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #1249a3;
    font-size: 11px;
    font-weight: 700;
    padding: 0;
}

.teacher-footer,
.student-footer,
.parent-footer {
    border-radius: 16px;
    background: var(--portal-surface);
    border-color: rgba(136, 153, 183, 0.32);
    color: #5b6a80;
}

.teacher-footer-dot,
.student-footer-dot,
.parent-footer-dot {
    opacity: 0.45;
}

.teacher-content,
.student-content,
.parent-content {
    gap: 14px;
}

.teacher-dashboard,
.student-dashboard,
.parent-dashboard {
    gap: 16px;
}

.teacher-section,
.student-section,
.parent-section,
.manager-body .hub-section {
    padding: clamp(14px, 1.7vw, 20px);
    border-radius: 20px;
    border: 1px solid rgba(133, 150, 181, 0.3);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 255, 0.9) 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 40, 0.08);
}

.teacher-section-head h2,
.student-section-head h2,
.parent-section-head h2,
.manager-body .hub-section-head h1,
.manager-body .hub-section-head h2 {
    margin: 0;
    font-size: clamp(19px, 1.45vw, 27px);
    color: #12243d;
}

.teacher-section-sub,
.student-section-sub,
.parent-section-sub,
.manager-body .hub-section-head p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.teacher-grid-2,
.student-grid-2,
.parent-grid-2 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.teacher-grid-3,
.student-grid-3 {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.teacher-card,
.student-card,
.teacher-kpi,
.student-kpi,
.parent-kpi,
.parent-metric,
.parent-weekly-metric,
.teacher-mini,
.student-mini {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 16px;
    background: var(--portal-surface);
    box-shadow: 0 8px 20px rgba(15, 23, 40, 0.06);
}

.teacher-card,
.student-card {
    padding: 14px;
}

.teacher-kpi,
.student-kpi,
.parent-kpi,
.parent-metric,
.parent-weekly-metric {
    padding: 12px 13px;
    display: grid;
    gap: 3px;
}

.teacher-kpi span,
.student-kpi span,
.parent-kpi span,
.parent-metric span,
.parent-weekly-metric span {
    color: #5f6e84;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.teacher-kpi strong,
.student-kpi strong,
.parent-kpi strong,
.parent-metric strong,
.parent-weekly-metric strong {
    color: #13243e;
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.1;
}

.teacher-kpi-sub,
.student-kpi-sub,
.student-type-sub {
    color: #617087;
    font-size: 12px;
}

.teacher-mini,
.student-mini {
    padding: 12px;
    display: grid;
    gap: 8px;
    background: var(--portal-surface-soft);
}

.teacher-mini-title,
.student-mini-title {
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #4d607e;
    font-weight: 700;
}

.teacher-mini-row,
.student-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(133, 151, 183, 0.3);
}

.teacher-mini-row:last-child,
.student-mini-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.teacher-mini-label,
.student-mini-label {
    color: #5f7088;
    font-size: 12px;
}

.teacher-mini-val,
.student-mini-val {
    color: #1a2d4b;
    font-weight: 700;
    font-size: 12px;
    text-align: right;
}

.teacher-hero-copy,
.student-hero-copy,
.parent-hero-copy {
    display: grid;
    gap: 10px;
    align-content: start;
}

.teacher-hero-kicker,
.student-hero-kicker,
.parent-hero-kicker {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #4f6482;
    font-weight: 700;
}

.teacher-hero-title,
.student-hero-title,
.parent-hero-title {
    margin: 0;
    color: #10243e;
    font-size: clamp(30px, 3.2vw, 42px);
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.teacher-hero-sub,
.student-hero-sub,
.parent-hero-sub {
    margin: 0;
    color: #576783;
    font-size: 14px;
}

.teacher-dot,
.student-dot,
.parent-dot {
    margin: 0 8px;
    opacity: 0.5;
}

.teacher-hero-panel,
.student-hero-panel,
.parent-hero-panel {
    min-width: min(430px, 100%);
    display: grid;
    gap: 10px;
    align-content: start;
}

.teacher-kpi-grid,
.student-kpi-grid,
.parent-kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.teacher-info,
.student-info {
    display: grid;
    gap: 0;
}

.teacher-info-row,
.student-info-row {
    display: grid;
    grid-template-columns: minmax(92px, 142px) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(135, 151, 181, 0.28);
}

.teacher-info-row:last-child,
.student-info-row:last-child {
    border-bottom: 0;
}

.teacher-info-key,
.student-info-key {
    color: #5f6f86;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.teacher-info-val,
.student-info-val {
    color: #1a2c47;
    font-size: 13px;
    font-weight: 640;
    min-width: 0;
    overflow-wrap: anywhere;
}

.teacher-note-text {
    margin: 0;
    line-height: 1.65;
}

.teacher-actions,
.teacher-hero-actions,
.student-hero-actions,
.parent-hero-actions {
    gap: 8px;
}

.teacher-chip,
.student-chip,
.parent-chip {
    border-color: rgba(130, 148, 178, 0.36);
    background: rgba(255, 255, 255, 0.76);
    color: #2d4666;
    padding: 7px 12px;
    font-size: 12px;
}

.teacher-chip:hover,
.student-chip:hover,
.parent-chip:hover {
    border-color: rgba(107, 127, 160, 0.42);
    background: rgba(240, 245, 252, 0.92);
    color: #213856;
}

.teacher-link-card {
    text-decoration: none;
    display: grid;
    gap: 9px;
    transition: transform var(--nx-fast), box-shadow var(--nx-fast), border-color var(--nx-fast);
}

.teacher-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 40, 0.12);
}

.teacher-link-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.teacher-link-card-head strong {
    color: #14233a;
    font-size: 16px;
}

.teacher-link-card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #1248a3;
    font-size: 11px;
    font-weight: 700;
}

.teacher-link-card-desc {
    color: #5a6a81;
    margin: 0;
}

.teacher-link-card-teal {
    border-color: rgba(9, 159, 134, 0.34);
    background: linear-gradient(145deg, rgba(8, 159, 132, 0.12) 0%, rgba(255, 255, 255, 0.92) 76%);
}

.teacher-link-card-sky {
    border-color: rgba(8, 106, 230, 0.32);
    background: linear-gradient(145deg, rgba(8, 106, 230, 0.11) 0%, rgba(255, 255, 255, 0.92) 76%);
}

.teacher-link-card-rose {
    border-color: rgba(186, 53, 94, 0.31);
    background: linear-gradient(145deg, rgba(186, 53, 94, 0.11) 0%, rgba(255, 255, 255, 0.92) 76%);
}

.teacher-link-card-indigo {
    border-color: rgba(78, 89, 213, 0.31);
    background: linear-gradient(145deg, rgba(78, 89, 213, 0.11) 0%, rgba(255, 255, 255, 0.92) 76%);
}

.teacher-stat,
.student-stat,
.student-type {
    display: grid;
    gap: 4px;
    padding: 12px;
}

.teacher-stat span,
.student-stat span,
.student-type span {
    color: #5d6e86;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.teacher-stat strong,
.student-stat strong,
.student-type strong {
    color: #14253f;
    font-size: 24px;
    line-height: 1.1;
}

.student-bars {
    display: grid;
    gap: 10px;
}

.student-bar {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(139, 156, 185, 0.3);
    background: var(--portal-surface-soft);
}

.student-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.student-bar-label {
    color: #1b2d48;
    font-size: 13px;
    font-weight: 700;
}

.student-bar-val {
    color: #355178;
    font-size: 12px;
    font-weight: 700;
}

.student-type-grid {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.student-homework {
    display: grid;
    gap: 10px;
}

.student-hw-item {
    border: 1px solid rgba(138, 155, 183, 0.3);
    border-radius: 15px;
    background: var(--portal-surface-soft);
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.student-hw-item.is-done {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.08);
}

.student-hw-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.student-hw-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.student-hw-meta {
    color: #5b6d86;
    font-size: 12px;
}

.student-hw-desc {
    color: #465a79;
    font-size: 13px;
    line-height: 1.55;
}

.student-hw-actions {
    display: grid;
    gap: 8px;
    align-content: start;
}

.student-ann-preview {
    margin: 0;
    color: #4f607b;
    font-size: 13px;
    line-height: 1.5;
}

.student-focus-list li {
    display: grid;
    gap: 4px;
}

.student-focus-cta {
    width: fit-content;
    margin-top: 2px;
}

.teacher-week,
.student-week {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.teacher-day,
.student-day {
    border: 1px solid rgba(138, 154, 183, 0.32);
    border-radius: 14px;
    background: var(--portal-surface-soft);
    padding: 10px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.teacher-day.is-today,
.student-day.is-today {
    border-color: var(--portal-brand-line);
    box-shadow: 0 12px 24px rgba(15, 23, 40, 0.08);
}

.teacher-day-head,
.student-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #1d2f4b;
}

.teacher-day-head strong,
.student-day-head strong {
    font-size: 13px;
}

.teacher-day-head span,
.student-day-head span {
    color: #5c6f87;
    font-size: 11px;
    font-weight: 700;
}

.teacher-day-empty,
.student-day-empty {
    color: #6a7b92;
    font-size: 13px;
}

.teacher-day-list,
.student-day-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.teacher-day-list li,
.student-day-list li {
    border: 1px solid rgba(140, 157, 186, 0.24);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px;
    display: grid;
    gap: 3px;
}

.teacher-lesson-time,
.student-lesson-time {
    color: #5f7189;
    font-size: 11px;
    font-weight: 700;
}

.teacher-lesson-title,
.student-lesson-title {
    color: #172b47;
    font-size: 13px;
    font-weight: 700;
}

.teacher-lesson-class,
.student-lesson-teacher {
    color: #50637f;
    font-size: 12px;
}

.teacher-form {
    display: grid;
    gap: 12px;
}

.teacher-form-row {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.teacher-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.teacher-form-row-wide {
    grid-column: 1 / -1;
}

.teacher-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.teacher-table-wrap,
.student-table-wrap {
    border-radius: 14px;
    border-color: rgba(140, 156, 184, 0.34);
}

.teacher-table-wrap table,
.student-table-wrap table {
    min-width: 700px;
}

.teacher-health-note {
    border: 1px solid rgba(11, 90, 226, 0.22);
    border-radius: 14px;
    background: rgba(11, 90, 226, 0.08);
    color: #24508d;
    padding: 11px 12px;
    font-size: 13px;
    line-height: 1.55;
}

.teacher-health-kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.teacher-health-kpi {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(138, 154, 183, 0.32);
    background: var(--portal-surface-soft);
    display: grid;
    gap: 4px;
}

.teacher-health-kpi span {
    color: #5d6f88;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.teacher-health-kpi strong {
    color: #152844;
    font-size: 25px;
    line-height: 1.08;
}

.teacher-health-kpi small {
    color: #5f718a;
    font-size: 12px;
}

.teacher-health-kpi.tone-risk {
    border-color: rgba(36, 102, 220, 0.36);
    background: rgba(36, 102, 220, 0.09);
}

.teacher-health-kpi.tone-high {
    border-color: rgba(195, 40, 40, 0.36);
    background: rgba(195, 40, 40, 0.11);
}

.teacher-health-kpi.tone-medium {
    border-color: rgba(185, 129, 5, 0.36);
    background: rgba(185, 129, 5, 0.11);
}

.teacher-health-kpi.tone-triage {
    border-color: rgba(9, 159, 134, 0.36);
    background: rgba(9, 159, 134, 0.1);
}

.teacher-health-action-strip {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.teacher-health-action-item {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 12px;
    background: var(--portal-surface);
    padding: 10px;
    display: grid;
    gap: 4px;
}

.teacher-health-action-item span {
    color: #5c6d85;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.teacher-health-action-item strong {
    color: #172b47;
    font-size: 19px;
}

.teacher-health-list {
    display: grid;
    gap: 10px;
}

.teacher-health-item {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 14px;
    background: var(--portal-surface);
    padding: 12px;
    display: grid;
    gap: 9px;
}

.teacher-health-item.risk-high {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.08);
}

.teacher-health-item.risk-medium {
    border-color: rgba(185, 129, 5, 0.34);
    background: rgba(185, 129, 5, 0.08);
}

.teacher-health-item.risk-low {
    border-color: rgba(9, 159, 134, 0.34);
    background: rgba(9, 159, 134, 0.08);
}

.teacher-health-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-health-item-head h3 {
    margin: 0;
    font-size: 17px;
}

.teacher-health-item-meta {
    color: #546884;
    font-size: 12px;
}

.teacher-health-dot {
    opacity: 0.4;
    margin: 0 6px;
}

.teacher-risk-badge.risk-high {
    border-color: rgba(195, 40, 40, 0.4);
    background: rgba(195, 40, 40, 0.14);
    color: #9d2525;
}

.teacher-risk-badge.risk-medium {
    border-color: rgba(185, 129, 5, 0.4);
    background: rgba(185, 129, 5, 0.14);
    color: #906304;
}

.teacher-risk-badge.risk-low {
    border-color: rgba(9, 159, 134, 0.4);
    background: rgba(9, 159, 134, 0.14);
    color: #0a6f5d;
}

.teacher-health-signals {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.teacher-health-signals li {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(138, 154, 183, 0.34);
    background: rgba(255, 255, 255, 0.7);
    color: #42536d;
    font-size: 12px;
}

.teacher-health-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-health-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.teacher-health-disabled {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(138, 154, 183, 0.34);
    background: rgba(255, 255, 255, 0.72);
    color: #546784;
    font-size: 12px;
}

.teacher-health-referral-form button {
    padding: 7px 10px;
    font-size: 12px;
}

.parent-child-switch {
    padding: 12px;
    border: 1px solid rgba(138, 154, 183, 0.32);
    border-radius: 14px;
    background: var(--portal-surface-soft);
    display: grid;
    gap: 8px;
}

.parent-child-row {
    gap: 8px;
}

.parent-child-row > * {
    flex: 1 1 180px;
}

.parent-child-row button {
    flex: 0 0 auto;
}

.parent-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.parent-trust-grid {
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    gap: 12px;
}

.parent-trust-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(138, 154, 183, 0.3);
    background: var(--portal-surface);
    display: grid;
    gap: 8px;
}

.parent-trust-card.tone-good {
    border-color: rgba(15, 143, 99, 0.36);
    background: rgba(15, 143, 99, 0.1);
}

.parent-trust-card.tone-warn,
.parent-trust-card.tone-medium {
    border-color: rgba(185, 129, 5, 0.36);
    background: rgba(185, 129, 5, 0.1);
}

.parent-trust-card.tone-risk,
.parent-trust-card.tone-danger,
.parent-trust-card.tone-bad {
    border-color: rgba(195, 40, 40, 0.36);
    background: rgba(195, 40, 40, 0.11);
}

.parent-trust-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.parent-trust-label {
    color: #5e718a;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.parent-trust-status {
    color: #223a5d;
    font-size: 12px;
    font-weight: 700;
}

.parent-trust-score {
    color: #112641;
    font-size: clamp(34px, 3.2vw, 48px);
    font-weight: 800;
    line-height: 1;
}

.parent-trust-score small {
    font-size: 15px;
    color: #4f6380;
    margin-left: 3px;
}

.parent-trust-headline {
    margin: 0;
    color: #334b6f;
}

.parent-trust-meta {
    color: #526680;
    font-size: 12px;
}

.parent-trust-kpis,
.parent-weekly-metrics,
.parent-metric-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.parent-trust-highlights {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.parent-trust-highlight {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 12px;
    background: var(--portal-surface-soft);
    color: #344a6c;
    font-size: 13px;
    padding: 10px 12px;
}

.parent-trust-panels {
    margin-top: 2px;
}

.parent-trust,
.parent-weekly {
    position: relative;
}

.parent-trust-timeline,
.parent-trust-plan {
    min-height: 100%;
}

.parent-touch-list {
    display: grid;
    gap: 8px;
}

.parent-touch-item {
    border: 1px solid rgba(138, 154, 183, 0.27);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px;
    display: grid;
    gap: 5px;
}

.parent-touch-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.parent-touch-time {
    color: #5e718a;
    font-size: 11px;
    font-weight: 700;
}

.parent-touch-detail {
    color: #42556f;
    font-size: 13px;
}

.parent-touch-actor {
    color: #2e4667;
    font-size: 12px;
    font-weight: 700;
}

.parent-touch-role {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: #60718a;
    font-weight: 600;
}

.parent-weekly-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.parent-weekly-score {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 16px;
    background: var(--portal-surface);
    padding: 14px;
    display: grid;
    gap: 8px;
}

.parent-weekly-score.tone-good {
    border-color: rgba(15, 143, 99, 0.36);
    background: rgba(15, 143, 99, 0.1);
}

.parent-weekly-score.tone-warn,
.parent-weekly-score.tone-medium {
    border-color: rgba(185, 129, 5, 0.36);
    background: rgba(185, 129, 5, 0.1);
}

.parent-weekly-score.tone-risk,
.parent-weekly-score.tone-danger,
.parent-weekly-score.tone-bad {
    border-color: rgba(195, 40, 40, 0.36);
    background: rgba(195, 40, 40, 0.11);
}

.parent-weekly-score-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.parent-weekly-label {
    color: #5e7189;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.parent-weekly-status {
    color: #20395f;
    font-size: 12px;
    font-weight: 700;
}

.parent-weekly-score-value {
    color: #122742;
    font-size: clamp(34px, 3.2vw, 48px);
    font-weight: 800;
    line-height: 1;
}

.parent-weekly-score-value small {
    font-size: 14px;
    color: #506480;
    margin-left: 3px;
}

.parent-weekly-headline {
    margin: 0;
    color: #334b6d;
}

.parent-weekly-actions {
    margin-top: 2px;
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 14px;
    background: var(--portal-surface-soft);
    padding: 12px;
}

.parent-weekly-actions h3 {
    margin-bottom: 8px;
}

.parent-weekly-actions ul {
    padding-left: 18px;
}

.parent-target-list,
.targets-list,
.targets-results {
    display: grid;
    gap: 10px;
}

.parent-target-item,
.target-card {
    border: 1px solid rgba(138, 154, 183, 0.32);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    padding: 11px;
}

.target-card.is-primary {
    border-color: rgba(15, 143, 99, 0.36);
    box-shadow: 0 10px 24px rgba(15, 143, 99, 0.14);
}

.parent-target-head,
.target-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.target-kicker,
.target-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.parent-target-title,
.target-title {
    color: #182c4a;
    font-size: 15px;
    font-weight: 700;
    margin-top: 6px;
}

.parent-target-meta,
.target-meta {
    color: #546983;
    font-size: 12px;
    margin-top: 4px;
}

.parent-target-base,
.target-delta {
    color: #2a466e;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 700;
}

.target-body {
    display: grid;
    gap: 6px;
}

.target-stats {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.targets-slots {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #1a4c9f;
    font-size: 12px;
    font-weight: 700;
}

.targets-search,
.targets-metrics-form {
    display: grid;
    gap: 8px;
}

.targets-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.targets-search-row > * {
    flex: 1 1 170px;
}

.targets-result {
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 13px;
    background: var(--portal-surface-soft);
    padding: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.targets-result-main {
    min-width: 0;
}

.targets-result-title {
    color: #182b48;
    font-size: 14px;
    font-weight: 700;
}

.targets-result-sub {
    color: #546981;
    font-size: 12px;
    margin-top: 3px;
}

.targets-result-badges {
    margin-top: 7px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.targets-btn {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.targets-btn.danger {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.12);
    color: #992424;
}

.targets-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.targets-metric {
    border: 1px solid rgba(138, 154, 183, 0.32);
    border-radius: 12px;
    background: var(--portal-surface-soft);
    padding: 11px;
    display: grid;
    gap: 4px;
}

.targets-metric span {
    color: #5d6f87;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.targets-metric strong {
    color: #162a47;
    font-size: 22px;
    line-height: 1.12;
}

.nexia-chart-card {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.nexia-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.nexia-chart-head h3 {
    margin: 0;
    font-size: 16px;
}

.nexia-chart-sub {
    color: #60708a;
    font-size: 12px;
    font-weight: 700;
}

.nexia-chart-rows {
    display: grid;
    gap: 8px;
}

.nexia-chart-row {
    display: grid;
    grid-template-columns: minmax(90px, 116px) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.nexia-chart-label {
    color: #2d405d;
    font-size: 12px;
    font-weight: 700;
}

.nexia-chart-value {
    color: #233b5d;
    font-size: 12px;
    font-weight: 700;
    min-width: 32px;
    text-align: right;
}

.nexia-chart-fill.tone-brand {
    background: linear-gradient(90deg, #0a69ff, #2f8cff);
}

.nexia-chart-fill.tone-accent {
    background: linear-gradient(90deg, #089a86, #17b7a1);
}

.nexia-chart-fill.tone-muted {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}

.manager-body .admin-layout {
    gap: 18px;
    padding: 18px;
}

.manager-body .admin-content {
    gap: 14px;
}

.manager-body .topbar {
    gap: 10px;
    padding: 16px 18px;
    border-radius: 22px;
    border-color: rgba(130, 148, 180, 0.36);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 255, 0.9) 100%);
    box-shadow: 0 16px 38px rgba(15, 23, 40, 0.1);
}

.manager-body .topbar-title-text {
    font-size: clamp(21px, 2vw, 31px);
    letter-spacing: -0.02em;
}

.manager-body .topbar-sub {
    color: #5c6d85;
}

.manager-body .hub-inline-link {
    border-color: var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #1248a2;
}

.manager-body .hub-badge {
    border-color: var(--portal-brand-line);
    background: var(--portal-brand-soft);
    color: #1248a2;
}

.manager-body .hub-quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.manager-body .hub-quick-card {
    padding: 16px;
    border-radius: 16px;
}

.manager-body .hub-quick-card h3 {
    margin-bottom: 5px;
}

.manager-body .hub-action-btn {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.manager-body #manager-summary .card {
    border-radius: 15px;
}

/* PDR portal card/grid hardening */
.pdr-body {
    overflow-x: hidden;
}

.pdr-admin-layout {
    align-items: start;
}

.pdr-admin-content {
    min-width: 0;
    gap: 14px;
}

.pdr-topbar {
    gap: 10px;
}

.pdr-panel-card,
.pdr-sub-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.pdr-sub-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(138, 154, 183, 0.28);
    background: rgba(255, 255, 255, 0.82);
}

.pdr-panel-card :where(h1, h2, h3, h4, p, span, strong, a, li),
.pdr-sub-card :where(h1, h2, h3, h4, p, span, strong, a, li) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pdr-stat-card {
    display: grid;
    gap: 3px;
    padding: 12px 13px;
    border: 1px solid rgba(138, 154, 183, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    min-width: 0;
}

.pdr-stat-card span {
    color: #5f6e84;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.pdr-stat-card strong {
    color: #13243e;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.1;
}

.pdr-filter-grid,
.pdr-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.pdr-filter-grid .form-group,
.pdr-form-grid .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.pdr-form-full {
    grid-column: 1 / -1;
}

.pdr-filter-actions,
.pdr-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdr-filter-actions > *,
.pdr-actions-inline > * {
    flex: 0 1 auto;
    min-width: 0;
}

.pdr-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdr-mini-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.pdr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.pdr-list li {
    min-width: 0;
    overflow-wrap: anywhere;
}

.pdr-list-bullet {
    list-style: disc;
    padding-inline-start: 20px;
}

.pdr-list-bullet li {
    display: list-item;
}

.pdr-status,
.pdr-risk-badge,
.pdr-tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(123, 142, 173, 0.38);
    background: rgba(255, 255, 255, 0.74);
    color: #2d3b52;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pdr-status {
    border-color: rgba(126, 145, 175, 0.44);
    background: rgba(114, 131, 161, 0.14);
    color: #3a4f6d;
}

.pdr-status.status-new,
.pdr-status.status-open {
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #164ea8;
}

.pdr-status.status-triaged,
.pdr-status.status-in_progress {
    border-color: rgba(185, 129, 5, 0.36);
    background: rgba(185, 129, 5, 0.14);
    color: #8b6005;
}

.pdr-status.status-resolved {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.14);
    color: #0b6d4a;
}

.pdr-status.status-dismissed {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.14);
    color: #9a2828;
}

.pdr-risk-badge {
    border-color: rgba(126, 145, 175, 0.44);
    background: rgba(114, 131, 161, 0.14);
    color: #3a4f6d;
}

.pdr-risk-badge.risk-low {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.14);
    color: #0b6d4a;
}

.pdr-risk-badge.risk-medium {
    border-color: rgba(185, 129, 5, 0.36);
    background: rgba(185, 129, 5, 0.14);
    color: #8b6005;
}

.pdr-risk-badge.risk-high {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.14);
    color: #9a2828;
}

.pdr-tier-badge {
    border-color: rgba(72, 98, 144, 0.36);
    background: rgba(72, 98, 144, 0.13);
    color: #1e3658;
}

.pdr-btn {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.pdr-report-spaced {
    margin-bottom: 12px;
}

/* Portal layout hardening (no color change) */
.teacher-grid-2 > *,
.student-grid-2 > *,
.parent-grid-2 > *,
.teacher-grid-3 > *,
.student-grid-3 > *,
.nexia-chart-grid > *,
.pdr-stats-grid > *,
.pdr-grid-2 > *,
.pdr-mini-stats > *,
.teacher-kpi-grid > *,
.student-kpi-grid > *,
.parent-kpi-grid > *,
.teacher-health-kpi-grid > *,
.parent-trust-grid > *,
.parent-weekly-summary > *,
.parent-trust-kpis > *,
.parent-weekly-metrics > *,
.parent-metric-grid > *,
.hub-quick-grid > *,
.stats-grid > * {
    min-width: 0;
}

.teacher-card,
.student-card,
.teacher-kpi,
.student-kpi,
.parent-kpi,
.parent-metric,
.parent-weekly-metric,
.parent-trust-card,
.parent-touch-item,
.parent-weekly-score,
.parent-weekly-actions,
.target-card,
.manager-body .hub-quick-card,
.manager-body #manager-summary .card {
    min-width: 0;
    overflow: hidden;
}

.teacher-card :where(h1, h2, h3, h4, p, span, strong, a, li),
.student-card :where(h1, h2, h3, h4, p, span, strong, a, li),
.parent-section :where(h1, h2, h3, h4, p, span, strong, a, li),
.manager-body .hub-section :where(h1, h2, h3, h4, p, span, strong, a, li) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.teacher-link-card-head,
.parent-trust-head,
.parent-touch-head,
.parent-weekly-score-head {
    flex-wrap: wrap;
}

.table-scroll,
.teacher-table-wrap,
.student-table-wrap,
.pdr-table-wrap,
.nx-table-wrap {
    max-width: 100%;
}

.manager-body .hub-actions > * {
    flex: 1 1 170px;
    min-width: 0;
}

@media (max-width: 1260px) {
    .parent-trust-grid,
    .parent-weekly-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .teacher-grid-2,
    .student-grid-2,
    .parent-grid-2,
    .pdr-grid-2 {
        grid-template-columns: 1fr;
    }

    .teacher-grid-3,
    .student-grid-3,
    .pdr-filter-grid,
    .pdr-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-hw-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .teacher-grid-3,
    .student-grid-3,
    .teacher-week,
    .student-week {
        grid-template-columns: 1fr;
    }

    .targets-search-row > *,
    .target-actions > *,
    .parent-child-row > *,
    .student-hw-actions > *,
    .pdr-filter-actions > *,
    .pdr-actions-inline > *,
    .manager-body .hub-actions > * {
        flex: 1 1 100%;
        width: 100%;
    }

    .pdr-filter-grid,
    .pdr-form-grid,
    .pdr-mini-stats {
        grid-template-columns: 1fr;
    }

    .targets-result {
        flex-direction: column;
    }
}

@keyframes nx-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1200px) {
    .msg-index-shell,
    .ann-index-shell,
    .acd-index-shell {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }

    .msg-index-shell > .msg-hero,
    .ann-index-shell > .ann-hero,
    .acd-index-shell > .acd-hero {
        grid-column: span 7;
        height: 100%;
    }

    .msg-index-shell > .msg-kpi-grid,
    .ann-index-shell > .ann-kpi-grid,
    .acd-index-shell > .acd-owner-filter {
        grid-column: span 5;
    }

    .acd-index-shell > .acd-kpi-grid {
        grid-column: span 7;
    }

    .acd-index-shell > .acd-toolbar-card {
        grid-column: span 5;
        align-self: stretch;
    }

    .msg-index-shell > :is(.msg-owner-filter, .msg-toolbar, .msg-tabbar, .msg-panel, .msg-empty-card),
    .ann-index-shell > :is(.ann-toolbar, .ann-tabbar, .ann-panel),
    .acd-index-shell > :is(.acd-table-card, .acd-form-card, .acd-empty) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1280px) {
    .profile-header,
    .school-hero,
    .teacher-hero,
    .student-hero,
    .parent-hero,
    .pdr-hero,
    .pm-hero,
    .asm-hero,
    .usr-hero,
    .qb-page-header {
        grid-template-columns: 1fr;
    }

    .acc-main-grid {
        grid-template-columns: 1fr;
    }

    .acc-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acc-groups {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .set-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msg-index-shell,
    .ann-index-shell,
    .acd-index-shell {
        grid-template-columns: 1fr;
    }

    .msg-index-shell > *,
    .ann-index-shell > *,
    .acd-index-shell > * {
        grid-column: 1 / -1;
    }

    .msg-kpi-grid,
    .ann-kpi-grid,
    .acd-kpi-grid,
    .msg-show-grid,
    .ann-show-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acd-filter-grid,
    .acd-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .sidebar-menu {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .sidebar-submenu {
        grid-template-columns: 1fr;
    }

    .sx-layout,
    .sx-command {
        grid-template-columns: 1fr;
    }

    .set-shell > .set-section {
        grid-column: 1 / -1;
    }

    .set-hero {
        grid-template-columns: 1fr;
    }

    .set-hero-actions {
        min-width: 0;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 980px) {
    .ai-pdf-index-page .ai-pdf-generate-form > * {
        flex: 1 1 170px;
    }

    .qb-grid.qb-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sec-main-grid,
    .health-grid,
    .bak-action-grid,
    .tgt-import-grid,
    .sbj-layout {
        grid-template-columns: 1fr;
    }

    .acc-toolbar {
        grid-template-columns: 1fr;
    }

    .set-form-grid {
        grid-template-columns: 1fr;
    }

    .atd-form-layout,
    .grd-form-layout,
    .ttb-layout,
    .scm-layout,
    .wa-layout {
        grid-template-columns: 1fr;
    }

    .msg-hero,
    .ann-hero,
    .acd-hero,
    .msg-toolbar,
    .ann-toolbar,
    .msg-compose-layout,
    .ann-create-layout,
    .acd-filter-grid,
    .acd-form-grid,
    .msg-show-grid,
    .ann-show-grid {
        grid-template-columns: 1fr;
    }

    .msg-kpi-grid,
    .ann-kpi-grid,
    .acd-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msg-hero-actions,
    .ann-hero-actions,
    .acd-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .nexia-chart-grid,
    .pdr-grid-2,
    .grid-2,
    .hero-container,
    .atd-hero-grid,
    .grd-hero-grid,
    .exm-hero-grid,
    .ttb-hero-grid,
    .wa-hero-grid,
    .scm-hero-grid,
    .cls-hero-grid,
    .pm-hero-grid,
    .asm-hero-grid,
    .usr-hero-grid,
    .profile-header,
    .school-hero,
    .teacher-hero,
    .student-hero,
    .parent-hero,
    .pdr-hero,
    .pm-hero,
    .asm-hero,
    .usr-hero,
    .qb-page-header {
        grid-template-columns: 1fr;
    }

    .topbar,
    .teacher-topbar,
    .student-topbar,
    .parent-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-user,
    .teacher-user,
    .student-user,
    .parent-user {
        width: 100%;
        justify-content: flex-start;
    }

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ai-pdf-questions-page .hub-actions .inline-form,
    .ai-pdf-questions-page .hub-actions .inline-form button,
    .ai-pdf-questions-page .hub-actions > .hub-action-btn {
        width: 100%;
    }

    .qb-grid.qb-grid-2,
    .qb-grid.qb-grid-3,
    .qb-create-page .qb-symbol-catalog {
        grid-template-columns: 1fr;
    }

    .qb-create-page .qb-symbol-grid {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    }

    .acc-hero-grid,
    .sec-hero-grid,
    .health-hero-grid,
    .bak-hero-grid,
    .sbj-hero-grid,
    .tgt-hero-grid {
        grid-template-columns: 1fr;
    }

    .acc-item {
        grid-template-columns: 1fr;
    }

    .acc-item-meta {
        justify-content: flex-start;
    }

    .sbj-head-tools .sbj-search,
    .tgt-head-tools .tgt-search {
        width: 100%;
    }

    .toolbar-form [class*="u-ctl-"],
    .inline-form [class*="u-ctl-"],
    .hub-actions [class*="u-ctl-"] {
        width: 100% !important;
        min-width: 0 !important;
    }

    .set-kpi-grid,
    .set-card-grid {
        grid-template-columns: 1fr;
    }

    .set-owner-filter-row > * {
        width: 100%;
    }

    .set-owner-filter-row .set-btn {
        justify-content: center;
    }

    .set-actions-row {
        justify-content: flex-start;
    }

    .msg-kpi-grid,
    .ann-kpi-grid,
    .acd-kpi-grid,
    .ann-check-grid {
        grid-template-columns: 1fr;
    }

    .msg-owner-filter-row > *,
    .acd-owner-row > *,
    .msg-toolbar-actions > *,
    .ann-toolbar-actions > *,
    .msg-compose-actions > *,
    .ann-create-actions > *,
    .acd-filter-actions > * {
        width: 100%;
    }

    .msg-toolbar-actions,
    .ann-toolbar-actions,
    .msg-compose-actions,
    .ann-create-actions,
    .acd-filter-actions,
    .acd-actions-inline {
        justify-content: flex-start;
    }

    [class$="-table-tools"] input[type="search"],
    [class$="-board-tools"] input[type="search"] {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 680px) {
    table,
    .admin-table,
    .qb-table,
    .nexia-table,
    .asm-table {
        min-width: 520px;
    }

    .teacher-shell,
    .student-shell,
    .parent-shell,
    .exam-shell,
    .sheet {
        width: min(100%, calc(100% - 16px));
    }
}

@media (max-width: 640px) {
    .features-grid,
    .cls-class-grid {
        grid-template-columns: 1fr;
    }

    .ai-pdf-index-page .ai-pdf-generate-form > * {
        flex: 1 1 100%;
        width: 100% !important;
    }

    .ai-pdf-index-page .hub-actions > .hub-action-btn,
    .ai-pdf-index-page .hub-actions > .inline-form,
    .ai-pdf-index-page .hub-actions > .inline-form button {
        width: 100%;
    }
}

/* Module fallback layout: keep undefined module grids/cards consistent */
:where(
    [class*="-kpi-grid"],
    [class*="-split-grid"],
    [class*="-edit-grid"],
    [class*="-studio-grid"],
    [class*="-summary-grid"],
    [class*="-module-grid"],
    [class*="-pulse-grid"],
    [class*="-preview-grid"],
    [class*="-setting-grid"],
    [class*="-wizard-grid"],
    [class*="-info-grid"],
    [class*="-roster-grid"],
    [class*="-week-grid"],
    [class*="-alert-grid"],
    [class*="-card-grid"]
) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    align-items: stretch;
}

:where(.form-grid, [class*="-filter-grid"], [class*="-form-grid"]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    align-items: end;
}

:where(.form-grid, [class*="-filter-grid"], [class*="-form-grid"]) > * {
    min-width: 0;
}

:where(
    [class*="-table-card"],
    [class*="-filter-card"],
    [class*="-form-card"],
    [class*="-panel-card"],
    [class*="-board-card"],
    [class*="-show-card"],
    [class*="-info-card"],
    [class*="-note-card"],
    [class*="-preview-card"],
    [class*="-wizard-card"],
    [class*="-empty-card"],
    [class*="-danger-card"],
    [class*="-health-card"],
    [class*="-score-card"],
    [class*="-module-card"],
    [class*="-pulse-card"],
    [class*="-subcard"],
    .acc-card,
    .asm-card,
    .qb-card,
    .qb-alert-card,
    .cls-class-card,
    .cls-day-card,
    .cls-pick-card,
    .cls-roster-card,
    .cls-schedule-card,
    .cls-tip-card,
    .theme-preview-card,
    .theme-studio-card,
    .wa-preview-card
) {
    display: grid;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

:where([class*="-kpi-card"]) {
    min-width: 0;
    overflow: hidden;
}

:where([class*="-card-top"], [class*="-card-actions"], [class*="-card-metrics"]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

:where([class*="-card-meta"]) {
    margin: 0;
    color: #5f7088;
    font-size: 12px;
    line-height: 1.45;
}

:where([class*="-card-id"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(123, 142, 173, 0.38);
    background: rgba(255, 255, 255, 0.74);
    color: #2d3b52;
    font-size: 11px;
    font-weight: 700;
}

.ttb-grid-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.ttb-grid-corner,
.ttb-grid-day,
.ttb-grid-period,
.ttb-grid-cell {
    border: 1px solid rgba(149, 164, 189, 0.32);
}

.ttb-grid-corner,
.ttb-grid-day {
    background: rgba(245, 248, 255, 0.96);
    color: #274163;
    font-weight: 700;
}

.ttb-grid-corner,
.ttb-grid-day,
.ttb-grid-period {
    padding: 9px 10px;
}

.ttb-grid-period {
    background: rgba(250, 252, 255, 0.96);
    color: #4c607d;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ttb-grid-cell {
    min-width: 140px;
    padding: 8px;
    vertical-align: top;
    background: rgba(255, 255, 255, 0.8);
}

/* Global compact layout: keep cards/forms side by side on tablet+ */
.cls-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    align-items: end;
}

.cls-filters > * {
    min-width: 0;
}

:where(
    .cards,
    .stats-grid,
    .hub-quick-grid,
    .cls-class-grid,
    .nexia-chart-grid,
    .teacher-grid-2,
    .student-grid-2,
    .parent-grid-2,
    .teacher-grid-3,
    .student-grid-3,
    .msg-kpi-grid,
    .ann-kpi-grid,
    .acd-kpi-grid,
    .msg-show-grid,
    .ann-show-grid,
    .set-card-grid,
    [class$="-kpi-grid"]
) {
    align-items: stretch;
}

:where(.form-grid, [class$="-filter-grid"], [class$="-form-grid"]) > * {
    min-width: 0;
}

@media (max-width: 980px) {
    :where(
        .cards,
        .stats-grid,
        .hub-quick-grid,
        .cls-class-grid,
        .nexia-chart-grid,
        .teacher-grid-2,
        .student-grid-2,
        .parent-grid-2,
        .teacher-grid-3,
        .student-grid-3,
        .msg-kpi-grid,
        .ann-kpi-grid,
        .acd-kpi-grid,
        .msg-show-grid,
        .ann-show-grid,
        .set-kpi-grid,
        .set-card-grid,
        [class$="-kpi-grid"]
    ) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    :where(.form-grid, [class$="-filter-grid"], [class$="-form-grid"], .cls-filters) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    :where(
        .msg-toolbar,
        .ann-toolbar,
        .msg-compose-layout,
        .ann-create-layout,
        .cls-form-layout,
        .atd-form-layout,
        .grd-form-layout,
        .ttb-layout,
        .scm-layout,
        .wa-layout
    ) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    :where(
        .msg-owner-filter-row > *,
        .acd-owner-row > *,
        .msg-toolbar-actions > *,
        .ann-toolbar-actions > *,
        .msg-compose-actions > *,
        .ann-create-actions > *,
        .acd-filter-actions > *,
        .set-owner-filter-row > *,
        .set-actions-row > *,
        .targets-search-row > *
    ) {
        width: auto;
        flex: 1 1 170px;
    }
}

@media (max-width: 640px) {
    :where(
        .cards,
        .stats-grid,
        .hub-quick-grid,
        .cls-class-grid,
        .nexia-chart-grid,
        .teacher-grid-2,
        .student-grid-2,
        .parent-grid-2,
        .teacher-grid-3,
        .student-grid-3,
        .msg-kpi-grid,
        .ann-kpi-grid,
        .acd-kpi-grid,
        .msg-show-grid,
        .ann-show-grid,
        .set-kpi-grid,
        .set-card-grid,
        [class$="-kpi-grid"],
        .form-grid,
        [class$="-filter-grid"],
        [class$="-form-grid"],
        .cls-filters,
        .msg-toolbar,
        .ann-toolbar,
        .msg-compose-layout,
        .ann-create-layout,
        .cls-form-layout,
        .atd-form-layout,
        .grd-form-layout,
        .ttb-layout,
        .scm-layout,
        .wa-layout
    ) {
        grid-template-columns: 1fr !important;
    }

    :where(
        .msg-owner-filter-row > *,
        .acd-owner-row > *,
        .msg-toolbar-actions > *,
        .ann-toolbar-actions > *,
        .msg-compose-actions > *,
        .ann-create-actions > *,
        .acd-filter-actions > *,
        .set-owner-filter-row > *,
        .set-actions-row > *,
        .targets-search-row > *
    ) {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    body::before,
    .exam-backdrop,
    .sidebar,
    .topbar,
    .teacher-topbar,
    .student-topbar,
    .parent-topbar,
    .toolbar,
    .teacher-footer,
    .student-footer,
    .parent-footer {
        display: none !important;
    }

    .admin-layout,
    .teacher-shell,
    .student-shell,
    .parent-shell,
    .sheet,
    .exam-shell,
    .admin-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #fff !important;
    }

    .leaf-toolbar {
        display: none !important;
    }

    .leaf-sheet {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .leaf-body {
        gap: 14px;
    }

    .leaf-body::before {
        transform: translateX(-7px);
    }
}

/* LMS flat interface override: no gradients, modern neutral palette */
:root {
    --nx-bg: #f3f6fb;
    --nx-bg-deep: #edf1f7;
    --nx-surface: #ffffff;
    --nx-surface-soft: #f8fafd;
    --nx-line: #d4dce8;
    --nx-text: #0f1b2d;
    --nx-muted: #536179;
    --nx-brand: #2563eb;
    --nx-brand-strong: #1d4ed8;
    --nx-accent: #0f766e;
    --nx-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.07);
    --nx-shadow-strong: 0 16px 36px rgba(15, 23, 42, 0.1);
    --gradient-primary: #2563eb;
    --gradient-accent: #0f766e;
    --gradient-premium: #eef2f8;
}

:root[data-theme="dark"] {
    --nx-bg: #0b1220;
    --nx-bg-deep: #0a1324;
    --nx-surface: #111b2f;
    --nx-surface-soft: #14233a;
    --nx-line: #26364f;
    --nx-text: #e6edf8;
    --nx-muted: #9cafca;
    --nx-brand: #3b82f6;
    --nx-brand-strong: #2563eb;
    --nx-accent: #14b8a6;
    --gradient-primary: #3b82f6;
    --gradient-accent: #14b8a6;
    --gradient-premium: #172235;
}

html,
body,
.app-body,
.admin-body,
.manager-body,
.teacher-body,
.student-body,
.parent-body {
    background: var(--nx-bg) !important;
    background-image: none !important;
}

body::before,
.teacher-shell::before,
.student-shell::before,
.parent-shell::before,
.leaf-body::before {
    display: none !important;
    background: none !important;
}

:where(
    .sidebar,
    .topbar,
    .teacher-topbar,
    .student-topbar,
    .parent-topbar,
    .nx-command-panel,
    .card,
    .detail-card,
    .nexia-card,
    .nx-card,
    .teacher-section,
    .student-section,
    .parent-section,
    .hub-section,
    .msg-shell > *,
    .ann-shell > *,
    .acd-shell > *,
    [class*="-hero"],
    [class*="-panel"]
) {
    background-color: var(--nx-surface) !important;
    background-image: none !important;
    border-color: var(--nx-line) !important;
    backdrop-filter: none !important;
}

.sidebar,
.topbar,
.teacher-topbar,
.student-topbar,
.parent-topbar,
.card,
.detail-card,
.nexia-card,
.nx-card {
    box-shadow: var(--nx-shadow-soft) !important;
}

.nx-btn-primary,
.topbar-logout,
.msg-btn-primary,
.ann-btn-primary,
.sidebar-menu a.active {
    background: var(--nx-brand) !important;
    background-image: none !important;
    border-color: var(--nx-brand) !important;
    color: #fff !important;
}

.nx-btn-primary:hover,
.topbar-logout:hover,
.msg-btn-primary:hover,
.ann-btn-primary:hover,
.sidebar-menu a.active:hover {
    background: var(--nx-brand-strong) !important;
    border-color: var(--nx-brand-strong) !important;
}

#admin-summary .stats-grid .card::before,
#admin-quick-actions .hub-quick-card::before {
    background: #94a3b8 !important;
}

#admin-summary .stats-grid .card:nth-child(4n + 1)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 1)::before {
    background: #2563eb !important;
}

#admin-summary .stats-grid .card:nth-child(4n + 2)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 2)::before {
    background: #0f766e !important;
}

#admin-summary .stats-grid .card:nth-child(4n + 3)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 3)::before {
    background: #4f46e5 !important;
}

#admin-summary .stats-grid .card:nth-child(4n + 4)::before,
#admin-quick-actions .hub-quick-card:nth-child(4n + 4)::before {
    background: #d97706 !important;
}

/* Module layout normalization: reports, messaging-related centers, calendar, documents */
.msg-index-shell,
.ann-index-shell {
    grid-auto-flow: row;
    gap: 12px;
}

.msg-index-shell > *,
.ann-index-shell > * {
    min-width: 0;
}

.cal-shell,
.doc-shell,
.rep-shell {
    display: grid;
    gap: 12px;
}

.cal-shell > *,
.doc-shell > *,
.rep-shell > * {
    min-width: 0;
}

:where(.cal-shell, .doc-shell, .rep-shell) :where(.nx-card, .detail-card, .card, .nexia-card) {
    border-color: color-mix(in srgb, var(--nx-brand, #2563eb) 24%, #c7d2e2);
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--nx-brand, #2563eb) 56%, #fff 44%),
        var(--nx-shadow-soft);
}

.cal-hero,
.doc-hero,
.rep-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.cal-hero-main,
.doc-hero-main,
.rep-hero-main {
    display: grid;
    gap: 8px;
}

.cal-hero-meta,
.doc-hero-meta,
.rep-hero-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cal-hero-actions,
.doc-hero-actions,
.rep-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-eyebrow,
.doc-eyebrow,
.rep-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(10, 105, 255, 0.3);
    background: rgba(10, 105, 255, 0.1);
    color: #1148a7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cal-kpi-grid,
.doc-kpi-grid,
.rep-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.cal-kpi-card,
.doc-kpi-card,
.rep-kpi-card {
    display: grid;
    gap: 4px;
    align-content: start;
}

.cal-kpi-card span,
.doc-kpi-card span,
.rep-kpi-card span {
    color: #4d5e79;
    font-size: 12px;
    font-weight: 700;
}

.cal-kpi-card strong,
.doc-kpi-card strong,
.rep-kpi-card strong {
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.1;
    color: #12213a;
}

.cal-kpi-card small,
.doc-kpi-card small,
.rep-kpi-card small {
    color: #5d6b82;
    font-size: 12px;
}

.cal-owner-filter-row,
.doc-owner-filter-row,
.rep-owner-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-owner-filter-row .cal-input,
.doc-owner-filter-row .doc-input,
.rep-owner-filter-row .rep-input {
    flex: 1 1 220px;
    min-width: 170px;
}

.cal-toolbar,
.doc-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.rep-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(170px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

.cal-search-wrap,
.doc-search-wrap,
.rep-search-wrap {
    min-width: 0;
}

.cal-toolbar-actions,
.doc-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cal-pill-group,
.doc-pill-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-pill,
.doc-pill {
    appearance: none;
    border: 1px solid rgba(138, 154, 181, 0.46);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #273447;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.cal-pill:hover,
.doc-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.36);
}

.cal-pill.is-active,
.doc-pill.is-active {
    border-color: rgba(10, 105, 255, 0.36);
    background: rgba(10, 105, 255, 0.12);
    color: #1048aa;
}

.cal-table-head,
.doc-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cal-check-all,
.doc-check-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #304158;
}

.cal-table-wrap,
.doc-table-wrap {
    min-width: 0;
}

.cal-table,
.doc-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.cal-main-text,
.doc-main-text {
    font-weight: 700;
    color: #1f2d41;
}

.cal-sub-text,
.doc-sub-text {
    color: var(--nx-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.cal-col-actions,
.doc-col-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.cal-empty-state,
.doc-empty-state,
.cal-filter-empty,
.doc-filter-empty {
    margin: 0;
    color: var(--nx-muted);
}

.cal-chip,
.doc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(138, 154, 181, 0.38);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    color: #2f4159;
    background: rgba(255, 255, 255, 0.74);
}

.cal-chip.is-tenant {
    border-color: rgba(10, 105, 255, 0.34);
    background: rgba(10, 105, 255, 0.12);
    color: #1148a7;
}

.cal-chip.is-staff {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.12);
    color: #0a6d4a;
}

.cal-chip.is-students,
.doc-chip.is-type {
    border-color: rgba(123, 142, 173, 0.36);
    background: rgba(123, 142, 173, 0.13);
    color: #3a4b63;
}

.cal-create-layout,
.doc-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 12px;
    align-items: start;
}

.cal-create-form,
.doc-create-form {
    display: grid;
    gap: 12px;
}

.cal-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cal-field-row,
.doc-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-template-list,
.doc-template-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-template-btn,
.doc-template-btn,
.cal-mini-btn {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.cal-quick-time,
.cal-check-row,
.cal-create-actions,
.doc-create-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-preview-block,
.doc-preview-block {
    border: 1px solid rgba(150, 165, 189, 0.3);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.88);
    padding: 8px 10px;
    display: grid;
    gap: 3px;
}

.cal-preview-block span,
.doc-preview-block span {
    color: var(--nx-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-preview-body,
.doc-preview-body {
    min-height: 140px;
    white-space: pre-wrap;
    border: 1px solid rgba(150, 165, 189, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    padding: 10px;
    color: #1f2d41;
}

.doc-file-drop {
    border: 1px dashed rgba(135, 153, 183, 0.46);
    border-radius: 12px;
    padding: 12px;
    background: rgba(247, 250, 255, 0.85);
}

.doc-file-copy {
    margin-top: 8px;
    color: var(--nx-muted);
    font-size: 12px;
}

.rep-owner-filter {
    display: grid;
    gap: 8px;
}

.rep-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(139, 157, 185, 0.34);
    background: rgba(255, 255, 255, 0.72);
    color: #304158;
    font-size: 12px;
    font-weight: 700;
}

.rep-result-badge {
    align-self: end;
}

.rep-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 12px;
    align-items: start;
}

.rep-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.rep-module-card {
    border: 1px solid rgba(139, 157, 185, 0.34);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    padding: 12px;
    display: grid;
    gap: 10px;
    align-content: start;
}

.rep-module-card.is-missing {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.07);
}

.rep-module-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rep-module-tag,
.rep-state,
.rep-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border: 1px solid rgba(138, 154, 181, 0.38);
}

.rep-module-tag {
    color: #345174;
    background: rgba(148, 163, 184, 0.15);
}

.rep-state.is-ready {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.12);
    color: #0a6d4a;
}

.rep-state.is-missing {
    border-color: rgba(195, 40, 40, 0.34);
    background: rgba(195, 40, 40, 0.12);
    color: #9a2727;
}

.rep-module-card h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.rep-module-card p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 13px;
}

.rep-module-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.rep-module-stats > div {
    border: 1px solid rgba(145, 160, 186, 0.3);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.86);
    padding: 8px 10px;
    display: grid;
    gap: 2px;
}

.rep-module-stats span {
    color: #5b6a81;
    font-size: 11px;
    font-weight: 700;
}

.rep-module-stats strong {
    color: #12213a;
    font-size: 17px;
    line-height: 1.15;
}

.rep-module-stats code {
    color: #314863;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.rep-module-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-link {
    appearance: none;
    border: 1px solid rgba(136, 154, 182, 0.42);
    background: rgba(255, 255, 255, 0.76);
    color: #2a3950;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.rep-link:hover {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #1249ab;
}

.rep-link-primary {
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #1249ab;
}

.rep-missing-note {
    color: #8c2e2e;
    font-size: 12px;
}

.rep-no-result {
    margin: 12px 0 0;
    color: var(--nx-muted);
}

.rep-side {
    display: grid;
    gap: 12px;
}

.rep-health-card {
    display: grid;
    gap: 10px;
}

.rep-health-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rep-health-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(138, 154, 181, 0.38);
    font-size: 12px;
    font-weight: 700;
}

.rep-health-pill.is-good {
    border-color: rgba(15, 143, 99, 0.34);
    background: rgba(15, 143, 99, 0.12);
    color: #0a6d4a;
}

.rep-health-pill.is-warn {
    border-color: rgba(185, 129, 5, 0.34);
    background: rgba(185, 129, 5, 0.12);
    color: #8a5f03;
}

.rep-health-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.rep-health-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}

.rep-health-track > span.is-good {
    background: #16a34a;
}

.rep-health-track > span.is-warn {
    background: #d97706;
}

.rep-health-list,
.rep-missing-list {
    margin: 0;
    padding-left: 18px;
    color: #42526a;
    font-size: 12px;
    line-height: 1.5;
}

.rep-empty-note {
    margin: 0;
    color: var(--nx-muted);
}

.rep-summary-list {
    display: grid;
    gap: 8px;
}

.rep-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(145, 160, 186, 0.3);
    border-radius: 10px;
    background: rgba(247, 250, 255, 0.86);
    padding: 8px 10px;
}

.rep-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 360px);
    gap: 12px;
    align-items: start;
}

.rep-shell > .rep-detail-layout,
.rep-shell > .rep-section-card,
.rep-shell > .rep-empty-card {
    grid-column: 1 / -1;
    min-width: 0;
}

.rep-main-stack {
    display: grid;
    gap: 12px;
}

.rep-section-card,
.rep-side-card {
    display: grid;
    gap: 12px;
}

.rep-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.rep-section-head h2,
.rep-side-card h3 {
    margin: 0;
}

.rep-section-head p,
.rep-side-card p {
    margin: 4px 0 0;
    color: var(--nx-muted);
}

.rep-catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.rep-report-card {
    border: 1px solid rgba(139, 157, 185, 0.34);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    padding: 14px;
    display: grid;
    gap: 10px;
    align-content: start;
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--rep-accent, #2563eb) 52%, #fff 48%),
        var(--nx-shadow-soft);
}

.rep-report-card h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

.rep-report-card p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 13px;
}

.rep-chip-row,
.rep-card-actions,
.rep-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-favorite-btn {
    appearance: none;
    border: 1px solid rgba(136, 154, 182, 0.42);
    background: rgba(255, 255, 255, 0.82);
    color: #2a3950;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    transition: transform var(--nx-fast), border-color var(--nx-fast), background var(--nx-fast), color var(--nx-fast);
}

.rep-favorite-btn:hover,
.rep-favorite-btn.is-active {
    transform: translateY(-1px);
    border-color: rgba(10, 105, 255, 0.35);
    background: rgba(10, 105, 255, 0.12);
    color: #1249ab;
}

.rep-inline-form,
.rep-stack {
    display: grid;
    gap: 8px;
}

.rep-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rep-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.rep-filter-grid label,
.rep-stack label {
    display: grid;
    gap: 6px;
}

.rep-filter-grid span,
.rep-stack span {
    font-size: 12px;
    font-weight: 700;
    color: #304158;
}

.rep-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.rep-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.rep-table th,
.rep-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 157, 185, 0.22);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.rep-table th {
    color: #304158;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rep-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #42526a;
}

.rep-list li {
    display: grid;
    gap: 2px;
}

.rep-delivery-list {
    display: grid;
    gap: 10px;
}

.rep-delivery-item {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(139, 157, 185, 0.24);
    border-radius: 14px;
    background: rgba(247, 250, 255, 0.82);
}

.rep-inline-actions,
.rep-delivery-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-delivery-meta {
    color: #42526a;
    font-size: 12px;
}

.rep-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(139, 157, 185, 0.32);
    background: rgba(233, 240, 251, 0.82);
    color: #28436f;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rep-status-pill.is-success {
    border-color: rgba(34, 116, 78, 0.24);
    background: rgba(228, 246, 237, 0.92);
    color: #1f6c49;
}

.rep-status-pill.is-failed {
    border-color: rgba(177, 60, 60, 0.24);
    background: rgba(253, 236, 236, 0.94);
    color: #983535;
}

.rep-status-pill.is-pending {
    border-color: rgba(154, 125, 48, 0.24);
    background: rgba(255, 247, 223, 0.92);
    color: #8a6a16;
}

.rep-hint {
    margin: 0;
    color: var(--nx-muted);
    font-size: 12px;
}

.rep-sublist {
    padding-left: 16px;
    gap: 6px;
}

@media (min-width: 1200px) {
    .msg-index-shell > .msg-hero,
    .ann-index-shell > .ann-hero,
    .msg-index-shell > .msg-kpi-grid,
    .ann-index-shell > .ann-kpi-grid {
        align-self: stretch;
    }

    .cal-shell,
    .doc-shell,
    .rep-shell {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }

    .cal-shell > .cal-hero,
    .doc-shell > .doc-hero,
    .rep-shell > .rep-hero {
        grid-column: span 7;
        height: 100%;
    }

    .cal-shell > .cal-kpi-grid,
    .doc-shell > .doc-kpi-grid,
    .rep-shell > .rep-kpi-grid,
    .rep-shell > .rep-owner-filter {
        grid-column: span 5;
    }

    .cal-shell > .cal-owner-filter,
    .doc-shell > .doc-owner-filter,
    .cal-shell > .cal-toolbar,
    .doc-shell > .doc-toolbar {
        grid-column: span 6;
    }

    .cal-shell > :is(.cal-table-card, .cal-empty-card, .cal-create-layout),
    .doc-shell > :is(.doc-table-card, .doc-empty-card, .doc-create-layout),
    .rep-shell > :is(.rep-toolbar, .rep-layout, .rep-detail-layout, .rep-section-card, .rep-empty-card) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1280px) {
    .cal-shell,
    .doc-shell,
    .rep-shell {
        grid-template-columns: 1fr;
    }

    .rep-layout,
    .rep-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .cal-hero,
    .doc-hero,
    .rep-hero,
    .cal-toolbar,
    .doc-toolbar,
    .rep-toolbar,
    .cal-create-layout,
    .doc-create-layout,
    .cal-grid-two,
    .rep-layout,
    .rep-detail-layout {
        grid-template-columns: 1fr;
    }

    .cal-kpi-grid,
    .doc-kpi-grid,
    .rep-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cal-hero-actions,
    .doc-hero-actions,
    .rep-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .cal-kpi-grid,
    .doc-kpi-grid,
    .rep-kpi-grid,
    .rep-mini-grid,
    .rep-module-stats {
        grid-template-columns: 1fr;
    }

    .cal-owner-filter-row > *,
    .doc-owner-filter-row > *,
    .rep-owner-filter-row > *,
    .cal-toolbar-actions > *,
    .doc-toolbar-actions > *,
    .cal-create-actions > *,
    .doc-create-actions > *,
    .rep-toolbar > * {
        width: 100%;
    }

    .cal-pill-group,
    .doc-pill-group {
        width: 100%;
    }

    .cal-pill,
    .doc-pill {
        flex: 1 1 120px;
        text-align: center;
    }
}
