/* ============================================================
   MMS Tracker - Mobile App Shell
   Everything below is scoped to html.mms-mobile (added by JS
   only on small screens), so the desktop layout is untouched.
   ============================================================ */

:root {
  --mms-navy: #0b3d7b;
  --mms-navy-dk: #082c59;
  --mms-gold: #f2a900;
  --mms-appbar-h: 56px;
  --mms-tabbar-h: 62px;
  --mms-safe-top: env(safe-area-inset-top, 0px);
  --mms-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mms-radius: 16px;
}

/* Shared chrome (hidden until mobile mode turns it on) */
#mmsAppBar, #mmsTabBar, #mmsLauncher, #mmsInstallBanner,
#mmsIosSheet, #mmsToast, #mmsPtr { display: none; }

/* ============================================================
   1. MOBILE MODE
   ============================================================ */
html.mms-mobile { -webkit-text-size-adjust: 100%; }

html.mms-mobile body {
  background: #f2f4f7;
  overscroll-behavior-y: contain;
}

/* Kill the old floating hamburger - the app bar replaces it */
html.mms-mobile .content > .btn[data-bs-target="#mobileSidebar"] { display: none !important; }

html.mms-mobile .content {
  margin-left: 0;
  padding: calc(var(--mms-appbar-h) + var(--mms-safe-top) + 10px) 12px
           calc(var(--mms-tabbar-h) + var(--mms-safe-bottom) + 18px);
}

/* Section transition */
html.mms-mobile .app-section { animation: mmsFadeUp .24s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes mmsFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 1a. App bar ---------- */
html.mms-mobile #mmsAppBar {
  display: flex;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1045;
  align-items: center; gap: 6px;
  height: calc(var(--mms-appbar-h) + var(--mms-safe-top));
  padding: var(--mms-safe-top) 8px 0;
  background: linear-gradient(135deg, var(--mms-navy) 0%, var(--mms-navy-dk) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(8, 44, 89, .28);
}
#mmsAppBar .mms-ab-btn {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: #fff;
  border-radius: 50%; font-size: 1.05rem;
  -webkit-tap-highlight-color: transparent;
}
#mmsAppBar .mms-ab-btn:active { background: rgba(255,255,255,.18); }
#mmsAppBar .mms-ab-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 1.02rem; font-weight: 600; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#mmsAppBar .mms-ab-sub {
  display: block; font-size: .68rem; font-weight: 400;
  opacity: .72; margin-top: -2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#mmsAppBar .mms-ab-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mms-gold); color: #3a2600;
  display: grid; place-items: center;
  font-weight: 700; font-size: .82rem; border: 0;
}

/* ---------- 1b. Bottom tab bar ---------- */
html.mms-mobile #mmsTabBar {
  display: flex;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 1045;
  height: calc(var(--mms-tabbar-h) + var(--mms-safe-bottom));
  padding-bottom: var(--mms-safe-bottom);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid #e4e7ec;
  box-shadow: 0 -2px 14px rgba(16, 24, 40, .07);
}
#mmsTabBar .mms-tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border: 0; background: transparent;
  color: #6b7280; font-size: .66rem; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}
#mmsTabBar .mms-tab i { font-size: 1.16rem; transition: transform .18s ease; }
#mmsTabBar .mms-tab.active { color: var(--mms-navy); }
#mmsTabBar .mms-tab.active i { transform: translateY(-2px); }
#mmsTabBar .mms-tab:active i { transform: scale(.88); }
#mmsTabBar .mms-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#mmsTabBar .mms-tab-fab { position: relative; }
#mmsTabBar .mms-tab-fab i {
  width: 46px; height: 46px; margin-top: -20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mms-navy) 0%, #1663c7 100%);
  color: #fff; font-size: 1.16rem;
  box-shadow: 0 6px 16px rgba(11, 61, 123, .42);
}
#mmsTabBar .mms-tab-fab:active i { transform: scale(.92); }

/* ---------- 1c. App launcher ---------- */
html.mms-mobile #mmsLauncher {
  display: flex;
  flex-direction: column;
  position: fixed; inset: 0;
  z-index: 1060;
  background: #f2f4f7;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}
