/* App Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
}

/* Sidebar */
.app-sidebar {
  background: var(--sidebar-bg);
  color: #8292ad;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 40;
}

/* Brand Logo (Fragger Style) */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  padding: 0 6px;
  cursor: pointer;
  text-align: left;
}

.brand-logo-img {
  height: 38px;
  max-width: 120px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--blue);
  color: #fff;
  clip-path: polygon(18% 0, 100% 0, 78% 100%, 0 100%);
  font-style: italic;
  font-size: 21px;
  font-weight: 800;
}

.brand small {
  display: block;
  font: 600 8px 'DM Sans', sans-serif;
  letter-spacing: 0.34em;
  color: #8290a8;
}

/* Nav Sections */
.nav-section-title {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #556885;
  margin: 20px 10px 8px;
  font-weight: 700;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: #93a2bb;
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.nav-item .badge {
  margin-left: auto;
  background: #234476;
  color: #dbe7ff;
  padding: 2px 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.nav-item.active .badge {
  background: var(--blue);
  color: #fff;
}

.nav-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Main Content Area */
.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
}

/* Top Navigation Bar */
.topbar {
  height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 19px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-banner {
  background: linear-gradient(90deg, #ff4655, #bd3c49);
  color: #fff;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(255, 70, 85, 0.25);
}

.preview-banner button {
  background: #ffffff22;
  border: 1px solid #ffffff55;
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}

/* Page Content View */
.content-area {
  padding: 32px;
  flex: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left 0.3s ease;
  }

  .app-sidebar.open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .content-area {
    padding: 20px 16px;
  }

  .topbar {
    padding: 0 16px;
  }
}
