/**
 * Admin + student panel — Materio-inspired shell (purple primary, soft surfaces, spacing).
 * Uses :is(#admin-body, #student-body) so one block serves both layouts.
 */

/* Base type is 14px on the public site. Panels are one pixel larger. */
html:has(#admin-body),
html:has(#student-body) {
    font-size: 15px;
}

/* Controls and labels are locked in px; keep the same +1px inside the panels. */
:is(#admin-body, #student-body) :is(
    .btn-primary,
    .btn-secondary,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input.w-full,
    select,
    select.w-full,
    textarea,
    textarea.w-full
) {
    font-size: 15px !important;
}

:is(#admin-body, #student-body) :is(
    .form-label,
    label.block.text-sm,
    label.form-label,
    form label[for],
    .form-group label,
    label.block
) {
    font-size: 13px !important;
}

:is(#admin-body, #student-body) {
    font-size: 15px;
    /* 8px-based spacing scale */
    --admin-space-1: 0.25rem;
    --admin-space-2: 0.5rem;
    --admin-space-3: 0.75rem;
    --admin-space-4: 1rem;
    --admin-space-5: 1.25rem;
    --admin-space-6: 1.5rem;
    --admin-space-8: 2rem;
    --admin-radius-sm: 5px;
    --admin-radius-md: 5px;
    --admin-radius-lg: 5px;
    --admin-border: rgba(47, 43, 61, 0.08);
    --admin-border-strong: rgba(47, 43, 61, 0.12);

    --materio-primary: #7367f0;
    --materio-primary-dark: #5e52d8;
    --materio-primary-soft: #9e95f5;
    --materio-page-bg: #f4f5fa;
    --materio-sidebar-bg: #f4f5fa;
    --materio-card-header-bg: #f4f5fa;
    --materio-surface: #ffffff;
    --materio-nav-active-shadow: 0 2px 6px 0 rgba(115, 103, 240, 0.45);

    --ee-accent: #7367f0;
    --ee-accent-hover: #5e52d8;
    --ee-accent-soft: #8f85f4;
    --ee-radius: 5px;
    --app-focus: #a79bf7;
    --app-focus-offset: #fff;

    --primary-25: #fdfcff;
    --primary-50: #f5f3ff;
    --primary-100: #ebe7fd;
    --primary-200: #d9d2fb;
    --primary-300: #beb0f6;
    --primary-400: #9585ed;
    --primary-500: #7367f0;
    --primary-600: #5e52d8;
    --primary-700: #4f45b8;
    --primary-800: #423a96;
    --primary-900: #3a337a;

    --bs-primary: #7367f0;
    --bs-primary-rgb: 115, 103, 240;
    --bs-link-color: #7367f0;
    --bs-link-hover-color: #5e52d8;

    --app-space-y: clamp(0.75rem, 1.6vw, 1.125rem);
    --app-space-x: clamp(0.75rem, 3vw, 1.375rem);
    --ee-panel-section-gap: clamp(0.75rem, 1.5vw, 1rem);
    --ee-panel-block-gap: clamp(0.5rem, 1vw, 0.75rem);
}

html.dark :is(#admin-body, #student-body) {
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-border-strong: rgba(255, 255, 255, 0.12);

    --materio-page-bg: #25293c;
    --materio-sidebar-bg: #2a2d42;
    --materio-surface: #2f3349;
    --materio-nav-active-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.35);

    --ee-surface: #2f3349;
    --ee-surface-muted: #25293c;
    --ee-border: #3e425c;
    --app-focus: #b4abf8;
    --app-focus-offset: #2f3349;

    --primary-50: rgba(115, 103, 240, 0.12);
    --primary-100: rgba(115, 103, 240, 0.18);
    --primary-200: rgba(115, 103, 240, 0.28);
    --primary-300: rgba(158, 149, 245, 0.45);
    --primary-400: #9e95f5;
    --primary-500: #9e95f5;
    --primary-600: #b4abf8;
    --primary-700: #c9c4fa;
    --primary-800: #dedafc;
    --primary-900: #f0eeff;

    --bs-primary: #9e95f5;
    --bs-primary-rgb: 158, 149, 245;
    --bs-link-color: #b4abf8;
    --bs-link-hover-color: #c9c4fa;
}

:is(#admin-body, #student-body).font-sans {
    background-color: var(--materio-page-bg) !important;
    color: #2f2b3d;
}

html.dark :is(#admin-body, #student-body).font-sans {
    color: #e6e6f0;
}

/* ----- Top bar ----- */
:is(#admin-body, #student-body) .student-topnav {
    background-color: var(--materio-surface) !important;
    border-bottom: 1px solid rgba(47, 43, 61, 0.06) !important;
    box-shadow: 0 2px 6px 0 rgba(47, 43, 61, 0.05) !important;
    backdrop-filter: none;
}

html.dark :is(#admin-body, #student-body) .student-topnav {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.25) !important;
}

:is(#admin-body, #student-body) .student-topnav .ee-topnav-btn {
    border-radius: var(--ee-radius, 5px);
}

