:root {
  --bg: #0b0d11;
  --bg-2: #10141c;
  --surface: #161b26;
  --surface-2: #1c2330;
  --line: #2a3344;
  --text: #eef2f7;
  --muted: #8d97ab;
  --mint: #3ee0b2;
  --mint-dim: #1a4d40;
  --gold: #f0c35a;
  --rose: #ff6b7a;
  --blue: #7aa2ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
}

a { color: var(--mint); }
button, input, select, textarea { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #121722 0%, #0d1118 100%);
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #7affd4, #1d8f73 55%, #0e3b32);
  box-shadow: 0 0 0 1px #3ee0b255, 0 8px 20px #3ee0b233;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.nav-btn:hover, .nav-btn.active {
  background: #1b2433;
  color: var(--text);
}
.nav-btn.active { box-shadow: inset 3px 0 0 var(--mint); }

.sidebar-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 28px 36px 48px;
  background:
    radial-gradient(900px 400px at 90% -10%, #1c3d35 0%, transparent 55%),
    var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 16px;
}
.topbar h2 { margin: 0; font-size: 30px; font-weight: 620; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
}
.btn.primary {
  background: var(--mint);
  color: #06281f;
  font-weight: 700;
}
.btn.gold { background: var(--gold); color: #2b2108; font-weight: 700; }
.btn.danger { background: #3a1c22; color: var(--rose); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.kpi span { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.kpi strong {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
}
.kpi em { color: var(--mint); font-style: normal; font-size: 12px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #223;
}
.pill.on { background: var(--mint-dim); color: var(--mint); }
.pill.off { background: #3a1c22; color: var(--rose); }
.pill.warn { background: #3a3218; color: var(--gold); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
}
textarea { min-height: 160px; resize: vertical; }
textarea.paste, textarea.html { font-family: var(--mono); font-size: 13px; line-height: 1.5; }
textarea.paste { min-height: 180px; }
textarea.html { min-height: 220px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  color: var(--text);
  font-size: 14px;
}
.check input { width: 16px; height: 16px; accent-color: var(--mint); }
.compose {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}
.preview-box {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}
.preview-frame {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-top: 10px;
}
.preview-frame.mob { width: 380px; max-width: 100%; }
.preview-to { min-width: 220px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #14241f;
  border: 1px solid #2f6;
  color: var(--mint);
  padding: 12px 16px;
  border-radius: 12px;
  display: none;
}
.toast.show { display: block; }
.toast.err { background: #2a1518; border-color: var(--rose); color: var(--rose); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 300px at 50% 0%, #1b3d34, transparent 60%),
    var(--bg);
}
.login-card {
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 8px 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 10px;
}
.bar {
  flex: 1;
  background: linear-gradient(180deg, var(--mint), #1c5f4e);
  border-radius: 8px 8px 4px 4px;
  min-height: 6px;
  position: relative;
}
.bar span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
}

.public-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% -10%, #17352d, transparent 50%),
    radial-gradient(700px 300px at 100% 0%, #2a2412, transparent 45%),
    #090b0f;
}
.landing {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
}
.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  font-size: 12px;
  margin: 0 0 14px;
}
.landing h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  margin: 0 0 16px;
  font-weight: 650;
}
.landing .lead { color: #c6cedb; font-size: 18px; line-height: 1.6; }
.points { margin: 28px 0 0; padding: 0; list-style: none; }
.points li {
  margin: 0 0 10px;
  padding-left: 22px;
  position: relative;
  color: #d5dbe6;
}
.points li::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  position: absolute;
  left: 0; top: 8px;
}
.form-card {
  background: rgba(22, 27, 38, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 24px;
}
.form-card h3 { margin: 0 0 6px; }
.thanks-card {
  max-width: 640px;
  margin: 12vh auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
}

.hidden { display: none !important; }
.empty { color: var(--muted); padding: 20px 0; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .kpis, .grid-2, .form-grid, .landing { grid-template-columns: 1fr; }
  .form-card { position: static; }
}
