@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg:       #070710;
  --bg2:      #0d0d1a;
  --surface:  #111127;
  --card:     #14142a;
  --card2:    #1a1a35;
  --border:   #1e1e3d;
  --border2:  #2a2a50;
  --accent:   #4f8eff;
  --accent-hover: #3a75e0;
  --accent2:  #00d9a3;
  --accent3:  #ff5e87;
  --accent4:  #ffb344;
  --text:     #e2e2f5;
  --text2:    #9494b8;
  --text3:    #5a5a7a;
  --easy:     #00d9a3;
  --medium:   #ffb344;
  --hard:     #ff5e87;
  --win:      #ffd700;
  --font:     'Outfit', sans-serif;
  --mono:     'JetBrains Mono', monospace;
  --radius:   8px;
  --sidebar-w: 240px;
  --topbar-h:  56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s; }
.sidebar-header { height: var(--topbar-h); padding: 0 20px; display: flex; align-items: center; border-bottom: 1px solid var(--border); font-size: 20px; font-weight: 700; }
.sidebar-header span { color: var(--accent); }
.nav { flex: 1; padding: 20px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; padding: 12px 20px; color: var(--text2); font-weight: 500; transition: all 0.2s; gap: 12px; }
.nav-item:hover, .nav-item.active { background: var(--surface); color: #fff; border-right: 3px solid var(--accent); }
.nav-item svg { width: 18px; height: 18px; }

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); background: rgba(7, 7, 16, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 90; }
.page-header { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.user-menu { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

.content-area { padding: 30px; flex: 1; overflow-y: auto; }

/* Buttons & Inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: var(--radius); border: none; cursor: pointer; transition: all 0.2s; white-space: nowrap; outline: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(79, 142, 255, 0.3); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--card); border-color: var(--border2); }
.btn-danger { background: var(--accent3); color: #fff; }
.btn-success { background: var(--accent2); color: #fff; }
.btn-gold { background: var(--win); color: #000; }

.input-group { margin-bottom: 16px; }
.input-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text2); font-weight: 500; }
.input-field { width: 100%; font-family: var(--font); background: var(--bg); border: 1px solid var(--border); color: #fff; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; transition: border-color 0.2s; }
.input-field:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(79, 142, 255, 0.2); }
select.input-field { cursor: pointer; max-height: 40px;}

/* Cards & Badges */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.card-title { font-size: 18px; font-weight: 600; margin: 0; }

.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-blue { background: rgba(79, 142, 255, 0.1); color: var(--accent); }
.badge-green { background: rgba(0, 217, 163, 0.1); color: var(--accent2); }
.badge-red { background: rgba(255, 94, 135, 0.1); color: var(--accent3); }
.badge-orange { background: rgba(255, 179, 68, 0.1); color: var(--accent4); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 12px; border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { background: var(--surface); color: var(--text2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; position: sticky; top: 0; z-index: 10; cursor: pointer; user-select: none; }
.table th:hover { color: var(--accent); }
.table tbody tr:hover { background: var(--surface); }
.table td { font-size: 14px; font-weight: 500; }
.table .num { font-family: var(--mono); text-align: right; }
.table th.num { text-align: right; }

/* Utilities */
.flx { display: flex; }
.flx-col { flex-direction: column; }
.ai-c { align-items: center; }
.jc-sb { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text2); }
.text-mono { font-family: var(--mono); }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border-left: 4px solid var(--accent); color: #fff; padding: 12px 20px; border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-size: 14px; font-weight: 500; animation: slideIn 0.3s ease forwards; display: flex; align-items: center; justify-content: space-between; min-width: 250px; }
.toast.success { border-left-color: var(--accent2); }
.toast.error { border-left-color: var(--accent3); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* Sidebar Widget */
.api-widget { background: var(--bg); margin: 20px; padding: 15px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 13px; }
.api-widget-title { color: var(--text2); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; font-size: 11px; }
.api-widget-val { font-family: var(--mono); font-size: 16px; color: #fff; font-weight: 600; margin-bottom: 4px; }
.api-widget-sub { color: var(--text3); font-size: 12px; }

/* Responsive */
.mobile-toggle { display: none; background: transparent; border: none; color: #fff; font-size: 24px; cursor: pointer; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 5px 0 20px rgba(0,0,0,0.5); }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: block; }
}
