.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.24s ease;
  overflow-y: auto;
}

.brand-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--blue-600) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-en);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
}

.brand-role {
  font-family: var(--font-en);
  font-size: 0.72rem;
  color: var(--blue-600);
  font-weight: 700;
}

.sidebar-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--navy-900);
  font-size: 0.95rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-tab-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  margin-bottom: 12px;
}

.tab-switch-btn {
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tab-switch-btn:hover {
  color: var(--navy-900);
}

.tab-switch-btn.is-active {
  background: var(--blue-600);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease;
  width: 100%;
  text-align: left;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--blue-600);
}

.nav-item:hover svg {
  color: var(--blue-600);
}

.nav-item.active {
  background: var(--navy-900);
  color: #FFFFFF;
}

.nav-item.active svg {
  color: #FFFFFF;
}

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.admin-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.admin-profile-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-900), var(--blue-600));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.admin-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.admin-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role-text {
  font-family: var(--font-en);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue-600);
}

.sidebar-settings-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 41, 66, 0.06);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-settings-icon-btn svg {
  width: 17px;
  height: 17px;
}

.sidebar-settings-icon-btn:hover {
  background: var(--bg-soft);
  color: var(--blue-600);
}

.sidebar-settings-icon-btn.active {
  background: var(--blue-600);
  color: #FFFFFF;
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.scroll-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
  transition: width 0.08s linear;
}

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

.menu-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--navy-900);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.menu-toggle-btn:hover {
  background: var(--bg-soft);
  color: var(--blue-600);
}

.menu-toggle-btn svg {
  width: 19px;
  height: 19px;
}

.topbar-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-900);
}

.topbar-tab-tag {
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--blue-600);
}

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

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--blue-600);
  font-size: 0.8rem;
  font-weight: 700;
}

.topbar-chip svg {
  width: 14px;
  height: 14px;
}

.admin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  background: var(--bg-page);
  border-radius: var(--radius-pill);
}

.page-content {
  padding: 24px 28px 36px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 218px;
  }

  .topbar {
    padding: 0 18px;
  }

  .page-content {
    padding: 20px 18px 28px;
  }

  .topbar-chip {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 12px 0 32px rgba(15, 41, 66, 0.16);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 41, 66, 0.45);
    backdrop-filter: blur(3px);
    z-index: 45;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-tab-switch {
    display: none;
  }

  .menu-toggle-btn {
    display: inline-flex;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
    height: 58px;
  }

  .topbar-title {
    font-size: 1.02rem;
  }

  .topbar .admin-meta {
    display: none;
  }

  .admin-pill {
    padding: 4px;
  }

  .page-content {
    padding: 16px 16px 28px;
  }
}