*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  min-height: 100vh;
  font-family: 'Figtree', 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
input, select, button, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.5); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

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

.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  padding: 20px 16px 16px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-bdr);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px;
  border-bottom: 1px solid var(--sidebar-bdr);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo-name,
.page-intro h1,
.topbar-title {
  font-family: 'Outfit', 'Figtree', sans-serif;
}

.logo-name {
  font-size: 1.08rem;
  font-weight: 700;
}

.logo-sub,
.nav-group-label,
.sidebar-footer-label,
.user-role {
  font-size: 0.68rem;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group-label {
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--sidebar-txt);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.88;
}

.nav-item:hover {
  color: var(--sidebar-txt-a);
  background: var(--sidebar-hover);
}

.nav-item.active {
  color: var(--sidebar-txt-a);
  background: var(--sidebar-act);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.sidebar-cta {
  padding: 4px;
}

.sidebar-entry,
.sidebar-footer {
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--sidebar-bdr);
  color: var(--text-3);
  line-height: 1.6;
  font-size: 0.8rem;
}

.right-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--topbar-bdr);
}

.topbar-left,
.topbar-right,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar-title {
  font-size: 1.34rem;
  font-weight: 700;
}

.topbar-subtitle {
  color: var(--text-3);
  font-size: 0.88rem;
}

.topbar-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.topbar-home-link { white-space: nowrap; }

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-name {
  font-size: 0.94rem;
  font-weight: 700;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.main > .page {
  max-width: 1440px;
  margin: 0 auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeUp 0.22s ease; }

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

.page-shell,
.nw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 28px;
}

.page-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-intro h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.page-intro p {
  color: var(--text-3);
  font-size: 0.92rem;
  line-height: 1.5;
}

.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--foreground);
  border-radius: 999px;
  transition: all 0.2s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 30;
}

.sidebar-overlay.visible { display: block; }
.bottom-nav { display: none; }
