:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.1);
  --secondary-color: #10b981;
  --dark-bg: #0f172a;
  --dark-card: rgba(30, 41, 59, 0.7);
  --light-bg: #f8fafc;
  --light-card: rgba(255, 255, 255, 0.8);
  --text-dark: #f8fafc;
  --text-light: #1e293b;
  --text-muted-dark: #94a3b8;
  --text-muted-light: #64748b;
  --border-dark: rgba(255, 255, 255, 0.1);
  --border-light: rgba(0, 0, 0, 0.08);
  
  --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);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-light);
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

.dark-mode {
  background-color: var(--dark-bg);
  color: #ffffff;
}

.dark-mode h1, 
.dark-mode h2, 
.dark-mode h3, 
.dark-mode h4, 
.dark-mode h5, 
.dark-mode h6,
.dark-mode p,
.dark-mode li,
.dark-mode ul,
.dark-mode label,
.dark-mode .form-label {
  color: #ffffff !important;
}

.dark-mode .text-muted {
  color: #cbd5e1 !important;
}

.dark-mode input::placeholder {
  color: #94a3b8 !important;
}

/* Glassmorphic Cards */
.card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background-color: var(--light-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode .card {
  background-color: var(--dark-card);
  border: 1px solid var(--border-dark);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
  background-color: #f1f5f9;
  z-index: 1;
}

body.dark-mode .login-container {
  background: radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.2), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
  background-color: #020617;
}

/* Abstract blobs for login background */
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.6;
  animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
  top: 10%;
  left: 20%;
  width: 400px;
  height: 400px;
  background: rgba(79, 70, 229, 0.4);
  border-radius: 50%;
}

.blob-2 {
  bottom: 10%;
  right: 20%;
  width: 500px;
  height: 500px;
  background: rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  animation-delay: -5s;
}

body.dark-mode .blob-1 { background: rgba(79, 70, 229, 0.25); }
body.dark-mode .blob-2 { background: rgba(16, 185, 129, 0.15); }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -50px) scale(1.1); }
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 3rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  z-index: 2;
  position: relative;
}

.dark-mode .login-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Form Controls */
.form-control-custom {
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  background-color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.form-control-custom:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-light);
  background-color: #fff;
  transform: translateY(-1px);
}

.dark-mode .form-control-custom {
  background-color: rgba(15, 23, 42, 0.6);
  border-color: var(--border-dark);
  color: var(--text-dark);
}

.dark-mode .form-control-custom:focus {
  background-color: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

/* Buttons */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
  border: none;
  color: white;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-primary-custom:active {
  transform: translateY(0);
}

.btn-oauth {
  background-color: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  border: 1px solid var(--border-light);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-oauth:hover {
  background-color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dark-mode .btn-oauth {
  background-color: rgba(30, 41, 59, 0.8);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

.dark-mode .btn-oauth:hover {
  background-color: rgba(51, 65, 85, 0.9);
}

.oauth-icon {
  width: 22px;
  height: 22px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.8rem 0;
  color: var(--text-muted-light);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.dark-mode .divider { color: var(--text-muted-dark); }
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}
.dark-mode .divider::before, .dark-mode .divider::after {
  border-bottom-color: var(--border-dark);
}
.divider::before { margin-right: 1em; }
.divider::after { margin-left: 1em; }

/* Sidebar */
.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 1px 0 15px rgba(0,0,0,0.02);
}

.dark-mode .sidebar {
  background: rgba(15, 23, 42, 0.85);
  border-right: 1px solid var(--border-dark);
  box-shadow: 1px 0 25px rgba(0,0,0,0.2);
}

.main-content {
  margin-left: 280px;
  padding: 40px;
  min-height: 100vh;
  position: relative;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .topbar {
  border-bottom-color: var(--border-dark);
}

/* Nav Items */
.nav-item-custom {
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--text-muted-light);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.dark-mode .nav-item-custom {
  color: var(--text-muted-dark);
}

.nav-item-custom:hover, .nav-item-custom.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateX(4px);
}

.dark-mode .nav-item-custom:hover, .dark-mode .nav-item-custom.active {
  background-color: rgba(79, 70, 229, 0.2);
  color: #818cf8;
}

/* Stat Icons */
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.3s ease;
}

.card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Badges */
.badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .dark-mode .sidebar {
    border-bottom: 1px solid var(--border-dark);
  }
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  .blob { display: none; } /* Hide blobs on mobile to prevent overflow */
}
