html, body {
  overscroll-behavior: none;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  z-index: 30;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f16001 0%, #e85002 65%, #c10801 100%);
  color: var(--primary-fg);
  box-shadow: inset 0 1px 0 rgba(249, 249, 249, 0.34), 0 0 20px -4px rgba(232, 80, 2, 0.65);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand-tag { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 8px 4px;
}
.nav-group-label:first-child { margin-top: 2px; }

.nav-item {
  position: relative;
  width: 100%;
  min-block-size: 40px;
  padding: 8px 11px;
  border: none;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background-color 160ms var(--ease-spring), color 160ms var(--ease-spring), box-shadow 180ms var(--ease-spring), transform 150ms var(--ease-spring);
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item:active { transform: scale(0.96); }
.nav-item.active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.nav-item.active svg {
  color: var(--primary);
}
.nav-item-subtle { color: var(--muted); }

.nav-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--warn-soft);
  color: var(--warn);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  isolation: isolate;
}

/* Ambient orange-ember backlit glow tipis di sudut workspace */
.workspace::before {
  content: '';
  position: fixed;
  top: -140px;
  right: -100px;
  width: 540px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    rgba(241, 96, 1, 0.16) 0%,
    rgba(193, 8, 1, 0.08) 46%,
    transparent 74%
  );
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}

.topbar {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.breadcrumb { margin: 0; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.page-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.25; }
.topbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.content {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

.view { display: none; }
.view.active {
  display: block;
  animation: viewEnter 200ms var(--ease-spring) both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}
.mobile-only { display: none; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 34, 31, 0.42);
  z-index: 25;
}

/* Desktop app-shell: sidebar terkunci diam, hanya .workspace yang scroll independen */
@media (min-width: 981px) {
  body,
  .app-shell {
    height: 100dvh;
    overflow: hidden;
  }

  .workspace {
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  /* Beranda terkunci 100dvh di desktop — tanpa vertical scroll / scrollbar */
  body.is-dashboard .workspace {
    overflow: hidden;
  }

  body.is-dashboard .content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: clamp(18px, 2.4vh, 26px) 28px 24px;
    display: flex;
    flex-direction: column;
  }

  body.is-dashboard #view-dashboard.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
  }

  body.is-dashboard #view-dashboard .hero-banner {
    margin-bottom: clamp(20px, 2.8vh, 28px);
  }

  body.is-dashboard #view-dashboard .section-head {
    margin-bottom: 12px;
  }

  body.is-dashboard #view-dashboard .pillar-grid {
    margin-bottom: 16px;
  }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-modal);
  }
  .sidebar.open { transform: translateX(0); }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .topbar-right { width: 100%; }
  .topbar-right .btn { flex: 1; }
  .content { padding: 18px 16px 48px; }
}
