:root {
  font: 16px/1.48 Inter, 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
  --ink: #edeef5; --muted: #a9aec2; --light-ink: #949bb3;
  --bg: #14151d; --surface: #1c1e29; --field: #191b25;
  --edge: #343749; --edge-soft: #2b2e3e; --hover: #252838; --header-row: #222431;
  --chip: #2a2d3e; --chip-text: #bec3d6;
  --primary: #a89cff; --primary-soft: #30294b;
  --primary-fill: #5545cc; --primary-hover: #6250db; --primary-ink: #fff;
  --green: #83dcb1; --green-soft: #1d3832;
  --amber: #f3cb83; --amber-soft: #392f26;
  --red: #ffaab6; --red-soft: #412832;
  --blue: #a8c3ff; --blue-soft: #26344f;
  --overlay: #090a12ae; --shadow: 0 1px 4px #0a0b1740; --float-shadow: 0 18px 56px #090a1280;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled, select:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { color: var(--ink); background: var(--primary-fill); }
button svg, .btn svg { flex: 0 0 auto; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 64px 1fr; }
.sidebar { grid-column: 1; grid-row: 1 / -1; height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--edge); z-index: 3; }
.brand { display: flex; align-items: center; gap: 11px; height: 64px; padding: 0 22px; white-space: nowrap; border-bottom: 1px solid var(--edge-soft); }
.brand-home { display: inline-flex; align-items: center; gap: 11px; border-radius: 6px; text-decoration: none; }
.brand-home:hover strong { color: var(--primary); }
.mark { width: 35px; height: 35px; border-radius: 10px; flex: 0 0 auto; }
.brand strong { display: block; font-size: 15px; line-height: 1.3; letter-spacing: -.025em; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.nav { flex: 1; padding: 24px 12px; overflow-y: auto; }
.nav-label { margin: 0 10px 8px; color: var(--light-ink); font-size: 12px; font-weight: 650; }
.nav-label:not(:first-child) { margin-top: 25px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; margin-bottom: 3px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; white-space: nowrap; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item[aria-current="page"] { color: var(--primary); background: var(--primary-soft); font-weight: 650; }
.nav-item .nav-count { margin-left: auto; color: var(--chip-text); font-size: 12px; font-weight: 650; padding: 1px 6px; border-radius: 5px; background: var(--chip); }
.nav-item[aria-current="page"] .nav-count { color: var(--primary); background: var(--field); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--edge-soft); }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 9px; }
.profile-card > div { min-width: 0; flex: 1; }
.profile-card strong,.profile-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card strong { font-size: 13px; }
.profile-card small { color: var(--muted); font-size: 12px; }
.topbar { grid-column: 2; grid-row: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 30px; background: var(--surface); border-bottom: 1px solid var(--edge); min-width: 0; }
.crumbs,.top-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs { white-space: nowrap; font-size: 14px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 650; }
.crumbs svg { color: var(--light-ink); }
.scope { gap: 9px; display: flex; align-items: center; white-space: nowrap; }
.scope .select { min-width: 136px; }
main { grid-column: 2; min-width: 0; padding: 33px 30px 30px; width: 100%; max-width: 1720px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(29px, 3.2vw, 36px); letter-spacing: -.045em; line-height: 1.12; margin: 0 0 7px; font-weight: 730; }
.page-head p { font-size: 14px; margin: 0; color: var(--muted); }
.page-head .btn { margin-top: 3px; }
.page-tools { display: flex; gap: 8px; align-items: flex-start; }
.btn,.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); min-height: 36px; padding: 6px 11px; font-size: 14px; text-decoration: none; white-space: nowrap; font-weight: 620; }
.btn:not(:disabled):hover,.icon-btn:not(:disabled):hover { background: var(--hover); border-color: var(--light-ink); }
.btn.primary { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--primary-ink); }
.btn.primary:not(:disabled):hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.quiet,.icon-btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn { width: 34px; min-height: 34px; padding: 0; flex: 0 0 auto; color: var(--muted); }
.mobile-toggle { display: none; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { text-align: left; width: 100%; display: flex; flex-direction: column; padding: 15px 16px 14px; min-height: 122px; background: var(--surface); border: 1px solid var(--edge); border-radius: 13px; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--primary); }
.kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 620; font-size: 14px; }
.kpi-head .tile { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; flex: 0 0 auto; }
.tile.amber { color: var(--amber); background: var(--amber-soft); }
.tile.purple { color: var(--primary); background: var(--primary-soft); }
.tile.green { color: var(--green); background: var(--green-soft); }
.tile.blue { color: var(--blue); background: var(--blue-soft); }
.kpi strong { display: block; font-size: 29px; line-height: 1.1; letter-spacing: -.045em; margin: 3px 0 6px; font-weight: 730; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.kpi strong small { font-size: 15px; letter-spacing: 0; color: var(--primary); }
.panel { background: var(--surface); border: 1px solid var(--edge); border-radius: 13px; box-shadow: var(--shadow); min-width: 0; }
.panel-title { padding: 17px 18px 0; }
.panel-title h2 { font-size: 17px; margin: 0 0 2px; letter-spacing: -.02em; }
.panel-title p { font-size: 13px; margin: 0; color: var(--muted); }
.tabs { display: flex; align-items: stretch; gap: 20px; padding: 0 18px; margin-top: 9px; border-bottom: 1px solid var(--edge); max-width: 100%; overflow-x: auto; white-space: nowrap; }
.tab { display: flex; align-items: center; gap: 6px; position: relative; border: 0; background: none; padding: 11px 0; min-height: 43px; font-size: 14px; font-weight: 560; color: var(--muted); }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { color: var(--primary); font-weight: 700; }
.tab[aria-pressed="true"]::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--primary); }
.tab-count { display: inline-flex; min-width: 20px; padding: 1px 5px; justify-content: center; border-radius: 5px; background: var(--chip); font-size: 11px; color: var(--chip-text); font-weight: 650; }
.tab[aria-pressed="true"] .tab-count { background: var(--primary-soft); color: var(--primary); }
.toolbar { padding: 12px 18px; display: flex; gap: 8px; align-items: center; }
.toolbar-grow { flex: 1; }
.bulk-bar { padding: 9px 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; background: var(--header-row); }
.bulk-bar[hidden] { display: none; }
.bulk-bar > span { margin-right: auto; color: var(--muted); white-space: nowrap; }
.bulk-bar strong { display: inline-block; min-inline-size: 2ch; color: var(--ink); font-variant-numeric: tabular-nums; }
.batch-list { max-height: 270px; overflow: auto; }
.search { position: relative; width: min(335px, 100%); }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--light-ink); pointer-events: none; }
.search input,.field input,.field textarea,.select select { width: 100%; border: 1px solid var(--edge); border-radius: 8px; background: var(--field); padding: 7px 10px; min-height: 37px; color: var(--ink); font-size: 14px; }
.search input { padding-left: 35px; }
.search input::placeholder,.field input::placeholder,.field textarea::placeholder { color: var(--light-ink); }
.select { position: relative; display: inline-block; }
.select select { appearance: none; padding: 7px 30px 7px 10px; white-space: nowrap; }
.select > svg { pointer-events: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--light-ink); }
.table-scroll { overflow: auto; width: 100%; position: relative; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; text-align: left; font-variant-numeric: tabular-nums; }
.withdrawals { min-width: 810px; }
thead { background: var(--header-row); color: var(--muted); }
thead th { border-top: 1px solid var(--edge-soft); border-bottom: 1px solid var(--edge); font-size: 12px; font-weight: 670; }
td,th { padding: 9px 13px; }
th:first-child,td:first-child { padding-left: 18px; }
th:last-child,td:last-child { padding-right: 18px; }
.withdrawals .select-cell { width: 44px; padding: 0 8px 0 14px; text-align: center; }
.select-cell input { width: 17px; height: 17px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--primary-fill); }
tbody td { border-bottom: 1px solid var(--edge-soft); height: 57px; }
.table-row:hover td { background: var(--hover); }
.table-row { cursor: pointer; }
.primary-cell { font-weight: 680; display: block; line-height: 1.36; }
.secondary-cell { color: var(--muted); display: block; font-size: 12px; line-height: 1.35; margin-top: 2px; }
.reconciliation-reason { color: var(--amber); }
.reconciliation-verified { color: var(--green); }
.link { font-weight: 680; color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.person { display: flex; gap: 9px; align-items: center; min-width: 0; }
.person > div { min-width: 0; }
.person .primary-cell { white-space: nowrap; max-width: 19ch; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 750; flex: 0 0 auto; }
.avatar.a1 { color: var(--blue); background: var(--blue-soft); }
.avatar.a2 { color: var(--amber); background: var(--amber-soft); }
.avatar.a3 { color: var(--red); background: var(--red-soft); }
.avatar.a4 { color: var(--green); background: var(--green-soft); }
.avatar.large { width: 42px; height: 42px; font-size: 15px; }
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 6px; padding: 3px 7px; font-size: 12px; font-weight: 650; line-height: 1.4; background: var(--chip); color: var(--chip-text); }
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge.pending { color: var(--amber); background: var(--amber-soft); }
.badge.success,.badge.approved,.badge.live { color: var(--green); background: var(--green-soft); }
.badge.processed,.badge.demo { color: var(--blue); background: var(--blue-soft); }
.badge.suspended,.badge.failed,.badge.rejected,.badge.reconcile { color: var(--red); background: var(--red-soft); }
.tag { display: inline-flex; padding: 2px 6px; background: var(--chip); color: var(--chip-text); border-radius: 5px; font-size: 11px; font-weight: 640; }
.amount { white-space: nowrap; }
.usd-equivalent { display: inline-block; margin-inline-start: .45em; color: var(--muted); font-size: .9em; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-sub .usd-equivalent { margin-inline-start: 0; font-size: inherit; color: var(--ink); }
.withdrawals .usd-equivalent { display: block; margin-inline-start: 0; }
.table-link-button { border: 0; background: transparent; padding: 1px 0; text-align: left; font-size: inherit; }
.table-link-button:hover { color: var(--primary); }
.mobile-request { display: none; }
.table-end { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 12px 18px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.pagination .icon-btn { width: 31px; min-height: 31px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty svg { color: var(--primary); }
.empty b { display: block; color: var(--ink); margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; }
.inline-alert { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin: 0 0 15px; border-radius: 8px; font-size: 13px; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--edge); }
.inline-alert svg { flex: 0 0 auto; }
.simple-panel { overflow: hidden; }
.simple-panel > header { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.simple-panel h2 { margin: 0; font-size: 17px; }
.simple-panel table { min-width: 600px; }
.simple-panel td:last-child .btn { margin-left: 6px; }
.right { text-align: right; }
.brand-login { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; font-weight: 700; }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login-card { width: min(100%, 470px); padding: 26px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.login-card p { color: var(--muted); margin: 7px 0 19px; font-size: 14px; }
.login-card .btn { width: 100%; margin-top: 12px; }
.boot { display: grid; place-items: center; height: 100dvh; color: var(--muted); }
dialog { border: 1px solid var(--edge); color: var(--ink); background: var(--surface); padding: 0; box-shadow: var(--float-shadow); }
dialog::backdrop { background: var(--overlay); }
#detail-dialog { margin: 0 0 0 auto; border: 0; border-left: 1px solid var(--edge); width: min(100vw, 570px); max-width: none; height: 100dvh; max-height: 100dvh; overflow-y: auto; }
#detail-dialog[open] { display: flex; flex-direction: column; }
#form-dialog { border-radius: 15px; width: min(calc(100vw - 28px), 480px); max-height: calc(100dvh - 26px); overflow: auto; }
.dialog-head { background: var(--surface); position: sticky; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--edge); z-index: 1; }
.dialog-head .hint { margin: 0 0 3px; }
.dialog-head h2 { font-size: 22px; margin: 0; letter-spacing: -.035em; }
.dialog-body { padding: 18px 22px; flex: 1; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--edge); }
.details-block { border: 1px solid var(--edge); border-radius: 10px; padding: 13px 15px; margin-bottom: 12px; }
.details-block h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.details-block h3 svg { color: var(--primary); }
.details-block p { margin: 0; font-size: 14px; color: var(--muted); }
.detail-status { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: minmax(105px, 39%) 1fr; gap: 7px 10px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.kv code { font-size: 12px; }
.long-value .icon-btn { display: inline-flex; width: 23px; min-height: 23px; margin-left: 4px; vertical-align: middle; }
.history-list { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.history-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--edge-soft); overflow-wrap: anywhere; }
.history-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.history-list li:first-child { padding-top: 0; }
details > summary { cursor: pointer; font-size: 14px; font-weight: 660; }
details[open] > summary { margin-bottom: 10px; }
.field { display: block; margin: 11px 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.field input, .field textarea, .field .select { display: block; margin-top: 5px; font-weight: 400; }
.field textarea { resize: vertical; min-height: 76px; }
.field .select select { width: 100%; }
.field.check { display: flex; align-items: center; gap: 9px; }
.field.check input { width: auto; min-height: auto; margin: 0; }
.prompt { margin: 0 0 9px; color: var(--muted); font-size: 14px; }
#toast { position: fixed; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 44px)); z-index: 9; }
#toast:not(:empty) { padding: 11px 15px; background: var(--primary-soft); color: var(--ink); box-shadow: var(--float-shadow); font-size: 14px; border: 1px solid var(--edge); border-radius: 9px; }
@media (max-width: 1140px) {
  .shell { grid-template-columns: 203px minmax(0, 1fr); }
  .topbar { padding: 0 20px; } main { padding: 26px 20px; }
  .tabs { gap: 15px; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 59px 1fr; }
  .topbar,main { grid-column: 1; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: 241px; box-shadow: var(--float-shadow); }
  .sidebar.is-open { display: flex; }
  .mobile-toggle { display: inline-flex; }
  .sidebar .brand .mobile-toggle { margin-left: auto; }
  .brand { padding: 0 15px; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 12px; } main { padding: 22px 12px; }
  .crumbs .crumb-root,.crumbs .crumb-chevron { display: none; }
  .scope .select { min-width: 110px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .kpi { padding: 10px 12px; min-height: 96px; }
  .kpi-head { font-size: 13px; } .kpi-head .tile { width: 27px; height: 27px; }
  .kpi strong { font-size: 24px; }
  .page-head { gap: 8px; margin-bottom: 16px; }
  .page-head p { font-size: 13px; }
  .page-head .btn { font-size: 0; min-width: 38px; padding: 6px 8px; gap: 0; }
  .panel-title { padding: 12px 12px 0; }
  .tabs { padding: 0 12px; margin-top: 4px; }
  .toolbar { padding: 10px 12px; flex-wrap: wrap; }
  .search { width: 100%; flex: 0 0 100%; }
  .toolbar-grow { display: none; }
  #network-filter,.period-select { flex: 1 1 0; min-width: 0; }
  #network-filter .select,.period-select { width: 100%; }
  .withdrawals { min-width: 0; table-layout: fixed; }
  .withdrawals .request-cell,.withdrawals .debit-cell,.withdrawals .date-cell,.withdrawals .action-cell { display: none; }
  .withdrawals .player-cell { width: 36%; }
  .withdrawals .payout-cell { width: 26%; }
  .withdrawals .select-cell { width: 31px; padding: 0 5px 0 7px; }
  .bulk-bar { padding: 8px; gap: 5px; }
  .bulk-bar .btn { font-size: 12px; }
  .withdrawals th,.withdrawals td { padding: 8px; overflow-wrap: anywhere; }
  .withdrawals .person .avatar { display: none; }
  .withdrawals .user-id { display: none; }
  .withdrawals .mobile-request { display: inline-block; font-size: 12px; }
  .withdrawals .badge { white-space: normal; font-size: 11px; }
  .withdrawals .amount { white-space: normal; font-size: 13px; }
  .table-end { padding: 10px 12px; gap: 5px; }
  .table-end .size-select { display: none; }
  .dialog-head,.dialog-body,.dialog-foot { padding-left: 15px; padding-right: 15px; }
}
@media (max-width: 355px) {
  .scope .badge { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.roles-panel { margin-top: 16px; padding: 15px 18px; }
.roles-panel h2 { margin: 0 0 9px; font-size: 17px; }
.queue-hint { margin: 11px 2px 0; }
.details-block .provider-reason { margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
