
@font-face {
    font-family: 'Nunito';
    src: url('../fonts/Nunito/nunito-sans-latin-400-normal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/Nunito/nunito-sans-latin-500-normal.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/Nunito/nunito-sans-latin-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/Nunito/nunito-sans-latin-700-normal.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/Nunito/nunito-sans-latin-800-normal.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ================================================================
           DESIGN SYSTEM  -  EDU PORTAL  (Light Blue-Violet Theme)
           CSS Variables cascade into ALL child pages automatically.
        ================================================================ */
:root {
    --sidebar-width: 252px;
    --navbar-height: 62px;
    /* Brand - Indigo/Violet */
    --brand-25: #f5f3ff;
    --brand-50: #ede9fe;
    --brand-100: #ddd6fe;
    --brand-200: #c4b5fd;
    --brand-300: #a78bfa;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-900: #312e81;
    /* Status */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    /* Surfaces */
    --body-bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #f8f8fc;
    --border: #e4e4f0;
    --border-light: #eeeef8;
    --text-900: #1e1b3a;
    --text-700: #3d3a5c;
    --text-500: #6b6891;
    --text-300: #a8a6c0;
    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8e6f6;
    --sidebar-text: #6b6891;
    --sidebar-text-hover: #1e1b3a;
    --sidebar-active-bg: #ede9fe;
    --sidebar-active: #4f46e5;
    --sidebar-icon: #a78bfa;
    --sidebar-icon-active: #4f46e5;
    --sidebar-section: #b8b5d0;
    /* Navbar */
    --navbar-bg: #ffffff;
    --navbar-border: #e8e6f6;
    --navbar-shadow: 0 1px 0 #e8e6f6, 0 4px 16px rgba(99,102,241,.05);
    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(99,102,241,.07);
    --shadow-sm: 0 2px 8px rgba(99,102,241,.09);
    --shadow: 0 4px 20px rgba(99,102,241,.11);
    --shadow-lg: 0 8px 32px rgba(99,102,241,.14);
    /* Shape */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: .18s cubic-bezier(.4,0,.2,1);
    --maintenance-notice-height: 48px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Default 16px; JS applies saved preference before paint */
html {
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 16px;
    scroll-behavior: smooth;
}

    html.fs-sm {
        font-size: 14px;
    }

    html.fs-md {
        font-size: 16px;
    }

    html.fs-lg {
        font-size: 18px;
    }

    html.fs-xl {
        font-size: 20px;
    }

body {
    font-family: 'Nunito', system-ui, sans-serif;
    background: var(--body-bg);
    color: var(--text-900);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
}

.maintenance-notice-banner {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    z-index: 1030;
    width: 100%;
    min-height: var(--maintenance-notice-height);
    padding: 0.65rem 1rem;
    color: #1f2937;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .14);
}

.maintenance-notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    max-width: 1180px;
    margin: 0 auto;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

body.has-maintenance-notice .app-main,
body.has-maintenance-notice .app-main-full {
    padding-top: calc(var(--navbar-height) + var(--maintenance-notice-height));
}

.maintenance-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.maintenance-notice-warning {
    background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
}

.maintenance-notice-danger {
    background: linear-gradient(135deg, #fecaca 0%, #ef4444 100%);
    color: #fff;
}

.maintenance-notice-danger .maintenance-notice-icon {
    color: #991b1b;
}

.maintenance-notice-info {
    background: linear-gradient(135deg, #bfdbfe 0%, #3b82f6 100%);
    color: #fff;
}

@media (max-width: 575.98px) {
    .maintenance-notice-content {
        align-items: flex-start;
        justify-content: flex-start;
        text-align: start;
        font-size: 0.9rem;
    }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--brand-200);
    border-radius: 99px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--brand-400);
    }

/* === CARD === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}

    .card:hover {
        box-shadow: var(--shadow-sm);
    }

.card-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 14px 20px;
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-700);
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--surface-2);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius) !important;
    padding: 12px 20px;
}

.card-accent-brand {
    border-top: 3px solid var(--brand-500);
}

.card-accent-success {
    border-top: 3px solid var(--success);
}

.card-accent-warning {
    border-top: 3px solid var(--warning);
}

.card-accent-danger {
    border-top: 3px solid var(--danger);
}

/* === BUTTONS === */
.btn {
    font-family: 'Nunito',system-ui,sans-serif;
    font-weight: 700;
    font-size: .875rem;
    border-radius: var(--radius-sm);
    padding: 7px 18px;
    letter-spacing: .01em;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--brand-500);
    border-color: var(--brand-500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.28);
}

    .btn-primary:hover, .btn-primary:focus {
        background: var(--brand-600);
        border-color: var(--brand-600);
        color: #fff;
        box-shadow: 0 4px 14px rgba(99,102,241,.38);
    }

.btn-outline-primary {
    border-color: var(--brand-300);
    color: var(--brand-600);
}

    .btn-outline-primary:hover {
        background: var(--brand-50);
        border-color: var(--brand-500);
        color: var(--brand-600);
    }

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-sm {
    padding: 5px 13px;
    font-size: .8rem;
    border-radius: var(--radius-xs);
}

.btn-lg {
    padding: 11px 26px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* === BADGE === */
.badge {
    font-family: 'Nunito',system-ui,sans-serif;
    font-weight: 700;
    font-size: .72rem;
    padding: 4px 10px;
    border-radius: 99px;
}

    .badge.bg-primary {
        background: var(--brand-500) !important;
    }

    .badge.bg-success {
        background: var(--success) !important;
    }

    .badge.bg-warning {
        background: var(--warning) !important;
        color: #fff !important;
    }

    .badge.bg-danger {
        background: var(--danger) !important;
    }

    .badge.bg-secondary {
        background: var(--text-300) !important;
    }

.badge-soft-primary {
    background: var(--brand-50);
    color: var(--brand-600);
}

.badge-soft-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-soft-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-soft-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-soft-info {
    background: var(--info-light);
    color: #1e40af;
}

/* === TABLE === */
.table {
    font-size: .9rem;
    color: var(--text-700);
}

    .table thead th {
        font-weight: 800;
        font-size: .75rem;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-500);
        border-bottom: 2px solid var(--border);
        padding: 11px 16px;
        background: var(--surface-2);
        white-space: nowrap;
    }

    .table tbody td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-light);
        vertical-align: middle;
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

.table-hover tbody tr:hover td {
    background: var(--brand-25);
}

.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
}

