:root {
  --canvas: #211d3c;
  --canvas-deep: #17142c;
  --surface: #30294f;
  --surface-raised: #38315a;
  --surface-soft: #282246;
  --border: #4b426f;
  --text: #f8f6ff;
  --muted: #b2aacb;
  --muted-2: #8e84ac;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --success: #48c993;
  --danger: #ff6f8e;
  --confirm-start: #159b69;
  --confirm-end: #48c993;
  --cancel-start: #b92c4c;
  --cancel-end: #ef5c78;
  --warning: #f6be5d;
  --shadow: 0 18px 48px rgb(6 3 20 / 30%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "coins-icons";
  font-display: swap;
  src: url("../fonts/icons.woff2") format("woff2"), url("../fonts/icons.woff") format("woff");
  font-weight: 400;
  font-style: normal;
}

body[data-theme="light"] {
  --canvas: #aebdcb;
  --canvas-deep: #9eafbf;
  --surface: #c2ced9;
  --surface-raised: #ced8e1;
  --surface-soft: #b5c3d0;
  --border: #8fa1b3;
  --text: #102235;
  --muted: #334d65;
  --muted-2: #50677c;
  --success: #157a51;
  --danger: #bd2447;
  --warning: #9b6a00;
  --shadow: 0 18px 48px rgb(43 68 94 / 14%);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 67% -10%, #493784 0, transparent 36rem), var(--canvas); }
body[data-theme="light"] { background: radial-gradient(circle at 67% -10%, #94a9bf 0, transparent 32rem), var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 53% 5%, #243957 0, transparent 28rem), var(--canvas-deep); }
.login-card { width: min(100%, 450px); padding: 34px; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); background: linear-gradient(145deg, #18263a, #111b2a); }
.brand-mark { display: flex; gap: 12px; align-items: center; color: var(--text); font-weight: 800; letter-spacing: .03em; }
.brand-mark__site-symbol { position: relative; display: block; flex: 0 0 43px; width: 43px; height: 43px; overflow: hidden; }
.brand-mark__site-symbol img { display: block; width: 282px; max-width: none; height: 43px; transform: translateX(-123px); }
.brand-mark__text { flex: 1; min-width: 0; font-size: 19px; line-height: 1.02; white-space: nowrap; }
.brand-mark small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .105em; }
.login-card h1 { margin: 32px 0 8px; font-size: 26px; }
.login-card p { color: var(--muted); line-height: 1.5; }
.credentials { margin: 22px 0; padding: 13px; border-left: 3px solid var(--accent); border-radius: 8px; background: #101926; color: var(--muted); font-size: 13px; line-height: 1.55; }

.field { display: grid; gap: 9px; margin: 16px 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; outline: none; color: var(--text); background: #292247; line-height: 1.4; }
.check-field { display: inline-flex; gap: 9px; align-items: center; min-height: 34px; margin: 0; color: var(--text); cursor: pointer; }
.check-field input[type="checkbox"] { appearance: none; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 1px solid #8d7fbb; border-radius: 5px; background: #211b3b; display: grid; place-content: center; }
.check-field input[type="checkbox"]::after { width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; content: ''; opacity: 0; transform: rotate(-45deg) translateY(-1px); }
.check-field input[type="checkbox"]:checked { border-color: var(--confirm-start); background: var(--confirm-start); }
.check-field input[type="checkbox"]:checked::after { opacity: 1; }
.currency-switches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.currency-switches legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .currency-switches { grid-template-columns: 1fr; } }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ff245724; }
.field select option { background: #111b2a; }
.button { min-height: 42px; padding: 9px 16px; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(100deg, var(--confirm-start), var(--confirm-end)); font-weight: 800; font-size: 14px; box-shadow: 0 7px 18px rgb(21 155 105 / 28%); }
.button:hover:not(:disabled) { filter: brightness(1.1); }
.button:focus-visible, .nav-item:focus-visible { outline: 3px solid #d2baff; outline-offset: 2px; }
.button--soft { background: #494064; color: var(--text); box-shadow: none; }
.button--danger { background: #87334b; }
.button--small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.button--wide { width: 100%; margin-top: 9px; }
.message { min-height: 20px; margin-top: 12px; color: var(--danger); font-size: 13px; }
.message.success { color: var(--success); }

.admin-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; overflow-y: auto; border-right: 1px solid var(--border); background: #252041; }
.sidebar .brand-mark { width: 100%; min-height: 70px; margin: 0 0 22px; padding: 12px 11px; border: 1px solid #584b83; border-radius: 10px; background: linear-gradient(105deg, #332b57, #262041); }
.sidebar .brand-mark__site-symbol { flex-basis: 38px; width: 38px; height: 38px; }
.sidebar .brand-mark__site-symbol img { width: 249px; height: 38px; transform: translateX(-109px); }
.sidebar .brand-mark__text { font-size: 16px; letter-spacing: .015em; }
.sidebar .brand-mark small { margin-top: 4px; font-size: 9px; letter-spacing: .095em; }
.nav-group { margin: 11px 0 4px; padding: 0 11px; color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-list { display: grid; gap: 6px; }
.nav-section { display: grid; gap: 2px; }
.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 43px; padding: 8px 12px; border: 0; border-radius: 9px; color: #d1c8e7; background: transparent; text-align: left; font-size: 14px; font-weight: 650; }
.nav-item:hover:not(:disabled) { color: var(--text); background: #3a305d; }
.nav-item.active { color: #fff; background: linear-gradient(100deg, #7547c9, #a955d6); box-shadow: 0 4px 12px rgb(116 71 201 / 28%); }
.nav-item:disabled { color: #5f5877; }
.nav-submenu { display: grid; gap: 3px; }
.nav-submenu__header { display: flex; align-items: stretch; }
.nav-submenu__header .nav-item { min-width: 0; flex: 1; }
.nav-submenu-toggle { display: grid; place-items: center; width: 38px; border: 0; border-radius: 10px; color: #c8c2df; background: transparent; font-size: 20px; }
.nav-submenu-toggle:hover { color: var(--text); background: #1d2a3d; }
.nav-subitem { display: flex; gap: 10px; align-items: center; min-height: 31px; margin-left: 20px; padding: 5px 12px; border: 0; border-radius: 7px; color: #aaa3c1; background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.nav-subitem:hover { color: var(--text); background: rgb(126 84 192 / 15%); }
.nav-subitem.active { color: #fff; background: transparent; box-shadow: inset 3px 0 0 #c084fc; }
.nav-subitem__icon { width: 18px; font-size: 16px; }
.nav-icon { display: grid; place-items: center; width: 24px; color: currentColor; font-family: "coins-icons"; font-size: 21px; font-style: normal; line-height: 1; }
.nav-icon::before { font-family: inherit; font-weight: 400; }
.nav-icon--home::before { content: "\e923"; }
.nav-icon--players::before { content: "\e929"; }
.nav-icon--bonus::before { content: "\e91c"; }
.nav-icon--slots::before { content: "\e907"; }
.nav-icon--payments::before { content: "\e910"; }
.nav-icon--payment-systems::before { content: "\e908"; }
.nav-icon--vip::before { content: "\e90d"; }
.nav-icon--tournaments::before { content: "\e92c"; }
.nav-icon--jackpots::before { content: "\e90f"; }
.nav-icon--betting::before { content: "\e900"; }
.nav-icon--wheel::before { content: "\e919"; }
.nav-icon--agents::before { content: "\e90c"; }
.nav-icon--affiliate::before { content: "\e91d"; }
.nav-icon--settings::before { content: "\e924"; }
.nav-icon--tests::before { content: "\e92b"; }
.nav-icon--safety::before { content: "\e91f"; }
.nav-note { margin-left: auto; color: #8c80a9; font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 22px 11px 0; color: var(--muted-2); font-size: 12px; line-height: 1.5; }

.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; gap: 16px; align-items: center; min-height: 78px; padding: 14px 34px; border-bottom: 1px solid var(--border); background: #252041f2; backdrop-filter: blur(16px); }
.menu-toggle { display: none; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: #172337; font-size: 12px; font-weight: 700; }
.topbar-search { display: flex; gap: 10px; align-items: center; width: min(34vw, 360px); min-width: 220px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted-2); background: #292247; font-size: 15px; }
.topbar-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.topbar-search input::placeholder { color: var(--muted); }
.topbar-tools { display: flex; gap: 7px; margin-left: auto; }
.topbar-icon { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; }
.topbar-icon--text { font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.locale-toggle { display: flex; gap: 5px; align-items: center; justify-content: center; width: 64px; }
.topbar-icon:hover { color: var(--text); background: #1d2a3d; }
.locale-control { position: relative; }
.locale-menu { position: absolute; z-index: 50; top: calc(100% + 9px); right: 0; display: grid; width: 184px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); background: var(--surface-raised); }
.locale-menu.is-hidden { display: none; }
.locale-menu button { display: flex; gap: 10px; align-items: center; padding: 11px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; font-size: 14px; }
.locale-flag { flex: 0 0 auto; font-size: 19px; line-height: 1; }
.locale-menu button:hover { background: var(--surface-soft); }
.operator { display: flex; gap: 11px; align-items: center; }
.operator-profile { position: relative; }
.operator-avatar { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #f01348, #ff5c7f); font-size: 16px; font-weight: 800; box-shadow: 0 7px 18px #ff24573a; }
.operator-avatar:hover { filter: brightness(1.1); transform: translateY(-1px); }
.operator-copy { display: grid; gap: 2px; font-size: 14px; }
.operator-copy small { color: var(--muted); font-size: 11px; }
.profile-menu { position: absolute; z-index: 50; top: calc(100% + 10px); right: 0; width: 270px; padding: 8px; border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); background: var(--surface-raised); }
.profile-menu.is-hidden { display: none; }
.profile-menu__identity { display: grid; gap: 4px; padding: 11px; border-bottom: 1px solid var(--border); }
.profile-menu__identity strong { font-size: 14px; }
.profile-menu__identity span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu button { width: 100%; margin-top: 6px; padding: 11px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; font-size: 14px; font-weight: 700; }
.profile-menu button:hover { background: var(--surface-soft); }

.page { width: 100%; max-width: none; margin: 0; padding: 32px 42px 52px; }
.page-heading { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 23px; }
.eyebrow { margin-bottom: 6px; color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; }
.page-heading p { max-width: 820px; margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select { min-height: 34px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface); font-size: 12px; }
.range-set { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #101a29; }
.range { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.range.active { color: #fff; background: var(--accent); }

.notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #314463; border-radius: 9px; color: #cbd5e4; background: #172337; font-size: 12px; line-height: 1.5; }
.notice strong { color: #fff; }
.notice.warning { border-color: #725928; background: #2d2518; color: #ddc98f; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 12px; }
.kpis > * { min-width: 0; }
.kpi { min-height: 122px; min-width: 0; padding: 17px; border: 1px solid var(--border); border-radius: 11px; background: linear-gradient(145deg, #1b2a40, #141e2d); box-shadow: 0 12px 26px #070d1621; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { margin: 16px 0 5px; overflow-wrap: anywhere; font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.kpi-meta { color: var(--accent-2); font-size: 11px; }
.treasury-protocol-value { font-size: clamp(13px, 1.25vw, 18px); line-height: 1.16; letter-spacing: -.02em; word-break: break-word; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 20px; }
.dashboard-activity { min-width: 0; }
.dashboard-pending { max-width: none; }
.dashboard-grid .card-heading { gap: 14px; flex-wrap: wrap; }
.dashboard-range { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.card { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.card-heading { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.card-heading h2 { min-width: 0; margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.card-heading span { color: var(--muted); font-size: 11px; }
.card-body { padding: 16px; }

.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }
.table-wrap > table { min-width: 760px; table-layout: auto; }
.table-wrap > table.pin-codes-table { min-width: 940px; }
.table-wrap > table.vip-levels-table { min-width: 1160px; }
.table-wrap > table.payments-table { min-width: 1120px; }
.payments-table th, .payments-table td { white-space: nowrap; overflow-wrap: normal; }
.payments-table th:nth-child(6), .payments-table td:nth-child(6) { min-width: 128px; }
.payments-table th:nth-child(7), .payments-table td:nth-child(7) { min-width: 160px; }
.payments-table th:last-child, .payments-table td:last-child { min-width: 104px; padding-right: 17px; text-align: right; }
.payments-table td:last-child .text-button { display: inline-flex; justify-content: flex-end; margin-left: 0; white-space: nowrap; }
.pin-codes-table th, .pin-codes-table td,
.vip-levels-table th, .vip-levels-table td { white-space: nowrap; overflow-wrap: normal; }
.vip-levels-table th:nth-child(6), .vip-levels-table td:nth-child(6) { min-width: 250px; white-space: normal; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--border); text-align: left; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; vertical-align: middle; }
th { color: #c1b7d9; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #3a305d; }
.amount { font-weight: 800; }
.amount.positive { color: var(--success); }
.amount.negative { color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; color: #cad7e9; background: #263a55; font-size: 10px; font-weight: 700; }
.badge.ok { color: #8ce3bc; background: #184735; }
.badge.warning { color: #ffd27b; background: #513d19; }
.badge.error { color: #ff9eb1; background: #552136; }
.empty { padding: 34px 18px; color: var(--muted); text-align: center; font-size: 13px; }
.pending-list { display: grid; gap: 10px; }
.pending { padding: 12px; border: 1px solid #30415c; border-radius: 8px; background: #111b2a; }
.pending strong { display: block; margin-bottom: 4px; font-size: 12px; }
.pending span { color: var(--muted); font-size: 11px; }

.two-column { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 16px; }
.two-column > *, .card-body, .card-heading > * { min-width: 0; }
.settings-form { padding: 18px; }
.settings-form .button { margin-top: 4px; }
.settings-domain-title { margin: 18px 0 8px; font-size: 12px; }
.settings-domain-list { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; list-style: none; }
.settings-domain-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); }
.settings-domain-list code { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.health-list { display: grid; gap: 8px; }
.health-row { display: grid; grid-template-columns: 1.25fr 90px 2fr; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.health-row:last-child { border-bottom: 0; }
.health-row p { margin: 0; color: var(--muted); line-height: 1.4; }
.permission-list { display: flex; flex-wrap: wrap; gap: 6px; }
.permission { padding: 4px 6px; border: 1px solid #355073; border-radius: 5px; color: #c7d9f0; background: #172337; font-size: 10px; }
.loading { display: grid; min-height: 280px; place-items: center; color: var(--muted); }
.error-panel { padding: 18px; border: 1px solid #6e2d47; border-radius: 10px; color: #ffc1cf; background: #351426; }
.mobile-only { display: none; }
.muted { color: var(--muted); }
.card-body--compact { padding: 12px 16px; }
.table-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.compact-field { display: grid; gap: 6px; min-width: min(100%, 210px); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.compact-field input, .compact-field select { min-height: 39px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; outline: 0; color: var(--text); background: #292247; font: inherit; letter-spacing: normal; text-transform: none; }
.compact-field input:focus, .compact-field select:focus { border-color: var(--accent); }
.text-button { display: inline-flex; align-items: center; min-height: 34px; margin: 0; padding: 6px 7px; border: 0; color: var(--accent-2); background: transparent; font-size: 13px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.text-button:hover { color: #fff; text-decoration: underline; }
.operators-table { min-width: 900px; }
.operators-table th, .operators-table td { white-space: nowrap; overflow-wrap: normal; }
.operators-table th:nth-child(1), .operators-table td:nth-child(1) { min-width: 250px; }
.operators-table th:nth-child(2), .operators-table td:nth-child(2) { min-width: 180px; }
.operators-table th:nth-child(3), .operators-table td:nth-child(3) { min-width: 110px; }
.operators-table th:nth-child(4), .operators-table td:nth-child(4) { min-width: 170px; }
.operators-table th:last-child, .operators-table td:last-child { min-width: 150px; padding-right: 18px; text-align: right; }
.operators-table td:last-child .text-button { justify-content: flex-end; }
.player-actions { display: flex; align-items: center; gap: 6px; }
.player-actions .text-button { margin-left: 0; }
.balance-action { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 7px; color: #fff; font-size: 19px; font-weight: 800; line-height: 1; }
.balance-action--credit { background: linear-gradient(135deg, #159b69, #48c993); }
.balance-action--debit { background: linear-gradient(135deg, var(--cancel-start), var(--cancel-end)); }
.balance-action:hover { filter: brightness(1.12); }
.players-table { min-width: 1180px; }
.players-table td { vertical-align: middle; }
.players-table th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.players-table th:nth-child(1) { min-width: 270px; }
.players-table th:nth-child(2) { min-width: 100px; }
.players-table th:nth-child(3), .players-table th:nth-child(4) { min-width: 138px; }
.players-table th:nth-child(5) { min-width: 92px; }
.players-table th:nth-child(6) { min-width: 190px; }
.players-table th:nth-child(7) { min-width: 440px; }
.treasury-table { min-width: 1080px; }
.treasury-table th, .treasury-table td { white-space: nowrap; overflow-wrap: normal; }
.treasury-table th:last-child,
.treasury-table .currency-actions { background: var(--surface); position: sticky; right: 0; z-index: 1; }
.treasury-table th:last-child { z-index: 2; }
.currency-actions { min-width: 150px; }
.table-muted { color: var(--muted); font-size: 12px; }
.table-id { display: inline-block; max-width: 148px; overflow: hidden; color: #8f82b2; font-size: 10px; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.table-date { display: inline-grid; gap: 2px; min-width: 104px; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.table-date small { color: var(--muted); font-size: 11px; }
.domain-ledger-table { min-width: 760px; }
.domain-ledger-table td { white-space: normal; overflow-wrap: anywhere; }
.domain-ledger-table td:first-child { width: 18%; }
.domain-ledger-table code { color: #a99acb; font-size: 11px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 350px; }
.row-actions .text-button { min-height: 34px; padding: 5px 4px; }
.player-card-list { display: none; }
.player-card { display: grid; gap: 16px; padding: 18px; border-top: 1px solid var(--border); background: var(--surface-raised); }
.player-card__header { display: flex; gap: 12px; align-items: start; justify-content: space-between; }
.player-card__header strong, .player-card__header small { display: block; }
.player-card__header strong { font-size: 16px; overflow-wrap: anywhere; }
.player-card__header small { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.player-card__balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-card__balances > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.player-card__balances span, .player-card__details dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.player-card__balances b { font-size: 15px; overflow-wrap: anywhere; }
.player-card__details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.player-card__details div { min-width: 0; }
.player-card__details dt { margin-bottom: 4px; }
.player-card__details dd { margin: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.player-card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-fact { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.profile-fact span { color: var(--muted); font-size: .77rem; text-transform: uppercase; letter-spacing: .04em; }
.profile-fact b { overflow-wrap: anywhere; }
.profile-section { margin-top: 20px; }
.profile-actions { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.profile-section h3 { margin: 0 0 10px; font-size: 1rem; }
@media (max-width: 560px) { .profile-summary { grid-template-columns: 1fr; } }
.modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 18px; background: rgb(4 9 16 / 74%); }
.modal.is-hidden { display: none; }
.modal-card { width: min(100%, 520px); padding: 24px; border: 1px solid #65558f; border-radius: 12px; box-shadow: 0 26px 70px #0c0820cc; background: #30294f; }
.modal-card--wide { width: min(100%, 1100px); }
.modal-heading { display: flex; gap: 15px; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.modal-heading h2 { margin: 0; font-size: 17px; }
.modal-close { width: 31px; height: 31px; border: 0; border-radius: 7px; color: #fff; background: linear-gradient(100deg, var(--cancel-start), var(--cancel-end)); font-size: 22px; line-height: 1; }
.modal-close:hover { filter: brightness(1.1); }
.form-note { margin: 11px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; margin-top: 18px; }
.form-actions .button--soft { color: #fff; background: linear-gradient(100deg, var(--cancel-start), var(--cancel-end)); box-shadow: 0 7px 18px rgb(185 44 76 / 25%); }
.check-field { display: flex; gap: 8px; align-items: center; margin-top: 11px; color: var(--text); font-size: 12px; }
.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form .message { flex-basis: 100%; }
.tournament-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 17px; }
.tournament-tab { min-height: 35px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 800; }
.tournament-tab:hover, .tournament-tab.active { border-color: #3e9474; color: #fff; background: #195d47; }
.tournament-list { display: grid; gap: 12px; padding: 14px; }
.tournament-card { overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-raised); }
.tournament-card__heading, .tournament-card__footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 15px; }
.tournament-card__heading { border-bottom: 1px solid var(--border); }
.tournament-card__heading strong, .tournament-card__heading code { display: block; }
.tournament-card__heading strong { font-size: 14px; }
.tournament-card__heading code { margin-top: 3px; color: var(--muted); font-size: 11px; }
.tournament-card__metrics { display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: 12px; padding: 14px 15px; }
.tournament-card__metrics div { display: grid; gap: 5px; min-width: 0; }
.tournament-card__metrics small { color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tournament-card__metrics strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.tournament-card__footer { min-height: 49px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.4; }
.tournament-card__footer span { min-width: 0; overflow-wrap: anywhere; }
.tournament-card__footer > .button:first-of-type { margin-left: auto; }
.tournament-card__footer > .button + .button { margin-left: -5px; }
.tournament-empty { display: grid; min-height: 165px; place-content: center; gap: 9px; padding: 24px; color: var(--muted); text-align: center; }
.tournament-empty strong { color: var(--text); font-size: 14px; }
.tournament-empty span { max-width: 480px; font-size: 12px; line-height: 1.5; }
.tournament-config-block { margin-top: 20px; padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.tournament-config-block h3 { margin: 0 0 10px; font-size: 14px; }
.tournament-config-block h3 + select { margin-bottom: 16px; }
.tournament-config-block select { width: 100%; min-height: 88px; padding: 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: #111b2a; }
.tournament-prize-rows { display: grid; gap: 10px; margin-bottom: 11px; }
.tournament-prize-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 0 12px; border-bottom: 1px solid var(--border); }
.tournament-prize-row .field { margin: 0; }
#tournament-form .two-column { align-items: start; }
#tournament-form .two-column .field { margin: 0; }
#tournament-form input[type="datetime-local"] { min-width: 0; min-height: 46px; padding-inline: 12px; }
#tournament-modal .modal-card--wide { max-height: calc(100dvh - 36px); overflow-y: auto; }
#tournament-modal #tournament-form { padding-bottom: 78px; }
#tournament-modal .form-actions { position: fixed; z-index: 61; right: max(18px, calc((100vw - 1100px) / 2 + 20px)); bottom: 18px; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-raised); box-shadow: 0 12px 30px rgb(2 6 17 / 55%); }

body[data-theme="light"] .sidebar { border-color: #33465d; background: linear-gradient(180deg, #29384c, #1e2b3c); }
body[data-theme="light"] .topbar { background: #cbd6e0f2; }
body[data-theme="light"] .sidebar .brand-mark { border-color: #52677e; background: linear-gradient(105deg, #33465e, #253449); }
body[data-theme="light"] .sidebar .brand-mark, body[data-theme="light"] .sidebar .brand-mark small { color: #eef5fc; }
body[data-theme="light"] .nav-group { color: #9eb1c5; }
body[data-theme="light"] .nav-item { color: #e4edf6; }
body[data-theme="light"] .nav-item:hover:not(:disabled), body[data-theme="light"] .nav-subitem:hover { color: #fff; background: #3a5069; }
body[data-theme="light"] .nav-item.active { color: #fff; background: linear-gradient(100deg, #7052c7, #a863d8); box-shadow: 0 4px 12px rgb(112 82 199 / 24%); }
body[data-theme="light"] .nav-item:disabled { color: #71849a; }
body[data-theme="light"] .nav-subitem { color: #c6d4e2; }
body[data-theme="light"] .nav-subitem.active { color: #fff; background: transparent; box-shadow: inset 3px 0 0 #c99bff; }
body[data-theme="light"] .nav-submenu-toggle { color: #d8e4ef; }
body[data-theme="light"] .nav-submenu-toggle:hover { color: #fff; background: #3a5069; }
body[data-theme="light"] .login-page { background: radial-gradient(circle at 53% 5%, #d8e7fb 0, transparent 28rem), var(--canvas-deep); }
body[data-theme="light"] .login-card, body[data-theme="light"] .kpi { background: #c9d5df; }
body[data-theme="light"] .kpi { background: linear-gradient(145deg, #d1dce5, #b9c8d5); }
body[data-theme="light"] .credentials, body[data-theme="light"] .field input, body[data-theme="light"] .field select, body[data-theme="light"] .field textarea, body[data-theme="light"] .topbar-search, body[data-theme="light"] .compact-field input, body[data-theme="light"] .compact-field select, body[data-theme="light"] .pending, body[data-theme="light"] .modal-card, body[data-theme="light"] .tournament-config-block select { background: #d5dfe7; }
body[data-theme="light"] .topbar-icon:hover { background: #eaf1f9; }
body[data-theme="light"] .button--soft { background: #e3edf8; color: #25364a; }
body[data-theme="light"] .form-actions .button--soft { color: #fff; background: linear-gradient(100deg, var(--cancel-start), var(--cancel-end)); }
body[data-theme="light"] .notice { border-color: #c5d5e6; color: #40546b; background: #f0f6fc; }
body[data-theme="light"] tbody tr:hover { background: #f4f8fc; }
body[data-theme="light"] .range-set { background: #eef3f8; }
body[data-theme="light"] th { color: #3e5369; }
body[data-theme="light"] .badge { color: #314a63; background: #dce8f3; }
body[data-theme="light"] .badge.ok { color: #17643f; background: #d7f1e3; }
body[data-theme="light"] .badge.warning { color: #825900; background: #fff0c9; }
body[data-theme="light"] .badge.error { color: #9c2440; background: #ffe0e7; }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .nav-item { gap: 10px; padding-inline: 10px; font-size: 14px; }
  .page { padding: 24px 22px 42px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .operator-copy { display: none; }
  .topbar { gap: 10px; padding: 12px 18px; }
  .topbar-search { width: min(26vw, 250px); min-width: 150px; }
  .card-heading { align-items: flex-start; }
  .card-heading > span { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
  .dashboard-range { text-align: left; }
  .dashboard-activity .table-wrap > table { min-width: 760px; }
  .tournament-card__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tournament-card__footer > .button:first-of-type { margin-left: 0; }
  .tournament-card__footer > .button + .button { margin-left: 0; }
}
@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; }
  .sidebar .brand-mark { min-height: 58px; margin-bottom: 18px; padding: 9px; }
  .sidebar .brand-mark__site-symbol { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar .brand-mark__site-symbol img { width: 223px; height: 34px; transform: translateX(-98px); }
  .sidebar .brand-mark__text { font-size: 13px; }
  .sidebar .brand-mark small { font-size: 8px; }
  .nav-list { gap: 11px; }
  .nav-group { display: block; margin: 8px 0 2px; padding-inline: 9px; font-size: 9px; }
  .nav-item { gap: 10px; min-height: 43px; padding: 8px 10px; font-size: 13px; }
  .nav-subitem { margin-left: 18px; font-size: 12px; }
  .topbar { min-height: 72px; padding: 12px 18px; }
  .topbar-search { width: min(25vw, 240px); min-width: 130px; }
  .page { padding: 26px 22px 44px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .players-table { min-width: 740px; }
  .players-table th:nth-child(5), .players-table td:nth-child(5), .players-table th:nth-child(6), .players-table td:nth-child(6) { display: none; }
  .players-table th, .players-table td { padding: 12px 11px; }
  .row-actions { min-width: 225px; gap: 5px; }
  .row-actions .button--small { padding-inline: 8px; font-size: 12px; }
  .row-actions .text-button { font-size: 12px; }
  .players-table-wrap { display: none; }
  .player-card-list { display: grid; }
}
@media (min-width: 681px) and (max-width: 900px) {
  /* Keep navigation permanently visible on compact desktop windows. */
  .admin-shell { display: grid; grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { position: static; z-index: auto; width: auto; max-width: none; transform: none; transition: none; box-shadow: none; }
  .menu-toggle { display: none; }
  .topbar { padding-inline: 14px; }
  .topbar-search { width: min(44vw, 320px); }
  .page { padding-inline: 14px; }
  .table-wrap > table, .dashboard-activity .table-wrap > table { min-width: 590px; }
  /* One compact-desktop grid standard across every admin register: no clipped columns. */
  .table-wrap > table { width: 100%; min-width: 100%; table-layout: fixed; }
  .table-wrap th, .table-wrap td { padding: 11px 7px; white-space: normal; overflow-wrap: anywhere; font-size: 11px; line-height: 1.3; }
  .table-wrap th { font-size: 8px; letter-spacing: .045em; line-height: 1.25; }
  /* Payments must keep their action visible instead of pushing it past the viewport. */
  .table-wrap > table.payments-table { min-width: 100%; table-layout: fixed; }
  .payments-table th, .payments-table td { min-width: 0; padding: 10px 5px; white-space: normal; overflow-wrap: anywhere; font-size: 10px; }
  .payments-table th { font-size: 7px; }
  .payments-table th:nth-child(1), .payments-table td:nth-child(1) { width: 14%; }
  .payments-table th:nth-child(2), .payments-table td:nth-child(2) { width: 15%; }
  .payments-table th:nth-child(3), .payments-table td:nth-child(3) { width: 9%; }
  .payments-table th:nth-child(4), .payments-table td:nth-child(4) { width: 8%; }
  .payments-table th:nth-child(5), .payments-table td:nth-child(5) { width: 9%; }
  .payments-table th:nth-child(6), .payments-table td:nth-child(6) { width: 14%; white-space: nowrap; overflow-wrap: normal; }
  .payments-table th:nth-child(7), .payments-table td:nth-child(7) { width: 12%; }
  .payments-table th:last-child, .payments-table td:last-child { width: 11%; min-width: 0; padding-right: 5px; }
  .payments-table td:last-child .text-button { font-size: 10px; }
  /* Agent register: preserve the edit control at compact desktop widths. */
  .table-wrap > table.operators-table { min-width: 100%; table-layout: fixed; }
  .operators-table th, .operators-table td { min-width: 0; padding: 11px 6px; white-space: normal; overflow-wrap: anywhere; }
  .operators-table th:nth-child(1), .operators-table td:nth-child(1) { width: 28%; min-width: 0; }
  .operators-table th:nth-child(2), .operators-table td:nth-child(2) { width: 23%; min-width: 0; }
  .operators-table th:nth-child(3), .operators-table td:nth-child(3) { width: 17%; min-width: 0; }
  .operators-table th:nth-child(4), .operators-table td:nth-child(4) { display: none; }
  .operators-table th:last-child, .operators-table td:last-child { width: 32%; min-width: 0; padding-right: 6px; text-align: right; }
  .operators-table td:last-child .text-button { max-width: 100%; padding-inline: 2px; font-size: 11px; }
  .dashboard-activity th, .dashboard-activity td { padding: 12px 10px; }
  .dashboard-activity th { font-size: 10px; }
  .dashboard-activity .table-date { min-width: 92px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treasury-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .treasury-kpis .kpi { min-height: 122px; padding: 14px; }
  .treasury-kpis .kpi-value { margin-top: 12px; font-size: 20px; }
  .treasury-kpis .treasury-protocol-value { font-size: 13px; }
  /* VIP must remain a readable grid inside the compact, permanently visible sidebar layout. */
  .table-wrap > table.vip-levels-table { min-width: 100%; table-layout: fixed; }
  .vip-levels-table th, .vip-levels-table td { padding: 11px 6px; white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
  .vip-levels-table th { font-size: 8px; letter-spacing: .045em; line-height: 1.25; }
  .vip-levels-table th:nth-child(1), .vip-levels-table td:nth-child(1) { width: 8%; }
  .vip-levels-table th:nth-child(2), .vip-levels-table td:nth-child(2) { width: 13%; }
  .vip-levels-table th:nth-child(3), .vip-levels-table td:nth-child(3) { width: 12%; }
  .vip-levels-table th:nth-child(4), .vip-levels-table td:nth-child(4) { width: 14%; }
  .vip-levels-table th:nth-child(5), .vip-levels-table td:nth-child(5) { width: 16%; }
  .vip-levels-table th:nth-child(6), .vip-levels-table td:nth-child(6) { min-width: 0; width: 19%; }
  .vip-levels-table th:nth-child(7), .vip-levels-table td:nth-child(7) { width: 9%; }
  .vip-levels-table th:nth-child(8), .vip-levels-table td:nth-child(8) { width: 9%; }
}
@media (max-width: 680px) {
  .admin-shell { grid-template-columns: 70px minmax(0, 1fr); }
  .sidebar { padding-inline: 6px; }
  .sidebar .brand-mark { min-height: 52px; padding: 7px; justify-content: center; }
  .sidebar .brand-mark__site-symbol { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar .brand-mark__site-symbol img { width: 223px; height: 34px; transform: translateX(-98px); }
  .sidebar .brand-mark__text, .nav-label, .nav-group, .sidebar-footer, .nav-submenu-toggle { display: none; }
  .nav-list { gap: 5px; }
  .nav-item { justify-content: center; min-height: 46px; padding: 9px; }
  .nav-submenu__header { display: block; }
  .nav-submenu .nav-subitem { display: none; }
  .nav-submenu .nav-subitem.active { display: flex; justify-content: center; margin-left: 0; padding: 7px; }
  .topbar { padding: 12px 14px; }
  .menu-toggle { display: none; }
  .topbar-search { display: none; }
  .page { padding: 23px 18px 36px; }
  .dashboard-grid, .two-column { grid-template-columns: 1fr; }
  .table-wrap > table, .dashboard-activity .table-wrap > table { min-width: 620px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { min-height: 104px; padding: 13px; }
  .kpi-value { font-size: 20px; }
  .topbar { min-height: 68px; }
  .page-heading h1 { font-size: 22px; }
  .health-row { grid-template-columns: 1fr; gap: 7px; }
  .tournament-card__metrics { grid-template-columns: 1fr; }
  .tournament-card__footer { align-items: flex-start; flex-direction: column; }
  .tournament-card__footer > .button:first-of-type, .tournament-card__footer > .button + .button { margin-left: 0; }
  .tournament-prize-row { grid-template-columns: 1fr 1fr; }
  #tournament-modal .form-actions { right: 18px; bottom: 18px; }
  .domain-ledger-table { min-width: 620px; }
  .domain-ledger-table th, .domain-ledger-table td { padding: 11px 10px; font-size: 12px; }
  .domain-ledger-table th { font-size: 9px; }
  .domain-ledger-table th:first-child, .domain-ledger-table td:first-child { display: none; }
  .players-table { min-width: 620px; }
  .players-table th:nth-child(2), .players-table td:nth-child(2) { display: none; }
  .row-actions { min-width: 190px; }
}

/* A client demo is often shown in a narrow browser window. Keep account actions
   in the first view instead of forcing the operator to horizontally scroll. */
.payment-method-card { display: grid; min-width: 0; grid-template-rows: 104px 1fr; }
.three-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.three-column:has(.payment-method-card) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.payment-method-card .card-heading { display: block; min-height: 104px; }
.payment-method-card .card-heading > .badge { display: inline-flex; margin-top: 8px; }
.payment-method-card__title { display: flex; min-width: 0; align-items: center; gap: 13px; }
.payment-method-card__title h2 { margin: 0; font-size: 18px; }
.payment-method-card__title .muted { display: block; margin-top: 3px; }
.payment-logo { display: inline-flex; width: 54px; height: 34px; flex: 0 0 54px; align-items: center; justify-content: center; border-radius: 8px; background: #1d4ed8; color: #fff; font: 800 13px/1 Arial, sans-serif; letter-spacing: .6px; }
.payment-logo--mastercard { background: linear-gradient(90deg, #d92534 0 48%, #f7a600 48% 100%); color: #fff; letter-spacing: 0; }
.payment-method-card .card-body { display: grid; grid-template-rows: auto auto 1fr; gap: 11px; }
.payment-method-card .amount { margin: 0; font-size: 17px; }
.payment-method-card .card-body .button { align-self: end; }
.payment-method-card__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-inline: 4px; align-self: end; }
.payment-method-card__actions .button { box-sizing: border-box; min-width: 0; width: 100%; padding-inline: 4px; font-size: 12px; letter-spacing: 0; line-height: 1.15; white-space: nowrap; overflow: hidden; }
@media (min-width: 681px) and (max-width: 1320px) {
  .admin-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .sidebar .brand-mark { min-height: 58px; padding: 9px; }
  .sidebar .brand-mark__site-symbol { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar .brand-mark__site-symbol img { width: 223px; height: 34px; transform: translateX(-98px); }
  .sidebar .brand-mark__text { display: block; font-size: 13px; }
  .nav-label { display: inline; }
  .nav-group { display: block; }
  .nav-item { justify-content: flex-start; padding-inline: 10px; }
  .players-table { min-width: 740px; }
  .players-table th:nth-child(5), .players-table td:nth-child(5), .players-table th:nth-child(6), .players-table td:nth-child(6) { display: none; }
  .players-table th, .players-table td { padding: 12px 11px; }
  .row-actions { min-width: 225px; gap: 5px; }
  .row-actions .button--small { padding-inline: 8px; font-size: 12px; }
  .row-actions .text-button { font-size: 12px; }
  .three-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .three-column:has(.payment-method-card) { grid-template-columns: 1fr; }
  .three-column { grid-template-columns: 1fr; }
}

/* Financial registry: preserve whole labels and use the existing horizontal scroll. */
[hidden] { display: none !important; }
.table-wrap > table.treasury-table { min-width: 1080px; }
.table-wrap > table.treasury-table th, .table-wrap > table.treasury-table td { white-space: nowrap; overflow-wrap: normal; }

/* Mobile administration: keep the whole navigation available in a drawer.
   The previous icon rail hid submenu entries, which made several admin areas
   unreachable on a phone. */
@media (max-width: 680px) {
  body { overflow-x: hidden; }
  .admin-shell { display: block; min-height: 100dvh; }
  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(86vw, 310px);
    height: 100dvh;
    padding: 16px 12px 26px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--border);
    box-shadow: 20px 0 48px rgb(5 3 18 / 42%);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .admin-shell.sidebar-is-open .sidebar { transform: translateX(0); }
  .sidebar .brand-mark { justify-content: flex-start; min-height: 58px; margin-bottom: 14px; padding: 9px 10px; }
  .sidebar .brand-mark__site-symbol { width: 36px; height: 36px; flex-basis: 36px; }
  .sidebar .brand-mark__site-symbol img { width: 236px; height: 36px; transform: translateX(-103px); }
  .sidebar .brand-mark__text { display: block; font-size: 14px; }
  .sidebar .brand-mark small { display: block; font-size: 8px; }
  .nav-list { gap: 7px; }
  .nav-group { display: block; margin: 10px 0 3px; padding-inline: 10px; }
  .nav-item { justify-content: flex-start; gap: 11px; padding: 9px 11px; }
  .nav-label { display: inline; }
  .nav-submenu__header { display: flex; }
  .nav-submenu-toggle { display: grid; }
  .nav-submenu .nav-subitem,
  .nav-submenu .nav-subitem.active { display: flex; justify-content: flex-start; margin-left: 20px; padding: 7px 11px; }
  .sidebar-footer { display: block; padding-top: 18px; }
  .workspace { min-width: 0; }
  .topbar { position: sticky; z-index: 10; gap: 8px; padding: 10px 12px; }
  .menu-toggle { display: inline-flex; flex: 0 0 auto; }
  .topbar-tools { gap: 2px; }
  .topbar-icon { width: 36px; height: 36px; font-size: 17px; }
  .locale-toggle { width: 54px; font-size: 10px; }
  .operator { margin-left: 0; }
  .operator-profile { display: none; }
  .operator > .button { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  .page { padding: 18px 14px 32px; }
  .page-heading { gap: 10px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { font-size: 13px; }
  .toolbar { width: 100%; }
  .toolbar > .button { flex: 1 1 auto; }
  .table-wrap { margin-inline: -1px; border-radius: 8px; }
  .table-wrap > table,
  .table-wrap > table.payments-table,
  .table-wrap > table.treasury-table,
  .table-wrap > table.pin-codes-table,
  .table-wrap > table.vip-levels-table { min-width: 680px; table-layout: auto; }
  .modal { align-items: end; padding: 10px; }
  .modal-card,
  .modal-card--wide { width: 100%; max-height: calc(100dvh - 20px); padding: 18px 15px; overflow-y: auto; border-radius: 14px; }
  .modal-heading { gap: 10px; }
  .modal-heading h2 { font-size: 16px; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1 1 130px; }
  #tournament-modal .form-actions { position: static; padding: 0; border: 0; box-shadow: none; background: transparent; }
}

/* Keep the mobile document fixed to the viewport. Wide data tables scroll
   inside their own frame only; they must never widen the whole admin page. */
@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .admin-shell,
  .workspace,
  .page,
  .page-heading,
  .card,
  .card-body,
  .topbar,
  .topbar-tools,
  .modal-card,
  .table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    width: 100%;
    overflow: hidden;
  }

  .table-wrap {
    width: 100%;
    margin-inline: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
}
