@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Design Tokens ──────────────────────────────────────── */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --brand-50: #f0f4f8; --brand-100: #d9e2ec; --brand-200: #bcccdc;
  --brand-300: #9fb3c8; --brand-400: #829ab1; --brand-500: #627d98;
  --brand-600: #486581; --brand-700: #334e68; --brand-800: #243b53; --brand-900: #102a43;
  --accent-400: #5c7c9a; --accent-500: #486581; --accent-600: #334e68;
  --success-400: #57a773; --success-500: #3f8a5a; --success-600: #2d6a4f;
  --warning-400: #d4a84b; --warning-500: #b8922e;
  --danger-400: #c05454; --danger-500: #a63d3d;
  --surface-0: #111214; --surface-50: #16181a; --surface-100: #1c1e21;
  --surface-200: #242628; --surface-300: #2d2f32; --surface-400: #3a3c3f;
  --surface-500: #4a4c50; --surface-600: #6b6e73; --surface-700: #8a8d93;
  --surface-800: #b0b3b8; --surface-900: #d1d4d8; --surface-950: #eceef0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2); --shadow-md: 0 2px 8px rgba(0,0,0,0.25); --shadow-lg: 0 4px 16px rgba(0,0,0,0.3);
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px; --radius-full: 9999px;
}

/* ─── Base ────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); background: var(--surface-0); color: var(--surface-900); min-height: 100vh; line-height: 1.6; }
a { color: inherit; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-100); }
::-webkit-scrollbar-thumb { background: var(--surface-400); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-500); }

/* ─── Card ───────────────────────────────────────────────── */
.glass-card { background: var(--surface-100); border: 1px solid var(--surface-300); border-radius: var(--radius-lg); transition: border-color 0.15s ease; }
.glass-card:hover { border-color: var(--surface-400); }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-slide-up { animation: slideInUp 0.35s ease-out forwards; }
.stagger-1 { animation-delay: 0.03s; } .stagger-2 { animation-delay: 0.06s; }
.stagger-3 { animation-delay: 0.09s; } .stagger-4 { animation-delay: 0.12s; }
.stagger-5 { animation-delay: 0.15s; } .stagger-6 { animation-delay: 0.18s; }
.skeleton { background: linear-gradient(90deg, var(--surface-200) 25%, var(--surface-300) 50%, var(--surface-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: var(--radius-sm); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-sans); font-weight: 500; font-size: 14px; line-height: 1; padding: 10px 20px; border-radius: var(--radius-md); border: none; cursor: pointer; transition: all 0.15s ease; text-decoration: none; white-space: nowrap; user-select: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-primary:active:not(:disabled) { background: var(--brand-800); }
.btn-secondary { background: var(--surface-300); color: var(--surface-900); border: 1px solid var(--surface-400); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-400); }
.btn-ghost { background: transparent; color: var(--surface-800); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-200); color: var(--surface-900); }
.btn-danger { background: var(--danger-500); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--danger-400); }
.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-lg { font-size: 15px; padding: 12px 24px; border-radius: var(--radius-md); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--surface-800); letter-spacing: 0.01em; }
.form-input, textarea.form-input { font-family: var(--font-sans); font-size: 14px; padding: 10px 14px; background: var(--surface-200); border: 1px solid var(--surface-400); border-radius: var(--radius-md); color: var(--surface-950); outline: none; transition: border-color 0.15s; }
.form-input::placeholder { color: var(--surface-600); }
.form-input:focus { border-color: var(--brand-500); }
.form-error { font-size: 12px; color: var(--danger-400); }
.form-hint { font-size: 12px; color: var(--surface-700); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-sm); letter-spacing: 0.02em; text-transform: uppercase; }
.badge-brand { background: rgba(72,101,129,0.2); color: var(--brand-400); }
.badge-success { background: rgba(63,138,90,0.2); color: var(--success-400); }
.badge-warning { background: rgba(184,146,46,0.2); color: var(--warning-400); }
.badge-danger { background: rgba(166,61,61,0.2); color: var(--danger-400); }
.badge-accent { background: rgba(72,101,129,0.15); color: var(--accent-400); }
.badge-neutral { background: var(--surface-300); color: var(--surface-800); }

/* ─── Progress Bar ───────────────────────────────────────── */
.progress-bar { width: 100%; height: 4px; background: var(--surface-300); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--brand-500); border-radius: var(--radius-full); transition: width 0.4s ease; }
.progress-bar-fill.success { background: var(--success-500); }

/* ─── Stat Card ──────────────────────────────────────────── */
.stat-card { padding: 20px; border-radius: var(--radius-lg); background: var(--surface-100); border: 1px solid var(--surface-300); transition: border-color 0.15s; }
.stat-card:hover { border-color: var(--surface-400); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--surface-700); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--surface-950); line-height: 1.1; }
.stat-value.brand { color: var(--surface-950); }
.stat-sub { font-size: 12px; color: var(--surface-700); margin-top: 4px; }

/* ─── Layout ─────────────────────────────────────────────── */
.page-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.section-title { font-size: 17px; font-weight: 600; color: var(--surface-950); margin-bottom: 16px; }
.section-subtitle { font-size: 13px; color: var(--surface-700); margin-top: -12px; margin-bottom: 16px; }

/* ─── Table ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--surface-700); padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--surface-300); }
.data-table td { font-size: 13px; padding: 10px 14px; color: var(--surface-900); border-bottom: 1px solid var(--surface-200); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-50); }

/* ─── Alert Messages ────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--danger-400); }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: var(--success-400); }

/* ─── Role Toggle ────────────────────────────────────────── */
.role-toggle { display: flex; background: var(--surface-200); border-radius: var(--radius-md); padding: 3px; margin-bottom: 24px; }
.role-toggle button { flex: 1; padding: 8px 0; border-radius: var(--radius-sm); border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--font-sans); background: transparent; color: var(--surface-700); transition: all 0.2s ease; }
.role-toggle button.active { background: var(--brand-600); color: white; }

/* ─── Two-column grid ───────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-container { padding: 16px; }
  .stat-value { font-size: 22px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .desktop-nav { display: none !important; }
  .mobile-menu-btn { display: block !important; }
}
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}
