@media (max-width: 991.98px) {
    :root {
        --mx-primary: #6A2DBF;
        --mx-primary-soft: #f1e9ff;
        --mx-success: #22c55e;
        --mx-danger: #ef4444;
        --mx-bg: #f9fafb;
        --mx-surface: #ffffff;
        --mx-text: #0f172a;
        --mx-muted: #64748b;
        --mx-border: #e2e8f0;
        --mx-shadow: 0 16px 38px rgba(15, 23, 42, 0.10);
        --mx-radius: 24px;
        --mx-radius-sm: 18px;
        --mx-gap: 16px;
    }

    body.mobile-shell-basic,
    body.mobile-shell-public,
    body.mobile-shell-admin,
    body.mobile-shell-student,
    body.mobile-shell-agent {
        background:
            radial-gradient(circle at top right, rgba(79, 70, 229, 0.10), transparent 28%),
            linear-gradient(180deg, #f8fbff 0%, var(--mx-bg) 42%, #f3f6fb 100%);
        color: var(--mx-text);
    }

    body.mobile-shell-basic .btn,
    body.mobile-shell-public .btn,
    body.mobile-shell-admin .btn,
    body.mobile-shell-student .btn,
    body.mobile-shell-agent .btn {
        min-height: 46px;
        border-radius: 16px;
        font-weight: 700;
        box-shadow: none;
    }

    body.mobile-shell-basic .form-control,
    body.mobile-shell-basic .form-select,
    body.mobile-shell-public .form-control,
    body.mobile-shell-public .form-select,
    body.mobile-shell-admin .form-control,
    body.mobile-shell-admin .form-select,
    body.mobile-shell-student .form-control,
    body.mobile-shell-student .form-select,
    body.mobile-shell-agent .form-control,
    body.mobile-shell-agent .form-select {
        min-height: 48px;
        border-radius: 16px;
        border: 1px solid var(--mx-border);
        box-shadow: none;
    }

    body.mobile-shell-basic .card,
    body.mobile-shell-public .card,
    body.mobile-shell-admin .card,
    body.mobile-shell-student .card,
    body.mobile-shell-agent .card {
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: var(--mx-radius);
        box-shadow: var(--mx-shadow);
        overflow: hidden;
    }

    body.mobile-shell-public .public-navbar,
    body.mobile-shell-basic .navbar {
        position: sticky;
        top: 0;
        z-index: 1040;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        background:
            linear-gradient(135deg, #ffffff 0%, #f8fbff 100%) !important;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    }

    body.mobile-shell-public .public-navbar .container,
    body.mobile-shell-basic .navbar .container {
        min-height: auto;
        padding-top: calc(14px + env(safe-area-inset-top));
        padding-bottom: 14px;
        align-items: center;
        gap: 12px;
    }

    body.mobile-shell-public .brand-wrap,
    body.mobile-shell-basic .navbar-brand {
        color: var(--mx-text) !important;
    }

    body.mobile-shell-public .brand-mark,
    body.mobile-shell-basic .navbar-brand {
        box-shadow: none;
    }

    body.mobile-shell-public .brand-chip,
    body.mobile-shell-public .brand-subtitle,
    body.mobile-shell-public .public-nav-links,
    body.mobile-shell-basic .nav-link {
        display: none !important;
    }

    body.mobile-shell-public .brand-title {
        color: var(--mx-text);
        font-size: 18px;
    }

    body.mobile-shell-basic main,
    body.mobile-shell-public main {
        padding-bottom: 100px;
    }

    body.mobile-shell-basic .page-container {
        padding: 16px 14px 100px;
    }

    body.mobile-shell-basic .footer {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 1030;
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.94);
        box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
    }

    body.mobile-shell-public .page-shell {
        padding: 14px 10px 104px !important;
    }

    body.mobile-shell-public .page-frame {
        min-height: calc(100vh - 126px);
        border-radius: 30px !important;
        background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
        box-shadow: var(--mx-shadow) !important;
    }

    body.mobile-shell-public .page-hero {
        border-bottom-left-radius: 28px;
        border-bottom-right-radius: 28px;
        padding: 22px 18px !important;
        background:
            radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 26%),
            linear-gradient(135deg, #4A1FA3 0%, #6A2DBF 48%, #8A4DFF 100%) !important;
    }

    body.mobile-shell-public .page-hero-title h1,
    body.mobile-shell-public .page-hero-title h2,
    body.mobile-shell-public .page-hero-title h3 {
        font-size: 24px !important;
    }

    body.mobile-shell-public .page-content {
        padding: 18px 16px !important;
    }

    body.mobile-shell-public .public-mobile-dock {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        transform: none !important;
        width: auto !important;
        border-radius: 24px !important;
        padding: 10px 12px !important;
        background: rgba(15, 23, 42, 0.94) !important;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24) !important;
        border: 1px solid rgba(255,255,255,0.08);
        backdrop-filter: blur(16px);
    }

    body.mobile-shell-public .public-mobile-link {
        color: rgba(255,255,255,0.78) !important;
        border-radius: 16px !important;
        min-height: 58px;
    }

    body.mobile-shell-public .public-mobile-link.primary {
        background: linear-gradient(135deg, #6A2DBF, #8A4DFF) !important;
    }

    body.mobile-shell-admin .sidebar,
    body.mobile-shell-student .student-sidebar,
    body.mobile-shell-agent .agent-sidebar {
        width: min(82vw, 320px) !important;
        padding: 18px 14px !important;
        border-radius: 0 26px 26px 0;
        box-shadow: 18px 0 44px rgba(15, 23, 42, 0.24);
    }

    body.mobile-shell-admin .main,
    body.mobile-shell-admin .main.collapsed,
    body.mobile-shell-student .student-main,
    body.mobile-shell-agent .agent-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.mobile-shell-admin .header-wrap,
    body.mobile-shell-student .student-topbar,
    body.mobile-shell-agent .agent-topbar {
        padding-left: 14px !important;
        padding-right: 14px !important;
        padding-top: calc(14px + env(safe-area-inset-top)) !important;
    }

    body.mobile-shell-admin .header,
    body.mobile-shell-student .student-topbar,
    body.mobile-shell-agent .agent-topbar {
        background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
        border: 1px solid rgba(226, 232, 240, 0.95) !important;
        border-radius: 24px !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
    }

    body.mobile-shell-admin .toggle-btn,
    body.mobile-shell-student .sidebar-toggle,
    body.mobile-shell-agent .agent-toggle {
        width: 46px !important;
        height: 46px !important;
        border-radius: 16px !important;
        background: var(--mx-primary-soft) !important;
        color: var(--mx-primary) !important;
        border: 1px solid rgba(106, 45, 191, 0.14) !important;
        box-shadow: none !important;
    }

    body.mobile-shell-admin .content,
    body.mobile-shell-student .student-content,
    body.mobile-shell-agent .agent-content {
        padding: 16px 14px 108px !important;
    }

    body.mobile-shell-admin .content-shell,
    body.mobile-shell-student .student-content,
    body.mobile-shell-agent .agent-content {
        max-width: 100%;
    }

    body.mobile-shell-admin .admin-mobile-dock,
    body.mobile-shell-student .student-mobile-dock,
    body.mobile-shell-agent .agent-mobile-dock {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        transform: none !important;
        width: auto !important;
        border-radius: 24px !important;
        padding: 10px 12px !important;
        background: rgba(15, 23, 42, 0.94) !important;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24) !important;
        border: 1px solid rgba(255,255,255,0.08);
        backdrop-filter: blur(16px);
    }

    body.mobile-shell-admin .admin-mobile-link,
    body.mobile-shell-student .student-mobile-link,
    body.mobile-shell-agent .agent-mobile-link {
        border-radius: 16px !important;
        min-height: 58px;
        color: rgba(255,255,255,0.8) !important;
    }

    body.mobile-shell-admin .admin-mobile-link.primary,
    body.mobile-shell-student .student-mobile-link.primary,
    body.mobile-shell-agent .agent-mobile-link.primary {
        background: linear-gradient(135deg, #6A2DBF, #8A4DFF) !important;
        color: #fff !important;
        box-shadow: none !important;
    }

    body.mobile-shell-admin .menu a,
    body.mobile-shell-admin .menu button,
    body.mobile-shell-student .student-nav a,
    body.mobile-shell-agent .agent-nav a {
        border-radius: 18px !important;
        min-height: 56px;
    }

    body.mobile-shell-admin .nav-icon,
    body.mobile-shell-student .student-nav-icon,
    body.mobile-shell-agent .agent-nav-icon {
        width: 42px !important;
        height: 42px !important;
        border-radius: 14px !important;
    }

    body.mobile-shell-admin .smart-filters,
    body.mobile-shell-student .smart-filters,
    body.mobile-shell-agent .smart-filters {
        border-radius: 24px !important;
        box-shadow: var(--mx-shadow) !important;
    }

    body.mobile-shell-admin .smart-filters-grid,
    body.mobile-shell-student .smart-filters-grid,
    body.mobile-shell-agent .smart-filters-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.mobile-shell-admin .section-heading,
    body.mobile-shell-public .section-heading,
    body.mobile-shell-student .section-heading,
    body.mobile-shell-agent .section-heading {
        display: grid;
        gap: 4px;
        margin-bottom: 14px;
    }

    body.mobile-shell-admin .table-responsive table,
    body.mobile-shell-public .table-responsive table,
    body.mobile-shell-student .table-responsive table,
    body.mobile-shell-agent .table-responsive table {
        min-width: 680px;
    }
}

@media (max-width: 767.98px) {
    body.mobile-shell-basic .page-container,
    body.mobile-shell-public .page-content,
    body.mobile-shell-admin .content,
    body.mobile-shell-student .student-content,
    body.mobile-shell-agent .agent-content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.mobile-shell-public .page-hero-title,
    body.mobile-shell-admin .header-left,
    body.mobile-shell-student .topbar-left {
        align-items: flex-start !important;
    }

    body.mobile-shell-public .page-hero-meta,
    body.mobile-shell-admin .header-right,
    body.mobile-shell-student .topbar-right,
    body.mobile-shell-agent .agent-topbar .d-flex.align-items-center.gap-3.flex-wrap:last-child {
        width: 100% !important;
    }

    body.mobile-shell-admin .header-right,
    body.mobile-shell-student .topbar-right {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body.mobile-shell-admin .profile,
    body.mobile-shell-student .profile-card {
        width: 100% !important;
    }

    body.mobile-shell-admin .admin-mobile-dock,
    body.mobile-shell-student .student-mobile-dock,
    body.mobile-shell-agent .agent-mobile-dock,
    body.mobile-shell-public .public-mobile-dock {
        padding: 8px 10px !important;
    }

    body.mobile-shell-admin .admin-mobile-link span,
    body.mobile-shell-student .student-mobile-link span,
    body.mobile-shell-agent .agent-mobile-link span,
    body.mobile-shell-public .public-mobile-link span {
        font-size: 10px !important;
    }
}
