/* MathFilm — shared app shell (topbar, colors, layout chrome)
   Chuẩn shell: user/shell/ — trang gốc /user/home */

@import url('../shell/tokens.css');
@import url('../shell/layout.css');
@import url('../shell/artboard-unified.css');
@import url('phone.css');

html,
body.user-shell {
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif);
}

:root {
  --type-title: 24px;
  --type-body: 20px;
  --type-meta: 18px;
  --fs-nav: var(--shell-nav-fs);
  --fs-body: var(--type-body);
  --fs-sm: var(--type-body);
  --fs-xs: var(--type-meta);
  --blue: #2f6bff;
  --blue-2: #5b8cff;
  --blue-light: #7aa4ff;
  --orange: #ff7a3d;
  --orange-2: #ff9a5c;
  --orange-soft: #ffe4d4;
  --blue-gradient: linear-gradient(165deg, #5b8cff 0%, #2f6bff 50%, #ff7a3d 120%);
  --blue-gradient-soft: linear-gradient(128deg, #7aa4ff 0%, #5b8cff 42%, #2f6bff 100%);
  --blue-gradient-banner: linear-gradient(90deg, #1a4a8c 0%, #2f6bff 48%, #ff7a3d 100%);
  --blue-gradient-btn: linear-gradient(135deg, #2f6bff 0%, #3d7aff 48%, #ff7a3d 100%);
  --navy: #0f2942;
  --navy-mid: #1a3d5c;
  --teal: #4db6ac;
  --teal-dark: #3da89e;
  --teal-soft: #e8f6f4;
  --text: #1e3a5f;
  --muted: #5a7194;
  --line: #d0dced;
  --line-soft: #e8f1ff;
  --bg: #d4e4f8;
  --panel: rgba(255, 255, 255, 0.55);
  --shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 12px 28px rgba(15, 35, 60, 0.1);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.7) inset, 0 18px 40px rgba(15, 35, 60, 0.12);
  --card-radius: 14px;
  --button-radius: 10px;
  --page-gutter-bottom: 20px;
}

.user-shell .viewport {
  background: transparent;
}

.user-shell .topbar,
body.user-shell > .topbar,
body.shell-topbar-pinned > .topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  transform: none !important;
  scale: none !important;
  zoom: normal !important;
  z-index: 1000 !important;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  height: var(--shell-topbar-h) !important;
  min-height: var(--shell-topbar-h) !important;
  max-height: var(--shell-topbar-h) !important;
  padding: 0 var(--shell-topbar-pad-right, var(--shell-topbar-pad-x)) 0 var(--shell-topbar-pad-left, var(--shell-topbar-pad-x)) !important;
  background: #fff !important;
  border-bottom: 1px solid #e8edf3 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  --fs-nav: var(--shell-nav-fs);
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
  font-size: var(--shell-nav-fs) !important;
  line-height: 1.2 !important;
  visibility: visible !important;
  opacity: 1 !important;
  view-transition-name: mathfilm-topbar;
}

/* Soft nav: topbar đứng yên, nội dung đổi nhẹ */
html.soft-nav-enabled {
  view-transition-name: none;
}

@view-transition {
  navigation: none;
}

::view-transition-group(mathfilm-topbar) {
  animation-duration: 0.01ms;
  z-index: 1001;
}

::view-transition-old(mathfilm-topbar),
::view-transition-new(mathfilm-topbar) {
  animation: none;
  mix-blend-mode: normal;
  height: 100%;
  overflow: clip;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 160ms;
  animation-timing-function: ease;
}

::view-transition-old(root) {
  animation-name: soft-nav-fade-out;
}

::view-transition-new(root) {
  animation-name: soft-nav-fade-in;
}

@keyframes soft-nav-fade-out {
  to { opacity: 0; }
}

@keyframes soft-nav-fade-in {
  from { opacity: 0; }
}

html.soft-nav-busy,
html.soft-nav-busy body {
  cursor: progress;
}

/* Soft-nav: ẩn nội dung (giữ topbar) tới khi CSS trang mới + artboard scale xong */
html.soft-nav-pending body.user-shell > *:not(header.topbar):not(#account-panel) {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Campus overlay nằm ngoài .viewport — ẩn trước khi campus.css kịp apply */
body.campus-page > .overlay:not(.open) {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Hide in-flow/scaled copies until JS pins topbar to body */
.artboard .topbar,
.layout > .topbar,
.curriculum-layout > .topbar {
  visibility: hidden !important;
  pointer-events: none !important;
}

.user-shell .layout {
  display: flex;
  flex-direction: column;
  padding-top: var(--shell-topbar-h);
  min-height: 100%;
}

/* Fixed topbar placeholder when still under .layout (pre-pin) */
.user-shell .layout > .topbar {
  flex: 0 0 0;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.user-shell .brand,
body.shell-topbar-pinned > .topbar .brand,
body.user-shell > .topbar .brand {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  color: var(--navy);
  font-family: var(--shell-brand-font, "Outfit", "Manrope", system-ui, sans-serif) !important;
  font-weight: var(--shell-brand-weight, 700) !important;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none !important;
}

.user-shell .brand strong,
body.shell-topbar-pinned > .topbar .brand strong,
body.user-shell > .topbar .brand strong {
  font-family: var(--shell-brand-font, "Outfit", "Manrope", system-ui, sans-serif) !important;
  font-size: var(--shell-nav-fs) !important;
  font-weight: var(--shell-brand-weight, 700) !important;
  letter-spacing: -0.02em;
  line-height: 1.1 !important;
  white-space: nowrap;
}

.user-shell .brand-mark,
body.shell-topbar-pinned > .topbar .brand-mark,
body.user-shell > .topbar .brand-mark {
  width: var(--shell-brand-mark-size, 20px) !important;
  height: var(--shell-brand-mark-size, 20px) !important;
  border-radius: 5px !important;
  background: var(--blue-gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--shell-brand-font, "Outfit", "Manrope", system-ui, sans-serif) !important;
  font-size: var(--shell-brand-mark-fs, 11px) !important;
  font-weight: var(--shell-brand-weight, 700) !important;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.user-shell .menu {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  overflow: visible;
  padding: 0;
  height: 100%;
}

.user-shell .menu > a,
.user-shell .nav-drop-trigger,
body.shell-topbar-pinned > .topbar .menu > a,
body.shell-topbar-pinned > .topbar .nav-drop-trigger,
body.user-shell > .topbar .menu > a,
body.user-shell > .topbar .nav-drop-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 5px;
  flex-shrink: 0;
  height: auto;
  margin: 0;
  padding: 0 8px !important;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
  font-size: var(--shell-nav-fs) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
  line-height: 1.1 !important;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.user-shell .menu > a svg,
.user-shell .nav-drop-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-shell .menu > a.is-active,
.user-shell .nav-drop-trigger.is-active,
.user-shell .nav-drop.is-active > .nav-drop-trigger,
body.shell-topbar-pinned > .topbar .menu > a.is-active,
body.shell-topbar-pinned > .topbar .nav-drop-trigger.is-active,
body.shell-topbar-pinned > .topbar .nav-drop.is-active > .nav-drop-trigger,
body.user-shell > .topbar .menu > a.is-active,
body.user-shell > .topbar .nav-drop-trigger.is-active,
body.user-shell > .topbar .nav-drop.is-active > .nav-drop-trigger {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.user-shell .menu > a:hover,
.user-shell .nav-drop-trigger:hover,
body.shell-topbar-pinned > .topbar .menu > a:hover,
body.shell-topbar-pinned > .topbar .nav-drop-trigger:hover,
body.user-shell > .topbar .menu > a:hover,
body.user-shell > .topbar .nav-drop-trigger:hover {
  color: var(--blue);
}

.user-shell .nav-drop {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  height: 100%;
  z-index: 1;
}

.user-shell .nav-drop.is-open {
  z-index: 630;
}

.user-shell .nav-drop-caret {
  width: 10px;
  height: 10px;
  opacity: 0.7;
  transition: transform 160ms ease;
}

.user-shell .nav-drop.is-open .nav-drop-caret {
  transform: rotate(180deg);
}

.user-shell .nav-drop-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 640;
  min-width: 0;
  width: max-content;
  max-width: min(92vw, 280px);
  margin-top: 0;
  padding: 4px 6px;
  border: 1px solid #d9e4f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-shell .nav-drop-menu[hidden] {
  display: none !important;
}

.user-shell .nav-drop-item,
.user-shell .nav-drop-item:link,
.user-shell .nav-drop-item:visited,
.user-shell .nav-drop-item:hover,
.user-shell .nav-drop-item:focus,
.user-shell .nav-drop-item.is-active {
  display: flex !important;
  align-items: center !important;
  align-self: auto !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--text) !important;
  font: inherit !important;
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
  font-size: var(--shell-nav-fs) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
}

.user-shell .nav-drop-item:hover,
.user-shell .nav-drop-item.is-active {
  background: #f1f6ff !important;
  color: var(--blue) !important;
}

.user-shell .nav-drop-num {
  flex: 0 0 1.1em;
  width: 1.1em;
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted, #5a7194);
  text-align: right;
}

.user-shell .nav-drop-item.is-active .nav-drop-num,
.user-shell .nav-drop-item:hover .nav-drop-num {
  color: var(--blue);
}

.user-shell .nav-drop-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-shell .account-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  justify-self: end;
  flex-shrink: 0;
}

.user-shell .shell-budget {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid #fde68a;
  border-radius: 5px;
  background: #fffbeb;
  color: #b45309;
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.user-shell .shell-budget:hover {
  border-color: #fbbf24;
  background: #fef3c7;
  color: #92400e;
}

.user-shell .shell-budget svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #d97706;
}

.user-shell .account {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: min(180px, 30vw);
  padding: 2px 6px 2px 8px;
  border: 1px solid #d9e4f5;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
}

.user-shell .account.is-open {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.user-shell .account .phone {
  min-width: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px !important;
  font-family: var(--font-body, "Manrope", "Segoe UI", system-ui, sans-serif) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.user-shell .avatar {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 10px !important;
  font-weight: 700;
  background: var(--blue-gradient);
  box-shadow: none;
}

.user-shell .caret {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  color: #8da0bf;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-shell .account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 600;
  min-width: 220px;
  padding: 6px;
  border: 1px solid #d9e4f5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.user-shell .account-menu[hidden] {
  display: none !important;
}

.user-shell .account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: var(--type-meta);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.user-shell .account-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-shell .account-menu-item:hover {
  background: #f1f6ff;
  color: var(--blue);
}

.user-shell .account-menu-item--danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.user-shell .account-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: #e8edf3;
}

.user-shell .billing-amount-card,
.user-shell .billing-confirm-card,
.user-shell .billing-history-btn {
  border-color: #cfe0ff;
}

.user-shell .billing-quick-btn {
  border-color: #d4e4f8;
  background: #f8fbff;
}

.user-shell .billing-quick-btn.is-active {
  border-color: var(--blue);
  background: #eef4ff;
  color: var(--blue);
}

.user-shell .account {
  border-color: #d9e4f5;
}

@media (max-width: 1100px) {
  :root {
    --fs-nav: 20px;
  }

  .user-shell .topbar {
    gap: 8px;
    padding: 0 var(--shell-topbar-pad-right, var(--shell-viewport-gutter)) 0 var(--shell-topbar-pad-left, var(--shell-viewport-gutter)) !important;
  }

  .user-shell .brand strong,
  body.shell-topbar-pinned > .topbar .brand strong,
  body.user-shell > .topbar .brand strong {
    font-size: var(--shell-nav-fs) !important;
  }

  .user-shell .menu > a {
    padding: 8px 8px 10px;
    gap: 5px;
  }

  .user-shell .menu > a span {
    display: none;
  }

  .user-shell .nav-drop-trigger {
    padding: 8px 8px 10px;
    gap: 5px;
  }

  .user-shell .nav-drop-trigger > span {
    display: none;
  }

  .user-shell .shell-budget {
    padding: 6px 10px;
    font-size: var(--type-meta);
  }

  .user-shell .shell-budget svg {
    width: 16px;
    height: 16px;
  }

  .user-shell .account .phone {
    max-width: 100px;
    font-size: var(--type-meta);
  }
}

/* —— Home hero banner —— */

.home-hero-banner {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.home-hero-banner img {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* —— Home dashboard (overview + sidebar) —— */

.home-top-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 10px;
  align-items: stretch;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.home-side-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.overview-head {
  display: none;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 8px 10px 7px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.14) 0 50px, transparent 52px),
    var(--blue-gradient, linear-gradient(180deg, #5b9dff 0%, #3b82f6 52%, #2563eb 100%));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
  color: #fff;
  text-align: center;
}

.overview-stat-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.overview-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.overview-stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-stat--total .overview-stat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fecaca;
}

.overview-stat--fav .overview-stat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fde68a;
}

.overview-stat--paid .overview-stat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #bfdbfe;
}

.overview-stat--month .overview-stat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}

.overview-stat strong {
  font-size: var(--type-title);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.overview-stat--total strong {
  color: #0f172a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.overview-stat--fav strong {
  color: #38bdf8;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.overview-stat--paid strong {
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.overview-stat--month strong {
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.overview-stat-label {
  width: 100%;
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-stat-note {
  width: 100%;
  font-size: var(--type-meta);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-side-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 0;
  height: 100%;
  padding: 8px 10px 7px;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.14) 0 50px, transparent 52px),
    var(--blue-gradient, linear-gradient(180deg, #5b9dff 0%, #3b82f6 52%, #2563eb 100%));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.balance-side-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.balance-side-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fde68a;
}

.balance-side-label {
  width: 100%;
  margin: 0;
  font-size: var(--type-body);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.94;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-side-value {
  margin: 0;
  font-size: var(--type-title);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.balance-side-sub {
  width: 100%;
  margin: 0;
  font-size: var(--type-meta);
  font-weight: 600;
  opacity: 0.78;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mascot-deco-card {
  padding: 0;
  border: 1px solid rgba(207, 224, 255, 0.9);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

@media (max-width: 1100px) {
  .home-top-grid {
    grid-template-columns: 1fr;
  }

  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-side-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .overview-stats,
  .home-side-col {
    grid-template-columns: 1fr;
  }
}


/* —— Dark topbar: gradient chrome + high-contrast nav —— */
html[data-theme="dark"] .user-shell .topbar,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar,
html[data-theme="dark"] body.user-shell > .topbar {
  background:
    radial-gradient(ellipse 70% 160% at 6% 50%, rgba(255, 122, 61, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 180% at 88% 40%, rgba(91, 157, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 40% 120% at 50% 120%, rgba(47, 107, 255, 0.12), transparent 60%),
    linear-gradient(105deg, #0a1424 0%, #121f36 38%, #162848 68%, #0e1a2e 100%) !important;
  border-bottom: 1px solid rgba(91, 157, 255, 0.28) !important;
  backdrop-filter: blur(14px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.1) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .user-shell .brand strong,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .brand strong,
html[data-theme="dark"] body.user-shell > .topbar .brand strong {
  color: #f2f7ff !important;
}

html[data-theme="dark"] .user-shell .menu > a,
html[data-theme="dark"] .user-shell .nav-drop-trigger,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .menu > a,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .nav-drop-trigger,
html[data-theme="dark"] body.user-shell > .topbar .menu > a,
html[data-theme="dark"] body.user-shell > .topbar .nav-drop-trigger {
  color: #c9d8ef !important;
}

html[data-theme="dark"] .user-shell .menu > a.is-active,
html[data-theme="dark"] .user-shell .nav-drop-trigger.is-active,
html[data-theme="dark"] .user-shell .nav-drop.is-active > .nav-drop-trigger,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .menu > a.is-active,
html[data-theme="dark"] body.user-shell > .topbar .menu > a.is-active {
  color: #ffffff !important;
  border-bottom-color: #ff7a3d !important;
}

html[data-theme="dark"] .user-shell .menu > a:hover,
html[data-theme="dark"] .user-shell .nav-drop-trigger:hover,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .menu > a:hover,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .nav-drop-trigger:hover {
  color: #ffffff !important;
  border-bottom-color: rgba(91, 157, 255, 0.75) !important;
}

html[data-theme="dark"] .user-shell .account,
html[data-theme="dark"] .user-shell .shell-budget,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .account,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .shell-budget {
  background: linear-gradient(165deg, rgba(30, 48, 78, 0.95), rgba(18, 32, 54, 0.92)) !important;
  border-color: rgba(91, 157, 255, 0.3) !important;
  color: #e8eef8 !important;
}

html[data-theme="dark"] .user-shell .account .phone,
html[data-theme="dark"] body.shell-topbar-pinned > .topbar .account .phone {
  color: #d5e2f5 !important;
}

html[data-theme="dark"] .user-shell .shell-budget:hover {
  border-color: rgba(255, 122, 61, 0.55) !important;
  color: #ffb088 !important;
}

html[data-theme="dark"] .user-shell .nav-drop-menu {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 122, 61, 0.14), transparent 55%),
    linear-gradient(180deg, #15233a 0%, #101b2e 100%) !important;
  border-color: rgba(91, 157, 255, 0.28) !important;
}

html[data-theme="dark"] .user-shell .nav-drop-item,
html[data-theme="dark"] .user-shell .nav-drop-item:link,
html[data-theme="dark"] .user-shell .nav-drop-item:visited {
  color: #e2ebf8 !important;
}

html[data-theme="dark"] .user-shell .nav-drop-item:hover,
html[data-theme="dark"] .user-shell .nav-drop-item.is-active {
  background: linear-gradient(90deg, rgba(255, 122, 61, 0.16), rgba(91, 157, 255, 0.18)) !important;
  color: #ffffff !important;
}

.mf-onboarding-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 13050;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 29, 42, 0.94);
  color: #f7faff;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  text-align: center;
  box-shadow:
    0 12px 28px rgba(15, 41, 66, 0.28),
    0 4px 12px rgba(47, 107, 255, 0.18);
  animation: mf-onboarding-toast-in 0.2s ease;
}

.mf-onboarding-toast.is-leaving {
  animation: mf-onboarding-toast-out 0.18s ease forwards;
}

@keyframes mf-onboarding-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes mf-onboarding-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

