/* ==========================================================================
   AUTOMECH V2 — MOBILE APP SHELL (Mẫu 3B: Floating Capsule Dock + Bottom Sheet)
   Scoped to .ms-* & body.phone-only-mode; zero impact on Desktop Web UI.
   ========================================================================== */

body.phone-only-mode .mobile-bottom-nav {
  display: none !important;
}

body.phone-only-mode {
  --ms-bg: #F3F5F9;
  --ms-card: #FFFFFF;
  --ms-card-subtle: #F8FAFC;
  --ms-border: #DCE3EC;
  --ms-text: #0F172A;
  --ms-muted: #64748B;
  --ms-accent: #2563EB;
  --ms-accent-dark: #1D4ED8;
  --ms-accent-soft: rgba(37, 99, 235, 0.12);
  --ms-success: #10B981;
  --ms-success-soft: rgba(16, 185, 129, 0.13);
  --ms-warning: #F59E0B;
  --ms-warning-soft: rgba(245, 158, 11, 0.15);
  --ms-danger: #EF4444;
  --ms-danger-soft: rgba(239, 68, 68, 0.13);
  --ms-info: #2563EB;
  --ms-info-soft: rgba(37, 99, 235, 0.12);
  --ms-brand-blue: #1D4ED8;
  --ms-header-bg: rgba(255, 255, 255, 0.94);
  --ms-dock-bg: rgba(255, 255, 255, 0.94);
  --ms-shadow-card: 0 2px 10px rgba(15, 23, 42, 0.045);
  --ms-shadow-dock: 0 12px 32px rgba(15, 23, 42, 0.13);
  background: var(--ms-bg);
  color: var(--ms-text);
  overflow-x: hidden;
}

[data-theme="dark"] body.phone-only-mode,
body.dark-theme.phone-only-mode {
  --ms-bg: #0B1220;
  --ms-card: #151E2E;
  --ms-card-subtle: #111927;
  --ms-border: #263449;
  --ms-text: #F1F5F9;
  --ms-muted: #94A3B8;
  --ms-accent: #60A5FA;
  --ms-accent-dark: #3B82F6;
  --ms-accent-soft: rgba(96, 165, 250, 0.18);
  --ms-success: #34D399;
  --ms-success-soft: rgba(52, 211, 153, 0.16);
  --ms-warning: #FBBF24;
  --ms-warning-soft: rgba(251, 191, 36, 0.16);
  --ms-danger: #F87171;
  --ms-danger-soft: rgba(248, 113, 113, 0.18);
  --ms-info: #60A5FA;
  --ms-info-soft: rgba(96, 165, 250, 0.16);
  --ms-brand-blue: #60A5FA;
  --ms-header-bg: rgba(15, 23, 42, 0.94);
  --ms-dock-bg: rgba(21, 30, 46, 0.94);
  --ms-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
  --ms-shadow-dock: 0 14px 34px rgba(0, 0, 0, 0.48);
}

/* Clean scroll container so sticky header never misaligns with .ms-shell */
body.phone-only-mode .app-wrapper,
body.phone-only-mode .main-wrapper {
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}
body.phone-only-mode .content-area {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
  background: var(--ms-bg) !important;
  -webkit-overflow-scrolling: touch;
}
body.phone-only-mode #page-container {
  min-height: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

/* Desktop ?mobile=1 Preview Frame */
body.phone-only-mode.ms-desktop-preview,
body.phone-only-mode.ms-desktop-preview .content-area {
  background: #E7ECF4 !important;
}
[data-theme="dark"] body.phone-only-mode.ms-desktop-preview,
body.dark-theme.phone-only-mode.ms-desktop-preview,
[data-theme="dark"] body.phone-only-mode.ms-desktop-preview .content-area,
body.dark-theme.phone-only-mode.ms-desktop-preview .content-area {
  background: #060A12 !important;
}
body.phone-only-mode.ms-desktop-preview .ms-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  border-radius: 0;
  border-left: 1px solid var(--ms-border);
  border-right: 1px solid var(--ms-border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
  overflow: visible;
}
body.phone-only-mode.ms-desktop-preview .ms-drawer-backdrop {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 430px;
  top: 0;
  bottom: 0;
  border-radius: 0;
  overflow: hidden;
}
body.phone-only-mode .toast-container {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: min(402px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  z-index: 15000;
  align-items: stretch;
}
body.phone-only-mode .toast-container .toast {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
}

.ms-shell {
  width: 100%;
  min-height: 100dvh;
  background: var(--ms-bg);
  color: var(--ms-text);
  font-family: var(--font-family, 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  position: relative;
}
.ms-shell *, .ms-sheet *, .ms-drawer *, .ms-account-popover * {
  box-sizing: border-box;
}

/* ======================== STICKY TOP HEADER ======================== */
#ms-header-slot {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
}
.ms-header {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: calc(62px + env(safe-area-inset-top, 0px));
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
  background: var(--ms-header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ms-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.ms-header.is-no-left {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 10px;
  gap: 8px;
}
.ms-header.is-no-left .ms-header-brand-block {
  justify-content: flex-start;
  padding-left: 0;
}
.ms-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ms-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.ms-menu-btn:active {
  background: var(--ms-accent-soft);
  transform: scale(0.94);
}
.ms-header-center {
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ms-header-center strong {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-header-brand-block {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-left: 0;
}
.ms-brand-logo {
  display: block;
  height: 44px;
  width: 86px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  -webkit-mask-image: url('/assets/automech-logo.png?v=20261201-mobbgd7');
  mask-image: url('/assets/automech-logo.png?v=20261201-mobbgd7');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
[data-theme="dark"] .ms-brand-logo,
body.dark-theme .ms-brand-logo {
  background: #60A5FA;
}
.ms-brand-company {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: -0.01em;
  color: var(--ms-accent);
  white-space: nowrap;
}
.ms-header:not(.is-no-left) .ms-brand-logo {
  height: 36px;
  width: 66px;
}
.ms-header:not(.is-no-left) .ms-brand-company {
  font-size: 11px;
}
@media (max-width: 395px) {
  .ms-header-brand-block { gap: 5px; }
  .ms-brand-logo { height: 38px; width: 70px; }
  .ms-brand-company { font-size: 11px; }
  .ms-header:not(.is-no-left) .ms-brand-logo { height: 32px; width: 58px; }
  .ms-header:not(.is-no-left) .ms-brand-company { font-size: 9.8px; }
}
.ms-header-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ms-text);
  line-height: 1.2;
}
.ms-header-center.is-detail {
  text-align: left;
  align-items: flex-start;
}
.ms-avatar-btn {
  padding: 0;
  border: 2px solid var(--ms-accent-soft);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}
.ms-avatar-btn:active {
  transform: scale(0.94);
}
.ms-icon-btn.is-ghost {
  border: 0;
  background: transparent;
  font-size: 18px;
  width: 34px;
  height: 34px;
}
.ms-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ms-theme-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: #475569;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ms-theme-btn:active {
  transform: scale(0.94);
}
.ms-theme-btn.is-dark {
  color: #FBBF24;
}

/* Avatar Account Popover */
.ms-account-backdrop {
  position: fixed;
  inset: 0;
  z-index: 930;
  background: transparent;
}
.ms-account-popover {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 236px;
  background: var(--ms-card);
  color: var(--ms-text);
  border: 1px solid var(--ms-border);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  animation: msFadeIn 0.14s ease;
}
[data-theme="dark"] .ms-account-popover, body.dark-theme .ms-account-popover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
body.phone-only-mode.ms-desktop-preview .ms-account-popover {
  right: auto;
  left: calc(50% + 215px - 248px);
}
.ms-account-head {
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--ms-border);
  margin-bottom: 6px;
}
.ms-account-head strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-account-head small {
  display: block;
  font-size: 11.5px;
  color: var(--ms-muted);
  margin-top: 2px;
}
.ms-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.ms-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.ms-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ms-identity-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ms-accent);
  line-height: 1.2;
}
.ms-identity strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ms-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.ms-identity small {
  font-size: 11.5px;
  color: var(--ms-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.ms-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.ms-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.ms-icon-btn:active {
  transform: scale(0.95);
}
.ms-badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ms-card);
  font-variant-numeric: tabular-nums;
}
.ms-badge-dot.hidden {
  display: none;
}

