:root {
  --bg: #f2f3f5;
  --side: #fff;
  --card: #fff;
  --line: #e5e6eb;
  --text: #1d2129;
  --muted: #86909c;
  --blue: #165dff;
  --blue-soft: #e8f3ff;
  --ok: #00b42a;
  --warn: #ff7d00;
  --bad: #f53f3f;
  --shadow: 0 4px 16px rgba(29, 33, 41, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.auth {
  width: min(420px, calc(100% - 32px));
  margin: 10vh auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.brand span { color: var(--blue); }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 16px 12px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.logo { display: flex; gap: 10px; align-items: center; padding: 6px 8px 16px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 700;
}
.logo strong { display: block; }
.logo small { color: var(--muted); }
.nav-label { margin: 14px 10px 6px; color: var(--muted); font-size: 12px; }
.nav-list { display: grid; gap: 2px; }
.nav-list button {
  display: flex; align-items: center; gap: 8px;
  text-align: left; border: 0; background: transparent;
  border-radius: 8px; padding: 9px 10px; cursor: pointer; color: #4e5969;
}
.nav-list button.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-ico { width: 16px; height: 16px; flex: none; }
.workspace { min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 5;
}
.crumb { color: var(--muted); }
.top-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: 13px;
}
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 20px 0; }
.hint, .muted { color: var(--muted); }
.err { color: var(--bad); min-height: 0; padding: 0 20px; }
.stats, .dash-grid { display: grid; gap: 16px; padding: 16px 20px 0; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wallet-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px 20px 0; }
.wallet-summary .panel { margin: 0; }
.wallet-form { display: grid; gap: 8px; margin-top: 12px; }
.wallet-form label { display: grid; gap: 6px; color: #4e5969; }
.wallet-form input { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.dash-grid { grid-template-columns: 1.4fr 0.8fr; }
.metric, .panel {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 16px 18px;
}
.metric { display: flex; justify-content: space-between; align-items: center; }
.metric span, .panel-title { color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 28px; color: var(--text); }
.metric i { width: 8px; height: 36px; border-radius: 99px; }
.card {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow);
  padding: 16px 18px; margin: 16px 20px 0;
}
.filters { padding: 0 20px; margin-top: 16px; }
.panel { margin: 16px 20px 0; }
.dash-grid .panel { margin: 0; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--text); }
.panel-title h3 { font-size: 16px; }
.mix { display: flex; gap: 18px; align-items: center; }
.donut { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut text { transform: rotate(90deg); transform-origin: 60px 60px; fill: var(--text); font-size: 12px; }
.donut text:first-of-type { font-size: 20px; font-weight: 650; }
.mix-legend { flex: 1; display: grid; gap: 10px; }
.mix-row { display: grid; grid-template-columns: 36px 1fr 28px; gap: 8px; align-items: center; color: var(--muted); }
.mix-row i { height: 8px; background: #f2f3f5; border-radius: 99px; display: block; }
.mix-row b { display: block; height: 8px; border-radius: 99px; }
.revenue { font-size: 28px; font-weight: 650; margin: 12px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.filters input, .filters select, .dialog input, .dialog select, .auth input {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
}
.filters input { min-width: 220px; }
.card, .panel table { width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: #f7f8fa; }
tr:last-child td { border-bottom: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.primary, .ghost, .danger, .text-btn {
  border-radius: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 14px; cursor: pointer;
}
.primary { background: var(--blue); color: #fff; border-color: transparent; }
.danger { color: var(--bad); }
.text-btn { border: 0; color: var(--blue); background: transparent; padding: 0; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 8px; font-size: 12px; background: #f2f3f5; }
.pill.ok { color: var(--ok); background: #e8ffea; }
.pill.warn { color: var(--warn); background: #fff7e8; }
.pill.bad { color: var(--bad); background: #ffece8; }
.mask { position: fixed; inset: 0; background: rgba(29, 33, 41, 0.45); display: grid; place-items: center; padding: 20px; z-index: 20; }
.dialog { width: min(680px, 100%); background: #fff; border-radius: 8px; padding: 20px 22px; box-shadow: var(--shadow); }
.dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.check-row { display: flex !important; align-items: flex-start; gap: 10px !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.check-row input { margin-top: 4px; }
.check-row span { display: grid; gap: 2px; }
.check-row small { color: var(--muted); font-weight: 400; }
.equity-limits { display: grid; gap: 10px; margin: 12px 0; }
.equity-limits section { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.equity-limits h3 { margin-bottom: 6px; font-size: 14px; }
.equity-limits .grid { gap: 4px 14px; }
.issue-validity { margin-top: 12px; padding: 12px; background: #f7f8fa; border-radius: 8px; }
.issue-validity > strong { display: block; margin-bottom: 8px; }
.issue-validity p { margin: 8px 0 0; color: var(--muted); }
.quick-cycles { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-cycles button { border: 1px solid var(--line); border-radius: 99px; background: #fff; padding: 6px 14px; cursor: pointer; }
.quick-cycles button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-list span { border-radius: 99px; padding: 1px 7px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.dialog label, .auth label { display: grid; gap: 6px; margin: 8px 0; color: #4e5969; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; background: #f7f8fa; padding: 12px; border-radius: 6px; }
pre { white-space: pre-wrap; background: #f7f8fa; padding: 14px; border-radius: 8px; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.template-dialog { width: min(880px, 100%); max-height: min(90vh, 900px); overflow: auto; }
.template-fields { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.template-fields > strong, .template-fields > small { display: block; margin-bottom: 8px; }
.template-fields > small { color: var(--muted); }
.template-fields .grid { max-height: 280px; overflow: auto; }
.product-key-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.copy-icon { border: 1px solid #e5e8ef; background: #fff; color: #596579; border-radius: 6px; padding: 4px 7px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.copy-icon:hover { border-color: #9aa8bd; color: #1f2937; background: #f7f9fc; }
.credential-stack { display: grid; gap: 7px; min-width: 260px; max-width: 360px; }
.credential-line { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
.credential-line small { color: var(--muted); font-size: 11px; }
.credential-line code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #253249; font-size: 11px; }
.credential-note { color: var(--muted); font-size: 11px; }
.generated-product-key { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 8px; margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.generated-product-key span { color: var(--muted); }
.generated-product-key small { grid-column: 2 / -1; color: var(--muted); }
.generated-product-key strong { color: #44516a; }
@media (max-width: 1100px) { .credential-stack { min-width: 220px; } .credential-line { grid-template-columns: 75px minmax(0, 1fr) auto auto; } }
.workspace > .panel:last-child, .workspace > .card { margin-bottom: 24px; }
@media (max-width: 980px) {
  .shell { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-groups { display: flex; gap: 12px; overflow: auto; }
  .nav-label { display: none; }
  .nav-list { display: flex; }
  .stats, .dash-grid { grid-template-columns: 1fr 1fr; }
  .wallet-summary { grid-template-columns: 1fr; }
  .dialog .grid { grid-template-columns: 1fr; }
}

.sdk-release { padding: 20px 0; border-top: 1px solid var(--line); }
.sdk-hash { display: block; overflow-wrap: anywhere; }
