:root {
  --bg: #0a0a0b;
  --panel: #111114;
  --panel-2: #17171b;
  --hover: #1e1e23;
  --line: #26262c;
  --line-2: #34343c;
  --text: #f4f4f5;
  --muted: #9b9ba4;
  --faint: #66666f;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);

  --wait: #f5a524;
  --error: #f04438;
  --success: #3bce86;
  --verification: #a855f7;
  --confirm: #06b6d4;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible { outline: none; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px 34px; }
.login-mark { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 12px; color: var(--text); margin-bottom: 22px; }
.login-card h1 { font-size: 20px; font-weight: 640; letter-spacing: -0.02em; }
.login-card p { color: var(--muted); font-size: 13.5px; margin: 5px 0 26px; }
.login-error { display: none; font-size: 12.5px; color: var(--error); margin-top: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.input { height: 44px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; color: var(--text); font-size: 14.5px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); color: var(--text); font-size: 13.5px; font-weight: 600; transition: background 0.15s, border-color 0.15s, transform 0.08s; }
.btn:hover { background: var(--hover); border-color: var(--line-2); }
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--text); color: #000; border-color: var(--text); width: 100%; height: 44px; font-size: 14.5px; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-icon { padding: 0; width: 40px; flex: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
.btn-ghost { background: transparent; }

.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

.sidebar { border-right: 1px solid var(--line); background: var(--panel); padding: 18px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 8px 8px 22px; }
.brand-mark { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); }
.brand-name { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--faint); margin-top: 1px; }

.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 550; transition: background 0.14s, color 0.14s; }
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-badge { margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--mono); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.nav-spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 66px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; background: rgba(10, 10, 11, 0.82); backdrop-filter: blur(10px); z-index: 5; }
.topbar h2 { font-size: 16px; font-weight: 640; letter-spacing: -0.01em; }
.topbar .sub { font-size: 12px; color: var(--faint); margin-top: 1px; }

.content { padding: 28px 30px 60px; }
.section { display: none; }
.section.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; transition: border-color 0.15s; }
.stat:hover { border-color: var(--line-2); }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-size: 30px; font-weight: 660; letter-spacing: -0.03em; margin-top: 9px; font-family: var(--mono); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 13.5px; font-weight: 640; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); padding: 12px 20px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.14s; cursor: pointer; }
.table tbody tr:hover { background: var(--panel-2); }
.row-new { animation: flash 1.5s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.id-cell { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.vals { color: var(--muted); font-size: 12.5px; }
.vals b { color: var(--text); font-weight: 550; }
.dot-sep { color: var(--faint); margin: 0 2px; }

.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); white-space: nowrap; }
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.badge[data-s="wait"] .bdot { background: var(--wait); }
.badge[data-s="success"] .bdot { background: var(--success); }
.badge[data-s="verification"] .bdot { background: var(--verification); }
.badge[data-s="confirm"] .bdot { background: var(--confirm); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--faint); padding: 56px 20px; font-size: 13.5px; }
.empty svg { color: var(--line-2); }

.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 40; }
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1); z-index: 41; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-head .t { font-size: 18px; font-weight: 680; font-family: var(--mono); letter-spacing: -0.01em; }
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; }
.kv { display: flex; flex-direction: column; gap: 15px; margin-bottom: 26px; }
.kv .row { display: flex; flex-direction: column; gap: 4px; }
.kv .row .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.kv .row .v { font-size: 14px; word-break: break-word; }

.ctl-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 11px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.status-btn { display: flex; align-items: center; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; transition: border-color 0.14s, background 0.14s; }
.status-btn:hover { background: var(--hover); }
.status-btn .bdot { width: 8px; height: 8px; border-radius: 50%; }
.status-btn[data-s="wait"] .bdot { background: var(--wait); }
.status-btn[data-s="success"] .bdot { background: var(--success); }
.status-btn[data-s="verification"] .bdot { background: var(--verification); }
.status-btn[data-s="confirm"] .bdot { background: var(--confirm); }
.status-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.status-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.verify-row { margin-top: 16px; }
.verify-row .ctl-title { margin-bottom: 7px; }

