/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: all var(--transition-normal); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--cyan-500));
  opacity: 0; transition: opacity var(--transition-normal);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--green-400); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--purple-400); }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--blue-400); }
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: var(--yellow-400); }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: var(--cyan-400); }
.stat-info { flex: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1.2; margin-top: 4px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600; transition: all var(--transition-fast);
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(135deg, var(--green-600), var(--green-500)); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-glow-green); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-light); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red-400); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.7rem 1rem;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 120px; resize: vertical; }

/* ===== SEARCH ===== */
.search-box { position: relative; max-width: 400px; }
.search-box input {
  width: 100%; padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 0.9rem;
}
.search-box svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 200; display: none; align-items: center; justify-content: center;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); width: 90%; max-width: 560px;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-xl);
  animation: modal-in 0.25s ease;
}
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 1rem; text-align: left; font-size: 0.875rem; }
th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem; border-bottom: 1px solid var(--border-color); }
td { border-bottom: 1px solid var(--border-color); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green-400); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red-400); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue-400); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow-400); }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--purple-400); }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.85rem 1.25rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--text-primary); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 0.5rem;
  animation: slide-in-right 0.3s ease; min-width: 280px;
}
.toast.success { border-left: 3px solid var(--green-500); }
.toast.error { border-left: 3px solid var(--red-500); }
.toast.info { border-left: 3px solid var(--blue-500); }

/* ===== GROUP CARD ===== */
.group-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.25rem;
  transition: all var(--transition-normal); cursor: pointer;
}
.group-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.group-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.group-avatar {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.group-name { font-weight: 600; font-size: 0.95rem; }
.group-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.group-actions { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border-color); }

/* ===== TOGGLE ===== */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--bg-input); border-radius: var(--radius-full);
  border: 1px solid var(--border-color); transition: all var(--transition-fast);
}
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted);
  transition: all var(--transition-fast);
}
.toggle input:checked + .toggle-slider { background: var(--green-600); border-color: var(--green-500); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); background: #fff; }

/* ===== MEMBER LIST ===== */
.member-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border-color); }
.member-item:last-child { border-bottom: none; }
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.member-info { flex: 1; }
.member-name { font-size: 0.85rem; font-weight: 500; }
.member-phone { font-size: 0.75rem; color: var(--text-muted); }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; }
.tab {
  padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); background: transparent; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all var(--transition-fast);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--green-400); border-bottom-color: var(--green-500); }

/* ===== LOADING ===== */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border-color); border-top-color: var(--green-500); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== RANKING ===== */
.rank-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.rank-item:last-child { border-bottom: none; }
.rank-pos {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; background: var(--bg-input); color: var(--text-secondary);
}
.rank-pos.gold { background: rgba(245,158,11,0.2); color: var(--yellow-400); }
.rank-info { flex: 1; }
.rank-name { font-size: 0.875rem; font-weight: 500; }
.rank-count { font-size: 0.75rem; color: var(--text-muted); }
.progress-bar { height: 6px; background: var(--bg-input); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--green-600), var(--green-400)); transition: width 0.5s ease; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state h4 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ===== ANIMATIONS ===== */
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