/* === FORM === */
.form-control, .form-select {
    font-family: 'Nunito',system-ui,sans-serif;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    padding: 8px 13px;
    color: var(--text-900);
    background: var(--surface);
    transition: border-color var(--transition),box-shadow var(--transition);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--brand-400);
        box-shadow: 0 0 0 3px rgba(99,102,241,.12);
        outline: none;
    }

.form-label {
    font-weight: 700;
    font-size: .82rem;
    color: var(--text-700);
    margin-bottom: 5px;
}

.form-text {
    font-size: .78rem;
    color: var(--text-500);
}

.input-group-text {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-500);
    font-size: .9rem;
}

/* === ALERT === */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: .9rem;
    padding: 12px 16px;
}

.alert-primary {
    background: var(--brand-50);
    color: var(--brand-700);
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
}

/* === STAT CARD === */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition),transform var(--transition);
}

    .stat-card:hover {
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

    .stat-icon.brand {
        background: var(--brand-50);
        color: var(--brand-600);
    }

    .stat-icon.success {
        background: var(--success-light);
        color: var(--success);
    }

    .stat-icon.warning {
        background: var(--warning-light);
        color: var(--warning);
    }

    .stat-icon.danger {
        background: var(--danger-light);
        color: var(--danger);
    }

    .stat-icon.info {
        background: var(--info-light);
        color: var(--info);
    }

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-900);
    line-height: 1;
}

.stat-label {
    font-size: .8rem;
    color: var(--text-500);
    font-weight: 600;
    margin-top: 3px;
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-900);
    margin: 0;
    letter-spacing: -.01em;
}

.page-subtitle {
    font-size: .82rem;
    color: var(--text-500);
    margin: 2px 0 0;
}

/* === AVATAR === */
.avatar {
    border-radius: 50%;
    background: linear-gradient(135deg,var(--brand-400),var(--brand-700));
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: .78rem;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: .92rem;
}

.avatar-lg {
    width: 54px;
    height: 54px;
    font-size: 1.15rem;
}

/* === LINKS + UTILS === */
a {
    color: var(--brand-600);
}

    a:hover {
        color: var(--brand-700);
    }

.text-muted {
    color: var(--text-500) !important;
}

.text-brand {
    color: var(--brand-500) !important;
}

.bg-brand {
    background: var(--brand-500) !important;
}

/* ================================================================
           FONT-SIZE CONTROL WIDGET (navbar)
        ================================================================ */
.font-size-ctrl {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
}

.fsc-label {
    font-size: .68rem;
    font-weight: 800;
    color: var(--text-300);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-right: 6px;
    border-right: 1px solid var(--border);
    margin-right: 2px;
}

