:root {
  --bg: #0b0f19;
  --bg-soft: #121826;
  --card: #161d2e;
  --border: #26304a;
  --text: #e8ecf4;
  --muted: #9aa6bf;
  --brand: #4f8cff;
  --brand-2: #8b5cf6;
  --accent: #4f8cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #17233d 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(11, 15, 25, .8);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #ffffff; font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .08s ease, box-shadow .2s ease;
  color: #ffffff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.btn:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 8px 24px rgba(79, 140, 255, .3); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--accent); box-shadow: none; }
.btn.danger { background: transparent; color: var(--err); border-color: #43304a; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Hero ── */
.hero { padding: 84px 0 60px; }
.hero h1 { font-size: 46px; line-height: 1.1; margin: 0 0 18px; font-weight: 850; letter-spacing: -.5px; }
.hero h1 .grad { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ── Sections ── */
section { padding: 48px 0; }
.section-title { font-size: 28px; margin: 0 0 8px; font-weight: 800; }
.section-sub { color: var(--muted); margin: 0 0 32px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.step-num {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(108, 140, 255, .15); color: var(--accent); font-weight: 800; margin-bottom: 14px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border); margin-top: 40px; padding: 30px 0;
  color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); }

/* ── Legal pages ── */
.legal { padding: 48px 0 20px; }
.legal h1 { font-size: 34px; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 28px; }
.legal h2 { font-size: 20px; margin: 30px 0 8px; }
.legal p, .legal li { color: #cdd5e6; }
.legal ul { padding-left: 20px; }

/* ── Dashboard ── */
.dash { padding: 40px 0; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.off { background: var(--err); }

.controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
select, input[type="text"], input[type="date"] {
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; min-width: 180px;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

.summary { display: flex; gap: 18px; flex-wrap: wrap; margin: 18px 0 8px; }
.stat { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; min-width: 150px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.err { background: rgba(248, 113, 113, .12); border: 1px solid #5b2b34; color: #ffd7d7; }
.alert.ok { background: rgba(52, 211, 153, .1); border: 1px solid #245943; color: #c7f5e3; }
.alert.warn { background: rgba(251, 191, 36, .1); border: 1px solid #5c4a1e; color: #ffe9b8; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }
details summary { cursor: pointer; color: var(--muted); }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .nav-links { gap: 14px; }
}