.custom-row { margin-top: 18px; }
.custom-row .ctl-title { margin-bottom: 7px; }
.custom-row textarea.input { width: 100%; min-height: 76px; padding: 12px 14px; line-height: 1.5; resize: vertical; font-family: inherit; }

.sms-row { margin-top: 18px; }
.sms-row .ctl-title { margin-bottom: 7px; }
.sms-code { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 4px; color: var(--text); padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; text-align: center; }
.sms-code .sms-empty { font-family: inherit; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--faint); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 18px 20px 6px; display: flex; flex-direction: column; gap: 5px; }
.card-id { font-size: 11px; font-family: var(--mono); color: var(--faint); }
.card-title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-desc { font-size: 12.5px; color: var(--muted); }
.card-foot { padding: 14px 20px 20px; }

.code { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; padding-right: 48px; font-family: var(--mono); font-size: 12.5px; color: #c9d3e8; overflow-x: auto; white-space: pre; line-height: 1.65; }
.code .tok-tag { color: #7aa2f7; }
.code .tok-attr { color: #8ed08a; }
.code .tok-str { color: #e0af68; }
.copy { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); transition: color 0.14s, border-color 0.14s; }
.copy:hover { color: var(--text); border-color: var(--line-2); }
.copy.done { color: var(--success); border-color: var(--success); }

.guide { max-width: 840px; }
.guide h3 { font-size: 15px; font-weight: 650; margin: 30px 0 12px; letter-spacing: -0.01em; }
.guide h3:first-child { margin-top: 0; }
.guide p { color: var(--muted); margin-bottom: 12px; }
.guide ul { color: var(--muted); margin: 0 0 12px 18px; }
.guide li { margin-bottom: 7px; }
.guide code.inl { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.step { display: flex; gap: 15px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.step .n { flex: none; width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.step .b { min-width: 0; flex: 1; }
.step .b h4 { font-size: 14px; font-weight: 620; margin-bottom: 6px; }
.step .b p { font-size: 13px; margin-bottom: 11px; }
.callout { display: flex; gap: 12px; border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin: 14px 0; background: var(--panel); }
.callout svg { flex: none; color: var(--accent); margin-top: 1px; }
.callout p { margin: 0; font-size: 12.5px; color: var(--muted); }

.integ { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px 26px; display: flex; flex-direction: column; gap: 22px; max-width: 820px; }
.integ-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.integ-id { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-bottom: 6px; }
.integ-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.integ-desc { font-size: 13.5px; color: var(--muted); margin: 0; max-width: 480px; line-height: 1.5; }
.integ-launcher { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 999px; background: #fff; color: #14161b; font-size: 14px; font-weight: 700; box-shadow: 0 8px 26px rgba(0,0,0,.25); flex: none; cursor: default; }

.integ-step { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; }
.integ-step-n { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--text); margin-top: 1px; }
.integ-step-body { min-width: 0; }
.integ-step-title { font-size: 14.5px; font-weight: 640; margin-bottom: 10px; color: var(--text); }
.integ-step-hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 9px; }
.integ-step-hint b { color: var(--text); font-weight: 600; }

.integ-amount { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--bg); width: fit-content; }
.integ-amount .input { width: 140px; height: 44px; border: 0; border-radius: 0; padding: 0 14px; font-family: var(--mono); font-size: 15px; font-weight: 600; background: transparent; }
.integ-amount .input:focus { box-shadow: none; }
.integ-cur { padding: 0 16px; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); height: 44px; display: inline-flex; align-items: center; }

.integ-demo { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; padding: 8px 0; }
.integ-demo:hover { opacity: .75; }

.inl { font-family: var(--mono); font-size: 12px; padding: 2px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; color: var(--text); }

@media (max-width: 640px) {
  .integ { padding: 22px 18px; }
  .integ-head { flex-direction: column; }
}

.toast-wrap { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; font-size: 13px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); animation: toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
.toast .bdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .brand { padding: 8px; }
  .nav-spacer, .side-foot { display: none; }
  .nav-item.active::before { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 22px 18px 50px; }
  .grid-2, .screens-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .row-req { grid-column: 1; }
  .field-row .row-del { grid-column: 2; justify-self: end; }
  .modal-back { padding: 20px 14px; }
}
