/**
 * ============================================================================
 * MOBILE APP SHELL, Orion Tech LMS Universal
 * ----------------------------------------------------------------------------
 * File : assets/mobile-app-shell.css
 * Created : 2026-05-13
 *
 * Tujuan :
 * Memberi tampilan khas "mobile app" di HP/tablet (≤ 992 px) SAJA untuk
 * SEMUA halaman & SEMUA role (siswa, admin/tutor, publik/landing) tanpa
 * menyentuh palet warna yang sudah ada. Semua warna yang dipakai di sini
 * diambil dari CSS variables yang sudah didefinisikan di layout eksisting
 * ( --orion-navy, --orion-gold, --orion-green, --orion-red, dsb ) sehingga
 * theme dark/light, customizer warna, dan jenis-lembaga label tetap jalan.
 *
 * Yang dibentuk:
 * 1. Mobile top-bar : brand + title di kiri, action (keluar/notif) di kanan,
 * mengganti tampilan topbar existing HANYA di ≤ 992 px.
 * 2. Bottom-nav 5-ikon tetap sticky di bawah (pattern aplikasi Android/iOS).
 * Konten otomatis kontekstual sesuai role (didrop dari
 * includes/mobile_app_shell.php).
 * 3. Drawer sidebar ulang: slide-in dari kiri, full height, scrollable,
 * tutup otomatis saat tap backdrop / item menu.
 * 4. Card-grid "fitur besar" ala screenshot ref (ikon warna-warni, label
 * center) dengan class `.mas-feature-grid`, opt-in per halaman.
 * 5. Section header ala "MyAcademic" dengan class `.mas-section-intro`.
 *
 * Tidak mengubah:
 * - Warna brand/theme/dark-mode.
 * - Desktop (≥ 993 px): semua rule di file ini otomatis tidak aktif.
 * - Struktur HTML yang sudah ada di halaman (semua rule pakai class baru
 * atau override media-query saja).
 * ============================================================================
 */

/* ---------------------------------------------------------------------------
 * 0. VARIABEL LOKAL, Fallback aman kalau variabel global belum di-set.
 * Warna persis dari layout existing, TIDAK menambah palet baru.
 * --------------------------------------------------------------------------- */
