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

:root {
  --bg:       #0d1117;
  --bg2:      #161b22;
  --bg3:      #1c2333;
  --hover:    #21262d;
  --border:   #30363d;
  --gold:     #f0b90b;
  --gold-bg:  rgba(240,185,11,0.1);
  --text:     #e6edf3;
  --muted:    #8b949e;
  --green:    #3fb950;
  --red:      #f85149;
  --blue:     #58a6ff;
  --font:     'Inter', sans-serif;
  --mono:     'JetBrains Mono', monospace;
  --r:        8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 220px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 50;
}
.sidebar-logo {
  padding: 20px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px;
}
.logo-icon { width: 30px; height: 30px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; color: #000; }
.sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r); color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500; margin-bottom: 2px; transition: all 0.15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(240,185,11,0.2); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); }

/* Main */
.main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.live-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.content { padding: 24px; flex: 1; }

/* Cards */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 40px; height: 40px; background: var(--gold-bg); border: 1px solid rgba(240,185,11,0.2); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.stat-value { font-size: 20px; font-weight: 700; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Table */
.card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg2); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid rgba(48,54,61,.5); transition: background .1s; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child { border-bottom: none; }
td { padding: 10px 16px; font-size: 13px; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-ok  { background: rgba(63,185,80,.15); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
.badge-err { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.badge-warn{ background: rgba(240,185,11,.15); color: var(--gold); border: 1px solid rgba(240,185,11,.3); }
.badge-info{ background: rgba(88,166,255,.15); color: var(--blue); border: 1px solid rgba(88,166,255,.3); }

/* Buttons */
.btn { padding: 7px 14px; border-radius: var(--r); border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--font); transition: all .15s; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: #ffe066; }
.btn-danger { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.btn-danger:hover { background: rgba(248,81,73,.3); }
.btn-ghost { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--gold); }

/* Form */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: .5px; }
.form-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; transition: border-color .15s; }
.form-input:focus { border-color: var(--gold); }

/* Hash */
.mono { font-family: var(--mono); font-size: 12px; color: var(--gold); }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 36px; width: 360px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { width: 48px; height: 48px; font-size: 20px; margin: 0 auto 10px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-logo p { color: var(--muted); font-size: 13px; }
.error-msg { background: rgba(248,81,73,.1); border: 1px solid rgba(248,81,73,.3); color: var(--red); padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; font-size: 13px; }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--bg3); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--r); padding: 12px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.5); transform: translateY(60px); opacity: 0; transition: all .3s; z-index: 999; }
.toast.show { transform: translateY(0); opacity: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
