@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-glow: rgba(99,102,241,0.25);
  --secondary: #10B981;
  --secondary-glow: rgba(16,185,129,0.2);
  --danger: #EF4444;
  --danger-glow: rgba(239,68,68,0.2);
  --warning: #F59E0B;
  --warning-glow: rgba(245,158,11,0.2);
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-hover: #334155;
  --surface-elevated: #263146;
  --border: #334155;
  --border-subtle: #1E293B;
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

html { font-size: 15px; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Outfit', sans-serif; font-weight: 600; line-height: 1.2; }

::selection { background: var(--primary); color: white; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 0.9rem;
  border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 0 20px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 30px var(--primary-glow); transform: translateY(-1px); color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: white; box-shadow: 0 0 20px var(--danger-glow); }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--text-muted); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.input {
  width: 100%; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.input::placeholder { color: var(--text-muted); }
.input-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

textarea.input { resize: vertical; min-height: 120px; }

select.input { cursor: pointer; }

.form-group { margin-bottom: 20px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--secondary); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info { background: rgba(99,102,241,0.15); color: var(--primary); }
.badge-muted { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.stat-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-card-value { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.stat-card-change { font-size: 0.78rem; margin-top: 8px; }
.stat-card-change.up { color: var(--secondary); }
.stat-card-change.down { color: var(--danger); }

.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms cubic-bezier(0.34,1.56,0.64,1) forwards;
  max-width: 380px;
}
.toast-success { background: var(--secondary); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-warning { background: var(--warning); color: black; }
.toast-info { background: var(--primary); color: white; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px) scale(0.95); } }

.progress-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 600ms ease; }
.progress-fill.primary { background: linear-gradient(90deg, var(--primary), var(--primary-hover)); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #DC2626); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #D97706); }
.progress-fill.success { background: linear-gradient(90deg, var(--secondary), #059669); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: all 200ms ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; max-width: 560px; width: 100%;
  box-shadow: var(--shadow-lg); transform: scale(0.95); transition: transform 200ms ease;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.empty-state { text-align: center; padding: 60px 24px; }
.empty-state-icon { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.3; }
.empty-state-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }

.page-header { margin-bottom: 32px; }
.page-title { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { font-size: 0.88rem; color: var(--text-muted); }

.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.grid { display: grid; gap: 20px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) { .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } .grid-cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; } .card { padding: 16px; } .page-title { font-size: 1.3rem; } }

.text-primary { color: var(--text) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--secondary) !important; }
.text-warning { color: var(--warning) !important; }

.fade-in { animation: fadeIn 400ms ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }

.copy-feedback { font-size: 0.75rem; color: var(--secondary); margin-left: 6px; }

/* Password strength meter */
.strength-meter { display: flex; gap: 4px; margin-top: 8px; }
.strength-bar { height: 3px; flex: 1; border-radius: 2px; background: var(--border); transition: background var(--transition); }
.strength-bar.active.weak { background: var(--danger); }
.strength-bar.active.medium { background: var(--warning); }
.strength-bar.active.strong { background: var(--secondary); }
