/* ========================================================
   COLLAPSIBLE SIDEBAR
   ======================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.mobile-sidebar-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: var(--transition);
  touch-action: manipulation;
}

.mobile-sidebar-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name span {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  align-self: flex-start;
}

.sidebar-nav-section {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px 6px;
  white-space: nowrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-weight: 600;
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.nav-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-btn-label {
  flex: 1;
  transition: opacity 0.2s;
}

.nav-btn-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-btn.active .nav-btn-badge {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-size: 11px;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.collapse-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--primary);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-btn-label,
body.sidebar-collapsed .nav-btn-badge,
body.sidebar-collapsed .user-meta {
  display: none !important;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
}

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

body.sidebar-collapsed .nav-btn {
  justify-content: center;
  padding: 12px 0;
}

body.sidebar-collapsed .collapse-btn svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .nav-btn[data-title]:hover::after {
  content: attr(data-title);
  position: absolute;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  background: #1e2230;
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
}

/* ========================================================
   MAIN WRAPPER & TOP ADMIN HEADER
   ======================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: var(--transition);
  background: var(--bg-base);
}

.admin-topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.hamburger-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hamburger-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: #818cf8;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb-root {
  color: var(--text-faint);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--text-faint);
  font-size: 11px;
}

.breadcrumb-active {
  color: var(--text-main);
  font-weight: 600;
}

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

.topbar-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.topbar-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* Admin Content Area */
.admin-content {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}
