/* Shared app shell: top bar + sidebar + mobile drawer */
/* Topbar ≈ 87% of marketing logo height; sidebar one step up — keeps hierarchy cohesive */
:root {
  --logo-mark-height-topbar: clamp(32px, 0.63rem + 4.14vw, 39px);
  --logo-mark-max-width-topbar: min(276px, 66vw);
  --logo-mark-height-sidebar: clamp(39px, 0.92rem + 3.22vw, 51px);
  --logo-mark-max-width-sidebar: min(299px, 100%);
}
.app-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  flex-wrap: wrap;
}
.topbar-brand-mini {
  display: none;
  align-items: center;
  align-self: center;
  gap: 8px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary, #0a0a0a);
  text-decoration: none;
}
/* Compact top bar: slightly smaller than main nav; still matches ~0.875rem util links */
.topbar-brand-mini.logo--platform-mark {
  padding: 0;
  border-radius: 0;
}
.topbar-brand-mini.logo--platform-mark .logo-platform-img {
  height: var(--logo-mark-height-topbar);
  width: auto;
  max-width: var(--logo-mark-max-width-topbar);
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-drawer-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-primary, #0a0a0a);
}
.nav-drawer-toggle:hover { background: var(--bg-warm, #fafafa); }
.topbar-util {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
}
.topbar-util a {
  color: var(--text-secondary, #525252);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 4px;
  white-space: nowrap;
}
.topbar-util a:hover { color: var(--text-primary, #0a0a0a); }
.topbar-util a[aria-current="page"] { color: var(--accent, #D7263D); }
.dashboard-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}
.sidebar {
  z-index: 50;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 80;
}
.sidebar-overlay.is-open { display: block; }
@media (max-width: 900px) {
  .nav-drawer-toggle { display: inline-flex; }
  .topbar-brand-mini { display: flex; }
  .dashboard-layout { flex-direction: row; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    box-shadow: none;
    z-index: 100;
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  }
  .main {
    flex: 1;
    width: 100%;
    max-width: none !important;
    padding: 24px 18px 48px !important;
  }
  .topbar-util {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    padding-top: 4px;
    border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  }
}

/* Sidebar wordmark: a touch larger than top bar; requires css/platform-logo.css on the page. */
.sidebar-logo.logo--platform-mark {
  gap: 0;
  align-items: center;
}
.sidebar-logo.logo--platform-mark .logo-platform-img {
  height: var(--logo-mark-height-sidebar);
  width: auto;
  max-width: var(--logo-mark-max-width-sidebar);
  border-radius: 0;
  object-fit: contain;
}