.fsc-btn {
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text-500);
    font-family: 'Nunito',system-ui,sans-serif;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    transition: all var(--transition);
}

    .fsc-btn:nth-child(2) {
        font-size: .68rem;
    }

    .fsc-btn:nth-child(3) {
        font-size: .8rem;
    }

    .fsc-btn:nth-child(4) {
        font-size: .92rem;
    }

    .fsc-btn:nth-child(5) {
        font-size: 1.05rem;
    }

    .fsc-btn:hover {
        background: var(--brand-50);
        color: var(--brand-600);
    }

    .fsc-btn.active {
        background: var(--brand-500);
        color: #fff;
        border-radius: var(--radius-xs);
    }

/* ================================================================
           SIDEBAR
        ================================================================ */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow: hidden;
    transition: transform var(--transition);
}

    .app-sidebar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg,var(--brand-600),var(--brand-300));
    }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 18px;
    height: var(--navbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg,var(--brand-500),var(--brand-300));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(99,102,241,.28);
}

.sidebar-brand-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--text-900);
    letter-spacing: -.01em;
    display: block;
}

.sidebar-brand-sub {
    font-size: .64rem;
    font-weight: 700;
    color: var(--brand-400);
    text-transform: uppercase;
    letter-spacing: .08em;
    display: block;
}

.sidebar-nav-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

    .sidebar-nav-wrap::-webkit-scrollbar {
        width: 3px;
    }

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-label {
    font-size: .64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--sidebar-section);
    padding: 16px 10px 5px;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: background var(--transition),color var(--transition);
    position: relative;
}

    .sidebar-link .nav-icon {
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        color: var(--sidebar-icon);
        flex-shrink: 0;
        transition: color var(--transition);
    }

    .sidebar-link:hover {
        background: var(--brand-25);
        color: var(--sidebar-text-hover);
    }

        .sidebar-link:hover .nav-icon {
            color: var(--brand-500);
        }

    .sidebar-link.active {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active);
        font-weight: 700;
    }

        .sidebar-link.active .nav-icon {
            color: var(--sidebar-icon-active);
        }

        .sidebar-link.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 7px;
            bottom: 7px;
            width: 3px;
            background: var(--brand-500);
            border-radius: 0 3px 3px 0;
        }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--brand-25);
    border: 1px solid var(--brand-100);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .7rem;
    color: var(--text-500);
}

.sidebar-logout-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    background: var(--danger-light);
    border: none;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition);
}

    .sidebar-logout-btn:hover {
        background: #fca5a5;
        color: #7f1d1d;
    }

/* ================================================================
           NAVBAR
        ================================================================ */
.app-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: var(--navbar-shadow);
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 10px;
    z-index: 1020;
}

.navbar-page-title {
    flex: 1;
    font-size: .95rem;
    font-weight: 800;
    color: var(--text-900);
    letter-spacing: -.01em;
}

.nav-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--brand-25);
    border: 1px solid var(--brand-100);
    border-radius: 99px;
    padding: 4px 13px;
    font-size: .76rem;
    color: var(--brand-600);
    font-weight: 700;
    white-space: nowrap;
}

.nav-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-500);
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

    .nav-icon-btn:hover {
        background: var(--brand-50);
        border-color: var(--brand-200);
        color: var(--brand-600);
    }

.nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.navbar-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 13px 4px 4px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: default;
}

    .navbar-user-chip:hover {
        border-color: var(--brand-200);
        box-shadow: var(--shadow-xs);
    }

.navbar-user-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-900);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
}

    .role-badge.Teacher {
        background: #dbeafe;
        color: #1e40af;
    }

    .role-badge.Manager {
        background: var(--brand-50);
        color: var(--brand-700);
    }

    .role-badge.Staff {
        background: var(--success-light);
        color: #065f46;
    }

    .role-badge.Student {
        background: var(--warning-light);
        color: #92400e;
    }

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-500);
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-navbar-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
    border-radius: 99px;
    background: linear-gradient(135deg,var(--brand-500),var(--brand-300));
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    box-shadow: 0 3px 12px rgba(99,102,241,.28);
    transition: opacity var(--transition),box-shadow var(--transition);
}

    .btn-navbar-login:hover {
        opacity: .9;
        color: #fff;
        box-shadow: 0 5px 18px rgba(99,102,241,.38);
    }

/* ================================================================
           LAYOUT SHELL
        ================================================================ */