:is(#admin-body #admin-profile-menu-btn, #student-body #student-profile-menu-btn) {
    border-radius: var(--ee-radius, 5px);
}

:is(#admin-body, #student-body) .student-topnav .text-gray-600,
:is(#admin-body, #student-body) .student-topnav .text-gray-700 {
    color: #6d6778 !important;
}

html.dark :is(#admin-body, #student-body) .student-topnav .text-gray-600,
html.dark :is(#admin-body, #student-body) .student-topnav .text-gray-400 {
    color: #a5a3b3 !important;
}

:is(#admin-body, #student-body) .student-topnav .border-gray-200,
:is(#admin-body, #student-body) .student-topnav .border-gray-600 {
    border-color: rgba(115, 103, 240, 0.12) !important;
}

/* ----- Sidebar (full viewport height under topnav; #f4f5fa rail) ----- */
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar {
    background: var(--materio-sidebar-bg) !important;
    border-right: 1px solid rgba(47, 43, 61, 0.08) !important;
    box-shadow: 2px 0 12px rgba(47, 43, 61, 0.04) !important;
    top: 4rem !important;
    bottom: 0 !important;
    height: auto !important;
    min-height: calc(100dvh - 4rem) !important;
    max-height: none !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar {
    background: var(--materio-sidebar-bg) !important;
    border-right-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2) !important;
}

@media (min-width: 1024px) {
    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar:not(.sidebar-collapsed) {
        width: 16rem !important;
        min-width: 16rem !important;
        max-width: 16rem !important;
    }

    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar.sidebar-collapsed:not(:hover) {
        width: 5rem !important;
        min-width: 5rem !important;
        max-width: 5rem !important;
    }

    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar {
        box-shadow: none !important;
    }
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-user-block img {
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.2);
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link:not(.ee-panel-nav-link--active),
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) button.sidebar-link,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link {
    border-radius: var(--ee-radius, 5px) !important;
    background: transparent !important;
    box-shadow: none !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link:not(.ee-panel-nav-link--active):hover,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) button.sidebar-link:hover {
    background-color: transparent !important;
    color: #374151 !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link:not(.ee-panel-nav-link--active):hover,
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) button.sidebar-link:hover {
    background-color: transparent !important;
    color: #d1d5db !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link.ee-panel-nav-link--active {
    background: transparent !important;
    color: #374151 !important;
    box-shadow: none !important;
    font-weight: 600 !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link.ee-panel-nav-link--active i {
    color: inherit !important;
    opacity: 0.9 !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link.sidebar-submenu-link--active {
    background: transparent !important;
    color: #374151 !important;
    font-weight: 600;
    box-shadow: none !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link.sidebar-submenu-link--active {
    background: transparent !important;
    color: #d1d5db !important;
    box-shadow: none !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu {
    border-left-color: rgba(115, 103, 240, 0.2) !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu {
    border-left-color: rgba(158, 149, 245, 0.25) !important;
}

/* Sidebar footer + collapse (same rail as menu) */
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer {
    background: var(--materio-sidebar-bg);
    border-top-color: rgba(47, 43, 61, 0.1) !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-admin-sidebar-toggle="collapse"],
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-student-sidebar-toggle="collapse"],
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-panel-sidebar-toggle="collapse"] {
    color: #4b5563 !important;
    font-weight: 500;
    border: none !important;
    background: transparent !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-admin-sidebar-toggle="collapse"],
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-student-sidebar-toggle="collapse"],
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-panel-sidebar-toggle="collapse"] {
    color: #9ca3af !important;
    border: none !important;
    background: transparent !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-admin-sidebar-toggle="collapse"]:hover,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-student-sidebar-toggle="collapse"]:hover,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-panel-sidebar-toggle="collapse"]:hover {
    background: transparent !important;
    border: none !important;
    color: #374151 !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-admin-sidebar-toggle="collapse"]:hover,
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-student-sidebar-toggle="collapse"]:hover,
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) > .ee-sidebar-footer [data-panel-sidebar-toggle="collapse"]:hover {
    background: transparent !important;
    color: #d1d5db !important;
}

/* ----- Main column ----- */
:is(#admin-body, #student-body) .student-main-bg {
    background: var(--materio-page-bg) !important;
}

html.dark :is(#admin-body, #student-body) .student-main-bg {
    background: var(--materio-page-bg) !important;
}

/* Cards / stat tiles */
:is(#admin-body, #student-body) .student-content .student-stat-card,
:is(#admin-body, #student-body) .student-content .rounded-2xl.border.bg-white,
:is(#admin-body, #student-body) .student-content .rounded-xl.border.bg-white {
    border-color: rgba(47, 43, 61, 0.06) !important;
    box-shadow: 0 2px 10px 0 rgba(47, 43, 61, 0.06) !important;
}

:is(#admin-body, #student-body) .student-content .student-stat-card {
    box-shadow:
        0 1px 2px rgba(47, 43, 61, 0.04),
        0 6px 16px rgba(47, 43, 61, 0.05) !important;
}

:is(#admin-body, #student-body) .student-stat-card.student-stat-card-1 { border-left-color: #7367f0 !important; }
:is(#admin-body, #student-body) .student-stat-card.student-stat-card-2 { border-left-color: #f59e0b !important; }
:is(#admin-body, #student-body) .student-stat-card.student-stat-card-3 { border-left-color: #10b981 !important; }
:is(#admin-body, #student-body) .student-stat-card.student-stat-card-4 { border-left-color: #8b5cf6 !important; }

html.dark :is(#admin-body, #student-body) .student-content .student-stat-card,
html.dark :is(#admin-body, #student-body) .student-content .rounded-2xl.border[class*="dark:bg-gray"],
html.dark :is(#admin-body, #student-body) .student-content .rounded-xl.border[class*="dark:bg-gray"] {
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.28) !important;
}

html.dark :is(#admin-body, #student-body) .student-stat-card.student-stat-card-1 { border-left-color: #9e95f5 !important; }
html.dark :is(#admin-body, #student-body) .student-stat-card.student-stat-card-2 { border-left-color: #fbbf24 !important; }
html.dark :is(#admin-body, #student-body) .student-stat-card.student-stat-card-3 { border-left-color: #34d399 !important; }
html.dark :is(#admin-body, #student-body) .student-stat-card.student-stat-card-4 { border-left-color: #a78bfa !important; }

:is(#admin-body, #student-body) .student-stat-card:hover {
    box-shadow: 0 4px 18px rgba(115, 103, 240, 0.12) !important;
    transform: translateY(-2px);
}

html.dark :is(#admin-body, #student-body) .student-stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

:is(#admin-body, #student-body) .student-content table tbody tr:hover {
    background-color: rgba(115, 103, 240, 0.06) !important;
}

html.dark :is(#admin-body, #student-body) .student-content table tbody tr:hover {
    background-color: rgba(158, 149, 245, 0.08) !important;
}

/* Toolbar / filter bars */
:is(#admin-body, #student-body) .student-content .um-filter-bar,
:is(#admin-body, #student-body) .student-content .roles-mgmt-header + .um-filter-bar {
    border-radius: var(--admin-radius-md);
    border-color: var(--admin-border-strong);
    box-shadow: 0 2px 10px rgba(47, 43, 61, 0.05);
    margin-bottom: var(--ee-panel-section-gap, 0.75rem);
}

html.dark :is(#admin-body, #student-body) .student-content .um-filter-bar {
    border-color: var(--admin-border-strong);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

:is(#admin-body, #student-body) .um-filter-bar__header {
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid var(--admin-border);
    background: var(--materio-card-header-bg, #f4f5fa) !important;
}

html.dark :is(#admin-body, #student-body) .um-filter-bar__header {
    border-bottom-color: var(--admin-border-strong);
    background: rgb(38 42 58) !important;
}

:is(#admin-body, #student-body) .um-filter-bar__form {
    gap: 0.5rem 0.75rem;
    padding: 0.625rem 0.875rem 0.75rem;
}

:is(#admin-body, #student-body) .um-filter-bar__field {
    gap: 0.25rem;
}

:is(#admin-body, #student-body) .um-filter-bar__btn {
    min-height: 2.75rem;
    height: auto;
    padding: 0.5rem 1.125rem;
    border-radius: var(--admin-radius-md) !important;
}

:is(#admin-body, #student-body) .um-filter-bar__btn--primary {
    background: var(--materio-primary);
    box-shadow: 0 1px 3px rgba(115, 103, 240, 0.25);
}

:is(#admin-body, #student-body) .um-filter-bar__btn--primary:hover {
    background: var(--materio-primary-dark);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.35);
}

:is(#admin-body, #student-body) .um-filter-bar__btn--secondary {
    border: 1px solid var(--admin-border-strong);
    color: #5b6472;
}

html.dark :is(#admin-body, #student-body) .um-filter-bar__btn--secondary {
    color: rgb(203 213 225);
}

:is(#admin-body, #student-body) .um-filter-bar .select2-container.select2-container--focus .select2-selection--single {
    border-color: var(--materio-primary) !important;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15) !important;
}

@media (max-width: 639px) {
    :is(#admin-body, #student-body) .um-filter-bar__search,
    :is(#admin-body, #student-body) .um-filter-bar__role,
    :is(#admin-body, #student-body) .um-filter-bar__status {
        min-width: 0 !important;
        width: 100% !important;
    }

    :is(#admin-body, #student-body) .um-filter-bar__form.um-filter-bar__form--cols-4-2-2-2-2 {
        grid-template-columns: 1fr;
    }
}

/* Dropdowns */
:is(#admin-body, #student-body) [data-ee-dropdown-panel],
:is(#admin-body #admin-profile-dropdown, #student-body #student-profile-dropdown) {
    border-radius: var(--ee-radius, 5px) !important;
    box-shadow: 0 8px 28px rgba(47, 43, 61, 0.1) !important;
}

html.dark :is(#admin-body, #student-body) [data-ee-dropdown-panel],
html.dark :is(#admin-body #admin-profile-dropdown, #student-body #student-profile-dropdown) {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4) !important;
}

:is(#admin-body, #student-body) .student-topnav .bg-primary-500 {
    background-color: var(--materio-primary) !important;
}

:is(#admin-body, #student-body) .student-sidebar button.sidebar-link:focus-visible {
    outline-color: rgba(115, 103, 240, 0.55);
}

:is(#admin-body, #student-body) .text-primary-600 {
    color: var(--materio-primary-dark) !important;
}

:is(#admin-body, #student-body) .text-primary-500 {
    color: var(--materio-primary) !important;
}

html.dark :is(#admin-body, #student-body) .dark\:text-primary-400 {
    color: var(--primary-400) !important;
}

:is(#admin-body, #student-body) .btn-primary {
    background-color: var(--materio-primary);
    border-color: var(--materio-primary);
}

:is(#admin-body, #student-body) .btn-primary:hover,
:is(#admin-body, #student-body) .btn-primary:focus {
    background-color: var(--materio-primary-dark);
    border-color: var(--materio-primary-dark);
}

/* ----- Content shell ----- */
:is(#admin-body, #student-body) .app-content-container {
    padding-left: max(var(--app-space-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--app-space-x), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--app-space-y), env(safe-area-inset-bottom, 0px));
}

:is(#admin-body, #student-body) nav[aria-label="Breadcrumb"] {
    margin-bottom: var(--ee-panel-block-gap, 0.625rem);
}

:is(#admin-body, #student-body) .roles-mgmt-header,
:is(#admin-body, #student-body) .users-mgmt-header,
:is(#admin-body, #student-body) .admin-page-header,
:is(#admin-body, #student-body) .app-page-toolbar {
    margin-bottom: var(--ee-panel-section-gap, 0.875rem);
    gap: var(--ee-panel-block-gap, 0.625rem);
}

:is(#admin-body, #student-body) .roles-mgmt-header h1,
:is(#admin-body, #student-body) .users-mgmt-header h1,
:is(#admin-body, #student-body) .admin-page-header h1 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.25;
}

:is(#admin-body, #student-body) .roles-mgmt-header p,
:is(#admin-body, #student-body) .users-mgmt-header p,
:is(#admin-body, #student-body) .admin-page-header p {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
}

:is(#admin-body, #student-body) .um-filter-bar {
    margin-bottom: var(--ee-panel-section-gap, 0.875rem) !important;
}

:is(#admin-body, #student-body) .users-stats-insights,
:is(#admin-body, #student-body) .ee-panel-stat-grid {
    margin-bottom: var(--ee-panel-section-gap, 0.875rem);
}

:is(#admin-body, #student-body) .ee-panel-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ee-panel-block-gap, 0.75rem) !important;
    min-width: 0;
}

@media (max-width: 639px) {
    :is(#admin-body, #student-body) .ee-panel-stat-grid {
        gap: 0.5rem !important;
    }

    :is(#admin-body, #student-body) .ee-panel-stat-grid .student-stat-card > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.625rem 0.5rem !important;
    }

    :is(#admin-body, #student-body) .ee-panel-stat-grid .student-stat-icon {
        width: 2.25rem !important;
        height: 2.25rem !important;
        font-size: 0.8125rem !important;
    }

    :is(#admin-body, #student-body) .ee-panel-stat-grid .ee-stat-label,
    :is(#admin-body, #student-body) .ee-panel-stat-grid .student-stat-card > div > div:last-child p:first-child {
        font-size: 0.625rem !important;
        letter-spacing: 0.04em;
    }

    :is(#admin-body, #student-body) .ee-panel-stat-grid .ee-stat-value,
    :is(#admin-body, #student-body) .ee-panel-stat-grid .student-stat-card > div > div:last-child p:nth-child(2) {
        font-size: 1.125rem !important;
    }

    :is(#admin-body, #student-body) .ee-panel-stat-grid .ee-stat-hint,
    :is(#admin-body, #student-body) .ee-panel-stat-grid .student-stat-card > div > div:last-child p:nth-child(3) {
        font-size: 0.6875rem !important;
    }
}

:is(#admin-body, #student-body) .ee-panel-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--admin-space-2);
}

:is(#admin-body, #student-body) .ee-panel-header-actions .um-filter-bar__btn {
    text-decoration: none;
    min-height: var(--ee-control-height, 42px);
}

:is(#admin-body, #student-body) .ee-panel-page-wrap {
    padding-bottom: var(--admin-space-6);
}

@media (max-width: 1023px) {
    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar).student-sidebar {
        width: min(17.5rem, calc(100vw - 1rem)) !important;
        max-width: min(17.5rem, calc(100vw - 1rem)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

@media (max-width: 1023px) {
    :is(#admin-body, #student-body) .ee-topnav-btn {
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0.5rem !important;
    }

    :is(#admin-body #admin-profile-menu-btn, #student-body #student-profile-menu-btn) {
        min-height: 2.75rem;
        padding-left: 0.375rem;
        padding-right: 0.5rem;
    }

    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link,
    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) button.sidebar-link {
        min-height: 2.75rem;
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link {
        min-height: 2.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

:is(#admin-body, #student-body) .student-stat-card {
    border-radius: var(--admin-radius-lg) !important;
}

:is(#admin-body, #student-body) .student-stat-card > div {
    gap: clamp(0.625rem, 1.5vw, 0.875rem);
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.875rem, 2.5vw, 1.125rem) !important;
}

:is(#admin-body, #student-body) .student-stat-card .student-stat-icon {
    border-radius: var(--admin-radius-md) !important;
}

:is(#admin-body, #student-body) .student-panel-card,
:is(#admin-body, #student-body) .ee-panel-card {
    border-radius: var(--admin-radius-lg) !important;
    border: 1px solid var(--admin-border) !important;
    background: var(--materio-surface, #fff) !important;
    box-shadow: 0 2px 10px rgba(47, 43, 61, 0.06) !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

html.dark :is(#admin-body, #student-body) .student-panel-card,
html.dark :is(#admin-body, #student-body) .ee-panel-card {
    border-color: var(--admin-border-strong) !important;
    background: var(--materio-surface, #2f3349) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25) !important;
}

:is(#admin-body, #student-body) .ee-panel-card__header,
:is(#admin-body, #student-body) .student-panel-card > .border-b {
    padding: clamp(0.875rem, 2.2vw, 1.125rem) clamp(1rem, 3vw, 1.35rem) !important;
    border-bottom-color: var(--admin-border) !important;
    background: var(--materio-card-header-bg, #f4f5fa) !important;
}

html.dark :is(#admin-body, #student-body) .ee-panel-card__header,
html.dark :is(#admin-body, #student-body) .student-panel-card > .border-b {
    border-bottom-color: var(--admin-border-strong) !important;
    background: rgb(38 42 58) !important;
}

/* List/table card title row */
:is(#admin-body, #student-body) .admin-list-card > .users-list-header {
    background: var(--materio-card-header-bg, #f4f5fa) !important;
    border-bottom-color: var(--admin-border) !important;
}

html.dark :is(#admin-body, #student-body) .admin-list-card > .users-list-header {
    background: rgb(38 42 58) !important;
    border-bottom-color: var(--admin-border-strong) !important;
}

/* Modal dialog title bar — compact white header (global h3 margin was stretching it) */
:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child,
:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > div.border-b:first-child,
:is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child,
:is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #111827;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.75rem 1.25rem !important;
}

html.dark :is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child,
html.dark :is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > div.border-b:first-child,
html.dark :is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child,
html.dark :is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child {
    background: rgb(47 51 73) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #f9fafb;
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child :is(h3, p),
:is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child :is(h3, p),
:is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child :is(h3, p) {
    color: #111827 !important;
    margin: 0 !important;
    font-size: 1.0625rem !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
}

html.dark :is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child :is(h3, p),
html.dark :is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child :is(h3, p),
html.dark :is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child :is(h3, p) {
    color: #f9fafb !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child button:not(.reg-tab-btn),
:is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child button:not(.reg-tab-btn),
:is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child button:not(.reg-tab-btn) {
    color: #6b7280 !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child button:not(.reg-tab-btn):hover,
:is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child button:not(.reg-tab-btn):hover,
:is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child button:not(.reg-tab-btn):hover {
    color: #111827 !important;
    background: rgba(15, 23, 42, 0.06);
}

html.dark :is(#admin-body, #student-body) div[id$='Modal'] > div:first-child > .border-b:first-child button:not(.reg-tab-btn),
html.dark :is(#admin-body, #student-body) .ee-edit-user-card > .border-b:first-child button:not(.reg-tab-btn),
html.dark :is(#admin-body, #student-body) .reg-wizard-card > .border-b:first-child button:not(.reg-tab-btn) {
    color: #d1d5db !important;
}

:is(#admin-body, #student-body) .ee-panel-card__body,
:is(#admin-body, #student-body) .student-panel-card > .p-5 {
    padding: clamp(1rem, 2.5vw, 1.35rem) !important;
}

:is(#admin-body, #student-body) .ee-panel-card__icon {
    border-radius: var(--admin-radius-md, 5px) !important;
}

:is(#admin-body, #student-body) .ee-panel-chart-tab {
    border-radius: var(--admin-radius-sm) !important;
    min-height: 2.5rem;
    padding: 0.375rem 0.875rem;
}

:is(#admin-body, #student-body) .student-topnav .ee-panel-topnav-title {
    min-width: 0;
    max-width: min(12rem, calc(100vw - 11rem));
}

@media (min-width: 768px) {
    :is(#admin-body, #student-body) .student-topnav .ee-panel-topnav-title {
        max-width: 20rem;
    }
}

@media (min-width: 1024px) {
    :is(#admin-body, #student-body) .student-topnav .ee-panel-topnav-title {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    :is(#admin-body, #student-body) .student-stat-card:hover {
        transform: none !important;
    }
}

:is(#admin-body, #student-body) .student-panel-card .space-y-3 > .flex.items-center.justify-between {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.875rem, 2.5vw, 1.125rem);
    border-radius: var(--admin-radius-md);
    border-color: var(--admin-border) !important;
    gap: var(--admin-space-3);
}

html.dark :is(#admin-body, #student-body) .student-panel-card .space-y-3 > .flex.items-center.justify-between {
    border-color: var(--admin-border-strong) !important;
}

:is(#admin-body, #student-body) .ee-panel-footer-link:focus-visible {
    outline: 2px solid var(--materio-primary);
    outline-offset: 2px;
    border-radius: var(--admin-radius-sm);
}

:is(#admin-body, #student-body) .student-charts-wrap {
    margin-bottom: var(--ee-panel-section-gap, 0.875rem);
    gap: var(--ee-panel-section-gap, 0.875rem) !important;
}

/* ----- Overlay modals (id ends with Modal): strip heavy button borders / 3D chrome, polish dialog ----- */
:is(#admin-body, #student-body) div[id$='Modal'].fixed,
:is(#admin-body, #student-body) div[id$='Modal'][class*='fixed'] {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child {
    border-radius: var(--admin-radius-lg, 5px);
    border: 1px solid rgba(47, 43, 61, 0.08) !important;
    background: #ffffff !important;
    box-shadow:
        0 24px 48px -12px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(47, 43, 61, 0.04);
}

html.dark :is(#admin-body, #student-body) div[id$='Modal'] > div:first-child {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgb(38 42 58) !important;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child {
    scrollbar-width: thin;
    scrollbar-color: rgba(115, 103, 240, 0.35) transparent;
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child::-webkit-scrollbar {
    width: 8px;
}

:is(#admin-body, #student-body) div[id$='Modal'] > div:first-child::-webkit-scrollbar-thumb {
    background: rgba(115, 103, 240, 0.28);
    border-radius: var(--ee-radius, 5px);
}

/* Icon-only close (X): no default / universal 42px CTA frame, no thick border */
:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-times']),
:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-xmark']) {
    min-height: 0 !important;
    height: 2.25rem !important;
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-width: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: var(--admin-radius-sm, 5px) !important;
    line-height: 1 !important;
    -webkit-appearance: none;
    appearance: none;
}

:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-times']):hover,
:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-xmark']):hover {
    background: rgba(47, 43, 61, 0.06) !important;
    border: none !important;
    box-shadow: none !important;
}

html.dark :is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-times']):hover,
html.dark :is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-xmark']):hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-times']):focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-xmark']):focus:not(:focus-visible) {
    outline: none !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-times']):focus-visible,
:is(#admin-body, #student-body) div[id$='Modal'] button:has(> i[class*='fa-xmark']):focus-visible {
    outline: 2px solid var(--materio-primary);
    outline-offset: 2px;
}

/* Primary / danger CTAs in modals: flat fill, soft shadow — no inset / double border */
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-indigo-600,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-blue-600,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-purple-600,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-green-600,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-primary-600,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-red-600 {
    border: none !important;
    border-width: 0 !important;
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.22) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-red-600 {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.22) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-purple-600 {
    box-shadow: 0 2px 8px rgba(126, 34, 206, 0.28) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-green-600 {
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-indigo-600:hover,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-blue-600:hover,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-purple-600:hover,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-green-600:hover,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-primary-600:hover,
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-red-600:hover {
    border: none !important;
    box-shadow: 0 4px 14px rgba(115, 103, 240, 0.28) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-purple-600:hover {
    box-shadow: 0 4px 14px rgba(126, 34, 206, 0.35) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-green-600:hover {
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.32) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-red-600:hover {
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3) !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button.bg-indigo-600:focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-blue-600:focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-purple-600:focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-green-600:focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-primary-600:focus:not(:focus-visible),
:is(#admin-body, #student-body) div[id$='Modal'] button.bg-red-600:focus:not(:focus-visible) {
    outline: none !important;
}

/* Secondary outline buttons in modals */
:is(#admin-body, #student-body) div[id$='Modal'] button[class*='border-gray'] {
    box-shadow: none !important;
    border-width: 1px !important;
    border-style: solid !important;
}

:is(#admin-body, #student-body) div[id$='Modal'] button:focus:not(:focus-visible) {
    outline: none !important;
}

/* Create-user wizard close (custom class, not only fa-times wrapper) */
:is(#admin-body, #student-body) #createUserModal .reg-wizard-icon-btn {
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

:is(#admin-body, #student-body) #createUserModal .reg-wizard-icon-btn:hover {
    box-shadow: none !important;
    border: none !important;
}

/* Flat sidebar menus — no filled backgrounds on any item state */
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(a.sidebar-link, button.sidebar-link, .sidebar-submenu-link, .ee-sidebar-nav-toggle) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(a.sidebar-link, button.sidebar-link, .sidebar-submenu-link, .ee-sidebar-nav-toggle):hover,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(a.sidebar-link, button.sidebar-link, .sidebar-submenu-link, .ee-sidebar-nav-toggle):focus,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(a.sidebar-link, button.sidebar-link, .sidebar-submenu-link, .ee-sidebar-nav-toggle):active,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(a.sidebar-link, button.sidebar-link, .sidebar-submenu-link, .ee-sidebar-nav-toggle):focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link.ee-panel-nav-link--active,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link.sidebar-submenu-link--active,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .ee-sidebar-nav-group.is-open > .ee-sidebar-nav-toggle {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Neutral sidebar text — no purple accent (override Bootstrap link color) */
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(
    a.sidebar-link,
    button.sidebar-link:not([data-ee-confirm-logout]),
    .sidebar-submenu-link,
    .ee-sidebar-nav-toggle
) {
    color: #4b5563 !important;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(
    a.sidebar-link,
    button.sidebar-link:not([data-ee-confirm-logout]),
    .sidebar-submenu-link,
    .ee-sidebar-nav-toggle
) {
    color: #9ca3af !important;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) :is(
    a.sidebar-link,
    button.sidebar-link:not([data-ee-confirm-logout]),
    .sidebar-submenu-link,
    .ee-sidebar-nav-toggle
) i {
    color: inherit !important;
    opacity: 0.9;
}

:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link.ee-panel-nav-link--active,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link.sidebar-submenu-link--active,
:is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .ee-sidebar-nav-group.is-open > .ee-sidebar-nav-toggle {
    color: #374151 !important;
    font-weight: 600;
}

html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) a.sidebar-link.ee-panel-nav-link--active,
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .sidebar-submenu-link.sidebar-submenu-link--active,
html.dark :is(#admin-body, #student-body) :is(#admin-sidebar, #student-sidebar) .ee-sidebar-nav-group.is-open > .ee-sidebar-nav-toggle {
    color: #d1d5db !important;
}

#admin-body .ee-dash-summary .ee-panel-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1023px) {
    #admin-body .ee-dash-summary .ee-panel-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#admin-body .ee-dash-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 1023px) {
    #admin-body .ee-dash-chart-grid {
        grid-template-columns: 1fr;
    }
}

#admin-body .ee-dash-bar-stage {
    position: relative;
    height: 240px;
}

#admin-body .ee-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

#admin-body .ee-dash-table th,
#admin-body .ee-dash-table td {
    padding: 0.55rem 0.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

#admin-body .ee-dash-table th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7280;
}

#admin-body #questionTypeFields .q-option-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#admin-body #questionTypeFields .q-option-main > .q-option {
    flex: 1 1 12rem;
    min-width: 12rem;
}

#admin-body #questionTypeFields .q-image-file {
    display: none;
}

#admin-body #questionTypeFields .q-image-field:not(.q-image-field--inline) {
    margin-top: 0.45rem;
}

#admin-body #questionTypeFields .q-image-field--inline {
    display: contents;
}

#admin-body #questionTypeFields .q-image-field--inline .q-image-pick,
#admin-body #questionTypeFields .q-option-main > .q-remove-row {
    order: 3;
}

#admin-body #questionTypeFields .q-image-field--inline .q-image-preview {
    order: 4;
}

#admin-body #questionTypeFields .q-image-drop {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 4.75rem;
    padding: 0.8rem 0.95rem;
    border: 1.5px dashed var(--primary-300);
    border-radius: 0.85rem;
    background: var(--primary-50);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

#admin-body #questionTypeFields .q-image-drop:hover,
#admin-body #questionTypeFields .q-image-drop:focus-visible,
#admin-body #questionTypeFields .q-image-field.is-drag .q-image-drop {
    border-color: var(--primary-500);
    background: var(--primary-100);
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.16);
    outline: none;
}

#admin-body #questionTypeFields .q-image-field.has-image .q-image-drop {
    cursor: default;
    border-style: solid;
    border-color: var(--primary-200);
    background: var(--materio-surface);
}

#admin-body #questionTypeFields .q-image-drop-empty {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    text-align: left;
}

#admin-body #questionTypeFields .q-image-field.has-image .q-image-drop-empty,
#admin-body #questionTypeFields .q-image-field:not(.has-image) .q-image-drop .q-image-preview,
#admin-body #questionTypeFields .q-image-field--inline .q-image-preview,
#admin-body #questionTypeFields .q-image-field--inline.has-image .q-image-pick {
    display: none;
}

#admin-body #questionTypeFields .q-image-field.has-image .q-image-drop .q-image-preview,
#admin-body #questionTypeFields .q-image-field--inline.has-image .q-image-preview {
    display: flex;
}

#admin-body #questionTypeFields .q-image-drop-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    background: var(--materio-surface);
    color: var(--primary-500);
    box-shadow: 0 1px 2px rgba(47, 43, 61, 0.08);
}

#admin-body #questionTypeFields .q-image-drop-copy,
#admin-body #questionTypeFields .q-image-preview-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

#admin-body #questionTypeFields .q-image-drop-copy strong,
#admin-body #questionTypeFields .q-image-preview-copy strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-800);
}

#admin-body #questionTypeFields .q-image-drop-copy span,
#admin-body #questionTypeFields .q-image-preview-copy span {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #6b7280;
}

#admin-body #questionTypeFields .q-image-pick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 42px;
    padding: 0 0.85rem;
    border: 1.5px dashed var(--primary-300);
    border-radius: 0.7rem;
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

#admin-body #questionTypeFields .q-image-pick:hover,
#admin-body #questionTypeFields .q-image-field.is-drag .q-image-pick {
    border-color: var(--primary-500);
    background: var(--primary-100);
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.16);
}

#admin-body #questionTypeFields .q-image-preview {
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

#admin-body #questionTypeFields .q-image-field--inline.has-image .q-image-preview {
    flex: 1 1 calc(100% - 1.75rem);
    margin-left: 1.75rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--primary-200);
    border-radius: 0.75rem;
    background: var(--materio-surface);
}

#admin-body #questionTypeFields .q-image-thumb {
    display: block;
    width: 4.5rem;
    height: 4.5rem;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid var(--admin-border-strong);
    background: #f8f7fb;
}

#admin-body #questionTypeFields .q-image-field:not(.q-image-field--inline) .q-image-thumb {
    width: 6.5rem;
    height: 4.75rem;
}

#admin-body #questionTypeFields .q-image-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

#admin-body #questionTypeFields .q-image-edit,
#admin-body #questionTypeFields .q-image-replace,
#admin-body #questionTypeFields .q-image-clear {
    border: 0;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

#admin-body #questionTypeFields .q-image-edit,
#admin-body #questionTypeFields .q-image-replace {
    background: var(--primary-100);
    color: var(--primary-700);
}

#admin-body #questionTypeFields .q-image-clear {
    background: #fef2f2;
    color: #b91c1c;
}

#admin-body .q-list-thumb {
    display: block;
    max-height: 7rem;
    max-width: 16rem;
    margin-top: 0.45rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    object-fit: contain;
    background: #fff;
}

#admin-body .q-img-studio {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#admin-body .q-img-studio[hidden] {
    display: none !important;
}

#admin-body .q-img-studio__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

#admin-body .q-img-studio__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: 1rem 1rem 0.9rem;
    border-radius: 0.9rem;
    background: var(--materio-surface);
    color: inherit;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

#admin-body .q-img-studio__head,
#admin-body .q-img-studio__foot,
#admin-body .q-img-studio__tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#admin-body .q-img-studio__head {
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

#admin-body .q-img-studio__head h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

#admin-body .q-img-studio__x {
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
}

#admin-body .q-img-studio__lead,
#admin-body .q-img-studio__status {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #6b7280;
}

#admin-body .q-img-studio__status {
    min-height: 1.1rem;
    margin: 0.55rem 0 0;
    color: #b91c1c;
}

#admin-body .q-img-studio__stage {
    position: relative;
    height: 360px;
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: #e5e7eb;
    background-image:
        linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
        linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
        linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    touch-action: none;
    user-select: none;
}

#admin-body .q-img-studio__stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#admin-body .q-img-studio__crop {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    cursor: move;
    visibility: hidden;
}

#admin-body .q-img-studio__crop.is-ready {
    visibility: visible;
}

#admin-body .q-img-studio__crop span {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid var(--primary-500);
    border-radius: 2px;
}

#admin-body .q-img-studio__crop [data-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
#admin-body .q-img-studio__crop [data-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
#admin-body .q-img-studio__crop [data-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
#admin-body .q-img-studio__crop [data-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
#admin-body .q-img-studio__crop [data-handle="n"] { left: calc(50% - 6px); top: -6px; cursor: ns-resize; }
#admin-body .q-img-studio__crop [data-handle="s"] { left: calc(50% - 6px); bottom: -6px; cursor: ns-resize; }
#admin-body .q-img-studio__crop [data-handle="w"] { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }
#admin-body .q-img-studio__crop [data-handle="e"] { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }

#admin-body .q-img-studio__tools {
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

#admin-body .q-img-studio__tools button,
#admin-body .q-img-studio__foot button {
    border: 1px solid var(--admin-border-strong);
    border-radius: 0.55rem;
    background: var(--materio-surface);
    color: inherit;
    padding: 0.42rem 0.75rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

#admin-body .q-img-studio__tools button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

#admin-body .q-img-studio__size {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
}

#admin-body .q-img-studio__foot {
    justify-content: flex-end;
    margin-top: 0.35rem;
}

#admin-body .q-img-studio__use {
    border-color: var(--primary-500) !important;
    background: var(--primary-500) !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    #admin-body .q-img-studio__stage {
        height: 240px;
    }

    #admin-body #questionTypeFields .q-image-preview-actions {
        margin-left: 0;
        width: 100%;
    }
}
