/*
 * EduSuite shared UI foundation
 * Lightweight tokens and cross-module primitives for the tenant and Nexus shells.
 */
:root {
    --edu-color-ink: #102a43;
    --edu-color-muted: #5c7083;
    --edu-color-surface: #ffffff;
    --edu-color-canvas: #f4f8fb;
    --edu-color-border: #d7e3ec;
    --edu-color-primary: #1769aa;
    --edu-color-primary-dark: #0b4775;
    --edu-color-accent: #07977e;
    --edu-color-success: #087f5b;
    --edu-color-warning: #a15c00;
    --edu-color-danger: #c73545;
    --edu-radius-sm: 10px;
    --edu-radius-md: 14px;
    --edu-radius-lg: 18px;
    --edu-shadow-sm: 0 4px 14px rgba(16, 42, 67, .07);
    --edu-shadow-md: 0 12px 30px rgba(16, 42, 67, .10);
    --edu-focus-ring: 0 0 0 3px rgba(36, 127, 218, .32);
    --edu-control-height: 44px;
    --edu-space-1: 4px;
    --edu-space-2: 8px;
    --edu-space-3: 12px;
    --edu-space-4: 16px;
    --edu-space-5: 24px;
    --edu-motion-fast: 160ms;
    --edu-motion-standard: 220ms;
    --edu-z-dropdown: 1050;
    --edu-z-overlay: 1200;
}

html { color-scheme: light; }

body.smart-responsive-app,
body.nexus-command-page {
    color: var(--edu-color-ink);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(36, 127, 218, .42) !important;
    outline-offset: 2px !important;
}

.edu-card {
    overflow: hidden;
    border: 1px solid var(--edu-color-border);
    border-radius: var(--edu-radius-lg);
    background: var(--edu-color-surface);
    box-shadow: var(--edu-shadow-sm);
}

