:root{
  --bg:#f6f7fb; --surface:#fff; --line:#e6e8f0; --line-2:#eef0f6;
  --text:#14172b; --muted:#6b7190; --brand:#4f46e5; --brand-2:#6366f1; --brand-soft:#eef0ff;
  --ok:#0f9d6b; --ok-soft:#e6f7f0; --bad:#d6336c; --bad-soft:#fde8ef; --wait:#b7791f; --wait-soft:#fdf3dc;
  --radius:14px; --shadow:0 1px 2px rgba(20,23,43,.04),0 8px 24px rgba(20,23,43,.06);
}
*{box-sizing:border-box}
html,body{margin:0}
body{font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{margin:0;font-weight:650;letter-spacing:-.01em}
code,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
code{background:var(--brand-soft);padding:1px 6px;border-radius:6px;font-size:.88em}
.muted{color:var(--muted)} .small{font-size:.85em} .right{text-align:right} .pos{color:var(--ok);font-weight:600} .neg{color:var(--bad);font-weight:600}
.ic{width:20px;height:20px;flex:none}

/* ---- shell ---- */
.shell{display:flex;min-height:100vh}
.side{width:240px;background:var(--surface);border-right:1px solid var(--line);padding:20px 14px;position:sticky;top:0;height:100vh;flex:none}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px;color:var(--text);padding:4px 8px 22px}
.brand:hover{text-decoration:none}
.logo{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--brand),#8b5cf6);color:#fff;display:grid;place-items:center;font-weight:700}
.side nav{display:flex;flex-direction:column;gap:2px}
.side nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:#4a4f6b;font-weight:500}
.side nav a:hover{background:var(--bg);text-decoration:none}
.side nav a.on{background:var(--brand-soft);color:var(--brand)}
.navsep{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:18px 12px 6px}
.main{flex:1;min-width:0}
.top{display:flex;align-items:center;gap:14px;padding:16px 28px;background:rgba(246,247,251,.85);backdrop-filter:blur(8px);position:sticky;top:0;z-index:5;border-bottom:1px solid var(--line-2)}
.top h1{font-size:20px;flex:1}
.top-r{display:flex;align-items:center;gap:12px}
.bal{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);padding:7px 14px;border-radius:999px;color:var(--text);font-variant-numeric:tabular-nums}
.bal small{color:var(--muted)} .bal:hover{text-decoration:none;border-color:var(--brand-2)}
.who{display:flex;align-items:center;gap:6px}
.who a{display:flex;align-items:center;gap:6px;color:var(--text);padding:7px 10px;border-radius:10px}
.who a:hover{background:var(--surface);text-decoration:none}
.burger{display:none;background:none;border:0;font-size:22px;cursor:pointer}
.page{padding:26px 28px 60px;max-width:1200px}

