/* ===========================================================================
   Paynovate Brand Hub — application shell
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--pv-font);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--pv-ink);
  background: var(--pv-surface);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  background: var(--pv-purple);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}
.sidebar__logo { height: 26px; width: auto; display: block; }
.sidebar__sub {
  font-size: var(--fs-micro); text-transform: uppercase;
  letter-spacing: .22em; color: rgba(255,255,255,.5);
}

.sidebar__nav { padding: var(--sp-2) var(--sp-3) var(--sp-7); }
.nav-group { margin-top: var(--sp-5); }
.nav-group:first-child { margin-top: var(--sp-2); }
.nav-group__label {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .13em;
  color: rgba(255,255,255,.42); padding: 0 var(--sp-3); margin-bottom: var(--sp-2);
}
.nav-link {
  display: block;
  padding: 9px var(--sp-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: rgba(255,255,255,.74);
  font-size: 14px;
  transition: background .14s ease, color .14s ease;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.is-active {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--pv-magenta);
}

/* ---------- Main ---------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(249, 248, 252, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pv-line);
  padding: var(--sp-4) var(--sp-7);
}
.topbar__crumb {
  font-size: var(--fs-micro); text-transform: uppercase;
  letter-spacing: .12em; color: var(--pv-ink-soft);
}
.topbar__title {
  font-size: var(--fs-h2); font-weight: 600;
  color: var(--pv-purple); letter-spacing: -.02em; margin-top: 1px;
}
.topbar__desc { font-size: var(--fs-small); color: var(--pv-ink-soft); margin-top: 3px; }

.page { padding: var(--sp-7); max-width: 1180px; }

/* ---------- Placeholder / loading ---------- */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: 52vh; gap: var(--sp-2); color: var(--pv-ink-soft);
}
.placeholder__icon {
  font-size: 26px; color: var(--pv-purple-tint); margin-bottom: var(--sp-2);
}
.placeholder strong { color: var(--pv-purple); font-size: var(--fs-h3); }

/* ---------- Mobile nav (hamburger + off-canvas drawer) ---------- */
.layout__hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 30;
  width: 42px; height: 42px;
  border: 0; border-radius: 10px;
  background: var(--pv-purple); color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(23,23,25,.18);
}
.layout__hamburger svg { width: 20px; height: 20px; }
.layout__backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(23,23,25,.45);
  z-index: 15;
  opacity: 0;
  transition: opacity .2s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout__hamburger { display: inline-flex; align-items: center; justify-content: center; }

  .sidebar {
    position: fixed; top: 0; left: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 32px rgba(0,0,0,.30);
  }
  .layout.is-nav-open .sidebar { transform: translateX(0); }
  .layout.is-nav-open .layout__backdrop { display: block; opacity: 1; }

  .main { width: 100%; min-width: 0; }
  .topbar { padding: var(--sp-3) var(--sp-5) var(--sp-3) 68px; }
  .topbar__title { font-size: 22px; }
  .topbar__desc { display: none; }
  .page { padding: var(--sp-5) var(--sp-4); }
}

@media (max-width: 560px) {
  /* Allow wide template surfaces to scroll horizontally rather than overflow */
  .stage { overflow-x: auto; padding: var(--sp-4); }
  .topbar { padding-left: 64px; }
  .topbar__title { font-size: 19px; }
  .page-intro h1 { font-size: 32px; }
}
