/* SMS Samurai — black & red */
:root {
  --bg: #070707;
  --panel: #111112;
  --panel2: #18181a;
  --line: #2a2a2e;
  --red: #e10600;
  --red-hi: #ff2d20;
  --red-dim: #5a0c09;
  --text: #ececec;
  --muted: #8d8d93;
  --ok: #2fbf71;
  --warn: #e6a700;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: var(--red-hi); }
code, pre { font-family: ui-monospace, Consolas, monospace; }
pre { background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre; font-size: 12.5px; }
h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: .5px; }
h3 { margin: 0 0 12px; font-size: 16px; }
h4 { margin: 16px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.boot { padding: 40px; color: var(--muted); }
.ok-text { color: var(--ok); }
.err-text { color: var(--red-hi); }
.danger-text { color: var(--red-hi); }
.form-error { color: var(--red-hi); min-height: 1.2em; margin: 4px 0; }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(225, 6, 0, .35), transparent 60%),
    repeating-linear-gradient(135deg, #0b0b0b 0 2px, #070707 2px 14px);
}
.login-card {
  width: 100%; max-width: 380px; background: rgba(12, 12, 13, .96);
  border: 1px solid var(--red-dim); border-top: 3px solid var(--red);
  border-radius: var(--radius); padding: 28px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 40px rgba(225, 6, 0, .12);
  display: flex; flex-direction: column; gap: 6px;
}
.brand-big { text-align: center; margin-bottom: 14px; }
.brand-big h1 { margin: 10px 0 2px; font-size: 30px; letter-spacing: 4px; font-weight: 800; }
.brand-big p { margin: 0; color: var(--muted); letter-spacing: 2px; font-size: 11px; text-transform: uppercase; }
em { font-style: normal; color: var(--red); }
.blade { display: inline-block; width: 120px; height: 4px; background: linear-gradient(90deg, transparent, var(--red) 30%, #fff 96%, transparent); transform: skewX(-30deg); border-radius: 2px; }
.blade.small { width: 26px; height: 3px; margin-right: 8px; vertical-align: middle; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: 56px 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; background: #000; border-bottom: 2px solid var(--red); }
.brand { font-weight: 800; letter-spacing: 3px; font-size: 16px; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.bal { color: var(--muted); }
.bal strong { color: var(--text); margin-left: 4px; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--text); text-decoration: none; padding: 9px 12px; border-radius: 8px; border-left: 3px solid transparent; }
.nav a:hover { background: var(--panel2); }
.nav a.active { background: linear-gradient(90deg, rgba(225, 6, 0, .22), transparent); border-left-color: var(--red); color: #fff; }
.content { padding: 24px; min-width: 0; }

.role-badge { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); }
.role-badge.superadmin { border-color: var(--red); color: var(--red-hi); }
.role-badge.supplier { border-color: var(--warn); color: var(--warn); }
.role-badge.user { border-color: #555; color: #ccc; }

/* ---------- blocks ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.stat strong { font-size: 20px; overflow-wrap: anywhere; }
.stat.accent { border-color: var(--red-dim); background: linear-gradient(160deg, rgba(225, 6, 0, .18), var(--panel) 60%); }
.stat.accent strong { color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: min(460px, 80vw); }
.row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input { max-width: 280px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.title-row h2 { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.counter { color: var(--muted); font-size: 12px; margin-top: -4px; }
.estimate { font-size: 13px; min-height: 1.2em; }
.rate-result { margin-top: 14px; }
ol { padding-left: 20px; }
ol li { margin: 6px 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.field > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.field small { color: var(--muted); }
input, select, textarea {
  width: 100%; background: #0a0a0b; color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font: inherit;
}
textarea { resize: vertical; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .18); }
input[type=checkbox] { width: auto; accent-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.btn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #444; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--red-hi); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--red-dim); color: var(--red-hi); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.wide { width: 100%; margin-top: 6px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #0c0c0d; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.clip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table.kv { width: auto; }
table.kv th { background: none; text-align: right; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 10px; color: var(--muted); }

.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: #ccc; white-space: nowrap; }
.badge.sent, .badge.delivered, .badge.earning, .badge.topup, .badge.refund { border-color: rgba(47, 191, 113, .5); color: var(--ok); }
.badge.failed, .badge.rejected, .badge.reversal { border-color: var(--red-dim); color: var(--red-hi); }
.badge.queued, .badge.routing, .badge.sending, .badge.adjust { border-color: rgba(230, 167, 0, .45); color: var(--warn); }

.secret-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #000; border: 1px dashed var(--red); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.secret-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.secret { color: #fff; font-size: 14px; word-break: break-all; flex: 1; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .75); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--red-dim); border-top: 3px solid var(--red); border-radius: var(--radius); padding: 18px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h3 { margin: 0; }
.toast { position: fixed; bottom: 20px; right: 20px; left: auto; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 8px; background: #000; border: 1px solid var(--line); border-left: 4px solid var(--ok); opacity: 0; transform: translateY(10px); transition: .25s; z-index: 60; }
.toast.err { border-left-color: var(--red); }
.toast.show { opacity: 1; transform: none; }

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; height: auto; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .nav a.active { border-bottom-color: var(--red); }
  .content { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .stack { min-width: 0; }
  .toolbar input { max-width: none; }
}

/* ---------- sign-up / docs / admin extras ---------- */
.links a { color: var(--red-hi); }
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.role-pick { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; }
.role-pick:has(input:checked) { border-color: var(--red); background: rgba(225, 6, 0, .1); }
.role-pick input { width: auto; margin-top: 3px; accent-color: var(--red); }
.role-pick span { display: flex; flex-direction: column; }
.role-pick small { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.public-shell { min-height: 100vh; }
.public-shell .topbar { height: 56px; }
.docs-public { max-width: 980px; margin: 0 auto; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.toc a { border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; text-decoration: none; color: var(--text); }
.toc a:hover { border-color: var(--red); }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.perm-list { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px; }
.check.big { font-size: 15px; }
.role-badge.admin { border-color: #b36bff; color: #c99bff; }
@media (max-width: 800px) { .role-choice { grid-template-columns: 1fr; } }

/* ---------- crypto ---------- */
.pay-box { border-color: var(--red-dim); }
.warn { background: rgba(230, 167, 0, .08); border: 1px solid rgba(230, 167, 0, .35); border-radius: 8px; padding: 10px 12px; }
.badge.deposit, .badge.withdrawal_refund, .badge.deposit_fee, .badge.withdrawal_fee { border-color: rgba(47, 191, 113, .5); color: var(--ok); }
.badge.withdrawal, .badge.payout { border-color: var(--red-dim); color: var(--red-hi); }
.inbox-text { white-space: pre-wrap; overflow-wrap: anywhere; display: inline-block; max-width: 420px; }