/* ======================== MAIN CONTENT ======================== */
.ms-main {
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ======================== QUICK JUMP STRIP (Landing shortcuts) ======================== */
.ms-quick-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.ms-quick-jump::-webkit-scrollbar {
  display: none;
}
.ms-quick-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: var(--ms-shadow-card);
  transition: border-color 0.14s ease, transform 0.12s ease;
}
.ms-quick-jump-btn i {
  color: var(--ms-accent);
  font-size: 13px;
}
.ms-quick-jump-btn:active {
  transform: scale(0.96);
  border-color: var(--ms-accent);
}

/* ======================== CARDS & SECTIONS ======================== */
.ms-card {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 18px;
  padding: 15px;
  box-shadow: var(--ms-shadow-card);
  min-width: 0;
}
.ms-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ms-card-head h2, .ms-card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ms-text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ms-card-head h2 i, .ms-card-head h3 i {
  color: var(--ms-accent);
  font-size: 14px;
}
.ms-link-btn {
  border: 0;
  background: transparent;
  color: var(--ms-accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
}

/* Filter Row & Selects */
.ms-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.ms-select, .ms-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  min-width: 0;
}
.ms-select:focus, .ms-input:focus {
  border-color: var(--ms-accent);
  box-shadow: 0 0 0 3px var(--ms-accent-soft);
}
.ms-btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.ms-btn-primary {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
  color: #FFFFFF;
}
.ms-btn-success {
  background: var(--ms-success);
  border-color: var(--ms-success);
  color: #FFFFFF;
}
[data-theme="dark"] .ms-btn-primary,
body.dark-theme .ms-btn-primary,
[data-theme="dark"] .ms-chip.is-active,
body.dark-theme .ms-chip.is-active,
[data-theme="dark"] .ms-subtab.is-active,
body.dark-theme .ms-subtab.is-active,
[data-theme="dark"] .ms-segmented button.is-active,
body.dark-theme .ms-segmented button.is-active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}
[data-theme="dark"] .ms-btn-success,
body.dark-theme .ms-btn-success {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}
.ms-btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--ms-danger);
}
.ms-btn-sm {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 10px;
}

/* Search + Filter Bar */
.ms-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ms-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.ms-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ms-muted);
  font-size: 13.5px;
  pointer-events: none;
}
.ms-search-wrap .ms-input {
  padding-left: 36px;
}