:root {
 --mas-navy : var(--orion-navy, #0a2540);
 --mas-gold : var(--orion-gold, #f5a623);
 --mas-green : var(--orion-green, #27ae60);
 --mas-red : var(--orion-red, #e74c3c);
 --mas-blue : var(--orion-blue, #2980b9);
 --mas-card : var(--app-card-bg, #fff);
 --mas-bg : var(--app-bg, #f5f6fa);
 --mas-text : var(--app-text, #0f172a);
 --mas-muted : var(--app-muted, #64748b);
 --mas-border : var(--app-border, #e5e7eb);
 --mas-radius : 18px;
 --mas-bnav-h : 68px;
 --mas-topbar-h : 58px;
 /* Safe-area insets (notch iPhone X+, punch-hole, dsb) */
 --mas-safe-t : env(safe-area-inset-top, 0px);
 --mas-safe-b : env(safe-area-inset-bottom, 0px);
 --mas-safe-l : env(safe-area-inset-left, 0px);
 --mas-safe-r : env(safe-area-inset-right, 0px);
}

/* ===========================================================================
 * 1. AKTIFKAN MOBILE SHELL HANYA DI ≤ 992 px
 * Pada ≥ 993 px: semua elemen mobile shell di-sembunyikan total.
 * =========================================================================== */
.mas-topbar,
.mas-bottom-nav,
.mas-drawer-backdrop,
.mas-brand-mobile { display: none !important; }

/* [v33 2026-05-13] Real backdrop element. Default disembunyikan;
 hanya muncul saat body.sb-open dan viewport mobile (≤992 px). */
.mas-backdrop {
 display: none;
 position: fixed;
 inset: 0;
 background: rgba(10, 37, 64, .55);
 -webkit-backdrop-filter: blur(2px);
 backdrop-filter: blur(2px);
 z-index: 1045;
 cursor: pointer;
 /* Aman di-tap di iOS (jangan ada delay 300ms) */
 touch-action: manipulation;
 -webkit-tap-highlight-color: transparent;
}

@media (max-width: 992px) {

 /* ------- 1a. MOBILE TOP-BAR ------- */
 .mas-topbar {
 display: flex !important;
 position: sticky;
 top: 0;
 left: 0;
 right: 0;
 height: calc(var(--mas-topbar-h) + var(--mas-safe-t));
 padding: calc(var(--mas-safe-t) + 6px) 14px 6px 14px;
 background: var(--mas-card);
 border-bottom: 1px solid var(--mas-border);
 align-items: center;
 gap: 10px;
 z-index: 1030;
 box-shadow: 0 2px 10px rgba(0,0,0,.04);
 }
 .mas-topbar .mas-burger {
 flex-shrink: 0;
 width: 40px; height: 40px;
 border: 0; background: transparent;
 color: var(--mas-navy);
 font-size: 1.2rem;
 border-radius: 10px;
 cursor: pointer;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 transition: background .18s;
 }
 .mas-topbar .mas-burger:hover,
 .mas-topbar .mas-burger:focus-visible {
 background: rgba(10,37,64,.06);
 }
 .mas-topbar .mas-brand {
 display: flex; align-items: center; gap: 10px;
 flex: 1 1 auto; min-width: 0;
 text-decoration: none; color: inherit;
 }
 .mas-topbar .mas-brand .mas-logo,
 .mas-topbar .mas-brand .mas-logo-ph {
 width: 38px; height: 38px;
 border-radius: 10px;
 object-fit: cover;
 background: linear-gradient(135deg, var(--mas-navy), var(--mas-blue));
 display: inline-flex; align-items: center; justify-content: center;
 color: #fff; flex-shrink: 0;
 font-size: 1.05rem;
 }
 .mas-topbar .mas-brand .mas-logo { padding: 4px; background: var(--mas-card); border: 1px solid var(--mas-border); color: var(--mas-navy); }
 .mas-topbar .mas-brand-text { min-width: 0; line-height: 1.15 }
 .mas-topbar .mas-brand-text strong {
 display: block;
 font-size: .98rem;
 font-weight: 800;
 color: var(--mas-text);
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
 }
 .mas-topbar .mas-brand-text small {
 display: block;
 font-size: .72rem;
 color: var(--mas-muted);
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
 }
 .mas-topbar .mas-actions {
 display: flex; align-items: center; gap: 6px; flex-shrink: 0;
 }
 .mas-topbar .mas-act-btn {
 min-width: 40px; height: 40px; padding: 0 10px;
 border-radius: 10px;
 border: 1px solid var(--mas-border);
 background: var(--mas-card);
 color: var(--mas-text);
 font-size: .85rem; font-weight: 600;
 display: inline-flex; align-items: center; gap: 6px;
 cursor: pointer; text-decoration: none;
 transition: all .18s;
 }
 .mas-topbar .mas-act-btn:hover,
 .mas-topbar .mas-act-btn:focus-visible {
 border-color: var(--mas-navy);
 color: var(--mas-navy);
 }
 .mas-topbar .mas-act-btn.mas-act-danger {
 color: var(--mas-red);
 border-color: rgba(231,76,60,.35);
 }
 .mas-topbar .mas-act-btn.mas-act-danger:hover {
 background: var(--mas-red);
 color: #fff;
 border-color: var(--mas-red);
 }
 .mas-topbar .mas-act-btn i { font-size: .95rem; }
 /* Badge kecil untuk notifikasi */
 .mas-topbar .mas-act-btn .mas-dot {
 position: absolute;
 top: 4px; right: 4px;
 min-width: 16px; height: 16px;
 background: var(--mas-red); color: #fff;
 font-size: .62rem; font-weight: 700;
 border-radius: 10px;
 display: inline-flex; align-items: center; justify-content: center;
 padding: 0 4px; line-height: 1;
 border: 1.5px solid var(--mas-card);
 }
 .mas-topbar .mas-act-btn.has-dot { position: relative; }

 /* Sembunyikan teks "Keluar" di HP kecil, ikon saja */
 @media (max-width: 380px) {
 .mas-topbar .mas-act-btn .mas-act-label { display: none; }
 .mas-topbar .mas-act-btn { padding: 0; justify-content: center; }
 }

 /* ===========================================================================
 * [v34 2026-05-13] PROFILE DROPDOWN di mobile top-bar (kanan-atas).
 * Gantikan tombol "Keluar" lama dengan dropdown gaya app:
 * - Tombol: avatar bulat + chevron
 * - Menu: header (avatar besar + nama + role) + 3 item
 * (Profil Saya / Ganti Foto Profil / Keluar)
 * Slide-in dari kanan-atas, tutup auto saat klik di luar / Esc.
 * =========================================================================== */
 .mas-pdd-wrap {
 position: relative;
 display: inline-flex;
 }
 .mas-pdd-btn {
 padding: 3px 8px 3px 3px !important;
 gap: 4px !important;
 border-radius: 999px !important;
 }
 .mas-pdd-btn .mas-pdd-ava,
 .mas-pdd-btn .mas-pdd-ava-ph {
 width: 32px; height: 32px;
 border-radius: 50%;
 object-fit: cover;
 background: var(--mas-gold);
 color: var(--mas-navy);
 display: inline-flex; align-items: center; justify-content: center;
 font-weight: 800; font-size: .85rem;
 flex-shrink: 0;
 border: 2px solid var(--mas-card);
 }
 .mas-pdd-btn .mas-pdd-chev {
 font-size: .65rem;
 color: var(--mas-muted);
 transition: transform .2s;
 }
 .mas-pdd-wrap.open .mas-pdd-btn .mas-pdd-chev {
 transform: rotate(180deg);
 }
 .mas-pdd-wrap.open .mas-pdd-btn {
 border-color: var(--mas-navy) !important;
 background: rgba(10,37,64,.04) !important;
 }

 /* ----- Dropdown menu panel ----- */
 /* [v36 2026-05-13] Pakai position:FIXED + anchor ke kanan viewport
 (sama seperti notif dropdown) supaya selalu di pojok kanan-atas. */
 .mas-pdd-menu {
 position: fixed;
 top: calc(var(--mas-topbar-h) + var(--mas-safe-t) + 6px);
 right: calc(12px + var(--mas-safe-r));
 left: auto;
 min-width: 280px;
 max-width: calc(100vw - 24px);
 background: var(--mas-card);
 border: 1px solid var(--mas-border);
 border-radius: 14px;
 box-shadow: 0 12px 36px rgba(10,37,64,.18);
 padding: 6px;
 z-index: 1060;
 display: none;
 overflow: hidden;
 animation: masPddIn .18s ease-out;
 }
 .mas-pdd-wrap.open .mas-pdd-menu {
 display: block;
 }
 @keyframes masPddIn {
 from { opacity: 0; transform: translateY(-6px); }
 to { opacity: 1; transform: translateY(0); }
 }

 /* ----- Header (avatar besar + nama + role), gaya navy bubble ----- */
 .mas-pdd-head {
 display: flex; align-items: center; gap: 10px;
 padding: 12px 12px;
 margin: -6px -6px 6px -6px;
 background: linear-gradient(135deg, var(--mas-navy), var(--mas-blue));
 color: #fff;
 border-radius: 14px 14px 0 0;
 }
 .mas-pdd-head-ava,
 .mas-pdd-head-ava-ph {
 width: 40px; height: 40px;
 border-radius: 50%;
 object-fit: cover;
 background: var(--mas-gold);
 color: var(--mas-navy);
 display: inline-flex; align-items: center; justify-content: center;
 font-weight: 800; font-size: 1rem;
 flex-shrink: 0;
 border: 2px solid rgba(255,255,255,.65);
 }
 .mas-pdd-head-text { line-height: 1.2; min-width: 0; }
 .mas-pdd-head-text strong {
 display: block;
 font-size: .92rem; font-weight: 700;
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
 max-width: 180px;
 }
 .mas-pdd-head-text small {
 display: block;
 font-size: .72rem; opacity: .85;
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
 max-width: 180px;
 }

 /* ----- Item menu ----- */
 .mas-pdd-item {
 display: flex; align-items: flex-start; gap: 10px;
 width: 100%;
 padding: 10px 10px;
 border: 0; background: transparent;
 text-align: left;
 text-decoration: none;
 color: var(--mas-text);
 font-family: inherit; font-size: .9rem;
 cursor: pointer;
 border-radius: 10px;
 transition: background .15s;
 }
 .mas-pdd-item + .mas-pdd-item { margin-top: 2px; }
 .mas-pdd-item:hover,
 .mas-pdd-item:focus-visible {
 background: rgba(10,37,64,.06);
 color: var(--mas-navy);
 outline: none;
 }
 .mas-pdd-item .mas-pdd-ico {
 width: 30px; height: 30px;
 border-radius: 8px;
 flex-shrink: 0;
 display: inline-flex; align-items: center; justify-content: center;
 font-size: .95rem;
 margin-top: 2px;
 }
 .mas-pdd-ico-blue { background: rgba(41,128,185,.14); color: var(--mas-blue); }
 .mas-pdd-ico-navy { background: rgba(10,37,64,.10); color: var(--mas-navy); }
 .mas-pdd-ico-red { background: rgba(231,76,60,.14); color: var(--mas-red); }

 .mas-pdd-item-text { line-height: 1.25; min-width: 0; }
 .mas-pdd-item-text strong {
 display: block;
 font-size: .9rem; font-weight: 700;
 margin-bottom: 1px;
 }
 .mas-pdd-item-text small {
 display: block;
 font-size: .73rem;
 color: var(--mas-muted);
 white-space: normal;
 }

 .mas-pdd-item.mas-pdd-danger {
 color: var(--mas-red);
 border-top: 1px solid var(--mas-border);
 margin-top: 4px;
 padding-top: 12px;
 border-radius: 0 0 10px 10px;
 }
 .mas-pdd-item.mas-pdd-danger:hover {
 background: rgba(231,76,60,.08);
 color: var(--mas-red);
 }
 .mas-pdd-item.mas-pdd-danger .mas-pdd-item-text small { color: rgba(231,76,60,.75); }

 /* Dark mode tweak */
 html[data-theme="dark"] .mas-pdd-menu {
 background: #1e293b;
 border-color: rgba(255,255,255,.1);
 }
 html[data-theme="dark"] .mas-pdd-item { color: #e2e8f0; }
 html[data-theme="dark"] .mas-pdd-item:hover { background: rgba(255,255,255,.06); }
 html[data-theme="dark"] .mas-pdd-item-text small { color: #94a3b8; }

 /* ===========================================================================
 * [v35 2026-05-13] NOTIFICATION DROPDOWN di mobile top-bar.
 * Klik lonceng → muncul dropdown 10 notif terbaru, dengan header
 * navy "Notifikasi (X baru)" + tombol "Tandai semua dibaca" + footer
 * "Lihat Semua Notifikasi →".
 * =========================================================================== */
 .mas-notif-wrap {
 position: relative;
 display: inline-flex;
 }
 .mas-notif-btn .mas-notif-badge.hidden { display: none; }
 .mas-notif-btn { position: relative; }

 /* [v36 2026-05-13] Pakai position:FIXED + anchor ke kanan viewport
 supaya dropdown tidak melebar ke kiri layar (user complain "terlalu
 ke kiri"). Top dihitung dari tinggi topbar + safe-area. */
 .mas-notif-dd {
 position: fixed;
 top: calc(var(--mas-topbar-h) + var(--mas-safe-t) + 6px);
 right: calc(12px + var(--mas-safe-r));
 left: auto;
 width: 320px;
 max-width: calc(100vw - 24px);
 background: var(--mas-card);
 border: 1px solid var(--mas-border);
 border-radius: 14px;
 box-shadow: 0 12px 36px rgba(10,37,64,.18);
 z-index: 1060;
 display: none;
 overflow: hidden;
 animation: masNotifIn .18s ease-out;
 }
 .mas-notif-wrap.open .mas-notif-dd { display: block; }
 @keyframes masNotifIn {
 from { opacity: 0; transform: translateY(-6px); }
 to { opacity: 1; transform: translateY(0); }
 }

 /* Header navy gradient */
 .mas-notif-head {
 padding: 12px 14px;
 background: linear-gradient(135deg, var(--mas-navy), var(--mas-blue));
 color: #fff;
 display: flex; align-items: center; justify-content: space-between;
 gap: 10px;
 }
 .mas-notif-head h6 {
 margin: 0;
 font-size: .92rem; font-weight: 700;
 display: flex; align-items: center; gap: 8px;
 line-height: 1.2;
 }
 .mas-notif-head h6 .mas-notif-head-count {
 font-weight: 500;
 opacity: .85;
 font-size: .82rem;
 }
 .mas-notif-head a {
 color: #ffd58a;
 font-size: .9rem;
 text-decoration: none;
 padding: 4px 8px;
 border-radius: 6px;
 transition: background .15s, color .15s;
 }
 .mas-notif-head a:hover { background: rgba(255,255,255,.1); color: #fff; }

 /* List, [v37 2026-05-13] tinggi maksimal = ~3 item, sisanya
 di-scroll. 1 item ≈ 110-120px (judul 2 baris + pesan 2 baris +
 waktu). Pakai 340px supaya 3 item full kelihatan, item ke-4
 dst. di-scroll. Plus styling scrollbar tipis. */
 .mas-notif-list {
 max-height: 340px;
 overflow-y: auto;
 overscroll-behavior: contain;
 -webkit-overflow-scrolling: touch;
 background: var(--mas-card);
 }
 /* Scrollbar tipis (WebKit / Chromium / Brave) */
 .mas-notif-list::-webkit-scrollbar { width: 6px; }
 .mas-notif-list::-webkit-scrollbar-track { background: transparent; }
 .mas-notif-list::-webkit-scrollbar-thumb {
 background: rgba(10,37,64,.18);
 border-radius: 6px;
 }
 .mas-notif-list::-webkit-scrollbar-thumb:hover {
 background: rgba(10,37,64,.32);
 }
 /* Firefox */
 .mas-notif-list {
 scrollbar-width: thin;
 scrollbar-color: rgba(10,37,64,.18) transparent;
 }
 .mas-notif-empty {
 padding: 36px 16px;
 text-align: center;
 color: var(--mas-muted);
 font-size: .85rem;
 line-height: 1.5;
 }
 .mas-notif-empty i {
 display: block;
 font-size: 2.2rem;
 margin-bottom: 10px;
 opacity: .55;
 }

 .mas-notif-item {
 display: flex; gap: 10px;
 padding: 12px 14px;
 text-decoration: none;
 color: var(--mas-text);
 border-bottom: 1px solid var(--mas-border);
 transition: background .15s;
 cursor: pointer;
 }
 .mas-notif-item:last-child { border-bottom: 0; }
 .mas-notif-item:hover { background: rgba(10,37,64,.04); }
 .mas-notif-item.unread { background: rgba(245,166,35,.08); }
 .mas-notif-item.unread:hover { background: rgba(245,166,35,.14); }

 .mas-notif-item .ico {
 width: 34px; height: 34px;
 border-radius: 8px;
 display: inline-flex; align-items: center; justify-content: center;
 flex-shrink: 0;
 font-size: 1rem;
 background: rgba(41,128,185,.14);
 color: var(--mas-blue);
 }
 .mas-notif-item .ico.success { background: rgba(39,174,96,.14); color: var(--mas-green); }
 .mas-notif-item .ico.warning { background: rgba(245,166,35,.18); color: #a16207; }
 .mas-notif-item .ico.danger { background: rgba(231,76,60,.14); color: var(--mas-red); }
 .mas-notif-item .ico.info { background: rgba(41,128,185,.14); color: var(--mas-blue); }

 .mas-notif-item .body { flex: 1; min-width: 0; }
 .mas-notif-item .body .t {
 margin: 0 0 2px;
 font-size: .85rem; font-weight: 700;
 color: var(--mas-text);
 line-height: 1.3;
 }
 .mas-notif-item .body .m {
 margin: 0;
 font-size: .78rem; color: var(--mas-muted);
 line-height: 1.4;
 display: -webkit-box;
 -webkit-line-clamp: 2;
 -webkit-box-orient: vertical;
 overflow: hidden;
 }
 .mas-notif-item .body .ago {
 display: inline-flex; align-items: center; gap: 4px;
 margin-top: 4px;
 font-size: .7rem; color: var(--mas-muted);
 }

 /* Footer */
 .mas-notif-foot {
 padding: 10px 14px;
 border-top: 1px solid var(--mas-border);
 text-align: center;
 background: #fafafa;
 }
 .mas-notif-foot a {
 color: var(--mas-navy);
 font-size: .85rem;
 font-weight: 600;
 text-decoration: none;
 display: inline-flex; align-items: center; gap: 6px;
 }
 .mas-notif-foot a:hover { color: var(--mas-gold); }

 /* Dark mode */
 html[data-theme="dark"] .mas-notif-dd { background: #1e293b; border-color: rgba(255,255,255,.1); }
 html[data-theme="dark"] .mas-notif-list { background: #1e293b; }
 html[data-theme="dark"] .mas-notif-item { color: #e2e8f0; border-color: rgba(255,255,255,.06); }
 html[data-theme="dark"] .mas-notif-item:hover { background: rgba(255,255,255,.05); }
 html[data-theme="dark"] .mas-notif-item.unread { background: rgba(245,166,35,.12); }
 html[data-theme="dark"] .mas-notif-item .body .m,
 html[data-theme="dark"] .mas-notif-item .body .ago { color: #94a3b8; }
 html[data-theme="dark"] .mas-notif-foot { background: #0f172a; border-color: rgba(255,255,255,.06); }
 html[data-theme="dark"] .mas-notif-foot a { color: #93c5fd; }

 /* ------- 1b. [DISABLED v20-orion 2026-05-20] ------- */
 /* Original: hide topbar lama saat .mas-topbar aktif. TAPI Orion TIDAK
 inject .mas-topbar dari PHP. Hide aja jadi user gak punya topbar di
 mobile. Disabled supaya topbar regular tetap visible. */
 /* body.mas-active .topbar,
 body.mas-active .ss-topbar { display: none !important; } */

 /* Sebagai gantinya: topbar tetap visible, tapi padding + size lebih compact di mobile */
 body.mas-active .topbar {
 padding: 0 10px !important;
 height: 56px !important;
 min-height: 56px !important;
 gap: 8px !important;
 }
 body.mas-active .topbar .btn-toggle-sb {
 padding: 5px 8px !important;
 font-size: 1.1rem !important;
 min-width: 38px !important;
 height: 38px !important;
 }
 body.mas-active .topbar .breadcrumb-orion {
 font-size: .82rem !important;
 flex: 1;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 }
 body.mas-active .topbar .breadcrumb-orion a:not(strong) { display: none !important; }
 body.mas-active .topbar .breadcrumb-orion .mx-1 { display: none !important; }
 body.mas-active .topbar-right { gap: 6px; }
 body.mas-active .topbar-icon { padding: 4px 7px !important; font-size: .9rem !important; }
 body.mas-active .user-menu { padding: 3px 5px !important; }
 body.mas-active .user-menu .info { display: none !important; }
 body.mas-active .user-menu .avatar-ph { width: 28px !important; height: 28px !important; font-size: .68rem !important; }

 /* ------- 1c. BOTTOM NAV ------- */
 .mas-bottom-nav {
 display: flex !important;
 position: fixed;
 left: 0; right: 0; bottom: 0;
 z-index: 1040;
 background: var(--mas-card);
 border-top: 1px solid var(--mas-border);
 box-shadow: 0 -4px 18px rgba(10,37,64,.08);
 padding: 6px calc(6px + var(--mas-safe-r)) calc(4px + var(--mas-safe-b)) calc(6px + var(--mas-safe-l));
 align-items: stretch;
 justify-content: space-around;
 min-height: calc(var(--mas-bnav-h) + var(--mas-safe-b));
 gap: 2px;
 }
 .mas-bottom-nav .mas-bnav-item {
 flex: 1 1 0;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 gap: 3px;
 padding: 6px 2px;
 text-decoration: none;
 color: var(--mas-muted);
 font-size: .7rem;
 font-weight: 600;
 border-radius: 12px;
 position: relative;
 transition: color .18s, background .18s, transform .18s;
 min-width: 0;
 }
 .mas-bottom-nav .mas-bnav-item i {
 font-size: 1.2rem;
 line-height: 1;
 transition: transform .18s;
 }
 .mas-bottom-nav .mas-bnav-item .mas-bnav-label {
 display: block;
 max-width: 100%;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 line-height: 1.1;
 }
 .mas-bottom-nav .mas-bnav-item:hover,
 .mas-bottom-nav .mas-bnav-item:focus-visible {
 color: var(--mas-navy);
 background: rgba(10,37,64,.04);
 }
 .mas-bottom-nav .mas-bnav-item.active {
 color: var(--mas-green);
 }
 .mas-bottom-nav .mas-bnav-item.active i { transform: translateY(-1px); }
 .mas-bottom-nav .mas-bnav-item.active::before {
 content: "";
 position: absolute;
 top: 3px;
 left: 50%;
 transform: translateX(-50%);
 width: 28px; height: 3px;
 border-radius: 3px;
 background: var(--mas-green);
 }
 /* Badge di ikon bottom-nav */
 .mas-bottom-nav .mas-bnav-item .mas-bnav-badge {
 position: absolute;
 top: 4px;
 left: calc(50% + 6px);
 min-width: 16px; height: 16px;
 background: var(--mas-red); color: #fff;
 font-size: .6rem; font-weight: 700;
 border-radius: 10px; padding: 0 4px;
 display: inline-flex; align-items: center; justify-content: center;
 border: 1.5px solid var(--mas-card);
 line-height: 1;
 }
 /* "More" (kalau bentuk kotak tengah highlight) */
 .mas-bottom-nav .mas-bnav-center {
 flex: 0 0 auto;
 align-self: center;
 margin-top: -14px;
 }
 .mas-bottom-nav .mas-bnav-center i {
 width: 48px; height: 48px;
 border-radius: 50%;
 background: linear-gradient(135deg, var(--mas-navy), var(--mas-blue));
 color: #fff;
 display: inline-flex; align-items: center; justify-content: center;
 font-size: 1.2rem;
 box-shadow: 0 6px 16px rgba(10,37,64,.25);
 }
 .mas-bottom-nav .mas-bnav-center .mas-bnav-label { margin-top: 4px; }

 /* [v36 2026-05-13] STICKY FOOTER LAYOUT untuk mobile.
 Body jadi flex column → main-wrapper grow ke remaining space →
 footer (white "© PKBM" + dark "Copyright Andra") otomatis nempel
 di bawah, di atas bottom-nav. Padding-bottom body untuk reserve
 space bnav (yang fixed). */
 body.mas-active {
 display: flex !important;
 flex-direction: column !important;
 min-height: 100vh !important;
 min-height: 100dvh !important;
 padding-bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b)) !important;
 margin: 0 !important;
 }
 /* main-wrapper / ss-main grow mengisi space biar footer didalemnya
 nempel di bawah-area-konten. Override min-height: 100vh dari
 admin_layout / siswa_layout yang bikin overflow. */
 body.mas-active > .main-wrapper,
 body.mas-active > .ss-main,
 body.mas-active > div:not(#masBackdrop):not(.mas-bottom-nav):not(.mas-topbar):first-of-type {
 flex: 1 0 auto !important;
 min-height: 0 !important;
 display: flex !important;
 flex-direction: column !important;
 }
 body.mas-active > .main-wrapper > main,
 body.mas-active > .main-wrapper > .content-area,
 body.mas-active > .ss-main > .ss-content {
 flex: 1 0 auto !important;
 }
 body.mas-active > .main-wrapper > footer,
 body.mas-active > .ss-main > footer {
 flex-shrink: 0 !important;
 margin-bottom: 0 !important;
 }
 /* Dark copyright bar (sibling div setelah main-wrapper), pastikan
 gak shrink, nempel di bawah main-wrapper (= di atas bnav). */
 body.mas-active > div[style*="background:#020d18"],
 body.mas-active > div[style*="background: #020d18"] {
 flex-shrink: 0 !important;
 }

 /* ------- 1d. DRAWER MOBILE (menu lengkap) -------
 Pakai REAL backdrop <div id="masBackdrop"> (lihat mobile_app_shell.php),
 BUKAN ::after, supaya klik di backdrop dijamin ke-handle JS.
 Pseudo-element ::after pada body di-NETRALKAN supaya tidak
 menumpuk dua backdrop (tampilan = redundant + klik mungkin nyangkut). */
 body.sb-open::after {
 /* sengaja kosong, ditangani oleh #masBackdrop sekarang */
 content: none !important;
 background: transparent !important;
 backdrop-filter: none !important;
 -webkit-backdrop-filter: none !important;
 display: none !important;
 }
 /* Aktifkan REAL backdrop saat drawer dibuka (mobile only) */
 body.sb-open .mas-backdrop {
 display: block !important;
 }
 body.sb-open .sidebar,
 body.sb-open .ss-sidebar {
 box-shadow: 6px 0 28px rgba(0,0,0,.25);
 border-top-right-radius: 0;
 border-bottom-right-radius: 0;
 z-index: 1050;
 }

 /* ------- 1e. FAB Chat / Asisten: geser ke atas supaya tidak ketindih
 oleh bottom-nav.

 [v35 2026-05-13] DI HP, FAB di pojok KANAN (sesuai permintaan user)
 tapi DI ATAS bottom-nav supaya tidak nabrak item Menu/Akun. JS
 (mobile-app-shell.js) juga set posisi via inline style sebagai
 jaminan utama, CSS ini sebagai layer kedua. */
 body.mas-active #fabMain,
 body.mas-active #caBtn {
 left: auto !important;
 right: 14px !important;
 transform: none !important;
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b) + 14px) !important;
 }
 /* Saat FAB open: rotate 90deg (tanpa translate) */
 body.mas-active #fabMain.open {
 transform: rotate(90deg) !important;
 }
 /* Stack sub-FAB di atas Main FAB, juga di pojok kanan */
 body.mas-active #fabSubs,
 body.mas-active .fab-subs {
 left: auto !important;
 right: 14px !important;
 transform: none !important;
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b) + 76px) !important;
 align-items: flex-end !important;
 }
 /* Hint bubble di HP: sudah disembunyikan via @media max-width:540px
 di fab-orchestrator.css, tidak perlu override. */
 body.mas-active #fabHint { display: none !important; }
 /* Backdrop FAB: full-screen tapi jangan masking bottom-nav */
 body.mas-active #fabBackdrop {
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b)) !important;
 }
 /* Kalau user expand FAB (body.fab-open) di HP, kecilkan ukuran Main FAB
 biar tetap clear bottom-nav. */
 body.mas-active #fabMain { width: 48px; height: 48px; font-size: 1.1rem; }
 body.mas-active #caBtn { width: 48px; height: 48px; font-size: 1.2rem; }
 body.mas-active .fab-sub { width: 42px; height: 42px; font-size: .95rem; }

 /* Generic FAB class lain (custom widget, kalau ada), geser juga */
 body.mas-active .wa-float,
 body.mas-active #tcGearBtn,
 body.mas-active .chat-asisten-fab,
 body.mas-active #chatAsistenFab,
 body.mas-active .fab-orchestrator,
 body.mas-active .fab-chat,
 body.mas-active .btn-floating-chat,
 body.mas-active .orion-fab,
 body.mas-active [data-pkbm-fab] {
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b) + 14px) !important;
 }
 /* ============================================================
 * [v40 2026-05-13] HIDE FAB & FLOATING WIDGETS saat modal open.
 * Pakai display:none + visibility + opacity + pointer-events
 * untuk WIN melawan FAB z-index 2147483599 yang tinggi banget.
 * ============================================================ */
 body.modal-open #fabMain,
 body.modal-open #fabSubs,
 body.modal-open #fabBackdrop,
 body.modal-open #fabHint,
 body.modal-open #caBtn,
 body.modal-open #caPanel,
 body.modal-open .wa-float,
 body.modal-open #tcGearBtn,
 body.modal-open #pkbmMusicPanel,
 body.modal-open .chat-asisten-fab,
 body.modal-open .fab-orchestrator,
 body.modal-open .fab-sub {
 display: none !important;
 visibility: hidden !important;
 opacity: 0 !important;
 pointer-events: none !important;
 }

 /* ============================================================
 * [v42 2026-05-13] MODAL DI TENGAH LAYAR, MAX SPECIFICITY
 *
 * KENAPA pakai `html body.modal-open ...` (specificity 0,2,2)?
 * Karena sebelumnya rule `.modal.show .modal-dialog` di
 * responsive-global.css & responsive-phase7.css force modal
 * fullscreen (min-height:100vh). Walaupun saya pakai !important
 * di sini, urutan load CSS bisa bikin yang LAIN menang.
 *
 * SOLUSI: bump specificity ke 0,2,2 dengan `html body` prefix
 * + tambah !important untuk lock seluruh property.
 *
 * Konflik file lain SUDAH dihapus juga (responsive-global.css line
 * 233 & 311, responsive-phase7.css line 60, darkmode.css line 2402).
 * ============================================================ */
 html body .modal {
 padding: 0 !important;
 }
 html body .modal.show .modal-dialog,
 html body.modal-open .modal-dialog {
 position: fixed !important;
 top: 50% !important;
 left: 50% !important;
 right: auto !important;
 bottom: auto !important;
 transform: translate(-50%, -50%) !important;
 width: calc(100vw - 32px) !important;
 max-width: 500px !important;
 min-width: 0 !important;
 height: auto !important;
 max-height: calc(100vh - 32px) !important;
 max-height: calc(100dvh - 32px) !important;
 min-height: 0 !important;
 margin: 0 !important;
 padding: 0 !important;
 display: flex !important;
 align-items: stretch !important;
 pointer-events: auto !important;
 }
 html body .modal.show .modal-content,
 html body.modal-open .modal-content {
 display: flex !important;
 flex-direction: column !important;
 width: 100% !important;
 height: auto !important;
 min-height: 0 !important;
 max-height: calc(100vh - 32px) !important;
 max-height: calc(100dvh - 32px) !important;
 border-radius: 14px !important;
 border: 0 !important; /* [v44] hilangin border tipis yang bocor di sudut */
 box-shadow: 0 20px 60px rgba(0,0,0,.4) !important;
 overflow: hidden !important;
 margin: 0 !important;
 background: #fff !important;
 }
 /* [v44 2026-05-13] Modal-header sudut atas BULAT supaya match
 dengan border-radius modal-content. Tanpa ini → header background
 (navy gradient) tetap kotak, sudut atas modal-content (putih)
 nongol di balik header → kelihatan kayak ada putih di kiri-kanan
 pojok atas. */
 html body.modal-open .modal-header {
 border-radius: 14px 14px 0 0 !important;
 border-top: 0 !important;
 border-left: 0 !important;
 border-right: 0 !important;
 /* [v45 2026-05-13] Title alignment fix, kalau title panjang
 dan wrap 2 baris, X button tetap rata dengan title secara
 vertikal (di tengah). Padding atas-bawah simetris. */
 align-items: center !important;
 padding: 12px 14px !important;
 }
 html body.modal-open .modal-header .modal-title {
 font-size: .92rem !important;
 line-height: 1.35 !important;
 flex: 1 1 auto !important;
 margin: 0 !important;
 word-wrap: break-word !important;
 overflow-wrap: break-word !important;
 }
 /* X close button: jangan stretch, posisi center vertikal */
 html body.modal-open .modal-header .btn-close,
 html body.modal-open .modal-header .close {
 flex: 0 0 auto !important;
 align-self: center !important;
 margin: 0 !important;
 padding: 8px !important;
 }
 /* [v43 2026-05-13] FIX SCROLL, banyak modal pakai <form> sebagai wrapper
 antara modal-content dan modal-body+modal-footer. Tanpa form ikut flex,
 body tidak punya tinggi terbatas → konten panjang KEPOTONG, footer
 (Tutup/Simpan) hilang. Force form jadi flex column juga. */
 html body.modal-open .modal-content > form,
 html body.modal-open .modal-content > form[method] {
 display: flex !important;
 flex-direction: column !important;
 flex: 1 1 auto !important;
 min-height: 0 !important;
 overflow: hidden !important;
 margin: 0 !important;
 padding: 0 !important;
 }
 /* [v45] Rule .modal-header & .modal-title detail di atas (line ~860+).
 Sini cukup sebut flex / margin saja supaya tetap konsisten. */
 html body.modal-open .modal-header {
 flex: 0 0 auto !important;
 margin: 0 !important;
 }
 html body.modal-open .modal-body {
 flex: 1 1 auto !important;
 min-height: 0 !important;
 overflow-y: auto !important;
 overflow-x: hidden !important;
 -webkit-overflow-scrolling: touch !important;
 padding: 14px !important;
 }
 html body.modal-open .modal-footer {
 flex: 0 0 auto !important;
 padding: 10px 14px !important;
 gap: 8px !important;
 margin: 0 !important;
 border-top: 1px solid rgba(0,0,0,.08) !important;
 background: #fff !important;
 }
 html body.modal-open .modal-footer .btn {
 flex: 1 1 auto !important;
 min-height: 44px !important;
 font-size: .92rem !important;
 }
 html body.modal-open .modal-footer .btn-secondary,
 html body.modal-open .modal-footer .btn-light {
 flex: 0 0 auto !important;
 min-width: 80px !important;
 }
 /* Modal khusus yang besar (modal-xl), kasih max-width lebih besar di tablet */
 @media (min-width: 600px) {
 html body .modal.show .modal-dialog.modal-xl,
 html body.modal-open .modal-dialog.modal-xl {
 max-width: 700px !important;
 }
 }

 /* [v36 2026-05-13] MUSIC PLAYER PANEL: posisi di KIRI tombol FAB
 (sesuai permintaan user). FAB ada di right:14px, lebar ~58px,
 jadi music panel anchor di right: 14+58+8 = 80px. Bottom sama
 dengan FAB supaya panel & FAB sejajar. */
 body.mas-active #pkbmMusicPanel {
 position: fixed !important;
 right: calc(80px + var(--mas-safe-r)) !important;
 left: auto !important;
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b) + 14px) !important;
 width: 280px !important;
 max-width: calc(100vw - 100px - var(--mas-safe-r) - var(--mas-safe-l)) !important;
 z-index: 2147483595 !important; /* di bawah FAB tapi di atas konten */
 }

 /* [v36 2026-05-13] Chat Asisten panel: fit RAPI antara topbar &
 bottom-nav. Jangan keluar atas (header chat ke-cut) atau menabrak
 bottom-nav. Override semua positioning dari chat-asisten.css. */
 body.mas-active #caPanel {
 position: fixed !important;
 top: calc(var(--mas-topbar-h) + var(--mas-safe-t) + 8px) !important;
 bottom: calc(var(--mas-bnav-h) + var(--mas-safe-b) + 8px) !important;
 left: calc(8px + var(--mas-safe-l)) !important;
 right: calc(8px + var(--mas-safe-r)) !important;
 width: auto !important;
 max-width: none !important;
 height: auto !important;
 max-height: none !important;
 border-radius: 14px !important;
 }
}

/* ===========================================================================
 * 2. FEATURE GRID ALA "MyAcademic" (opt-in via class .mas-feature-grid)
 * Dipakai siswa dashboard / admin dashboard / landing supaya look
 * kartu ikon warna-warni. Warna tile tetap neutral-netral + bisa
 * di-override per-item via class .mas-tile-*
 * =========================================================================== */
.mas-section-intro {
 margin: 6px 0 14px;
}
.mas-section-intro h4,
.mas-section-intro h3,
.mas-section-intro h2 {
 margin: 0 0 4px;
 color: var(--mas-text);
 font-weight: 800;
 font-size: 1.1rem;
 line-height: 1.25;
}
.mas-section-intro p {
 margin: 0;
 color: var(--mas-muted);
 font-size: .86rem;
 line-height: 1.45;
}

.mas-feature-grid {
 display: grid;
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 14px;
 margin: 6px 0 14px;
}
@media (max-width: 480px) {
 .mas-feature-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
}
@media (max-width: 360px) {
 .mas-feature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

.mas-feature-grid .mas-tile {
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 6px;
 padding: 4px 0;
 text-decoration: none;
 color: var(--mas-text);
 font-size: .78rem;
 font-weight: 600;
 line-height: 1.2;
 text-align: center;
 transition: transform .18s;
}
.mas-feature-grid .mas-tile:hover,
.mas-feature-grid .mas-tile:focus-visible {
 transform: translateY(-2px);
 color: var(--mas-navy);
}
.mas-feature-grid .mas-tile .mas-tile-ico {
 width: 58px; height: 58px;
 border-radius: 16px;
 display: inline-flex; align-items: center; justify-content: center;
 font-size: 1.4rem;
 background: rgba(10,37,64,.08);
 color: var(--mas-navy);
 box-shadow: 0 2px 6px rgba(10,37,64,.06);
}
@media (max-width: 360px) {
 .mas-feature-grid .mas-tile .mas-tile-ico { width: 52px; height: 52px; font-size: 1.25rem; border-radius: 14px; }
}
.mas-feature-grid .mas-tile .mas-tile-label {
 max-width: 100%;
 white-space: normal;
 word-break: break-word;
}

/* Variasi warna (soft tints), pakai warna brand existing, tidak menambah palet */
.mas-tile-green .mas-tile-ico { background: rgba(39,174,96,.16); color: var(--mas-green); }
.mas-tile-gold .mas-tile-ico { background: rgba(245,166,35,.18); color: #a16207; }
.mas-tile-blue .mas-tile-ico { background: rgba(41,128,185,.16); color: var(--mas-blue); }
.mas-tile-navy .mas-tile-ico { background: rgba(10,37,64,.12); color: var(--mas-navy); }
.mas-tile-red .mas-tile-ico { background: rgba(231,76,60,.16); color: var(--mas-red); }
.mas-tile-purple .mas-tile-ico { background: rgba(155,89,182,.18); color: #6b21a8; }
.mas-tile-teal .mas-tile-ico { background: rgba(20,184,166,.18); color: #0f766e; }
.mas-tile-orange .mas-tile-ico { background: rgba(249,115,22,.18); color: #c2410c; }

/* Dark-mode tweak (aktif cuma kalau halaman sedang dark-mode) */
html[data-theme="dark"] .mas-feature-grid .mas-tile { color: #e2e8f0; }
html[data-theme="dark"] .mas-feature-grid .mas-tile .mas-tile-ico { background: rgba(255,255,255,.08); color: #fff; }
html[data-theme="dark"] .mas-tile-green .mas-tile-ico { background: rgba(39,174,96,.24); color: #6ee7b7; }
html[data-theme="dark"] .mas-tile-gold .mas-tile-ico { background: rgba(245,166,35,.22); color: #fcd34d; }
html[data-theme="dark"] .mas-tile-blue .mas-tile-ico { background: rgba(41,128,185,.24); color: #93c5fd; }
html[data-theme="dark"] .mas-tile-red .mas-tile-ico { background: rgba(231,76,60,.24); color: #fca5a5; }
html[data-theme="dark"] .mas-tile-purple .mas-tile-ico { background: rgba(155,89,182,.24); color: #d8b4fe; }

/* ===========================================================================
 * 3. ANNOUNCEMENT / UPCOMING CARD ALA SCREENSHOT REF "Perlu kamu kerjakan"
 * Class .mas-todo-card (opt-in, dipakai di dashboard bila ada data).
 * =========================================================================== */
.mas-todo-card {
 display: flex;
 gap: 12px;
 padding: 12px 14px;
 border: 1px solid var(--mas-border);
 border-radius: 14px;
 background: var(--mas-card);
 text-decoration: none;
 color: var(--mas-text);
 align-items: flex-start;
 transition: box-shadow .2s, transform .2s;
}
.mas-todo-card:hover,
.mas-todo-card:focus-visible {
 box-shadow: 0 6px 18px rgba(10,37,64,.08);
 transform: translateY(-1px);
 color: var(--mas-navy);
}
.mas-todo-card .mas-todo-ico {
 width: 42px; height: 42px; flex-shrink: 0;
 border-radius: 12px;
 background: rgba(41,128,185,.14);
 color: var(--mas-blue);
 display: inline-flex; align-items: center; justify-content: center;
 font-size: 1rem;
}
.mas-todo-card .mas-todo-body { flex: 1; min-width: 0; }
.mas-todo-card .mas-todo-title {
 margin: 0; font-weight: 700; font-size: .92rem;
 line-height: 1.3; color: var(--mas-text);
}
.mas-todo-card .mas-todo-sub {
 margin: 2px 0 0; font-size: .76rem;
 color: var(--mas-muted); line-height: 1.35;
}
.mas-todo-card .mas-todo-chev {
 margin-left: 8px; color: var(--mas-muted); font-size: .8rem; flex-shrink: 0;
}

/* ===========================================================================
 * 4. PATCH KECIL UNTUK MOBILE VIEW (≤ 992 px)
 * Agar halaman existing terasa "app-like".
 * =========================================================================== */
@media (max-width: 992px) {
 /* Content-area lebih merapat tepi (pakai card sendiri-sendiri). */
 body.mas-active .content-area,
 body.mas-active .ss-content {
 padding-left: 14px !important;
 padding-right: 14px !important;
 }

 /* Page header: lebih ringkas di HP */
 body.mas-active .page-header {
 padding: 14px 14px !important;
 border-radius: 12px !important;
 }

 /* Kartu umum: sudut lebih bulat, shadow lebih lembut */
 body.mas-active .card-orion {
 border-radius: 14px !important;
 }
}

/* ===========================================================================
 * 5. SEMBUNYIKAN MOBILE SHELL SAAT PRINT & TIDAK DI-DESKTOP
 * =========================================================================== */
@media print {
 .mas-topbar,
 .mas-bottom-nav,
 .mas-drawer-backdrop { display: none !important; }
 body.mas-active { padding-bottom: 0 !important; }
}

/* ===========================================================================
 * 6. OPT-OUT: matikan mobile shell di halaman khusus
 * Tambahkan class `mas-off` di <body> halaman (ujian/kiosk/fullscreen)
 * supaya top-bar + bottom-nav mobile tidak muncul.
 * =========================================================================== */
body.mas-off .mas-topbar,
body.mas-off .mas-bottom-nav { display: none !important; }
body.mas-off { padding-bottom: 0 !important; }
