.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  transition: grid-template-columns var(--motion-base) ease;
}

.app-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #121722 0%, #1a2330 100%);
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
  transition: width var(--motion-base) ease;
}

.sidebar-wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand {
  background:
    radial-gradient(circle at top right, rgba(239, 154, 35, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
}

.brand-logo {
  display: inline-flex;
  align-items: center;
}

.brand-logo__img {
  width: min(100%, 180px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
  transition: width var(--motion-base) ease;
}

.sidebar-brand a {
  color: #ffffff;
}

.sidebar-brand p {
  color: var(--color-sidebar-muted) !important;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  color: rgba(205, 214, 228, 0.82);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer {
  color: var(--color-sidebar-muted) !important;
  border-top-color: rgba(255, 255, 255, 0.16) !important;
}

.offcanvas {
  background: linear-gradient(180deg, #121722 0%, #1a2330 100%);
  color: #ffffff;
}

.offcanvas .offcanvas-header {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.offcanvas-title__brand {
  display: inline-flex;
  align-items: center;
}

.offcanvas-title__logo {
  width: min(100%, 156px);
  height: auto;
}

.offcanvas .btn-close {
  filter: invert(1) grayscale(1) brightness(220%);
}

.offcanvas .sidebar-wrap {
  height: 100%;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  background: rgba(255, 255, 255, 0.92);
  min-height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(10px);
  border-bottom-color: #d5e0f4 !important;
}

.app-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--color-brand), var(--color-accent-orange), var(--color-accent-teal));
}

.header-utility {
  background: linear-gradient(90deg, rgba(60, 93, 170, 0.08), rgba(239, 154, 35, 0.08));
}

.header-logo {
  width: 130px;
  height: auto;
}

.app-content {
  padding: var(--space-4);
  flex: 1;
  min-width: 0;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px 1fr;
}

body.sidebar-collapsed .brand-logo {
  justify-content: center;
  width: 100%;
}

body.sidebar-collapsed .brand-logo__img {
  width: 42px;
}

body.sidebar-collapsed .sidebar-brand {
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

body.sidebar-collapsed .sidebar-nav {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

body.sidebar-collapsed .sidebar-section-label {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.app-footer {
  background: rgba(255, 255, 255, 0.88);
  border-top-color: #d5e0f4 !important;
}

@media (max-width: 991.98px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-content {
    padding: var(--space-3);
  }
}
