@media screen and (max-width: 767.98px) {
    html[data-theme="light"] body[data-staff-role] :is(.nk-wrap, .dashboardPage) {
        background-color: #f2f2f2;
        color: #364a63;
    }

    html[data-theme="light"] body[data-staff-role] .dashboardPage :is(.card, .card-inner) {
        background-color: #fff;
        color: #364a63;
    }

    .nk-content > .container, .nk-header > .container,
    .student-theme .mainContent .container, .student-theme .mainHeader .container {
        padding-inline: 12px;
    }

    .nk-content :is(.card, .nk-block, .nk-block-head-content, .pageHead__right),
    .student-theme :is(.studentClass, .profile_left, .profile_right, .progressSlider_right) {
        min-width: 0;
    }

    .nk-content :is(.card-inner, .modal-body):not(.p-0), .modal-content .modal-body {
        padding: 16px;
    }

    .nk-block-between, .student-list-card-header > .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nk-content :is(input.form-control, textarea.form-control, select.form-control, .select2-selection),
    .modal :is(input.form-control, textarea.form-control, select.form-control, .select2-selection),
    .student-theme :is(input.form-control, textarea.form-control, select.form-control),
    .login-landing input.form-control {
        font-size: 16px;
        min-height: 44px;
        max-width: 100%;
    }

    .nk-content :is(.btn, .pagination .page-link), .modal .btn,
    .student-theme .mainContent .btn {
        min-height: 40px;
    }

    #customSearchKeywords {
        font-size: 16px !important;
    }

    .nk-header .nk-header-wrap {
        gap: 6px;
    }

    .nk-header .nk-header-brand {
        margin-inline-end: 0;
        flex-shrink: 0;
    }

    .nk-header .logo-img, .student-theme .mainHeader .navbar-brand img {
        max-width: 47px;
        max-height: 38px;
    }

    .nk-header .nk-header-menu {
        position: static;
        width: auto;
        height: auto;
        margin-inline-end: auto;
        padding: 0;
        background: transparent;
        transform: none;
        flex-shrink: 0;
    }

    .nk-header .nk-header-menu .nk-menu-toggle > .user-info {
        display: block !important;
    }

    .nk-header .nk-header-menu .nk-menu-toggle {
        min-height: 44px;
        padding-inline: 4px;
    }

    .nk-header .grayscale-menu.show {
        position: fixed !important;
        inset: 65px 12px auto !important;
        width: auto !important;
        max-width: none;
        max-height: min(72vh, calc(100dvh - 80px));
        margin: 0;
        transform: none !important;
        overflow: auto;
    }

    .nk-header .grayscale-menu .nk-menu-icon,
    .nk-header .grayscale-menu .nk-menu-icon img {
        width: 40px !important;
        height: 40px !important;
    }

    .nk-header .grayscale-menu .nk-menu-link {
        min-height: 70px;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header
        :is(.header-search-wrap, .nk-quick-nav > li:has([data-target="sidebarMenu"])) {
        display: none;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .nk-header-menu .nk-menu-toggle {
        display: grid;
        place-items: center;
        min-width: 44px;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header :is(.logo-link, .nk-quick-nav, .user-toggle) {
        display: flex;
        align-items: center;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .logo-img {
        max-width: 59px;
        max-height: 44px;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .nk-menu-toggle .dropdown-indicator {
        display: flex;
        align-items: center;
        font-size: 0;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .nk-menu-toggle .dropdown-indicator::after {
        display: none;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .nk-menu-toggle .dropdown-indicator .icon {
        font-size: 21px;
        line-height: 1;
        padding: 0 !important;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .grayscale-menu .row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .grayscale-menu .nk-menu-item:not(:has(
        > a:is([href$="/students"], [href$="/bookings"], [href$="/presentations"],
            [href$="/study-sessions"], [href$="/test-taker"], [href$="/tests"], [href$="/staff/announcements"])
    )) {
        display: none;
    }

    body[data-staff-role]:not([data-staff-role="super"]) .nk-header .grayscale-menu .nk-menu-item:has(> a[href$="/staff/announcements"]) {
        grid-column: auto;
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header {
        background: #f7f8fa !important;
        border-color: #d8e1eb;
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header .logo-img {
        filter: brightness(0) saturate(100%) invert(15%) sepia(21%) saturate(1800%) hue-rotate(170deg) brightness(93%);
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header
        :is(.nk-menu-toggle .icon, .header-notifications-toggle, .theme-slider svg) {
        color: #263e55 !important;
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header
        :is(.grayscale-menu, .grayscale-menu .dropdown-inner, .grayscale-menu .nk-menu-sub) {
        background: #fff !important;
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header .grayscale-menu .nk-menu-text {
        color: #263e55 !important;
    }

    html[data-theme="light"] body[data-staff-role]:not([data-staff-role="super"]) .nk-header .grayscale-menu
        :is(.nk-menu-link:hover, .nk-menu-link:focus-visible, .nk-menu-item.active > .nk-menu-link) {
        background: #edf2f7 !important;
    }

    :is(.nk-header, .student-theme .mainHeader) .theme-slider-track {
        width: 42px;
        height: 24px;
    }

    :is(.nk-header, .student-theme .mainHeader) .theme-slider-thumb {
        height: 18px;
        width: 18px;
    }

    html[data-theme=charcoal] :is(.nk-header, .student-theme .mainHeader) .theme-slider-thumb {
        transform: translateX(18px);
    }

    :is(.nk-header, .student-theme .mainHeader) .theme-slider svg {
        width: 14px;
        height: 14px;
    }

    .nk-header .header-search-wrap .header-search-box.active {
        position: fixed;
        inset: 65px 12px auto;
        width: auto;
        z-index: 1001;
    }

    .nk-header .header-search-box.active .header-search-input,
    .nk-header .header-search-results {
        width: 100%;
        max-width: 100%;
    }

    :is(.nk-header, .student-theme .mainHeader) .header-notifications-panel {
        width: min(320px, calc(100vw - 24px));
        max-height: min(64vh, 420px);
        overflow-y: auto;
    }

    .nk-content :is(.table-responsive, .datatable-wrap, .table-responsive-matrix),
    .modal .table-responsive, .student-theme .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }

    .common-table {
        max-width: 100%;
        overflow-x: auto !important;
    }

    .nk-content table#example:not(.student-list-table),
    #Grades .table, .student-theme .studentClass .customTable > table {
        min-width: 620px;
    }

    .nk-content :is(.common-table, .datatable-wrap):has(.student-list-table) {
        overflow: visible !important;
    }

    #example.student-list-table,
    #example.student-list-table > tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    #example.student-list-table > thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    #example.student-list-table .student-list-record {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "name name" "code code" "risk status" "contract levels" "start end";
        gap: 8px 14px;
        padding: 14px;
        border-bottom: 1px solid var(--theme-line, #dce2ec);
    }

    .common-table #example.student-list-table .student-list-record > td {
        min-width: 0 !important;
        width: auto !important;
        padding: 0;
        border: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .student-list-record > td:nth-child(1),
    .student-list-record > td:nth-child(4),
    .student-list-record .student-phone-text {
        display: none;
    }

    .student-list-record > td:nth-child(2) { grid-area: code; }
    .student-list-record > td:nth-child(3) { grid-area: name; margin-inline-end: 44px; }
    .student-list-record > td:nth-child(5) { grid-area: levels; }
    .student-list-record > td:nth-child(6) { grid-area: contract; }
    .student-list-record > td:nth-child(7) { grid-area: start; }
    .student-list-record > td:nth-child(8) { grid-area: end; }
    .student-list-record > td:nth-child(9) { grid-area: risk; }
    .student-list-record > td:nth-child(10) { grid-area: status; }

    .student-list-record > td:nth-child(11) {
        position: absolute;
        inset-block-start: 8px;
        inset-inline-end: 8px;
    }

    .student-list-record .student-card-label.d-none {
        display: block !important;
        font-size: 12px;
        color: var(--theme-muted, #53647a);
    }

    .student-list-record .student-name-pill {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .nk-content .student-filter-section .form-group {
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 140px;
    }

    .student-list-card-header .form-group {
        max-width: 100%;
    }

    .nk-content .nav-tabs-card.flex-nowrap, .student-theme .mainContent .nav-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-padding-inline: 10px;
    }

    .nk-content .nav-tabs-card.flex-nowrap > *, .student-theme .mainContent .nav-tabs > * {
        flex-shrink: 0;
    }

    .nk-content .nav-tabs-card .nav-link {
        padding: 12px;
        white-space: nowrap;
    }

    #Attendance .attendance-controls {
        gap: 10px;
    }

    #Attendance .attendance-date-field {
        flex: 1 1 128px;
    }

    #Attendance .attendance-date-field input {
        width: 100%;
        min-width: 0;
    }

    #Attendance .attendance-share-controls {
        width: 100%;
        margin-inline-start: 0;
    }

    #Attendance #attendance-grid {
        min-width: 630px;
    }

    .study-breadcrumb, .study-page-subtitle {
        display: none;
    }

    .timetable-matrix-card .study-teacher-filter-wrap,
    .matrix-table-outer .matrix-scroll-btn {
        display: none !important;
    }

    .study-teacher-navigation .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .nk-content .timetable-matrix-table {
        table-layout: fixed;
        min-width: 100%;
    }

    .timetable-matrix-table th[data-teacher-id] {
        width: auto;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .timetable-matrix-table :is(th.time-col-header, td.time-cell) {
        box-sizing: border-box;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding-inline: 5px;
        text-align: center;
    }

    #Attendance .datepicker-dropdown {
        width: min(250px, calc(100vw - 48px));
        min-width: 0;
    }

    .nk-block-head .filterDropdown {
        width: min(350px, calc(100vw - 56px));
        min-width: 0;
    }

    .nk-block-head .toggle-expand-content:has(.filterDropdown) {
        width: auto;
        margin-inline: 0;
    }

    .nk-block-head .filterDropdown .select2-container {
        max-width: 100%;
    }

    .schedule-surface #calendar .fc-toolbar .fc-button {
        min-width: 44px;
        min-height: 44px;
    }

    .schedule-surface #calendar .fc-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    #calendar.schedule-columns:has(.fc-timeGridDay-view) .fc-header-toolbar {
        z-index: 4;
    }

    .schedule-surface #calendar .fc-toolbar-title {
        font-size: 1.15rem;
    }

    #calendar.schedule-columns .fc-view-harness:has(.fc-timeGridDay-view) .fc-col-header-cell-cushion {
        align-items: center;
    }

    #calendar.schedule-columns .fc-timegrid-slot-label {
        width: 38px;
    }

    #calendar.schedule-columns .fc-timegrid-slot-label-cushion {
        padding-inline-end: 8px;
    }

    .modal .modal-dialog {
        width: auto;
        max-width: none;
        margin: 10px;
    }

    .modal .modal-header, .modal .modal-footer {
        gap: 8px;
        padding: 12px 16px;
    }

    dialog.announcement-prompt {
        width: calc(100% - 24px);
        max-width: 480px;
        max-height: calc(100dvh - 24px);
        overflow: auto;
    }

    .student-theme .studentClass_head h2 {
        font-size: 1.35rem;
        overflow-wrap: anywhere;
    }

    .student-theme .studentClass_head img {
        flex-shrink: 0;
    }

    .student-theme .studentClassInfo {
        min-height: 76px;
        gap: 10px;
    }

    .student-theme .progressSlider_right {
        max-width: 100%;
    }
}

@media screen and (max-width: 374.98px) {
    .nk-header .theme-slider svg {
        display: none;
    }

    .nk-header .nk-quick-nav > li {
        margin-inline: 0;
    }
}
