:root {
  /* Modern Neutral Colors */
  --bg-color: #f3f4f6;
  --surface-color: #ffffff;
  --sidebar-bg: #111827;
  --sidebar-hover: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-text-active: #ffffff;
  
  /* Brand/Accent Palette (Blue modern) */
  --brand-primary: #3b82f6;
  --brand-hover: #2563eb;
  
  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --border-color: #e5e7eb;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Spacing */
  --sidebar-width: 260px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

/* --- Layout Wrapper --- */
#wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.25rem;
  text-decoration: none;
}
.sidebar-header:hover {
  color: #fff;
}
.sidebar-header i {
  color: var(--brand-primary);
  font-size: 1.5rem;
}

.sidebar-menu {
  padding: 1rem 0;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-menu li {
  padding: 0 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-link i {
  font-size: 1.1rem;
}

/* --- Main Content Area --- */
#content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Top Header */
.top-header {
  height: 70px;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background-color: var(--bg-color);
  color: var(--brand-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
}
.user-profile:hover {
  background: var(--bg-color);
}
.user-email-display {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Main Body */
main.container-fluid {
  padding: 2rem;
}

/* --- Cards --- */
.dashboard-card {
  background-color: var(--surface-color);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #f0fdf4; color: #22c55e; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }

.stat-title {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Mobile Sidebar Toggle */
#sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {
  #sidebar {
    position: absolute;
    left: calc(var(--sidebar-width) * -1);
  }
  #sidebar.show {
    left: 0;
  }
  #sidebar-toggle {
    display: flex;
  }
}