:root {
  color: #f3f3f3;
  background: #070707;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #070707;
  --side: #101010;
  --card: #111111;
  --input: #181818;
  --border: #2a2a2a;
  --muted: #8d8d8d;
  --amber: #f5b400;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px;
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid #1c1c1c;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 6px 10px 22px; }
.brand strong { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.sub { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #b5b5b5;
  font-weight: 500;
  font-size: 14px;
  text-align: left;
}
.nav-icon { width: 16px; height: 16px; flex: none; }
.nav:hover { color: #fff; background: #1a1a1a; }
.nav.on { color: #1a1200; background: var(--amber); font-weight: 650; }
.workspace { flex: 1; min-width: 0; padding: 28px 32px 72px; }
.page-head { margin-bottom: 18px; }
.page-head h1, .login h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -0.03em; }
.page-head p, .login .sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; font-weight: 400; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.table-card { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.card-head strong { font-size: 14px; font-weight: 650; }
.note { margin: 12px 0; font-size: 13px; color: #c8c8c8; }
.link { border: 0; background: none; color: var(--amber); font-weight: 650; padding: 0; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(400px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; display: grid; gap: 8px; }
.login .brand { padding: 0 0 8px; }
label { display: block; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.7); margin: 0 0 4px; }
input, select {
  width: 100%;
  background: var(--input);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  outline: none;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.primary, .ghost { border: 0; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 700; color: #fff; }
.primary { background: var(--amber); color: #1a1200; }
.ghost { background: transparent; color: #ececf1; border: 1px solid rgba(255,255,255,0.12); }
.muted, .hint { color: var(--muted); font-size: 12px; }
.bad { color: #f87171; font-size: 12px; min-height: 1em; }
.ok { color: #22c55e; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 6px; }
.dot.on { background: #22c55e; }
.dot.off { background: #3a4252; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: #7a7a7a;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 16px;
}
td { padding: 12px 16px; border-top: 1px solid #1f1f1f; vertical-align: middle; color: #ddd; }
td.end { text-align: right; }
.empty {
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 22px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}
.gate { padding: 0; overflow: hidden; }
.gate-head { padding: 9px 12px; border-bottom: 1px solid #ffffff0a; }
.gate-head strong { font-size: 13px; color: #fff; }
.gate-head p { font-size: 11px; color: #ffffff55; margin: 2px 0 0; line-height: 1.4; }
.gate-body { padding: 10px 12px; display: grid; gap: 10px; }
.inner, .device {
  background: #0f0f16;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
}
.inner-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inner-bar strong { font-size: 13px; flex: 1; min-width: 120px; }
.inner-bar span, .hint { font-size: 11px; color: #ffffff70; }
.editor, #new-product, #new-webhook, #new-key { display: none; gap: 8px; }
.product-save { display: grid; gap: 8px; }
.editor.open, #new-product.open, #new-webhook.open, #new-key.open { display: grid; }
.docs { display: grid; gap: 10px; margin-top: 16px; }
.docs h2 { font-size: 15px; margin: 8px 0 0; }
.docs p, .docs li { font-size: 13px; color: #c8c8c8; line-height: 1.55; margin: 0; }
.docs ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.docs code, .docs pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.docs pre {
  margin: 0;
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  color: #f3f3f3;
  line-height: 1.45;
}
.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #1a1400;
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 10px 12px;
  word-break: break-all;
  font-size: 12px;
  line-height: 1.5;
}
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.fields label { display: grid; gap: 4px; margin: 0; font-size: 11px; color: #ffffff70; }
.fields input, .fields select, .gate select {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: #e6e9ef; }
.check input, .checks input { width: auto; }
.gate-foot { display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid #ffffff0a; padding-top: 8px; }
.mini { border: 0; border-radius: 6px; padding: 5px 10px; font-size: 11px; font-weight: 700; color: #fff; }
.mini.edit { background: #ff8c00; }
.mini.danger { background: #dc2626; }
.mini.add { background: #16a34a; justify-self: start; }
.pkg {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff08;
  border: 1px solid #ffffff14;
}
.pkgs { display: grid; gap: 8px; }
.pkgs b { font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats div {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.stats span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stats b { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  font-size: 12px;
  font-weight: 600;
}
.open {
  border: 1px solid #3a3a3a;
  background: #161616;
  color: #eee;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}
.pill.success { color: #22c55e; }
.pill.failed, .pill.partial { color: #f97066; }
.pill.running, .pill.queued { color: #f5c16c; }
.receipt {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  background: #fff;
  color: #2a2e35;
  border-radius: 18px;
  padding: 14px 22px 22px;
  font-family: -apple-system, "Segoe UI", sans-serif;
}
.back {
  width: 22px;
  height: 22px;
  color: #1c1c1e;
  display: block;
}
.hero { text-align: center; margin: 28px 0 52px; }
.mark {
  width: 78px;
  height: 78px;
  margin: 0 auto;
  border: 3px solid #3aa0ff;
  border-radius: 50%;
  color: #3aa0ff;
  display: grid;
  place-items: center;
}
.mark svg { width: 34px; height: 34px; }
.receipt h3 {
  text-align: center;
  margin: 18px 0 0;
  font-size: 17px;
  font-weight: 650;
  color: #1c1c1e;
}
.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  font-size: 14px;
}
.line span { color: #c5cad3; font-weight: 400; }
.line b {
  font-weight: 400;
  text-align: right;
  color: #8d939e;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.gem { font-size: 14px; line-height: 1; flex: none; }
.contact {
  margin-top: 28px;
  background: #e7f4ff;
  color: #4aa3e8;
  text-align: center;
  border-radius: 14px;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 500;
}
.preview-block { margin-top: 12px; }
.preview-block > .ghost { width: 100%; margin-top: 10px; }
.eye { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}
.sheet {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #13131a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
}
.sheet h2 { margin: 0; }
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; z-index: 5; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 10px; }
  .brand { padding-bottom: 10px; }
  nav { display: flex; gap: 6px; overflow-x: auto; }
  .nav { width: auto; white-space: nowrap; }
  .workspace { padding: 16px; }
  .stats, .fields { grid-template-columns: 1fr 1fr; }
  table { display: block; overflow-x: auto; }
}
