:root {
  --bg: #f8faf9;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border: #e8f0ec;
  --fg: #1a2e23;
  --muted: #6b8f7a;
  --accent: #22c55e;
  --accent-dark: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.1);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Space Grotesk', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d1ddd6; border-radius: 3px; }

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-elevated);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 6px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-item.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.nav-item svg { flex-shrink: 0; }

/* Cards */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.06);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, transparent 50%, var(--accent-soft) 50%);
  border-radius: 0 20px 0 0;
}

.stat-card:hover { transform: translateY(-4px); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid var(--bg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--bg);
}
.data-table tr:hover td { background: rgba(34, 197, 94, 0.03); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--fg); }

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--bg); color: var(--fg); }
.icon-btn-sm { width: 36px; height: 36px; }

/* Search */
.search-input {
  background: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 12px 16px 12px 48px;
  color: var(--fg);
  width: 100%;
  max-width: 320px;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border-radius: 16px;
  padding: 8px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  font-weight: 500;
}
.dropdown-item:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* Progress */
.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* Avatar */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.avatar-sm { width: 40px; height: 40px; font-size: 13px; }

/* Notification */
.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeInUp 0.5s ease forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Responsive */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}