.app-main {
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main-inner {
    flex: 1;
    padding: 28px 26px 72px;
}

.app-main-full {
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 40px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    color: var(--text-300);
    z-index: 900;
}

.app-footer-full {
    left: 0;
}

.app-footer a {
    color: var(--brand-500);
    text-decoration: none;
    font-weight: 700;
}

/* === MOBILE === */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

        .app-sidebar.sidebar-open {
            transform: translateX(0);
        }

    .app-navbar {
        left: 0;
    }

    .app-main {
        margin-left: 0;
    }

    .app-footer {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .nav-breadcrumb {
        display: none;
    }

    .font-size-ctrl {
        display: none;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(30,27,74,.4);
        z-index: 1025;
        backdrop-filter: blur(3px);
    }

        .sidebar-overlay.active {
            display: block;
        }
}

.btn:focus-visible, a:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

.worked-sample-box {
    position: relative;
    padding: 1.25rem;
    border: 2px dashed #9ec5fe;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.08);
}

.worked-sample-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.worked-sample-note {
    margin-bottom: 0.85rem;
    color: #475569;
    font-size: 0.95rem;
}

.worked-sample-title {
    margin-bottom: 0.75rem;
    color: #0f172a;
    font-weight: 800;
}

.worked-sample-text {
    color: #1e293b;
    line-height: 1.8;
}

.worked-sample-image {
    object-fit: contain;
}

.worked-sample-audio-list {
    display: grid;
    gap: 0.75rem;
}

.worked-sample-audio-item {
    padding: 0.85rem;
    border: 1px solid #dbeafe;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.75);
}

.sample-guidance {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-color: #dbeafe !important;
}

@media (max-width: 768px) {
    .worked-sample-box {
        padding: 1rem;
    }
}

.worked-sample-structured-card {
    padding: 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.82);
}

.worked-sample-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    background: #f8fbff;
}

.worked-sample-option.is-correct {
    border-color: #86efac;
    background: #f0fdf4;
}

.worked-sample-answer {
    display: inline-block;
    min-width: 90px;
    margin: 0 0.2rem;
    padding: 0.15rem 0.5rem;
    border-bottom: 2px solid #1d4ed8;
    color: #1d4ed8;
    font-weight: 700;
    background: rgba(219, 234, 254, 0.55);
}

.worked-sample-wordbank {
    padding: 0.85rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
}

.worked-sample-answer-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.worked-sample-badge-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.worked-sample-answer-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.worked-sample-sequence {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.worked-sample-sequence li + li {
    margin-top: 0.45rem;
}

.worked-sample-select {
    min-width: 140px;
    border: 2px solid #9dc4f8;
    border-radius: 999px;
    background: #eef6ff;
    color: #0f3f73;
    font-weight: 600;
    opacity: 1;
}

.worked-sample-prose {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    line-height: 1.9;
    white-space: normal;
}

.worked-sample-keypoints {
    margin: 0;
    padding-left: 1.25rem;
}

.worked-sample-keypoints li + li {
    margin-top: 0.4rem;
}

/* Shared LTR metadata lines inside RTL pages */
.meta-ltr {
    text-align: left;
    direction: ltr;
}

.qtf-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qtf-toolbar-sticky {
    position: relative;
    z-index: 1065;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.08);
}

.qtf-toolbar-host,
.qtf-modal-toolbar-host {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.qtf-toolbar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 13rem;
}

.qtf-toolbar-title {
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.qtf-menu-button {
    border-radius: 999px;
}

.qtf-menu {
    min-width: 14rem;
    z-index: 1080;
}

.qtf-hint {
    color: #64748b;
    font-size: 0.8rem;
}

.qtf-active-field {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 0.18rem rgba(96, 165, 250, 0.16) !important;
}

.modal .qtf-modal-toolbar-host,
.modal .qtf-toolbar .dropdown {
    position: relative;
    z-index: 1066;
}

.modal .qtf-modal-header {
    overflow: visible;
    z-index: 1060;
}

.qtf-preview-surface {
    min-height: 10rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    line-height: 1.85;
    white-space: normal;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.qtf-underline {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.qtf-highlight {
    padding: 0 0.16em;
    border-radius: 0.2rem;
    background: #fef08a;
}

.qtf-color-red {
    color: #b91c1c;
}

.qtf-color-blue {
    color: #1d4ed8;
}

.qtf-color-green {
    color: #15803d;
}

.qtf-color-orange {
    color: #c2410c;
}

.qtf-size-sm {
    font-size: 0.85em;
}

.qtf-size-md {
    font-size: 1em;
}

.qtf-size-lg {
    font-size: 1.2em;
}

.qtf-size-xl {
    font-size: 1.4em;
}