html.mms-mobile #mmsLauncher.open { transform: none; }
#mmsLauncher .mms-lc-head {
  flex: 0 0 auto;
  padding: calc(var(--mms-safe-top) + 12px) 14px 12px;
  background: linear-gradient(135deg, var(--mms-navy) 0%, var(--mms-navy-dk) 100%);
  color: #fff;
}
#mmsLauncher .mms-lc-head .mms-lc-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
#mmsLauncher .mms-lc-head h6 { margin: 0; flex: 1; font-weight: 600; font-size: 1.05rem; }
#mmsLauncher .mms-lc-close {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center;
}
#mmsLauncher .mms-lc-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.16); border-radius: 12px; padding: 9px 12px;
}
#mmsLauncher .mms-lc-search i { opacity: .8; font-size: .9rem; }
#mmsLauncher .mms-lc-search input {
  flex: 1; border: 0; background: transparent; color: #fff;
  font-size: 16px; outline: none;
}
#mmsLauncher .mms-lc-search input::placeholder { color: rgba(255,255,255,.7); }
#mmsLauncher .mms-lc-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 12px calc(var(--mms-safe-bottom) + 120px);
}
#mmsLauncher .mms-lc-group {
  font-size: .7rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #8a94a6;
  margin: 20px 6px 10px;
}
#mmsLauncher .mms-lc-group:first-child { margin-top: 4px; }
#mmsLauncher .mms-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px;
}
@media (min-width: 420px) { #mmsLauncher .mms-grid { grid-template-columns: repeat(5, 1fr); } }

.mms-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px; border: 0; background: transparent;
  border-radius: 14px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mms-tile:active { background: rgba(11, 61, 123, .07); }
.mms-tile .mms-tile-ico {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.24rem; color: #fff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .16);
}
.mms-tile .mms-tile-lbl {
  font-size: .68rem; line-height: 1.2; font-weight: 600;
  color: #344054; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 74px;
}
.mms-c0 { background: linear-gradient(135deg,#1d4ed8,#3b82f6); }
.mms-c1 { background: linear-gradient(135deg,#0f766e,#14b8a6); }
.mms-c2 { background: linear-gradient(135deg,#b45309,#f59e0b); }
.mms-c3 { background: linear-gradient(135deg,#7e22ce,#a855f7); }
.mms-c4 { background: linear-gradient(135deg,#b91c1c,#ef4444); }
.mms-c5 { background: linear-gradient(135deg,#15803d,#22c55e); }
.mms-c6 { background: linear-gradient(135deg,#0369a1,#0ea5e9); }
.mms-c7 { background: linear-gradient(135deg,#4b5563,#6b7280); }

#mmsLauncher .mms-lc-empty {
  text-align: center; color: #98a2b3; padding: 48px 20px; font-size: .9rem;
}

/* ---------- 1d. Quick-access grid on the dashboard ---------- */
html.mms-mobile #mmsQuickWrap {
  background: #fff; border-radius: var(--mms-radius);
  padding: 14px 8px 6px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
}
html.mms-mobile #mmsQuickWrap .mms-qh {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 10px; font-size: .74rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: #8a94a6;
}
html.mms-mobile #mmsQuickWrap .mms-qh a { color: var(--mms-navy); text-decoration: none; font-size: .72rem; }
html.mms-mobile #mmsQuickWrap .mms-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }

/* ---------- 1e. Cards, buttons, forms: touch sizing ---------- */
html.mms-mobile .card { border-radius: var(--mms-radius); box-shadow: 0 2px 10px rgba(16,24,40,.06); }
html.mms-mobile .card-body { padding: 14px; }
html.mms-mobile h2 { font-size: 1.35rem; }
html.mms-mobile h3 { font-size: 1.2rem; }
html.mms-mobile h4 { font-size: 1.1rem; }
html.mms-mobile .stat-card h3 { font-size: 1.7rem; }

html.mms-mobile .btn {
  min-height: 44px; border-radius: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
html.mms-mobile .btn-sm { min-height: 36px; border-radius: 10px; padding: 6px 12px; }
html.mms-mobile .btn:active { transform: scale(.97); }
html.mms-mobile .btn-group .btn { border-radius: 0; }

html.mms-mobile .form-control,
html.mms-mobile .form-select {
  font-size: 16px;            /* stops iOS auto-zoom on focus */
  min-height: 46px; border-radius: 12px;
}
html.mms-mobile textarea.form-control { min-height: 92px; }
html.mms-mobile .input-group > .btn { min-height: 46px; }
html.mms-mobile .form-label { font-size: .82rem; color: #475467; }

/* ---------- 1f. Modals as bottom sheets ---------- */
/* Bootstrap keeps .modal as the scroll container; the dialog stays in normal
   flow (position: static) and is pushed to the bottom with flex - using
   position:absolute here made the dialog wider than the viewport. */
html.mms-mobile .modal { padding-left: 0 !important; padding-right: 0 !important; }
html.mms-mobile .modal-dialog {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: flex-end;
}
html.mms-mobile .modal-content {
  width: 100%;
  max-height: 94vh;
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(16, 24, 40, .28);
  padding-bottom: var(--mms-safe-bottom);
}
html.mms-mobile .modal-header,
html.mms-mobile .modal-footer { flex: 0 0 auto; }
html.mms-mobile .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html.mms-mobile .modal-header {
  border-radius: 22px 22px 0 0;
  position: relative;
  padding-top: 22px;
}
html.mms-mobile .modal-header::before {
  content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 3px; background: currentColor; opacity: .28;
}
html.mms-mobile .modal-footer {
  gap: 8px; border-top: 1px solid #eaecf0;
  padding: 12px 14px;
}
html.mms-mobile .modal-footer .btn { flex: 1 1 auto; }
html.mms-mobile .modal.fade .modal-dialog {
  transform: translateY(28px);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
}
html.mms-mobile .modal.show .modal-dialog { transform: none; }
/* full-screen variants keep their own behaviour */
html.mms-mobile .modal-fullscreen .modal-content { max-height: 100vh; border-radius: 0; }

/* ---------- 1g. Tables -> stacked cards ---------- */
html.mms-mobile .table-responsive { -webkit-overflow-scrolling: touch; }

html.mms-mobile table.mms-cards { border: 0; background: transparent; font-size: .88rem; }
html.mms-mobile table.mms-cards thead { display: none; }
html.mms-mobile table.mms-cards tbody { display: block; }
html.mms-mobile table.mms-cards tbody tr {
  display: block; background: #fff;
  border: 1px solid #eaecf0; border-radius: 14px;
  padding: 6px 12px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(16,24,40,.05);
}
html.mms-mobile table.mms-cards tbody td {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border: 0; border-bottom: 1px dashed #f2f4f7;
  padding: 8px 0; text-align: right !important; width: auto !important;
}
html.mms-mobile table.mms-cards tbody tr td:last-child { border-bottom: 0; }
html.mms-mobile table.mms-cards tbody td::before {
  content: attr(data-mms-label);
  flex: 0 0 40%; text-align: left;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: #98a2b3; padding-top: 2px;
}
html.mms-mobile table.mms-cards tbody td[data-mms-label=""]::before { display: none; }
html.mms-mobile table.mms-cards tbody td.mms-td-full {
  display: block; text-align: center !important; color: #98a2b3; padding: 14px 0;
}
html.mms-mobile table.mms-cards tbody td.mms-td-full::before { display: none; }
html.mms-mobile table.mms-cards tbody td .btn { min-height: 38px; }
html.mms-mobile table.mms-cards tfoot { display: block; }
html.mms-mobile table.mms-cards tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; background:#fff; border-radius:14px; padding:8px 12px; }
html.mms-mobile table.mms-cards tfoot td { border: 0; }

/* Tables that stay scrollable get a nudge affordance */
html.mms-mobile .table-responsive.mms-scrollable { position: relative; }
html.mms-mobile .table-responsive.mms-scrollable::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 26px;
  background: linear-gradient(to right, rgba(242,244,247,0), rgba(242,244,247,.92));
  pointer-events: none;
}

/* ---------- 1h. Offcanvas sidebar polish ---------- */
html.mms-mobile #mobileSidebar { width: 84vw; max-width: 320px; padding-top: var(--mms-safe-top); }
html.mms-mobile #mobileSidebar .nav-link { padding: 12px 16px; font-size: .95rem; border-radius: 10px; margin: 1px 8px; }
html.mms-mobile #mobileSidebar .nav-link:active { background: rgba(255,255,255,.14); }

/* ---------- 1i. Install banner ---------- */
html.mms-mobile #mmsInstallBanner {
  display: none;
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--mms-tabbar-h) + var(--mms-safe-bottom) + 12px);
  z-index: 1050;
  background: #fff; border-radius: 16px;
  box-shadow: 0 10px 32px rgba(16,24,40,.22);
  padding: 12px 14px;
  align-items: center; gap: 12px;
  animation: mmsSlideUp .3s ease both;
}
html.mms-mobile #mmsInstallBanner.show { display: flex; }
@keyframes mmsSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
#mmsInstallBanner img { width: 42px; height: 42px; border-radius: 11px; }
#mmsInstallBanner .mms-ib-txt { flex: 1; min-width: 0; }
#mmsInstallBanner .mms-ib-txt strong { display: block; font-size: .9rem; color: #101828; }
#mmsInstallBanner .mms-ib-txt small { color: #667085; font-size: .74rem; }
#mmsInstallBanner .mms-ib-go {
  border: 0; border-radius: 999px; padding: 9px 16px;
  background: var(--mms-navy); color: #fff; font-weight: 600; font-size: .84rem;
}
#mmsInstallBanner .mms-ib-x { border: 0; background: transparent; color: #98a2b3; font-size: 1rem; padding: 4px 6px; }

/* ---------- 1j. iOS "Add to Home Screen" sheet ---------- */
html.mms-mobile #mmsIosSheet {
  display: none; position: fixed; inset: 0; z-index: 1065;
  background: rgba(16,24,40,.5); align-items: flex-end;
}
html.mms-mobile #mmsIosSheet.show { display: flex; }
#mmsIosSheet .mms-ios-card {
  width: 100%; background: #fff; border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(24px + var(--mms-safe-bottom));
  animation: mmsSlideUp .28s ease both;
}
#mmsIosSheet h6 { font-weight: 700; margin-bottom: 14px; }
#mmsIosSheet ol { margin: 0 0 18px; padding-left: 20px; color: #475467; font-size: .9rem; line-height: 1.9; }
#mmsIosSheet .btn { width: 100%; }

/* ---------- 1k. Toast + pull to refresh ---------- */
html.mms-mobile #mmsToast {
  display: none; position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--mms-tabbar-h) + var(--mms-safe-bottom) + 16px);
  z-index: 1070; background: #101828; color: #fff;
  padding: 11px 18px; border-radius: 999px; font-size: .84rem;
  box-shadow: 0 8px 24px rgba(16,24,40,.3); max-width: 88vw; text-align: center;
}
html.mms-mobile #mmsToast.show { display: block; animation: mmsSlideUp .25s ease both; }
html.mms-mobile #mmsToast button {
  border: 0; background: transparent; color: var(--mms-gold); font-weight: 700; margin-left: 10px;
}

html.mms-mobile #mmsPtr {
  display: flex; position: fixed;
  top: calc(var(--mms-appbar-h) + var(--mms-safe-top)); left: 0; right: 0;
  height: 0; overflow: hidden; z-index: 1040;
  align-items: center; justify-content: center;
  color: var(--mms-navy); transition: height .12s linear;
}
html.mms-mobile #mmsPtr i { font-size: 1.1rem; }
html.mms-mobile #mmsPtr.spin i { animation: mmsSpin .8s linear infinite; }
@keyframes mmsSpin { to { transform: rotate(360deg); } }

/* ---------- 1l. Misc ---------- */
html.mms-mobile .swal2-popup { border-radius: 18px !important; font-size: .95rem !important; }
html.mms-mobile iframe { border-radius: 12px; }
html.mms-mobile .badge { font-size: .72rem; }
html.mms-mobile #loggedInUserDisplay { position: relative; }
html.mms-mobile .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.mms-mobile .nav-tabs .nav-link { white-space: nowrap; }

/* Standalone (installed) tweaks: no browser chrome, so no text selection drag */
html.mms-standalone { user-select: none; -webkit-user-select: none; }
html.mms-standalone input,
html.mms-standalone textarea,
html.mms-standalone [contenteditable],
html.mms-standalone table { user-select: text; -webkit-user-select: text; }

@media print {
  #mmsAppBar, #mmsTabBar, #mmsLauncher, #mmsInstallBanner, #mmsToast, #mmsPtr { display: none !important; }
  html.mms-mobile .content { padding: 0 !important; }
}

/* ============================================================
   2. DESIGN PASS v2 - richer, more tactile mobile UI
   ============================================================ */

/* ---------- 2a. Tiles ---------- */
html.mms-mobile .mms-tile {
  position: relative;
  overflow: hidden;
  padding: 12px 2px 10px;
  transition: transform .16s cubic-bezier(.22,1,.36,1);
}
html.mms-mobile .mms-tile:active { transform: scale(.94); background: transparent; }
html.mms-mobile .mms-tile .mms-tile-ico {
  width: 56px; height: 56px;
  border-radius: 18px;
  font-size: 1.32rem;
  color: #fff;
  background-image: linear-gradient(140deg, #2563eb, #1d4ed8);   /* replaced inline per tile */
  box-shadow: 0 6px 14px -4px rgba(16,24,40,.42), inset 0 1px 0 rgba(255,255,255,.32);
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .16s ease;
}
html.mms-mobile .mms-tile:active .mms-tile-ico {
  transform: translateY(1px) scale(.93);
  box-shadow: 0 2px 6px -2px rgba(16,24,40,.4), inset 0 1px 0 rgba(255,255,255,.32);
}
html.mms-mobile .mms-tile .mms-tile-lbl {
  font-size: .7rem; font-weight: 600; color: #344054; letter-spacing: .01em;
  max-width: 78px;
}

.mms-ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(11,61,123,.16);
  transform: scale(0); opacity: .75;
  animation: mmsRipple .5s ease-out forwards;
}
@keyframes mmsRipple { to { transform: scale(2.2); opacity: 0; } }

/* ---------- 2b. Launcher ---------- */
html.mms-mobile #mmsLauncher .mms-lc-head {
  box-shadow: 0 4px 18px rgba(8,44,89,.26);
  border-radius: 0 0 20px 20px;
}
html.mms-mobile #mmsLauncher .mms-lc-head h6 { font-size: 1.12rem; letter-spacing: -.01em; }
html.mms-mobile #mmsLauncher .mms-lc-search {
  border-radius: 14px; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.14);
}
html.mms-mobile #mmsLauncher .mms-lc-body { padding-top: 8px; }
html.mms-mobile #mmsLauncher .mms-lc-group {
  display: flex; align-items: center; gap: 10px;
  font-size: .68rem; color: #667085; margin: 22px 8px 8px;
}
html.mms-mobile #mmsLauncher .mms-lc-group::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(to right, #dde1e7, transparent);
}
html.mms-mobile #mmsLauncher .mms-grid {
  background: #fff; border-radius: 18px; padding: 8px 4px;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
}