.edu-card-header,
.edu-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--edu-space-4);
    padding: var(--edu-space-4) var(--edu-space-5);
}
.edu-card-header { border-bottom: 1px solid var(--edu-color-border); background: #fbfdff; }
.edu-card-footer { border-top: 1px solid var(--edu-color-border); background: var(--edu-color-canvas); }
.edu-card-heading { display: flex; min-width: 0; align-items: center; gap: var(--edu-space-3); }
.edu-card-heading > .fa { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: var(--edu-radius-sm); color: var(--edu-color-primary); background: #eaf4ff; }
.edu-card-heading h2 { margin: 0; color: var(--edu-color-ink); font-size: 18px; font-weight: 850; line-height: 1.25; }
.edu-card-heading p { margin: 3px 0 0; color: var(--edu-color-muted); font-size: 13px; }
.edu-card-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--edu-space-2); }
.edu-card-body { padding: var(--edu-space-5); }
.edu-card--interactive { transition: transform var(--edu-motion-standard) ease, box-shadow var(--edu-motion-standard) ease, border-color var(--edu-motion-standard) ease; }
.edu-card--interactive:hover { border-color: #aac7dc; box-shadow: var(--edu-shadow-md); transform: translateY(-2px); }

.edu-status.is-info { color: var(--edu-color-primary); background: #eaf4ff; }

.edu-field { display: grid; gap: 6px; min-width: 0; }
.edu-field-label { margin: 0; color: #29485f; font-size: 13px; font-weight: 800; }
.edu-field-label > span[aria-hidden="true"] { color: var(--edu-color-danger); }
.edu-field-control > :where(input, select, textarea) { width: 100%; min-height: var(--edu-control-height); }
.edu-field-help,
.edu-field-error { margin: 0; font-size: 12px; line-height: 1.4; }
.edu-field-help { color: var(--edu-color-muted); }
.edu-field-error { color: var(--edu-color-danger); font-weight: 700; }
.edu-field.has-error :where(input, select, textarea) { border-color: var(--edu-color-danger); }

.edu-data-region { position: relative; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.edu-data-region:focus-visible { box-shadow: inset var(--edu-focus-ring); }
.edu-data-region table { min-width: 680px; }
.edu-data-region caption { padding: var(--edu-space-3); color: var(--edu-color-muted); text-align: left; }

.edu-state {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    gap: var(--edu-space-4);
    padding: var(--edu-space-5);
    border: 1px dashed var(--edu-color-border);
    border-radius: var(--edu-radius-md);
    color: var(--edu-color-muted);
    background: var(--edu-color-canvas);
    text-align: left;
}
.edu-state > .fa { font-size: 26px; }
.edu-state strong { display: block; color: var(--edu-color-ink); font-size: 15px; }
.edu-state p { margin: 4px 0 0; }
.edu-state--error,
.edu-state--permission { color: var(--edu-color-danger); border-color: #efb6bc; background: #fff6f7; }
.edu-state--success { color: var(--edu-color-success); border-color: #a9dfcb; background: #f1fbf7; }
.edu-state--offline { color: #526b7d; }

.edu-tab-badge { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 6px; border-radius: 999px; color: #fff; background: var(--edu-color-danger); font-size: 10px; font-weight: 900; }

.edu-modal .modal-content { overflow: hidden; border: 1px solid var(--edu-color-border); border-radius: var(--edu-radius-lg); box-shadow: var(--edu-shadow-md); }
.edu-modal .modal-header,
.edu-modal .modal-footer { padding: var(--edu-space-4) var(--edu-space-5); border-color: var(--edu-color-border); background: #fbfdff; }
.edu-modal .modal-title { color: var(--edu-color-ink); font-size: 20px; font-weight: 850; }
.edu-modal .modal-body { padding: var(--edu-space-5); }
.edu-modal--sm .modal-dialog { max-width: 440px; }
.edu-modal--lg .modal-dialog { max-width: 920px; }

.edu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: calc(var(--edu-z-overlay) + 2);
    display: flex;
    width: min(440px, calc(100vw - 24px));
    height: 100dvh;
    flex-direction: column;
    color: var(--edu-color-ink);
    background: var(--edu-color-surface);
    box-shadow: -18px 0 45px rgba(16, 42, 67, .18);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform var(--edu-motion-standard) ease, visibility 0s linear var(--edu-motion-standard);
}
.edu-drawer--left { right: auto; left: 0; box-shadow: 18px 0 45px rgba(16, 42, 67, .18); transform: translateX(-105%); }
.edu-drawer.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.edu-drawer-header,
.edu-drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--edu-space-3); padding: var(--edu-space-4); border-bottom: 1px solid var(--edu-color-border); }
.edu-drawer-footer { border-top: 1px solid var(--edu-color-border); border-bottom: 0; }
.edu-drawer-header h2 { margin: 0; font-size: 20px; font-weight: 850; }
.edu-drawer-body { flex: 1 1 auto; padding: var(--edu-space-4); overflow-y: auto; overscroll-behavior: contain; }
.edu-icon-button { display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid var(--edu-color-border); border-radius: var(--edu-radius-sm); color: var(--edu-color-ink); background: #f3f7fa; }
.edu-drawer-backdrop { position: fixed; inset: 0; z-index: calc(var(--edu-z-overlay) + 1); display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(8, 31, 49, .46); opacity: 0; pointer-events: none; transition: opacity var(--edu-motion-standard) ease; }
.edu-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
body.edu-drawer-open { overflow: hidden; }

.edu-responsive-records-cards { display: none; }
.edu-record-card { padding: var(--edu-space-4); border: 1px solid var(--edu-color-border); border-radius: var(--edu-radius-md); background: var(--edu-color-surface); }

.edu-scroll-x {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.edu-scroll-x::after,
.smart-command-tabs::after,
.smart-underline-tabs::after {
    content: "";
    position: sticky;
    right: 0;
    width: 16px;
    flex: 0 0 16px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(16, 42, 67, .12));
}

.edu-status {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.edu-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.edu-status.is-success { color: var(--edu-color-success); background: #e7f8f1; }
.edu-status.is-warning { color: var(--edu-color-warning); background: #fff5dc; }
.edu-status.is-danger { color: var(--edu-color-danger); background: #fff0f1; }
.edu-status.is-neutral { color: var(--edu-color-muted); background: #eef3f7; }

.edu-empty-state,
.edu-error-state,
.edu-loading-state {
    display: grid;
    min-height: 150px;
    place-items: center;
    padding: var(--edu-space-5);
    border: 1px dashed var(--edu-color-border);
    border-radius: var(--edu-radius-md);
    color: var(--edu-color-muted);
    background: var(--edu-color-canvas);
    text-align: center;
}

/* Shared page header and compatibility treatment for legacy content headers. */
.smart-responsive-app .content-header {
    position: relative;
    display: flow-root;
    margin: 0;
    padding: 22px 22px 12px;
    color: var(--edu-color-ink);
}

.smart-responsive-app .content-header > h1,
.edu-page-header h1 {
    margin: 0;
    color: var(--edu-color-ink);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.smart-responsive-app .content-header > h1 > small,
.edu-page-header h1 > small {
    display: block;
    margin: 6px 0 0;
    color: var(--edu-color-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: 0;
}

.edu-page-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--edu-space-5);
}

.edu-page-heading { min-width: 0; }
.edu-page-header h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.edu-page-header h1 > small { flex-basis: 100%; }
.edu-page-header h1 > .fa { color: var(--edu-color-primary); font-size: .72em; }
.edu-page-eyebrow {
    margin: 0 0 5px;
    color: var(--edu-color-accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.edu-page-description { max-width: 720px; margin: 7px 0 0; color: var(--edu-color-muted); font-size: 14px; line-height: 1.5; }
.edu-page-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: var(--edu-space-2); }

.smart-responsive-app .content-header > .breadcrumb,
.edu-breadcrumbs .breadcrumb {
    position: static;
    float: none;
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 10px 0 0;
    padding: 0;
    color: var(--edu-color-muted);
    background: transparent;
    font-size: 12px;
}
.smart-responsive-app .content-header > .breadcrumb > li + li::before,
.edu-breadcrumbs .breadcrumb > li + li::before { padding: 0 3px 0 0; color: #91a4b5; content: "›"; }
.smart-responsive-app .content-header > .breadcrumb a,
.edu-breadcrumbs .breadcrumb a { color: var(--edu-color-primary); font-weight: 700; text-decoration: none; }
.smart-responsive-app .content-header > .breadcrumb a:hover,
.edu-breadcrumbs .breadcrumb a:hover { text-decoration: underline; }

.smart-responsive-app .form-control,
.smart-responsive-app select.form-control,
.smart-responsive-app .select2-selection {
    min-height: var(--edu-control-height);
    border-color: var(--edu-color-border);
    border-radius: var(--edu-radius-sm);
    box-shadow: none;
}

.smart-responsive-app .form-control:focus,
.smart-responsive-app .select2-container--focus .select2-selection {
    border-color: #65a8ed;
    box-shadow: var(--edu-focus-ring);
}

.smart-responsive-app .btn { min-height: 40px; border-radius: var(--edu-radius-sm); font-weight: 750; }
.smart-responsive-app .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--edu-color-border);
    border-radius: var(--edu-radius-md);
    background: var(--edu-color-surface);
    -webkit-overflow-scrolling: touch;
}
.smart-responsive-app .table-responsive > table { margin-bottom: 0; }
.smart-responsive-app table > thead > tr > th {
    border-bottom: 1px solid var(--edu-color-border);
    color: #3e596e;
    background: #eef4f8;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .025em;
}

@media (max-width: 767px) {
    .smart-responsive-app .content-header { padding: 16px 12px 10px; }
    .smart-responsive-app .content-header > h1 { font-size: clamp(22px, 7vw, 29px); line-height: 1.15; }
    .edu-page-header-main { flex-direction: column; gap: var(--edu-space-3); }
    .edu-page-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .edu-page-actions > .btn { flex: 1 1 180px; }
    .smart-responsive-app .content-header > .breadcrumb,
    .edu-breadcrumbs .breadcrumb { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 4px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .smart-responsive-app .modal-dialog { width: auto; margin: 12px; }
    .smart-responsive-app .modal-content { max-height: calc(100vh - 24px); overflow-y: auto; border-radius: var(--edu-radius-lg); }
    .smart-responsive-app .btn { min-height: 44px; }
    .edu-card-header,
    .edu-card-footer { align-items: stretch; padding: var(--edu-space-4); flex-direction: column; }
    .edu-card-actions { justify-content: flex-start; }
    .edu-card-actions > .btn { flex: 1 1 150px; }
    .edu-card-body { padding: var(--edu-space-4); }
    .edu-responsive-records.has-mobile-cards .edu-responsive-records-table { display: none; }
    .edu-responsive-records.has-mobile-cards .edu-responsive-records-cards { display: grid; gap: var(--edu-space-3); }
    .edu-modal .modal-body { padding: var(--edu-space-4); }
}

/* Shared System Alerts control. */
.system-alert-wrapper {
    display: flex;
    width: calc(100% - 410px);
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.system-prompt-wrapper { position: relative; min-width: 0; }

.system-alert-prompt,
.system-alert-wrapper .get-help-alert {
    position: relative;
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .10), inset 0 1px rgba(255, 255, 255, .08);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--edu-motion-fast) ease, box-shadow var(--edu-motion-fast) ease, border-color var(--edu-motion-fast) ease, background var(--edu-motion-fast) ease;
}

.system-alert-prompt:hover,
.system-alert-wrapper .get-help-alert:hover {
    color: #fff;
    border-color: rgba(114, 204, 255, .84);
    background: rgba(53, 183, 255, .18);
    box-shadow: 0 9px 22px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .10);
    text-decoration: none;
    transform: translateY(-2px);
}

.system-alert-prompt:active,
.system-alert-wrapper .get-help-alert:active { transform: translateY(0); }
.system-alert-prompt.crit { border-color: rgba(255, 115, 125, .75); background: rgba(185, 28, 28, .25); }

.system-alert-badge,
.ticket-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: var(--edu-color-danger);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.system-alert-icon { font-size: 16px; }

.system-alert-group {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: var(--edu-z-dropdown);
    display: none;
    width: min(360px, calc(100vw - 24px));
    max-height: min(440px, calc(100vh - 92px));
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid rgba(137, 169, 190, .65);
    border-radius: var(--edu-radius-lg);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--edu-shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.system-alert-group.active { display: grid; animation: edu-alert-in var(--edu-motion-fast) ease-out; }
.system-alert-cont { width: 100%; }
.system-alert-text {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #b8d9ed;
    border-radius: var(--edu-radius-sm);
    color: #174661;
    background: #edf8ff;
    font-weight: 700;
    text-align: left;
}
.system-alert-text.warn { color: #754b00; border-color: #efd28d; background: #fff8e7; }
.system-alert-text.crit { color: #8e2530; border-color: #efb6bc; background: #fff0f1; }
.system-alert-empty { color: var(--edu-color-muted); border-style: dashed; background: #f7fafc; }

.system-alert-wrapper.to-float {
    position: absolute;
    top: 10px;
    right: 12px;
    left: auto;
    z-index: var(--edu-z-overlay);
    width: auto;
}
.system-alert-wrapper.to-float .system-alert-prompt,
.system-alert-wrapper.to-float .get-help-alert { color: var(--edu-color-ink); border-color: var(--edu-color-border); background: rgba(255,255,255,.94); }

@keyframes edu-alert-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1000px) {
    .system-alert-wrapper { width: auto; margin-left: auto; }
    .system-alert-wrapper.may-float .get-help-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (max-width: 767px) {
    .system-alert-wrapper.may-float {
        position: static;
        width: auto;
        padding: 0;
        flex-direction: row;
        justify-content: flex-end;
    }
    .smart-responsive-app .system-alert-wrapper.may-float {
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .system-alert-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .system-alert-prompt,
    .system-alert-wrapper .get-help-alert { min-width: 44px; width: 44px; padding: 8px; border-radius: 14px; }
    .system-alert-badge,
    .ticket-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px; }
    .smart-responsive-app .system-alert-group {
        position: fixed;
        top: 104px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    .smart-responsive-app .system-alert-group.active { top: 104px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
    .system-alert-prompt,
    .system-alert-wrapper .get-help-alert,
    .smart-command-tab,
    .smart-underline-tab { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .system-alert-group.active { animation: none; }
    .edu-card--interactive,
    .edu-drawer,
    .edu-drawer-backdrop { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .edu-card--interactive:hover { transform: none; }
}

/* Phase 4: authentication, dashboards, student and staff workspaces. */
.edu-auth-content { padding-top: var(--edu-space-3); }
.edu-auth-card-wrap { width: min(100%, 720px); margin: 0 auto var(--edu-space-6); }
.edu-auth-card-wrap .edu-card { overflow: visible; }
.edu-auth-card-body { padding: var(--edu-space-5); }
.edu-auth-card-body .edu-field + .edu-field { margin-top: var(--edu-space-4); }
.edu-password-control { position: relative; }
.edu-password-control > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: #8395a7;
    pointer-events: none;
    transform: translateY(-50%);
}
.edu-password-control > .form-control { min-height: 48px; padding-left: 43px; }
.edu-auth-card-body .checkbox { margin: var(--edu-space-4) 0; }
.edu-auth-card-body .checkbox label { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; padding-left: 0; font-weight: 700; }
.edu-auth-card-body .checkbox input { position: static; width: 18px; height: 18px; margin: 0; }
.edu-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--edu-space-3); margin-top: var(--edu-space-5); padding-top: var(--edu-space-4); border-top: 1px solid var(--edu-color-border); }

.edu-directory-page .content { max-width: 1600px; margin-inline: auto; }
.edu-directory-page .box,
.edu-profile-page .box,
.edu-profile-page .nav-tabs-custom {
    border-color: var(--edu-color-border);
    border-radius: var(--edu-radius-lg);
    box-shadow: var(--edu-shadow-sm);
}
.edu-profile-page .smart-profile-sidebar .box-profile { padding: var(--edu-space-5); }
.edu-profile-page .profile-username { color: var(--edu-color-heading); font-weight: 850; overflow-wrap: anywhere; }
.edu-profile-page .list-group-unbordered { margin-top: var(--edu-space-4); }
.edu-profile-page .list-group-unbordered > .list-group-item { display: flow-root; padding: 12px 0; border-color: var(--edu-color-border); }
.edu-profile-page .list-group-unbordered > .list-group-item > .pull-right { max-width: 62%; overflow-wrap: anywhere; text-align: right; }
.edu-profile-page .nav-tabs-custom > .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.edu-profile-page .nav-tabs-custom > .nav-tabs > li { float: none; flex: 0 0 auto; }
.edu-profile-page .nav-tabs-custom > .nav-tabs > li > a { min-height: 44px; white-space: nowrap; }
.edu-dashboard-module .smart-dashboard,
.edu-student-module .content,
.edu-staff-module .content { min-width: 0; }
.edu-dashboard-module .smart-dashboard-hero,
.edu-dashboard-module .work-hub { isolation: isolate; }

@media (max-width: 767px) {
    .edu-auth-card-wrap { margin-bottom: var(--edu-space-4); }
    .edu-auth-card-body { padding: var(--edu-space-4); }
    .edu-form-actions { align-items: stretch; flex-direction: column-reverse; }
    .edu-form-actions > .btn { width: 100%; }
    .edu-profile-page .smart-profile-sidebar,
    .edu-profile-page .smart-profile-workspace { width: 100%; padding-inline: 0; }
    .edu-profile-page .smart-profile-sidebar { margin-bottom: var(--edu-space-4); }
    .edu-profile-page .list-group-unbordered > .list-group-item { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1.2fr); gap: 12px; }
    .edu-profile-page .list-group-unbordered > .list-group-item > .pull-right { max-width: none; }
    .edu-dashboard-module .smart-dashboard .row > [class*="col-"] { min-width: 0; }
}

/* Phase 5: attendance, academics, discipline, finance and POS operations. */
.edu-phase5-list-page .content { max-width: 1600px; margin-inline: auto; }
.edu-phase5-list-page .edu-operations-card {
    overflow: hidden;
    border: 1px solid var(--edu-color-border);
    border-radius: var(--edu-radius-lg);
    background: var(--edu-color-surface);
    box-shadow: var(--edu-shadow-sm);
}
.edu-phase5-list-page .edu-operations-card > .box-header {
    min-height: 68px;
    padding: var(--edu-space-4);
    border-bottom: 1px solid var(--edu-color-border);
    background: linear-gradient(180deg, #f8fbfd, #f3f7fa);
}
.edu-phase5-list-page .edu-operations-card > .box-header::after { display: table; clear: both; content: ""; }
.edu-phase5-list-page .edu-operations-card > .box-body { padding: var(--edu-space-4); }
.edu-phase5-list-page .edu-operations-card .table-responsive { margin: 0; }
.edu-phase5-list-page .edu-operations-card table { min-width: 760px; }
.edu-phase5-list-page .edu-operations-card table > tbody > tr { transition: background var(--edu-motion-fast) ease; }
.edu-phase5-list-page .edu-operations-card table > tbody > tr:hover { background: #f5f9fc; }
.edu-phase5-list-page .edu-operations-card .box-tools { display: flex; align-items: center; gap: var(--edu-space-2); }

.edu-phase5-workspace .dc-tabs,
.edu-phase5-workspace .bur-tabs,
.edu-phase5-workspace .bur-subtabs,
.edu-phase5-workspace .cashless-tabs,
.edu-phase5-workspace .cashless-service-tabs {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.edu-phase5-workspace .dc-tabs > *,
.edu-phase5-workspace .bur-tabs > *,
.edu-phase5-workspace .bur-subtabs > *,
.edu-phase5-workspace .cashless-tabs > *,
.edu-phase5-workspace .cashless-service-tabs > * { scroll-snap-align: start; }
.edu-phase5-workspace .bur-table-wrap,
.edu-phase5-workspace .dc-table-wrap { max-width: 100%; border-radius: var(--edu-radius-sm); }
.edu-phase5-workspace .form-control { font-size: max(14px, 1em); }

@media (max-width: 767px) {
    .edu-phase5-list-page .content { padding: 10px; }
    .edu-phase5-list-page .edu-operations-card { border-radius: var(--edu-radius-md); }
    .edu-phase5-list-page .edu-operations-card > .box-header,
    .edu-phase5-list-page .edu-operations-card > .box-body { padding: 12px; }
    .edu-phase5-list-page .edu-operations-card > .box-header > [class*="col-"] { width: 100%; padding: 0; margin-bottom: 10px; }
    .edu-phase5-list-page .edu-operations-card .box-tools { position: static; float: none !important; width: 100%; flex-wrap: wrap; }
    .edu-phase5-list-page .edu-operations-card .box-tools > .btn,
    .edu-phase5-list-page .edu-operations-card .box-tools > .dropdown { flex: 1 1 160px; }
    .edu-phase5-list-page .edu-operations-card .box-tools .btn { width: 100%; }
    .edu-phase5-list-page .dataTables_length,
    .edu-phase5-list-page .dataTables_filter { float: none !important; margin: 8px 0; text-align: left !important; }
    .edu-phase5-workspace .dc-tabs,
    .edu-phase5-workspace .bur-tabs,
    .edu-phase5-workspace .bur-subtabs,
    .edu-phase5-workspace .cashless-tabs,
    .edu-phase5-workspace .cashless-service-tabs { padding-bottom: 8px; }
}

/* Phase 6: safety, identity, PWA, reports and administration/settings. */
.edu-phase6-list-page .content { max-width: 1600px; margin-inline: auto; }
.edu-phase6-list-page .edu-control-card {
    overflow: hidden;
    border: 1px solid var(--edu-color-border);
    border-radius: var(--edu-radius-lg);
    background: var(--edu-color-surface);
    box-shadow: var(--edu-shadow-sm);
}
.edu-phase6-list-page .edu-control-card > .box-header {
    min-height: 68px;
    padding: var(--edu-space-4);
    border-bottom: 1px solid var(--edu-color-border);
    background: linear-gradient(180deg, #f8fbfd, #f3f7fa);
}
.edu-phase6-list-page .edu-control-card > .box-header::after { display: table; clear: both; content: ""; }
.edu-phase6-list-page .edu-control-card > .box-body { padding: var(--edu-space-4); }
.edu-phase6-list-page .edu-control-card table { min-width: 720px; }
.edu-phase6-list-page .edu-control-card table > tbody > tr { transition: background var(--edu-motion-fast) ease; }
.edu-phase6-list-page .edu-control-card table > tbody > tr:hover { background: #f5f9fc; }
.edu-phase6-list-page .edu-control-card .box-tools { display: flex; align-items: center; gap: var(--edu-space-2); }

.edu-phase6-workspace .sw-tabs,
.edu-phase6-workspace .vm-tabs,
.edu-phase6-workspace .rc-tabs,
.edu-phase6-workspace .settings-tabs,
.edu-phase6-workspace .sp-tabs,
.edu-phase6-workspace .pp-students,
.edu-phase6-workspace .pp-subtabs {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.edu-phase6-workspace .sw-tabs > *,
.edu-phase6-workspace .vm-tabs > *,
.edu-phase6-workspace .rc-tabs > *,
.edu-phase6-workspace .settings-tabs > *,
.edu-phase6-workspace .sp-tabs > *,
.edu-phase6-workspace .pp-students > *,
.edu-phase6-workspace .pp-subtabs > * { scroll-snap-align: start; }
.edu-phase6-workspace .table-wrap,
.edu-phase6-workspace .rc-table-wrap,
.edu-phase6-workspace .smart-settings-table { max-width: 100%; border-radius: var(--edu-radius-sm); }
.edu-phase6-workspace .empty,
.edu-phase6-workspace .rc-empty,
.edu-phase6-workspace .sp-empty,
.edu-phase6-workspace .pp-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    padding: var(--edu-space-5);
    overflow-wrap: anywhere;
}
.edu-pwa-module .sp-app,
.edu-pwa-module .pp-shell { min-width: 0; }
.edu-pwa-module .sp-tabs,
.edu-pwa-module .pp-students,
.edu-pwa-module .pp-subtabs { scrollbar-width: thin; }

@media (max-width: 767px) {
    .edu-phase6-list-page .content { padding: 10px; }
    .edu-phase6-list-page .edu-control-card { border-radius: var(--edu-radius-md); }
    .edu-phase6-list-page .edu-control-card > .box-header,
    .edu-phase6-list-page .edu-control-card > .box-body { padding: 12px; }
    .edu-phase6-list-page .edu-control-card .box-tools { position: static; float: none !important; width: 100%; flex-wrap: wrap; }
    .edu-phase6-list-page .edu-control-card .box-tools > .btn { width: 100%; }
    .edu-phase6-list-page .dataTables_length,
    .edu-phase6-list-page .dataTables_filter { float: none !important; margin: 8px 0; text-align: left !important; }
    .edu-phase6-workspace .sw-tabs,
    .edu-phase6-workspace .vm-tabs,
    .edu-phase6-workspace .rc-tabs,
    .edu-phase6-workspace .settings-tabs,
    .edu-phase6-workspace .sp-tabs,
    .edu-phase6-workspace .pp-students,
    .edu-phase6-workspace .pp-subtabs { padding-bottom: 8px; }
    .edu-pwa-module .sp-main,
    .edu-pwa-module .pp { padding-inline: max(9px, env(safe-area-inset-left)); }
}

/* Phase 7: system-wide responsive, accessibility and cleanup pass. */
.edu-skip-link {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    z-index: calc(var(--edu-z-toast, 1080) + 20);
    max-width: calc(100vw - 16px);
    padding: 11px 16px;
    border: 2px solid var(--edu-color-focus, #2563eb);
    border-radius: var(--edu-radius-sm, 8px);
    background: #fff;
    color: #102a43;
    font-weight: 800;
    box-shadow: var(--edu-shadow-lg, 0 18px 44px rgba(15, 42, 67, .22));
    transform: translateY(-150%);
    transition: transform var(--edu-motion-fast, 140ms) ease;
}
.edu-skip-link:focus { color: #102a43; transform: translateY(0); }

html, body { max-width: 100%; }
body.smart-responsive-app { overflow-x: clip; }
.smart-responsive-app .wrapper,
.smart-responsive-app .content-wrapper,
.smart-responsive-app .content,
.smart-responsive-app .row,
.smart-responsive-app [class*="col-"] { min-width: 0; }
.smart-responsive-app img,
.smart-responsive-app video { max-width: 100%; height: auto; }
.smart-responsive-app canvas,
.smart-responsive-app svg { max-width: 100%; }
.smart-responsive-app :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--edu-color-focus, #2563eb);
    outline-offset: 3px;
}
.smart-responsive-app [role="main"]:focus { outline: none; }
.smart-responsive-app :where(.table-responsive, .edu-scroll-x, [role="tablist"])[tabindex="0"]:focus-visible {
    border-radius: var(--edu-radius-sm, 8px);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

@media (max-width: 767px) {
    .smart-responsive-app .content-wrapper { overflow-x: clip; }
    .smart-responsive-app :where([role="tablist"], .nav-tabs, .settings-tabs, .smart-command-tabs, .smart-underline-tabs) {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .smart-responsive-app :where([role="tab"], .nav-tabs > li > a, .smart-command-tab, .smart-underline-tab) {
        min-height: 44px;
        white-space: nowrap;
    }
}

@media (forced-colors: active) {
    .edu-skip-link,
    .smart-responsive-app :where(a, button, input, select, textarea, [tabindex]):focus-visible {
        border: 2px solid CanvasText;
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }
    .edu-state,
    .edu-card,
    .box { border: 1px solid CanvasText; }
}

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