/* ============================================================
   ARUJA Admin Dashboard Styles
   Vibrant Light Sidebar Layout + Colorful Accents
   ============================================================ */

/* --- Dashboard Layout --- */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--gradient-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: var(--topbar-height);
}
.sidebar-brand .brand-logo {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: var(--text-xl);
  color: var(--primary-700);
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}
.sidebar-brand .brand-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary-200);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-6) var(--space-3);
}

.nav-section {
  margin-bottom: var(--space-6);
}
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 12px var(--space-4);
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-base);
  margin-bottom: 4px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding-left: calc(var(--space-4) + 4px);
}
.nav-item:hover i { transform: scale(1.15); }

.nav-item.active {
  background: #ffffff;
  color: var(--primary-700);
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.nav-item.active i { color: var(--primary-600); }

.nav-badge {
  margin-left: auto;
  background: var(--accent-500);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--space-6) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
}
.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #ffffff;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--surface-bg);
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
}

.topbar-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.table td {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(99, 102, 241, 0.02); }
  color: var(--primary-600);
  border-color: var(--primary-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.topbar-btn .notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: var(--accent-500);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-2);
}

/* --- Content Area --- */
.content-area {
  padding: var(--space-6);
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}
.page-header h2 {
  font-size: var(--text-2xl);
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* --- Stat Grid Override --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

/* --- Quick Actions --- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}
.quick-action-btn i {
  font-size: 1.5rem;
  color: var(--primary-400);
}
.quick-action-btn:hover {
  background: rgba(99,102,241,0.08);
  border-color: var(--primary-500);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* --- Sidebar overlay for mobile --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-sticky) - 1);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: calc(var(--z-sticky) + 1);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .topbar-title { font-size: var(--text-lg); }
  .content-area { padding: var(--space-4); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