/* ---------- 2c. Bottom tab bar ---------- */
html.mms-mobile #mmsTabBar .mms-tab { position: relative; overflow: hidden; }
html.mms-mobile #mmsTabBar .mms-tab i {
  position: relative; z-index: 1;
  width: 42px; height: 28px; display: grid; place-items: center;
  border-radius: 999px; transition: background .2s ease, transform .18s cubic-bezier(.22,1,.36,1);
}
html.mms-mobile #mmsTabBar .mms-tab.active i { background: rgba(11,61,123,.11); }
html.mms-mobile #mmsTabBar .mms-tab-fab i {
  width: 50px; height: 50px; margin-top: -22px; background: none;
  background-image: linear-gradient(140deg, #1d4ed8 0%, #0b3d7b 100%);
  box-shadow: 0 8px 20px -4px rgba(11,61,123,.55), inset 0 1px 0 rgba(255,255,255,.28);
  font-size: 1.24rem;
}
html.mms-mobile #mmsTabBar .mms-tab-fab.active i { background-image: linear-gradient(140deg, #1d4ed8, #0b3d7b); }
html.mms-mobile #mmsTabBar .mms-tab-fab span { margin-top: -2px; }

/* ---------- 2d. App bar ---------- */
html.mms-mobile #mmsAppBar { border-radius: 0 0 18px 18px; }
html.mms-mobile #mmsAppBar .mms-ab-title { letter-spacing: -.01em; }
html.mms-mobile #mmsAppBar .mms-ab-avatar {
  background-image: linear-gradient(140deg, #ffc94d, #f2a900);
  box-shadow: 0 2px 8px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.4);
}

