:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --green: #4ade80;
  --red: #f87171;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav {
  display: flex; align-items: center; gap: 2rem;
  padding: .75rem 2rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand-icon { background: var(--accent); color: var(--bg); border-radius: 6px; padding: 2px 7px; font-weight: 900; font-size: .9rem; font-family: monospace; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; flex: 1; }
.nav-links a { color: var(--muted); font-size: .9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { margin-left: auto; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; border: none; transition: .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #7dd3fc; text-decoration: none; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1.5rem; }
.ml { margin-left: .75rem; }

/* HERO */
.hero { text-align: center; padding: 5rem 2rem 3rem; max-width: 760px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(56,189,248,.12); color: var(--accent); border: 1px solid rgba(56,189,248,.3); border-radius: 99px; padding: .25rem .9rem; font-size: .8rem; font-weight: 600; margin-bottom: 1.5rem; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-snippet { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; text-align: left; position: relative; }
.snippet-label { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.snippet-code { font-family: monospace; font-size: .82rem; color: var(--accent); white-space: pre-wrap; word-break: break-all; }
.copy-btn { position: absolute; top: .75rem; right: .75rem; background: var(--bg3); color: var(--muted); border: none; border-radius: 6px; padding: .2rem .6rem; font-size: .78rem; cursor: pointer; }
.copy-btn:hover { color: var(--text); }

/* FEATURES STRIP */
.features-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: center; padding: 1.5rem 2rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg2); }
.feature { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.icon { font-size: 1rem; }

/* SECTIONS */
.section { padding: 5rem 2rem; }
.section-alt { background: var(--bg2); }
.container { max-width: 1100px; margin: 0 auto; }
.text-center { text-align: center; }
.section-title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.dash-body .card { background: var(--bg3); }
.card-icon { font-size: 1.5rem; margin-bottom: .75rem; }
.card h3 { font-size: 1rem; margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .9rem; }
.code-block { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; text-align: left; max-width: 600px; margin: 0 auto; }
.code-block pre { font-family: monospace; font-size: .85rem; color: var(--accent); white-space: pre-wrap; }

/* FOOTER */
.footer { border-top: 1px solid var(--border); padding: 1.5rem 2rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; max-width: 1100px; margin: 0 auto; font-size: .85rem; color: var(--muted); }
.footer-inner a { color: var(--muted); }

/* ── DASHBOARD ── */
.dash-body { background: var(--bg); min-height: 100vh; }
.dash-layout { display: flex; min-height: 100vh; }

.sidebar { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; background: var(--bg2); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.sidebar-section { display: flex; flex-direction: column; gap: .5rem; }
.sidebar-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.site-list { display: flex; flex-direction: column; gap: .25rem; }
.site-item { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; border-radius: 6px; cursor: pointer; font-size: .85rem; color: var(--muted); transition: .1s; }
.site-item:hover { background: var(--bg3); color: var(--text); }
.site-item.active { background: rgba(56,189,248,.15); color: var(--accent); font-weight: 600; }
.site-item .site-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.add-site-btn { text-align: left; margin-top: .25rem; }
.range-btns { display: flex; gap: .3rem; }
.range-btn { background: var(--bg3); border: none; color: var(--muted); border-radius: 6px; padding: .25rem .6rem; font-size: .82rem; cursor: pointer; }
.range-btn.active { background: var(--accent); color: var(--bg); font-weight: 700; }
.loading-pulse { color: var(--muted); font-size: .82rem; padding: .4rem .6rem; }

.dash-main { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; overflow-x: hidden; }
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.dash-title { font-size: 1.4rem; font-weight: 700; }
.dash-domain { color: var(--muted); font-size: .85rem; }
.realtime-badge { display: flex; align-items: center; gap: .4rem; background: var(--bg2); border: 1px solid var(--border); border-radius: 99px; padding: .3rem .85rem; font-size: .82rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.green { background: var(--green); animation: pulse 2s infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-val { font-size: 1.75rem; font-weight: 700; margin-top: .2rem; }

.dash-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
.legend { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 400; }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; }
.leg-dot.blue { background: var(--accent); }
.leg-dot.green { background: var(--green); }
.chart-wrap { height: 200px; position: relative; }
canvas { width: 100% !important; height: 100% !important; }

.bottom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table tr { border-bottom: 1px solid var(--border); }
.data-table tr:last-child { border-bottom: none; }
.data-table td, .data-table th { padding: .45rem .25rem; }
.data-table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.data-table td:last-child { text-align: right; color: var(--muted); }
.empty { color: var(--muted); font-size: .82rem; padding: 1rem 0; }
.full-table { min-width: 400px; }

.snippet-panel .dash-card { border-color: var(--accent); }
.snippet-block { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-family: monospace; font-size: .78rem; color: var(--accent); white-space: pre-wrap; word-break: break-all; margin-top: .5rem; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: .75rem; }
.modal h3 { font-size: 1.1rem; font-weight: 700; }
.modal label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; color: var(--text); font-size: .9rem; width: 100%; margin-top: .2rem; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }
