@media (max-width: 760px) {
  .sidebar { z-index: 50; left: -320px; width: min(310px, 88vw); padding: 18px 12px 14px; box-shadow: 20px 0 55px rgba(6,34,112,.25); transition: left .25s cubic-bezier(.22,.8,.25,1); }
  .sidebar.open { left: 0; }
  .sidebar-backdrop { z-index: 49; background: rgba(6,34,112,.42); backdrop-filter: blur(3px); }
  .sidebar-header { padding-bottom: 20px; }
  .sidebar-nav { margin-top: 20px; }
  .nav-item { min-height: 44px; padding: 11px 12px; font-size: .82rem; }
  .topbar { position: sticky; top: 0; z-index: 15; min-height: 70px; padding: 0 16px; box-shadow: 0 5px 20px rgba(6,34,112,.04); }
  .topbar-left { gap: 10px; }
  .topbar-left .icon-button { width: 38px; height: 38px; color: var(--brand-navy, #062270); background: #fff; border-color: #e5eaf2; border-radius: 11px; font-size: 17px; }
  .page-context strong { font-size: .88rem; }
  .content-area { padding: 25px 15px 42px; }
  .page-heading-row { gap: 14px; margin-bottom: 21px; }
  .page-heading-row h1 { font-size: clamp(1.8rem, 9vw, 2.35rem); }
  .page-heading-row > .primary-button, .page-heading-row > .secondary-button { width: 100%; }
  .topbar-actions { gap: 7px; }
  .topbar-actions .round-action { display: none; }
}
@media (max-width: 420px) { .content-area { padding-inline: 12px; } .welcome-banner { border-radius: 16px; } .stats-grid { gap: 8px; } .stat-card { padding: 13px; } }

/* Topbar utilities and the account popover */
.topbar-actions {
  position: relative;
}

.topbar-refresh {
  color: var(--dash-navy);
  font-size: 1.15rem;
  transition: transform .2s ease, color .2s ease, background .2s ease;
}

.topbar-refresh:hover {
  color: var(--brand-orange, #ff6500);
  background: #fff4ec;
}

.topbar-refresh.is-refreshing {
  color: var(--brand-orange, #ff6500);
  animation: dashboard-spin .8s linear infinite;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.profile-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 12px);
  right: 0;
  width: 286px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 31, 53, .18);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu-label {
  margin: 0 6px 10px;
  color: #98a5b4;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.profile-menu-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f7f9fc;
  border-radius: 10px;
}

.profile-menu-avatar {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--brand-orange, #ff6500);
  border-radius: 11px;
  font-size: .72rem;
  font-weight: 850;
}

.profile-menu-identity > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.profile-menu-identity strong,
.profile-menu-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-identity strong {
  color: var(--dash-navy);
  font-size: .75rem;
}

.profile-menu-identity span {
  margin-top: 2px;
  color: #8c9aaa;
  font-size: .63rem;
}

.profile-menu-divider {
  height: 1px;
  margin: 12px 2px 7px;
  background: var(--dash-line);
}

.profile-menu-action {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px 8px;
  color: var(--dash-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 750;
}

.profile-menu-action:hover {
  color: var(--brand-orange, #ff6500);
  background: #f7f9fc;
}

.profile-menu-action > span {
  display: grid;
  width: 20px;
  place-items: center;
  color: #8c9aaa;
}

.profile-menu-logout {
  color: #c45b4f;
}

.profile-menu-logout:hover {
  color: #a83f35;
  background: #fff4f2;
}

@media (max-width: 760px) {
  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions .topbar-refresh {
    display: inline-grid;
  }

  .profile-menu {
    right: -6px;
    width: min(286px, calc(100vw - 24px));
  }
}