/* Filter Chips (wrap cleanly, never clip) & Sub-tabs */
.ms-chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
}
.ms-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.ms-subtabs::-webkit-scrollbar {
  display: none;
}
.ms-chip, .ms-subtab {
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  color: var(--ms-muted);
  border-radius: 999px;
  padding: 8px 13px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.ms-chip {
  padding: 6px 9px;
  font-size: 11.5px;
}
.ms-chip-row.is-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}
.ms-chip-row.is-grid-5 .ms-chip {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 7px 2px;
  font-size: 11px;
  text-align: center;
}
@media (max-width: 385px) {
  .ms-chip-row.is-grid-5 { gap: 4px; }
  .ms-chip-row.is-grid-5 .ms-chip {
    padding: 6px 1px;
    font-size: 10px;
  }
}
.ms-chip.is-active, .ms-subtab.is-active {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}
.ms-subtab-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}
.ms-subtab.is-active .ms-subtab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}
.ms-subtabs.is-grid-4,
.ms-subtabs.is-grid-3 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding-bottom: 0;
}
.ms-subtabs.is-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ms-subtabs.is-grid-4 .ms-subtab,
.ms-subtabs.is-grid-3 .ms-subtab {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 8px 4px;
  font-size: 11.5px;
  gap: 4px;
  border-radius: 999px;
}
.ms-subtabs.is-grid-4 .ms-subtab-count,
.ms-subtabs.is-grid-3 .ms-subtab-count {
  font-size: 10px;
  padding: 1px 5px;
  flex-shrink: 0;
}
@media (max-width: 385px) {
  .ms-subtabs.is-grid-4,
  .ms-subtabs.is-grid-3 { gap: 4px; }
  .ms-subtabs.is-grid-4 .ms-subtab,
  .ms-subtabs.is-grid-3 .ms-subtab {
    padding: 7px 2px;
    font-size: 10.5px;
    gap: 2px;
  }
  .ms-subtabs.is-grid-4 .ms-subtab-count,
  .ms-subtabs.is-grid-3 .ms-subtab-count {
    font-size: 9.5px;
    padding: 1px 4px;
  }
}
.ms-subtabs[hidden],
.ms-subtabs.is-att-grid[hidden] {
  display: none !important;
}
.ms-subtabs.is-att-grid {
  display: grid;
  grid-template-columns: repeat(var(--ms-att-cols, 3), minmax(0, 1fr));
  gap: 6px 8px;
  overflow: visible;
  padding-bottom: 0;
}
.ms-subtabs.is-att-grid .ms-subtab {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 385px) {
  .ms-subtabs.is-att-grid { gap: 5px 6px; }
  .ms-subtabs.is-att-grid .ms-subtab { padding: 7px 4px; font-size: 11px; gap: 4px; }
}
.ms-pd-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Segmented Control (2-way switch) */
.ms-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
}
.ms-segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ms-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ms-segmented button.is-active {
  background: var(--ms-accent);
  color: #FFFFFF;
}
.ms-segmented.is-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ms-segmented.is-3 button {
  font-size: 11.5px;
  padding: 5px 4px;
  line-height: 1.2;
}

/* ======================== KPI GRID ======================== */
.ms-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ms-kpi-card {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: var(--ms-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  min-width: 0;
  font-family: inherit;
  color: inherit;
}
button.ms-kpi-card {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
button.ms-kpi-card:active {
  transform: scale(0.98);
}
.ms-kpi-card.is-full {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.ms-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ms-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--ms-accent-soft);
  color: var(--ms-accent);
}
.ms-kpi-card.is-success .ms-kpi-icon { background: var(--ms-success-soft); color: var(--ms-success); }
.ms-kpi-card.is-warning .ms-kpi-icon { background: var(--ms-warning-soft); color: var(--ms-warning); }
.ms-kpi-card.is-danger .ms-kpi-icon { background: var(--ms-danger-soft); color: var(--ms-danger); }
.ms-kpi-card.is-info .ms-kpi-icon { background: var(--ms-info-soft); color: var(--ms-info); }
.ms-kpi-val {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ms-text);
  font-variant-numeric: tabular-nums;
}
.ms-kpi-card.is-danger .ms-kpi-val { color: var(--ms-danger); }
.ms-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ms-muted);
  line-height: 1.3;
}
.ms-kpi-sub {
  font-size: 11px;
  color: var(--ms-muted);
  line-height: 1.3;
}

/* Alert Banner */
.ms-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(29, 78, 216, 0.06) 100%);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--ms-text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.ms-alert-banner.is-warn {
  background: var(--ms-warning-soft);
  border-color: rgba(245, 158, 11, 0.35);
}
.ms-alert-banner.is-locked {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  cursor: default;
}
.ms-alert-banner strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
.ms-alert-banner small {
  display: block;
  font-size: 11.5px;
  color: var(--ms-muted);
  margin-top: 2px;
}

/* ======================== PROGRESS & PILLS ======================== */
.ms-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.ms-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
  transition: width 0.25s ease;
}
.ms-progress-fill.is-done { background: var(--ms-success); }
.ms-progress-fill.is-warn { background: var(--ms-warning); }
.ms-progress-fill.is-danger { background: var(--ms-danger); }

.ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.16);
  color: var(--ms-muted);
}
.ms-pill-accent { background: var(--ms-accent-soft); color: var(--ms-accent); }
.ms-pill-success { background: var(--ms-success-soft); color: var(--ms-success); }
.ms-pill-warning { background: var(--ms-warning-soft); color: #B45309; }
[data-theme="dark"] .ms-pill-warning, body.dark-theme .ms-pill-warning { color: #FBBF24; }
.ms-pill-danger { background: var(--ms-danger-soft); color: var(--ms-danger); }
.ms-pill-info { background: var(--ms-info-soft); color: var(--ms-info); }

/* ======================== PROJECT & DEPT CARDS ======================== */
.ms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-project-card {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--ms-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.ms-project-card:active {
  transform: scale(0.99);
}
.ms-project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ms-code {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ms-accent);
  background: var(--ms-accent-soft);
  padding: 3px 8px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.ms-project-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ms-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-project-meta {
  font-size: 12px;
  color: var(--ms-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ms-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ms-muted);
  margin-bottom: 4px;
}
.ms-progress-row strong {
  color: var(--ms-text);
  font-variant-numeric: tabular-nums;
}

/* Compact Progress Item inside Dashboard */
.ms-prog-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--ms-border);
  cursor: pointer;
}
.ms-prog-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.ms-prog-item:first-child {
  padding-top: 0;
}
.ms-scroll-list.is-scrollable {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}
.ms-scroll-list.is-scrollable::-webkit-scrollbar {
  width: 4px;
}
.ms-scroll-list.is-scrollable::-webkit-scrollbar-track {
  background: transparent;
}
.ms-scroll-list.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

/* ======================== DONUT & CHARTS ======================== */
.ms-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ms-donut {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-donut::after {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--ms-card);
}
.ms-donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}
.ms-donut-center strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ms-donut-center span {
  font-size: 10.5px;
  color: var(--ms-muted);
}
.ms-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ms-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.ms-legend-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ms-muted);
}
.ms-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ms-legend-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--ms-text);
}

/* 12-Month Scrollable Chart */
.ms-month-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.ms-month-scroll .exec-month-chart {
  min-width: 560px;
}
.ms-month-scroll .exec-series-legend {
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
}

/* ======================== PROJECT DETAIL ======================== */
.ms-detail-hero {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 18px;
  padding: 15px;
  box-shadow: var(--ms-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ms-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ms-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--ms-card);
}
.ms-ring strong {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ms-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ms-border);
}
.ms-fact small {
  display: block;
  font-size: 11px;
  color: var(--ms-muted);
}
.ms-fact strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ms-text);
  margin-top: 2px;
}

/* Task Cards */
.ms-task-card {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
}
.ms-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ms-task-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ms-text);
  line-height: 1.35;
}
.ms-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--ms-muted);
}
.ms-inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.ms-inline-actions .ms-btn {
  flex: 1;
  min-width: 0;
}

/* WBS Tree */
.ms-wbs-parent {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 14px;
  overflow: hidden;
}
.ms-wbs-parent summary {
  list-style: none;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
}
.ms-wbs-parent summary::-webkit-details-marker { display: none; }
.ms-wbs-children {
  border-top: 1px solid var(--ms-border);
  padding: 6px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--ms-card-subtle);
}
.ms-wbs-leaf {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  font-size: 12.5px;
}

