/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--green);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-sidebar);
  margin-top: 1px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(200,216,204,.45);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 13.5px;
  font-weight: 450;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 7px;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 12.5px; color: #fff; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-sidebar); }

/* ─── Main ────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-date {
  font-size: 12.5px;
  color: var(--text-muted);
}

.content {
  padding: 28px;
  padding-bottom: 88px;
  flex: 1;
}

.page { display: none; }
.page.active { display: block; }

.row-3col { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }

/* ─── Collapsible nav groups ──────────────────────────────────────────── */
.nav-section-label.nav-collapsible {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 10px;
  border-radius: 5px;
  transition: background .15s;
}
.nav-section-label.nav-collapsible:hover {
  background: rgba(255,255,255,.05);
}
.nav-chevron {
  font-size: 8px;
  opacity: .55;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.nav-collapsible.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-group-body {
  overflow: hidden;
  max-height: 400px;
  transition: max-height .22s ease, opacity .18s ease;
  opacity: 1;
}
.nav-group-body.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Sub-items inside a group */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 22px;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(200,216,204,.75);
  font-size: 12.5px;
  font-weight: 400;
  transition: background .14s, color .14s;
  user-select: none;
}
.nav-sub-item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(200,216,204,.3);
  flex-shrink: 0;
  transition: background .14s, transform .14s;
}
.nav-sub-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-sub-item:hover::before { background: rgba(255,255,255,.5); }
.nav-sub-item.active {
  background: rgba(78,122,90,.35);
  color: #fff;
  font-weight: 500;
}
.nav-sub-item.active::before {
  background: #5DC780;
  transform: scale(1.3);
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #3d6248; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