/* ---- components ---- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);margin-bottom:20px}
.card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.card-head h2{font-size:16px}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:20px}
.narrow{max-width:640px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:var(--surface);color:var(--text);padding:9px 16px;border-radius:10px;font:inherit;font-weight:600;cursor:pointer;transition:.15s}
.btn:hover{border-color:var(--brand-2);text-decoration:none}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.primary:hover{background:#4338ca}
.btn.small{padding:5px 11px;font-size:13px;border-radius:8px}
.btn.block{width:100%;padding:12px}
.btn:disabled{opacity:.55;cursor:not-allowed}
.link{background:none;border:0;color:var(--brand);cursor:pointer;font:inherit;padding:0 4px}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field>span{font-size:13px;font-weight:600;color:#3b4060}
input[type=text],input[type=password],input[type=email],input[type=number],input[type=search],select,textarea{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font:inherit;color:var(--text);background:#fff;outline:none;transition:.15s}
input:focus,select:focus,textarea:focus{border-color:var(--brand-2);box-shadow:0 0 0 4px rgba(99,102,241,.15)}
input[readonly]{background:var(--bg)}
.mini{width:auto;padding:6px 9px;font-size:13px;max-width:130px}
.toolbar{display:flex;gap:12px;align-items:flex-end;margin-bottom:18px;flex-wrap:wrap}
.toolbar .field{margin:0}.field.inline{min-width:180px}.grow{flex:1}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.stack{display:flex;flex-direction:column}
.check{display:flex;gap:8px;align-items:center;margin-bottom:14px}
.alert{padding:12px 14px;border-radius:10px;margin-bottom:16px;font-weight:500}
.alert.ok{background:var(--ok-soft);color:#0b6e4b}.alert.err{background:var(--bad-soft);color:#a3204f}
.note{background:var(--brand-soft);color:#3730a3;padding:10px 12px;border-radius:10px;margin-bottom:12px;font-size:14px}
.addr{display:flex;align-items:center;gap:8px;background:var(--bg);border:1px dashed var(--line);padding:10px 12px;border-radius:10px;margin-bottom:14px;word-break:break-all}
.balance-big{margin-bottom:14px}.balance-big small{color:var(--muted);display:block}
.balance-big b{font-size:30px;letter-spacing:-.02em}.balance-big span{font-size:14px;color:var(--muted);font-weight:500}
.empty{padding:34px 10px;text-align:center;color:var(--muted)}
.pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600}
.pill.ok{background:var(--ok-soft);color:var(--ok)}.pill.bad{background:var(--bad-soft);color:var(--bad)}.pill.wait{background:var(--wait-soft);color:var(--wait)}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
th{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);text-align:left;font-weight:600;padding:10px 12px;border-bottom:1px solid var(--line)}
td{padding:12px;border-bottom:1px solid var(--line-2);vertical-align:middle}
tbody tr:hover{background:#fafbff}
.inline-form{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.kv{display:grid;grid-template-columns:140px 1fr;gap:10px 12px;margin:0}.kv dt{color:var(--muted)}.kv dd{margin:0;font-weight:500}
.code{background:#0f172a;color:#e2e8f0;padding:16px;border-radius:12px;overflow:auto;font-size:13px}
.sub{margin:20px 0 10px;font-size:15px}
.tabs{display:flex;gap:6px;margin-bottom:20px;flex-wrap:wrap}
.tabs a{padding:8px 14px;border-radius:999px;color:var(--muted);font-weight:600}
.tabs a.on{background:var(--brand);color:#fff}.tabs a:hover{text-decoration:none}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.stat small{color:var(--muted);display:block;margin-bottom:6px}.stat b{font-size:26px;letter-spacing:-.02em}
.stat em{display:block;font-size:12px;color:var(--bad);font-style:normal;margin-top:4px}
.stat.warn{border-color:#f5c36b;background:#fffaf0}

/* ---- purchase grid ---- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}
.svc{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:12px;cursor:pointer;transition:.18s;box-shadow:var(--shadow)}
.svc:hover{transform:translateY(-2px);border-color:var(--brand-2)}
.svc.out{opacity:.55;cursor:not-allowed}.svc.out:hover{transform:none;border-color:var(--line)}
.svc-top{display:flex;align-items:center;gap:12px}
.svc img,.ph{width:42px;height:42px;border-radius:12px;object-fit:cover;background:var(--brand-soft);flex:none;display:grid;place-items:center;color:var(--brand);font-weight:700}
.svc h4{margin:0;font-size:15px;line-height:1.2}
.svc-meta{display:flex;justify-content:space-between;align-items:flex-end}
.price{font-size:20px;font-weight:700;letter-spacing:-.02em}.price small{font-size:12px;color:var(--muted);font-weight:500}
.stk{font-size:12px;color:var(--muted);text-align:right}

/* ---- modal / toast ---- */
.modal{position:fixed;inset:0;background:rgba(20,23,43,.45);display:grid;place-items:center;z-index:50;padding:16px}
.modal[hidden]{display:none}
.modal-card{background:#fff;border-radius:18px;padding:24px;width:100%;max-width:520px;max-height:92vh;overflow:auto;position:relative;box-shadow:0 30px 80px rgba(20,23,43,.25)}
.modal .x{position:absolute;right:14px;top:10px;background:none;border:0;font-size:28px;cursor:pointer;color:var(--muted)}
.modal-head{display:flex;gap:14px;align-items:center;margin-bottom:18px}
.modal-head img{width:48px;height:48px;border-radius:12px;object-fit:cover}
.summary{display:flex;justify-content:space-between;align-items:center;background:var(--bg);padding:12px 14px;border-radius:10px;margin:4px 0 8px}
.summary b{font-size:20px}
.result-list{display:flex;flex-direction:column;gap:8px;margin:14px 0}
.result-item{display:flex;justify-content:space-between;align-items:center;background:var(--ok-soft);padding:10px 12px;border-radius:10px}
.toasts{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:8px;z-index:100}
.toast{background:#14172b;color:#fff;padding:11px 16px;border-radius:10px;box-shadow:var(--shadow);animation:in .2s}
.toast.err{background:#a3204f}
@keyframes in{from{transform:translateY(8px);opacity:0}}
.sms-item{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-bottom:10px}
.sms-item .meta{display:flex;justify-content:space-between;color:var(--muted);font-size:13px;margin-bottom:4px}

/* ---- auth ---- */
.auth-body{background:#fff}
.auth{display:grid;grid-template-columns:1.05fr 1fr;min-height:100vh}
.auth-hero{position:relative;overflow:hidden;padding:40px 56px;display:flex;flex-direction:column;justify-content:space-between;
  background:linear-gradient(160deg,#eef0ff 0%,#f6f2ff 55%,#fff1f7 100%)}
.auth-hero .brand{padding:0}
.hero-copy{position:relative;z-index:2;max-width:480px}
.hero-copy h2{font-size:40px;line-height:1.12;letter-spacing:-.03em;margin-bottom:16px}
.hero-copy p{color:#4a4f6b;font-size:16px}
.ticks{list-style:none;padding:0;margin:22px 0 0;display:flex;flex-direction:column;gap:10px}
.ticks li{padding-left:30px;position:relative;font-weight:500}
.ticks li:before{content:"";position:absolute;left:0;top:3px;width:18px;height:18px;border-radius:50%;background:var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat}
.hero-orbs i{position:absolute;border-radius:50%;filter:blur(2px);opacity:.55}
.hero-orbs i:nth-child(1){width:360px;height:360px;right:-120px;top:-90px;background:radial-gradient(circle at 30% 30%,#c7d2fe,transparent 70%)}
.hero-orbs i:nth-child(2){width:300px;height:300px;left:-80px;bottom:-100px;background:radial-gradient(circle at 60% 40%,#fbcfe8,transparent 70%)}
.hero-orbs i:nth-child(3){width:180px;height:180px;right:90px;bottom:90px;background:radial-gradient(circle,#ddd6fe,transparent 70%)}
.auth-form{display:grid;place-items:center;padding:32px}
.auth-card{width:100%;max-width:400px}
.auth-card h1{font-size:28px;letter-spacing:-.02em;margin-bottom:6px}
.auth-card .muted{margin:0 0 24px}
.auth-alt{text-align:center;margin-top:18px;color:var(--muted)}

@media (max-width:900px){
  .side{position:fixed;left:-260px;z-index:30;transition:.2s;box-shadow:var(--shadow)}
  .side.open{left:0}
  .burger{display:block}
  .page,.top{padding-left:16px;padding-right:16px}
  .who span{display:none}
  .auth{grid-template-columns:1fr}
  .auth-hero{display:none}
  .two{grid-template-columns:1fr}
}

/* ---- purchase (filter bar, category tabs, info cards) ---- */
.filter-card{padding:18px 20px 8px}
.filter-row{display:flex;gap:18px;align-items:flex-end;flex-wrap:wrap}
.filter-row .field{margin-bottom:0}
.filter-actions{display:flex;gap:8px}
.divider{border:0;border-top:1px solid var(--line);margin:16px 0 0}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:8px;padding:7px 14px 7px 10px;border:1px solid var(--line);border-radius:999px;background:#fff;font:inherit;font-weight:600;cursor:pointer;color:var(--text);transition:.15s}
.chip:hover{border-color:var(--brand-2)}
.chip.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
.flag{width:22px;height:16px;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.flag-fb{display:inline-grid;place-items:center;min-width:22px;height:16px;border-radius:3px;background:var(--bg);font-size:10px;font-weight:700;color:var(--muted);padding:0 3px}
.cat-tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none}
.cat-tabs button{background:none;border:0;border-bottom:2px solid transparent;padding:12px 16px;font:inherit;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap}
.cat-tabs button:hover{color:var(--text)}
.cat-tabs button.on{color:var(--brand);border-bottom-color:var(--brand)}
.svc{flex-direction:row;align-items:center;gap:14px;padding:14px}
.svc-img{flex:none}
.svc-img img,.svc-img .ph{width:56px;height:56px;border-radius:14px;object-fit:cover;font-size:22px}
.svc-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.svc-title{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
.svc-row{display:flex;justify-content:space-between;gap:8px;font-size:13px}
.svc-row label{color:var(--muted)}
.svc-row b{font-weight:700;font-variant-numeric:tabular-nums}
.grid{grid-template-columns:repeat(auto-fill,minmax(270px,1fr))}
.field>span em{font-style:normal;font-weight:500;color:var(--muted)}
.checks{display:flex;flex-wrap:wrap;gap:6px 14px;max-height:120px;overflow:auto;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.checks .check{margin:0;font-weight:500}

/* ---- specify number picker ---- */
.modal-card.wide{max-width:760px}
.tabs.sm{margin-bottom:14px}
.tabs.sm a{padding:6px 12px;font-size:14px}
.pick-table{max-height:340px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.pick-table th{position:sticky;top:0;background:#fff}
.pager{display:flex;align-items:center;justify-content:space-between;margin:10px 0}
.pick-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.spec-sel{margin:10px 0 14px;font-size:14px}
.wrap{max-height:140px;overflow:auto;margin-top:6px;word-break:break-all}
.actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}

/* ---- phone|link box ---- */
.keybox-wrap{margin:14px 0}
.keybox{width:100%;resize:vertical;padding:12px;border:1px solid var(--line);border-radius:12px;background:#0f172a;color:#e2e8f0;font-size:12.5px;line-height:1.6;white-space:pre;overflow:auto}
.kb-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;flex-wrap:wrap}

.mini.below{border-color:var(--bad);background:var(--bad-soft)}
.mini[type=number]{width:120px;max-width:none}

.deposit-main{background:var(--brand-soft);border:1px solid #dfe3ff;border-radius:12px;padding:18px}
.deposit-main h3{font-size:16px;margin-bottom:6px}
.deposit-main p{margin:0 0 14px;color:#3b4060}

.pager-nums{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap;margin:18px 0}
.pg{min-width:36px;height:36px;padding:0 10px;display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);font-weight:600}
a.pg:hover{border-color:var(--brand-2);text-decoration:none}
.pg.on{background:var(--brand);border-color:var(--brand);color:#fff}
.pg.off{opacity:.45}.pg.gap{border:0;background:none}

/* ---- brand logo ---- */
.brand-logo{display:block;height:42px;width:auto;max-width:100%}
.brand-logo.lg{height:68px}
.side .brand{padding:6px 8px 24px}
@media (max-width:900px){.brand-logo.lg{height:52px}}