/* ---------- 2e. Quick access block ---------- */
html.mms-mobile #mmsQuickWrap {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid #eef1f5;
  padding: 16px 8px 8px;
}
html.mms-mobile #mmsQuickWrap .mms-qh span { display: flex; align-items: center; gap: 7px; }
html.mms-mobile #mmsQuickWrap .mms-qh a { font-weight: 700; }

/* ---------- 2f. Section headings ---------- */
html.mms-mobile .app-section > h2,
html.mms-mobile .app-section > div > h2 {
  font-size: 1.22rem; font-weight: 700; letter-spacing: -.015em; color: #101828;
}
html.mms-mobile .app-section .d-flex.justify-content-between { flex-wrap: wrap; gap: 8px; }
html.mms-mobile .app-section .d-flex.gap-2 { flex-wrap: wrap; }

/* ---------- 2g. Empty + loading states ---------- */
html.mms-mobile table.mms-cards tbody td.mms-td-full {
  background: #fff; border-radius: 14px; font-size: .86rem;
}
.mms-skel {
  background: linear-gradient(90deg,#eef1f5 25%,#f7f9fb 37%,#eef1f5 63%);
  background-size: 400% 100%; animation: mmsShimmer 1.3s ease infinite;
  border-radius: 10px;
}
@keyframes mmsShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 2h. Comfort ---------- */
html.mms-mobile { scroll-behavior: smooth; }
html.mms-mobile .btn:focus, html.mms-mobile .form-control:focus, html.mms-mobile .form-select:focus {
  box-shadow: 0 0 0 4px rgba(11,61,123,.14);
}
html.mms-mobile .list-group-item { padding: 14px; }
html.mms-mobile .alert { border-radius: 14px; }
html.mms-mobile .progress { height: 10px; border-radius: 999px; }
html.mms-mobile ::-webkit-scrollbar { width: 0; height: 0; }

@media (prefers-reduced-motion: reduce) {
  html.mms-mobile .app-section,
  html.mms-mobile #mmsLauncher,
  .mms-ripple, .mms-skel { animation: none !important; transition: none !important; }
}

/* ---------- 2i. Horizontal-overflow guards ----------
   The dashboard metric pills sat in a non-wrapping flex row ~510px wide, which
   made Chrome widen the layout viewport and shrink the whole page. Let rows
   wrap on small screens and keep media inside its box. */
html.mms-mobile .content .d-flex:not(.flex-nowrap):not(.table-responsive) { flex-wrap: wrap; }
html.mms-mobile .content .flex-nowrap { flex-wrap: nowrap !important; }
html.mms-mobile .content .gap-4 { gap: .6rem !important; }
html.mms-mobile .content .gap-3 { gap: .5rem !important; }
html.mms-mobile .dashboard-metric-pill { flex: 0 0 auto; max-width: 100%; }
html.mms-mobile .dashboard-metric-label { font-size: .8rem; }

html.mms-mobile img,
html.mms-mobile canvas,
html.mms-mobile svg { max-width: 100%; }
html.mms-mobile canvas { height: auto !important; }
html.mms-mobile pre, html.mms-mobile code { white-space: pre-wrap; word-break: break-word; }
html.mms-mobile .text-truncate, html.mms-mobile td, html.mms-mobile th { overflow-wrap: anywhere; }
html.mms-mobile .btn-group { flex-wrap: wrap; }
html.mms-mobile .input-group { flex-wrap: nowrap; }

/* ---------- 2j. Typography scale inside sections ---------- */
html.mms-mobile .app-section h2 { font-size: 1.24rem !important; font-weight: 700; letter-spacing: -.015em; }
html.mms-mobile .app-section h3 { font-size: 1.12rem !important; }
html.mms-mobile .app-section h4 { font-size: 1.04rem !important; }
html.mms-mobile .app-section h5 { font-size: .98rem !important; }
html.mms-mobile .app-section h6 { font-size: .9rem !important; }
html.mms-mobile .app-section h2 i { font-size: .92em; }
html.mms-mobile .card-header { padding: 12px 14px; font-size: .92rem; font-weight: 600; }
html.mms-mobile .stat-card h3 { font-size: 1.55rem !important; }

/* ---------- 2k. Denser cards from tables ---------- */
html.mms-mobile table.mms-cards tbody tr { padding: 4px 12px; margin-bottom: 9px; border-radius: 15px; }
html.mms-mobile table.mms-cards tbody td { padding: 7px 0; gap: 10px; }
html.mms-mobile table.mms-cards tbody td::before { flex-basis: 36%; font-size: .68rem; }

/* ---------- 2l. Tab bar label spacing (FAB) ---------- */
html.mms-mobile #mmsTabBar .mms-tab-fab { justify-content: flex-end; padding-bottom: 6px; }
html.mms-mobile #mmsTabBar .mms-tab-fab i { margin-top: -26px; margin-bottom: 4px; }
html.mms-mobile #mmsTabBar .mms-tab-fab span { margin-top: 0; }

/* ---------- 2m. Recents strip ---------- */
html.mms-mobile #mmsLauncher .mms-lc-group.mms-recent { color: var(--mms-navy); }
html.mms-mobile #mmsLauncher .mms-grid.mms-recent-grid {
  background: linear-gradient(180deg,#ffffff,#f7faff);
  border: 1px solid #e6edf8;
}
