@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: #07070e;
  --bg2: #0d0d1c;
  --card: #101020;
  --card2: #14142a;
  --border: #1e1e38;
  --border2: #2a2a4a;
  --text: #eeeeff;
  --text2: #9090bb;
  --text3: #55557a;
  --accent: #7c3aed;
  --accent2: #6d28d9;
  --accent-dim: rgba(124,58,237,.12);
  --green: #10b981;
  --green-dim: rgba(16,185,129,.12);
  --red: #ef4444;
  --yellow: #f59e0b;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 10px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Auth ───────────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,58,237,.18) 0%, transparent 70%);
}

.auth-box {
  width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
}

.brand { text-align: center; margin-bottom: 32px; }

.brand-icon {
  width: 52px; height: 52px;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.brand-sub { font-size: 12px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 1.5px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }

input[type=text],input[type=password] {
  width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .18s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost { background: transparent; color: var(--text3); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.btn-full { width: 100%; justify-content: center; padding: 11px 18px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* ── Layout ──────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

.header-brand { display: flex; align-items: center; gap: 12px; }
.header-icon {
  width: 32px; height: 32px; background: var(--accent-dim);
  border: 1px solid var(--border2); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.header-name { font-weight: 700; font-size: 15px; }
.header-user { font-size: 12px; color: var(--text3); }

.header-right { display: flex; align-items: center; gap: 14px; }

.main { padding: 32px; max-width: 1100px; margin: 0 auto; }

/* ── Status hero ─────────────────────────────────────── */
.status-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 24px;
  gap: 20px;
}

.status-info { display: flex; align-items: center; gap: 18px; }

.status-dot {
  width: 18px; height: 18px; border-radius: 50%;
  flex-shrink: 0;
  background: #6b7280;
  box-shadow: 0 0 0 rgba(107,114,128,0);
  transition: all .3s;
}
.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 16px rgba(16,185,129,.6);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%,100% { box-shadow: 0 0 8px rgba(16,185,129,.5); }
  50% { box-shadow: 0 0 20px rgba(16,185,129,.9); }
}

.status-label { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.status-label.live { color: var(--green); }
.status-label.offline { color: var(--text3); }
.status-sub { font-size: 13px; color: var(--text2); margin-top: 3px; }

.status-uptime {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text2);
  text-align: right;
}
.status-uptime-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; text-align: right; }

/* ── Stats grid ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color .18s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { border-color: var(--border2); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.stat-card.active::before { opacity: 1; }

.stat-icon { font-size: 20px; margin-bottom: 12px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text3); font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; font-family: var(--mono); margin-top: 4px; }
.stat-unit { font-size: 12px; color: var(--text3); font-weight: 400; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── Chart card ──────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 14px; font-weight: 600; }
.chart-sub { font-size: 12px; color: var(--text3); }
canvas { width: 100% !important; }

/* ── Connection info ─────────────────────────────────── */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.info-card-title { font-size: 14px; font-weight: 600; margin-bottom: 18px; }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.6;
}
.info-key { font-size: 12px; color: var(--text2); }

.info-val {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--bg2);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 13px; padding: 3px 6px; border-radius: 4px;
  transition: color .18s;
}
.copy-btn:hover { color: var(--accent); }

/* ── Guide ───────────────────────────────────────────── */
.guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.guide-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.guide-step { display: flex; gap: 14px; margin-bottom: 14px; }
.guide-num {
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--accent-dim); border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
}
.guide-text { font-size: 13px; color: var(--text2); }
.guide-text strong { color: var(--text); }
.guide-code {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  color: var(--text);
  word-break: break-all;
}

/* ── Misc ────────────────────────────────────────────── */
.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 18px;
  font-size: 13px; color: var(--text); z-index: 999;
  animation: slideIn .2s ease;
}
.toast.success { border-color: rgba(16,185,129,.35); color: var(--green); }
.toast.error { border-color: rgba(239,68,68,.35); color: var(--red); }

@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