/* Member / Rank / Calendar */
.ms-member-card {
  background: var(--ms-card);
  border: 1px solid var(--ms-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ms-rank-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ms-card-subtle);
  border: 1px solid var(--ms-border);
  margin-top: 8px;
}
.ms-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.ms-cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ms-muted);
  padding: 4px 0;
}
.ms-cal-day {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  font-size: 12px;
}
.ms-cal-day.is-empty {
  border-style: dashed;
  opacity: 0.25;
}
.ms-cal-day.is-rest {
  background: var(--ms-info-soft);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--ms-info);
}
.ms-cal-day.is-holiday {
  background: var(--ms-warning-soft);
  border-color: rgba(245, 158, 11, 0.45);
  color: #B45309;
}
[data-theme="dark"] .ms-cal-day.is-holiday, body.dark-theme .ms-cal-day.is-holiday {
  color: #FBBF24;
}
.ms-cal-day small {
  font-size: 9.5px;
  font-weight: 700;
}

/* Empty & Loading */
.ms-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--ms-muted);
  font-size: 13px;
  background: var(--ms-card);
  border: 1px dashed var(--ms-border);
  border-radius: 16px;
}
.ms-empty i {
  display: block;
  font-size: 26px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* ======================== THUMB-ZONE BOTTOM SHEET (Mẫu 3B) ======================== */
.ms-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: msFadeIn 0.16s ease;
}
.ms-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--ms-card);
  color: var(--ms-text);
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -14px 40px rgba(15, 23, 42, 0.22);
  animation: msSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ms-sheet-backdrop.is-top {
  align-items: flex-start;
  padding: calc(116px + env(safe-area-inset-top, 0px)) 14px 18px;
}
.ms-sheet.is-top {
  max-width: 402px;
  border-radius: 20px;
  padding: 16px 18px 18px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  animation: msSlideDown 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes msSlideDown {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ms-sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  margin: 0 auto 14px;
}
.ms-sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.ms-sheet-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.ms-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ms-tool-tile {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
  color: var(--ms-text);
}
.ms-tool-tile:active .ms-tool-icon {
  transform: scale(0.94);
}
.ms-tool-icon {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.12s ease;
}
.ms-tint-purple { background: #EDE9FE; color: #7C3AED; }
.ms-tint-blue { background: #DBEAFE; color: #2563EB; }
.ms-tint-mint { background: #D1FAE5; color: #059669; }
.ms-tint-indigo { background: #E0E7FF; color: #4F46E5; }
.ms-tint-sky { background: #E0F2FE; color: #0284C7; }
.ms-tint-amber { background: #FEF3C7; color: #D97706; }

[data-theme="dark"] .ms-tint-purple, body.dark-theme .ms-tint-purple { background: rgba(139, 92, 246, 0.22); color: #C4B5FD; }
[data-theme="dark"] .ms-tint-blue, body.dark-theme .ms-tint-blue { background: rgba(59, 130, 246, 0.22); color: #93C5FD; }
[data-theme="dark"] .ms-tint-mint, body.dark-theme .ms-tint-mint { background: rgba(16, 185, 129, 0.22); color: #6EE7B7; }
[data-theme="dark"] .ms-tint-indigo, body.dark-theme .ms-tint-indigo { background: rgba(99, 102, 241, 0.22); color: #A5B4FC; }
[data-theme="dark"] .ms-tint-sky, body.dark-theme .ms-tint-sky { background: rgba(14, 165, 233, 0.22); color: #7DD3FC; }
[data-theme="dark"] .ms-tint-amber, body.dark-theme .ms-tint-amber { background: rgba(245, 158, 11, 0.22); color: #FCD34D; }

.ms-tool-tile span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}
.ms-sheet-divider {
  height: 1px;
  background: var(--ms-border);
  margin: 6px 0 10px;
}
.ms-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-sheet-row {
  width: 100%;
  min-height: 48px;
  padding: 10px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ms-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ms-sheet-row:active {
  background: var(--ms-card-subtle);
}
.ms-sheet-row-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.ms-sheet-row-left i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--ms-muted);
}
.ms-sheet-row.is-danger, .ms-sheet-row.is-danger i {
  color: var(--ms-danger);
}

/* Toggle Switch */
.ms-switch {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: #CBD5E1;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.ms-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}
.ms-switch.is-on {
  background: var(--ms-accent);
}
.ms-switch.is-on::after {
  transform: translateX(19px);
}

/* Task Progress Pills inside Task Sheet */
.ms-prog-pills {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 12px;
}
.ms-prog-pill {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card-subtle);
  color: var(--ms-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ms-prog-pill.is-active {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
  color: #FFFFFF;
}
.ms-prog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ms-prog-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.ms-prog-pct {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ms-accent);
}
.ms-prog-pct.is-complete {
  color: var(--ms-success, #10B981);
}
.ms-prog-steps {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ms-muted);
}
.ms-seg-bar {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}
.ms-seg {
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--ms-border);
  background: var(--ms-card-subtle);
  padding: 0;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease;
}
.ms-seg:active:not(:disabled) {
  transform: scale(0.95);
}
.ms-seg.is-filled {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
}
.ms-seg-bar.is-complete .ms-seg.is-filled {
  background: var(--ms-success, #10B981);
  border-color: var(--ms-success, #10B981);
}
.ms-seg:disabled {
  cursor: default;
  opacity: 0.7;
}
.ms-prog-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--ms-muted);
  margin: 5px 0 14px;
  font-variant-numeric: tabular-nums;
}
.ms-status-grid {
  display: grid;
  grid-template-columns: repeat(var(--ms-st-cols, 3), minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}
.ms-status-grid .ms-btn {
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
}

/* ======================== EMBEDDED ATTENDANCE OVERRIDES ======================== */
.ms-att-host .att-spa-scope {
  min-height: 0 !important;
}
.ms-att-host .leader-layout.preview-mobile.ms-att-embedded {
  max-width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.ms-att-host .mobile-viewport.ms-att-embedded {
  min-height: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
.ms-att-host .mobile-shell.ms-att-embedded {
  max-width: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.ms-att-host .mobile-shell.ms-att-embedded .mobile-main {
  padding: 0 !important;
}
.ms-att-host .mobile-identity-bar,
.ms-att-host .mobile-topbar,
.ms-att-host .mobile-tab-nav,
body.phone-only-mode .att-spa-scope .mobile-tab-nav {
  display: none !important;
}

/* ======================== LEFT SLIDE-OUT SIDE DRAWER (Mẫu 3A) ======================== */
.ms-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 920;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-start;
  animation: msFadeIn 0.16s ease;
}
.ms-drawer {
  width: min(78%, 312px);
  height: 100%;
  background: var(--ms-card);
  color: var(--ms-text);
  border-radius: 0 24px 24px 0;
  padding: 14px 14px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 12px 0 36px rgba(15, 23, 42, 0.22);
  animation: msSlideRight 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ms-drawer-hero {
  position: relative;
  border-radius: 18px;
  padding: 18px 36px 18px 14px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 55%, #1D4ED8 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  margin-bottom: 16px;
}
.ms-drawer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.65);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ms-drawer-user {
  min-width: 0;
}
.ms-drawer-user strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-drawer-user small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.3;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 2px;
}
.ms-drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}
.ms-drawer-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.ms-drawer-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ms-muted);
  padding: 6px 10px 4px;
}
.ms-drawer-item {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ms-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.ms-drawer-item-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ms-drawer-item-left i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--ms-muted);
}
.ms-drawer-item.is-active {
  background: var(--ms-accent-soft);
  color: var(--ms-accent);
}
.ms-drawer-item.is-active .ms-drawer-item-left i {
  color: var(--ms-accent);
}
.ms-drawer-item:active {
  background: var(--ms-card-subtle);
}
.ms-drawer-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--ms-border);
}
.ms-drawer-item.is-danger,
.ms-drawer-item.is-danger .ms-drawer-item-left i {
  color: var(--ms-danger);
}

@keyframes msFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes msSlideUp {
  from { transform: translateY(32px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes msSlideRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ms-sheet-backdrop, .ms-sheet, .ms-drawer-backdrop, .ms-drawer, .ms-account-popover { animation: none !important; }
  .ms-switch, .ms-switch::after, .ms-theme-btn { transition: none !important; }
}
