:root {
  --bg: #0f1115;
  --panel: #ffffff;
  --ink: #1a1d24;
  --muted: #6b7280;
  --line: #e6e8ec;
  --brand: #6d5efc;
  --brand-d: #5848e0;
  --green: #15a36a;
  --amber: #d98a00;
  --rose: #e0485f;
  --soft: #f5f6f9;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--bg); color: #fff;
  padding: 0.85rem 1.5rem;
}
.brand { font-weight: 700; letter-spacing: .2px; }
.brand-mark { color: var(--brand); margin-right: .25rem; }
.brand-sub { font-weight: 500; color: #9aa0ac; margin-left: .5rem; font-size: .8rem; }
.topnav { display: flex; gap: 1.1rem; flex: 1; }
.topnav a { color: #c8ccd6; font-size: .92rem; }
.topnav a.active, .topnav a:hover { color: #fff; text-decoration: none; }
.topright { display: flex; align-items: center; gap: .9rem; }
.who { color: #c8ccd6; font-size: .88rem; }
.btn-out {
  border: 1px solid #3a3f4b; color: #e6e8ec; padding: .35rem .8rem;
  border-radius: 8px; font-size: .85rem;
}
.btn-out:hover { background: #1c2027; text-decoration: none; }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.foot { text-align: center; color: var(--muted); padding: 1.5rem; font-size: .82rem; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }

/* Cards / panels */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .label { color: var(--muted); font-size: .82rem; }
.stat .value { font-size: 1.5rem; font-weight: 700; margin-top: .25rem; }
.stat .sub { color: var(--muted); font-size: .8rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.right { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge.success, .badge.active { background: #e3f6ec; color: var(--green); }
.badge.pending { background: #fcf1dc; color: var(--amber); }
.badge.failed, .badge.suspended, .badge.disabled { background: #fde6ea; color: var(--rose); }

/* Forms / buttons */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #d8d3ff; border-color: var(--brand); }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: none;
  padding: .6rem 1.1rem; border-radius: 9px; font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-d); text-decoration: none; }
.btn.block { width: 100%; }
.btn.sm { padding: .4rem .8rem; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--rose); }
.btn.danger:hover { background: #c53b50; }

.msg { padding: .7rem .9rem; border-radius: 9px; margin-bottom: 1rem; font-size: .9rem; }
.msg.ok { background: #e3f6ec; color: var(--green); }
.msg.err { background: #fde6ea; color: var(--rose); }

/* Auth screen */
.auth { max-width: 380px; margin: 6vh auto; }
.auth .panel { padding: 1.75rem; }
.auth h1 { text-align: center; }
.auth .lead { text-align: center; }
.hint { color: var(--muted); font-size: .82rem; margin-top: .35rem; }

/* Key box */
.keybox {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--soft); border: 1px solid var(--line); border-radius: 9px;
  padding: .6rem .8rem; margin-bottom: .75rem;
}
.keybox code { word-break: break-all; }

/* Mini bar chart */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 120px; padding-top: .5rem; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; }
.bars .cl { font-size: .72rem; color: var(--muted); }

.urlbox { display: flex; gap: .5rem; }
.urlbox input { font-size: .82rem; }
.tag { color: var(--muted); font-size: .8rem; }

/* ===========================================================================
 * Payouts / withdrawals + general polish (colorful, responsive, animated)
 * ========================================================================= */

/* Smooth, consistent transitions across interactive elements. */
a, .btn, .btn-out, .tab, input, select, textarea, .stat, .panel, .badge {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .12s ease;
}
.btn:active, .btn-out:active { transform: translateY(1px); }
.btn:hover { box-shadow: 0 4px 14px rgba(109, 94, 252, .28); }
.panel:hover { box-shadow: 0 2px 14px rgba(20, 24, 35, .06); }

/* Accent stat cards — a clean, colorful dashboard. */
.stat { position: relative; overflow: hidden; }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--brand); opacity: .9;
}
.stat.accent-green::before { background: var(--green); }
.stat.accent-amber::before { background: var(--amber); }
.stat.accent-brand::before { background: var(--brand); }
.stat.accent-rose::before  { background: var(--rose); }
.stat.accent-green { background: linear-gradient(180deg, #f1fbf6, #fff); }
.stat.accent-amber { background: linear-gradient(180deg, #fdf6e8, #fff); }
.stat.accent-brand { background: linear-gradient(180deg, #f2f0ff, #fff); }
.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 24, 35, .08); }

/* Info note bar (e.g. 24-hour payout SLA). */
.note-bar {
  background: linear-gradient(90deg, #eef0ff, #f4f6ff);
  border: 1px solid #dcdcfb; color: #4338ca;
  border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.25rem;
  font-size: .9rem;
}

/* Extra status badges. */
.badge.approved, .badge.paid { background: #e3f6ec; color: var(--green); }
.badge.rejected { background: #fde6ea; color: var(--rose); }
.badge.bank { background: #e8eefe; color: #3056d3; }
.badge.mobile { background: #fcf1dc; color: var(--amber); }

/* Filter tabs. */
.tabbar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tab {
  padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.tab:hover { color: var(--ink); text-decoration: none; border-color: #cfd3dc; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Type-to-confirm danger zone. */
.danger-zone {
  margin-top: 1rem; padding: 1rem; border: 1px solid #f3c4cd;
  background: #fff5f6; border-radius: var(--radius);
  animation: fade-in .18s ease;
}
.danger-zone code { background: #ffe1e6; padding: .05rem .35rem; border-radius: 5px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Inline admin action rows. */
.inline-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.inline-actions .note-input { width: auto; min-width: 130px; flex: 1 1 130px; padding: .35rem .5rem; font-size: .82rem; }

/* Horizontal scroll for wide tables on small screens. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 520px; }

/* Responsive nav + spacing tweaks. */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: .6rem 1rem; padding: .75rem 1rem; }
  .topnav { order: 3; width: 100%; overflow-x: auto; gap: .9rem; }
  .wrap { padding: 1.25rem 1rem 2.5rem; }
}
@media (max-width: 480px) {
  .inline-actions { width: 100%; }
  .inline-actions .note-input { flex-basis: 100%; }
}
