/* ==========================================================================
   RUBIT WORLD · Investment portal + admin
   Dark fintech: near-black canvas, graphite cards, RUBIT WORLD gold accent, Inter.
   (Token names --gold* are kept as the accent so older views keep working.)
   ========================================================================== */
:root {
  --bg: #0f1013;
  --bg-2: #0a0b0d;
  --surface: #16181d;
  --surface-2: #1b1e24;
  --surface-3: #23262e;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.11);
  --line-3: rgba(255,255,255,.18);
  --text: #eceae5;
  --muted: #a49f95;
  --dim: #716c63;
  --gold: #e0b66a;          /* accent: RUBIT WORLD gold */
  --gold-2: #c99a4c;
  --gold-3: #e8c27c;
  --gold-soft: rgba(224,182,106,.12);
  --gold-line: rgba(224,182,106,.32);
  --brand-grad: linear-gradient(135deg, #f4d896 0%, #d6a95c 45%, #a8772f 100%);
  --ink: #0a0b0d;           /* dark brand surface for the logo */
  --ink-2: #16181d;
  --ink-line: rgba(255,255,255,.08);
  --ink-text: #e9e6df;
  --ink-muted: #9a958b;
  --pos: #4fd39a;
  --pos-soft: rgba(79,211,154,.12);
  --neg: #f37b7b;
  --neg-soft: rgba(243,123,123,.12);
  --warn: #f0b65a;
  --warn-soft: rgba(240,182,90,.12);
  --info: #85adff;
  --info-soft: rgba(133,173,255,.12);
  --violet: #b39cff;
  --accent: var(--gold);
  --danger: var(--neg);
  --card: var(--surface);
  --card-2: var(--surface-2);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -18px rgba(0,0,0,.7);
  --shadow-lg: 0 20px 44px -16px rgba(0,0,0,.8);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 248px;
  color-scheme: dark;
  font-family: var(--sans);
  font-feature-settings: "cv11", "ss01";
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: radial-gradient(900px 500px at 100% -10%, rgba(224,182,106,.05), transparent 60%), var(--bg); background-attachment: fixed; }
::selection { background: rgba(224,182,106,.35); color: #fff; }
a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-2); }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.65rem; letter-spacing: -.025em; }
h2 { font-size: 1rem; } h3 { font-size: .92rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, .mono { font-family: var(--mono); font-size: .82em; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.small { font-size: .84rem; } .xs { font-size: .74rem; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .break { word-break: break-all; }
.green { color: var(--pos); } .red { color: var(--neg); } .amber { color: var(--warn); } .blue { color: var(--info); } .gold { color: var(--gold); }
.eyebrow { font-size: .78rem; color: var(--muted); font-weight: 500; }
.display { font-weight: 650; letter-spacing: -.03em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); border-right: 1px solid var(--ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 24px; color: var(--ink-text) !important; }
.brand-logo { display: block; height: auto; width: 100%; max-width: 190px; }
.top .brand-logo { width: 150px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 4px 12px -4px rgba(79,70,229,.6); }
.brand span:last-child { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; line-height: 1.2; }
.brand small { display: block; font-weight: 500; color: var(--dim); font-size: .7rem; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav .sec { color: #6f6a61; font-size: .72rem; font-weight: 600; padding: 16px 10px 6px; }
.nav a { position: relative; color: var(--ink-muted); padding: 9px 10px; border-radius: 9px; display: flex; align-items: center; gap: 11px; font-weight: 500; font-size: .89rem; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.on { color: #fff; background: linear-gradient(90deg, rgba(212,166,90,.2), rgba(212,166,90,.04)); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-3); }
.nav a.on svg { color: var(--gold-3); }
.nav .badge, .nav .badge.gold, .nav .badge.amber { background: rgba(212,166,90,.18); color: #f0cf8c; }
.nav form a { color: var(--ink-muted); }
.nav a .badge { margin-left: auto; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { padding: 14px 8px 2px; border-top: 1px solid var(--ink-line); margin-top: 14px; color: #6f6a61; font-size: .74rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--ink); background: rgba(13,14,17,.96); color: var(--ink-text); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); position: sticky; top: 0; z-index: 30; min-height: 64px; }
.top .grow { flex: 1; }
.top .who { display: flex; align-items: center; gap: 10px; color: var(--ink-text); font-size: .86rem; font-weight: 500; }
.avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px rgba(224,182,106,.25); border-radius: 50%; display: grid; place-items: center; background: var(--brand-grad); color: #1d1405; font-weight: 700; font-size: .76rem; flex: none; }
.content { padding: 30px 32px 80px; width: 100%; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.menu-btn { display: none !important; }
.top .btn.ghost { color: var(--ink-muted) !important; }
.top .btn.ghost:hover { color: #fff !important; background: rgba(255,255,255,.06); }
.top input { background: rgba(255,255,255,.05); border-color: var(--ink-line); color: var(--ink-text); box-shadow: none; }
.top input::placeholder { color: #7b766c; }
.top input:focus { border-color: rgba(212,166,90,.5); box-shadow: 0 0 0 4px rgba(212,166,90,.12); }
.top .badge.gold { background: rgba(212,166,90,.16); color: #f0cf8c; }
.top-logo { display: none; }
.scrim { display: none; }

/* ---------- Cards & grids ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.content > h2 { margin: 32px 0 12px; font-size: 1rem; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; min-height: 112px; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .label svg { width: 16px; height: 16px; color: var(--dim); }
.stat .value { font-size: 1.6rem; font-weight: 650; margin-top: auto; padding-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.15; }
.stat .sub { color: var(--dim); font-size: .78rem; margin-top: 4px; }
.stat.accent { border-color: var(--gold-line); background: radial-gradient(120% 140% at 100% 0%, rgba(224,182,106,.14), transparent 60%), var(--surface); }
.stat.accent .value { color: var(--gold-2); }
a.card.stat { color: inherit; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
a.card.stat:hover { border-color: var(--line-3); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* Balance hero (indigo card) */
.hero-card { color: #fff; border: 0; background:
  radial-gradient(90% 120% at 100% 0%, rgba(212,166,90,.28), transparent 55%),
  radial-gradient(60% 80% at 0% 100%, rgba(212,166,90,.08), transparent 60%),
  linear-gradient(135deg, #1b1d22 0%, #0f1013 100%); box-shadow: 0 20px 44px -20px rgba(13,14,17,.7); padding: 28px; }
.hero-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(244,216,150,.55), rgba(255,255,255,.04) 40%, rgba(168,119,47,.35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.hero-card .eyebrow { color: rgba(255,255,255,.72); }
.hero-card .hero-figure { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-card .muted, .hero-card .small { color: rgba(255,255,255,.78); }
.hero-card hr { border-top-color: rgba(255,255,255,.18); }
.hero-card .trio .fig { color: #fff; }
.hero-card .btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff !important; box-shadow: none; }
.hero-card .btn:hover { background: rgba(255,255,255,.22); }
.hero-card .btn.primary { background: var(--brand-grad); color: #1d1405 !important; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(212,166,90,.6); }
.hero-card .btn.primary:hover { filter: brightness(1.06); background: var(--brand-grad); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; white-space: nowrap; background: var(--surface-2); }
.card th { background: transparent; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td b { font-weight: 600; }
.empty { padding: 44px 20px !important; text-align: center; color: var(--dim); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: capitalize; background: var(--surface-3); color: var(--muted); border: 1px solid transparent; white-space: nowrap; line-height: 1.6; text-decoration: none !important; }
.badge.green, .badge.active, .badge.approved, .badge.paid, .badge.completed, .badge.ok, .badge.match { background: var(--pos-soft); color: var(--pos); }
.badge.amber, .badge.pending, .badge.running, .badge.capped, .badge.amount_mismatch { background: var(--warn-soft); color: var(--warn); }
.badge.red, .badge.closed, .badge.rejected, .badge.failed, .badge.mismatch, .badge.locked, .badge.no_transfer, .badge.not_found { background: var(--neg-soft); color: var(--neg); }
.badge.blue, .badge.not_configured { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.active::before, .badge.pending::before, .badge.closed::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; color: var(--text); font-size: .82rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input, select, textarea { width: 100%; background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--text); padding: 10px 13px; border-radius: var(--radius-sm); font: inherit; font-size: .92rem; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px; box-shadow: none; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { border-color: var(--gold-line); background: rgba(255,255,255,.045); box-shadow: 0 0 0 4px rgba(224,182,106,.12); }
input[disabled], input[readonly] { background: rgba(255,255,255,.02); color: var(--muted); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a49f95' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); padding: 0; box-shadow: none; }
input[type=file] { padding: 8px; font-size: .82rem; }
input[type=file]::file-selector-button { background: var(--surface-3); color: var(--text); border: 0; border-radius: 7px; padding: 6px 12px; margin-right: 10px; font: inherit; font-weight: 500; cursor: pointer; }
.inline-check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: .88rem; margin: 0; font-weight: 400; }
.hint { color: var(--dim); font-size: .76rem; margin-top: 6px; }
.err { color: var(--neg); font-size: .78rem; margin-top: 6px; }
.input-group { display: flex; min-width: 0; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); min-width: 0; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; box-shadow: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text) !important; font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .2s; text-decoration: none !important; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.btn:hover { background: rgba(255,255,255,.08); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { color: #1d1405 !important; border-color: transparent; background: var(--brand-grad); box-shadow: 0 1px 2px rgba(30,24,14,.1), 0 6px 16px -6px rgba(168,119,47,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: transparent; border-color: rgba(243,123,123,.4); color: var(--neg) !important; }
.btn.danger:hover { background: var(--neg-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted) !important; box-shadow: none; }
.btn.ghost:hover { color: var(--text) !important; background: var(--surface-3); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: .78rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 40px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Alerts & banners ---------- */
.alert { border-radius: 12px; padding: 12px 15px; border: 1px solid; margin-bottom: 20px; display: flex; gap: 11px; align-items: flex-start; font-size: .88rem; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.ok { background: var(--pos-soft); border-color: rgba(79,211,154,.3); color: #b9f2d6; }
.alert.bad { background: var(--neg-soft); border-color: rgba(243,123,123,.35); color: #ffd0d0; }
.alert.warn { background: var(--warn-soft); border-color: rgba(240,182,90,.35); color: #fbe0b0; }
.alert.info { background: var(--info-soft); border-color: rgba(133,173,255,.3); color: #d3e1ff; }
.banner-cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid rgba(240,182,90,.35); margin-bottom: 22px; }
.banner-cap.full { background: var(--neg-soft); border-color: rgba(243,123,123,.4); }
.banner-cap strong { font-size: 1.05rem; display: block; margin-bottom: 2px; }

/* ---------- Progress ---------- */
.bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #a8772f, #f0cf8c); border-radius: 999px; transition: width .6s var(--ease); }
.bar.warn > span { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar.full > span { background: linear-gradient(90deg, #f87171, var(--neg)); }
.bar.thin { height: 5px; }

/* ---------- Dropdown / modal ---------- */
.dd { position: relative; min-width: 0; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 24px)); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 24px 56px -12px rgba(0,0,0,.75); padding: 6px; z-index: 50; max-height: 70vh; overflow-y: auto; }
.dd-menu .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.dd-menu .item:hover { background: rgba(255,255,255,.04); }
.dd-menu .item.on { background: var(--gold-soft); }
.dd-menu hr { margin: 6px 0; }
.idchip { display: inline-flex; align-items: center; gap: 11px; padding: 5px 10px 5px 5px; border: 1px solid var(--ink-line); background: rgba(255,255,255,.04); border-radius: 12px; cursor: pointer; color: var(--ink-text); font: inherit; max-width: 100%; transition: border-color .15s; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.idchip:hover { border-color: rgba(212,166,90,.45); }
.idchip .av { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-grad); color: #1d1405; display: grid; place-items: center; font-weight: 700; font-size: .72rem; flex: none; }
.idchip .t { text-align: left; min-width: 0; }
.idchip b { display: block; font-size: .88rem; line-height: 1.2; }
.idchip small { color: var(--ink-muted); font-size: .72rem; white-space: nowrap; }
.idchip svg { width: 16px; height: 16px; color: var(--ink-muted); flex: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; width: 100%; max-width: 460px; padding: 26px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.85); }
.modal h2 { font-size: 1.25rem; }
[x-cloak] { display: none !important; }

/* ---------- Tabs (segmented) ---------- */
.tabs { display: flex; gap: 2px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; width: fit-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 7px 14px; color: var(--muted); border-radius: 8px; font-weight: 500; font-size: .84rem; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; font-weight: 600; }

/* ---------- Key-value ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; font-weight: 500; }

/* ---------- Level ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rung { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: var(--surface); box-shadow: var(--shadow); }
.rung.open { border-color: var(--gold-line); background: radial-gradient(120% 120% at 100% 0%, rgba(224,182,106,.12), transparent 60%), var(--surface); }
.rung .lv { font-size: .76rem; color: var(--muted); font-weight: 600; }
.rung .pc { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 2px; }
.rung.open .pc { color: var(--gold); }

/* ---------- Legs ---------- */
.legs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.leg { border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.leg.strong { border-top: 3px solid var(--info); }
.leg.other { border-top: 3px solid var(--gold); }
.leg .amt { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.vs { display: grid; place-items: center; color: var(--dim); font-size: 1.4rem; font-weight: 300; }

/* ---------- Tree ---------- */
.tree { overflow-x: auto; }
.tree ul { list-style: none; margin: 0; padding-left: 26px; border-left: 1px solid var(--line-2); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 8px 0; position: relative; }
.tree ul ul > li::before { content: ""; position: absolute; left: -26px; top: 20px; width: 20px; border-top: 1px solid var(--line-2); }
.node { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line-2); padding: 7px 12px; border-radius: 10px; box-shadow: var(--shadow); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: radial-gradient(60% 50% at 80% 20%, rgba(224,182,106,.06), transparent 60%), var(--bg); }
.auth-art { position: relative; overflow: hidden; padding: 44px 52px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background:
  radial-gradient(70% 55% at 85% 0%, rgba(212,166,90,.22), transparent 60%),
  radial-gradient(60% 50% at 0% 100%, rgba(212,166,90,.08), transparent 60%),
  var(--ink); }
.auth-art::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%; border: 1px solid rgba(212,166,90,.22); box-shadow: 0 0 0 70px rgba(212,166,90,.03), 0 0 0 140px rgba(212,166,90,.015); pointer-events: none; }
.auth-art .brand-logo { max-width: 260px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand { color: #fff !important; }
.auth-art .brand .logo { background: #fff; color: var(--gold-2); box-shadow: none; }
.auth-art .brand small, .auth-art .dim { color: rgba(255,255,255,.65); }
.auth-art h1 { color: #fff; font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; max-width: 520px; margin: 20px 0 26px; }
.auth-art h1 em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art .pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(212,166,90,.12); border: 1px solid rgba(212,166,90,.25); color: #fff; font-size: .78rem; font-weight: 500; }
.auth-art .pill .dot { background: #86efac !important; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-form h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-form .mobile-brand { display: none; padding: 6px 22px 8px; margin-bottom: 14px; }
.auth-form .mobile-brand .brand-logo { max-width: 210px; margin: 0 auto; }
.feature { display: flex; gap: 14px; margin-top: 18px; color: rgba(255,255,255,.75); max-width: 440px; }
.feature b { color: #fff; display: block; font-weight: 600; margin-bottom: 2px; }
.feature .ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(212,166,90,.12); border: 1px solid rgba(212,166,90,.25); color: #f0cf8c; display: grid; place-items: center; flex: none; }
.feature .ic svg { width: 18px; height: 18px; }

/* ---------- Charts ---------- */
.chart { display: flex; align-items: flex-end; gap: 5px; height: 180px; padding-top: 14px; border-bottom: 1px solid var(--line); }
.chart .b { flex: 1; background: linear-gradient(180deg, #e3bd72, rgba(224,182,106,.18)); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; transition: opacity .15s; }
.chart .b:hover { opacity: .8; }
.chart .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); padding: 4px 10px; border-radius: 7px; font-size: .72rem; white-space: nowrap; z-index: 5; }
.donut-legend { display: grid; gap: 12px; }
.donut-legend div { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.donut-legend span.v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.seg { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.seg span { display: block; height: 100%; }

/* ---------- Misc ---------- */
.pagination { margin-top: 16px; }
.pagination nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.notif { display: flex; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.notif.unread { background: rgba(224,182,106,.05); }
.notif:last-child { border-bottom: 0; }
.hero-figure { font-size: clamp(2.1rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trio .fig { font-size: 1.15rem; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- Mobile bottom nav (member) ---------- */
.bottom-nav { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content { padding: 26px 26px 80px; } .top { padding: 12px 26px; }
}
@media (max-width: 1080px) {
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > .span2 { grid-column: 1 / -1; }
  .g3:has(> .span2) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); z-index: 80; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: 20px 0 50px rgba(0,0,0,.6); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex !important; }
  .top { padding: 10px 14px; min-height: 60px; gap: 8px; }
  .top .who .name, .top .hide-sm { display: none; }
  .top-logo { display: block; }
  .content { padding: 20px 14px 100px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form .mobile-brand { display: block; }
  .legs { grid-template-columns: 1fr; } .vs { display: none; }
}
@media (max-width: 720px) {
  h1 { font-size: 1.45rem; }
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 12px; }
  .span2 { grid-column: auto; }
  .card { padding: 18px; border-radius: 14px; }
  .hero-card { padding: 22px; }
  .stat { min-height: 0; padding: 16px 18px; }
  .stat .value { font-size: 1.4rem; }
  .trio { gap: 10px; } .trio .fig { font-size: .98rem; }
  .hero-actions { width: 100%; } .hero-actions .btn { flex: 1; }
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-head { margin-bottom: 16px; align-items: stretch; }
  .page-head > * { width: 100%; }
  .page-head form.row input, .page-head form.row select { flex: 1; width: auto !important; min-width: 0; }
  .banner-cap .btn { width: 100%; }
  .auth-form { padding: 20px 14px; align-items: start; }
  .auth-form .card { padding: 22px 18px; }
  .tabs { width: 100%; }
  .modal { padding: 20px; }

  /* Member bottom navigation */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(14,15,18,.92); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--dim); font-size: .68rem; font-weight: 600; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.on { color: var(--gold); }
  .bottom-nav a.on svg { color: var(--gold-3); }
}
@media (max-width: 380px) {
  .idchip small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

input[type=date] { color-scheme: dark; }
select option { background: var(--surface-2); color: var(--text); }

/* ---------- Networks (BEP-20 / TRC-20) ---------- */
.net-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.net-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.net-opt:hover { border-color: var(--line-3); }
.net-opt.on { border-color: var(--gold-line); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(224,182,106,.08); }
.net-opt b { display: block; font-size: .9rem; }
.net-opt small { color: var(--muted); font-size: .74rem; }
.net-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: .64rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.net-ic.net-bep20 { background: rgba(243,186,47,.16); color: #f3ba2f; border: 1px solid rgba(243,186,47,.35); }
.net-ic.net-trc20 { background: rgba(255,60,80,.14); color: #ff5b6b; border: 1px solid rgba(255,60,80,.35); }
.badge.net-bep20 { background: rgba(243,186,47,.12); color: #f3ba2f; }
.badge.net-trc20 { background: rgba(255,60,80,.12); color: #ff6b7a; }
.seg-switch { display: inline-flex; padding: 4px; gap: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .84rem; padding: 7px 16px; border-radius: 8px; cursor: pointer; }
.seg-switch button.on { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-line); }
@media (max-width: 480px) { .net-pick { grid-template-columns: 1fr; } }
.net-logo { width: 40px; height: 40px; flex: none; }
.net-img { width: 16px; height: 16px; flex: none; margin-left: -3px; }
.badge.net-bep20, .badge.net-trc20 { padding-left: 5px; }
.seg-switch button { display: inline-flex; align-items: center; gap: 7px; }
.seg-switch .net-img { width: 18px; height: 18px; margin: 0; }

/* ---------- Receipt upload ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 64px; border: 1.5px dashed var(--line-3); border-radius: 12px; background: rgba(255,255,255,.02); cursor: pointer; color: var(--text); font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.dropzone.has { border-style: solid; border-color: var(--gold-line); }
.dropzone img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.dropzone .dz-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.dropzone .dz-ic svg { width: 18px; height: 18px; transform: rotate(180deg); }
.dropzone .dz-text { min-width: 0; }
.dropzone .dz-text b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone .dz-text small { color: var(--dim); font-size: .74rem; }
.receipt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.receipt-img { display: block; max-width: 100%; max-height: 520px; border-radius: 12px; border: 1px solid var(--line-2); background: #000; }

/* ---------- Switches ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; color: var(--text); font-size: .86rem; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #8a857c; transition: transform .2s var(--ease), background .2s; }
.switch input:checked + span { background: var(--gold-soft); border-color: var(--gold-line); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--gold); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(224,182,106,.25); }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font: inherit; font-size: .76rem; font-weight: 600; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; }
.toggle span { width: 28px; height: 16px; border-radius: 999px; background: var(--surface-3); position: relative; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #8a857c; transition: transform .2s; }
.toggle.on { color: var(--gold); border-color: var(--gold-line); }
.toggle.on span { background: var(--gold-soft); }
.toggle.on span::after { transform: translateX(12px); background: var(--gold); }
.toggle[disabled] { opacity: .6; cursor: not-allowed; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

/* ==========================================================================
   App-like mobile experience
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
@media (max-width: 920px) {
  body { overscroll-behavior-y: none; }
  .top { padding-top: calc(10px + env(safe-area-inset-top)); }
  .content { animation: page-in .28s var(--ease) both; }
  @keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 720px) {
  /* 16px inputs stop iOS from zooming the page on focus */
  input, select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 46px; }
  .btn.sm { min-height: 34px; }
  .content { padding: 16px 14px calc(108px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 1.4rem; }
  .card, .stat, .btn, .bottom-nav a, .net-opt, .nav a, .dropzone { transition: transform .12s var(--ease), background .15s, border-color .15s; }
  a.card:active, .btn:active, .net-opt:active, .dropzone:active, .nav a:active { transform: scale(.97); }

  /* bottom tab bar with a raised centre action */
  .bottom-nav { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; border: 1px solid var(--line-2); border-radius: 20px; background: rgba(18,20,25,.9); box-shadow: 0 18px 40px -12px rgba(0,0,0,.85); }
  .bottom-nav a { position: relative; font-size: .64rem; letter-spacing: .02em; padding: 7px 2px 6px; }
  .bottom-nav a.on { background: var(--gold-soft); }
  .bottom-nav a:active { transform: scale(.92); }
  .bottom-nav a.fab { background: none !important; color: var(--gold); }
  .bottom-nav .fab-btn { width: 52px; height: 52px; margin: -30px auto 2px; border-radius: 18px; display: grid; place-items: center; color: #1d1405; background: var(--brand-grad); box-shadow: 0 10px 24px -8px rgba(214,169,92,.75), 0 0 0 5px var(--bg); }
  .bottom-nav .fab-btn svg { width: 24px; height: 24px; stroke-width: 2.4; color: #1d1405 !important; }
  .bottom-nav .nb { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--neg); color: #fff; font-size: .6rem; font-style: normal; font-weight: 700; display: grid; place-items: center; }

  /* full-width primary actions inside forms feel native */
  form > .btn.primary, form .row > .btn.primary:only-child { width: 100%; }
  .card-head { flex-wrap: wrap; }
}
@media (display-mode: standalone) {
  .top { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* ==========================================================================
   Admin console (v2)
   ========================================================================== */
.admin .side { background: linear-gradient(180deg, #0c0d10, #08090b); }
.admin .brand { padding-bottom: 8px; }
.console-tag { margin: 0 8px 14px; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.admin .nav a span:not(.badge) { flex: 1; }
.admin-top { gap: 14px; }
.top-title { font-weight: 650; font-size: 1rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.search-box { position: relative; display: flex; align-items: center; min-width: 0; }
.search-box > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.search-box input { padding-left: 36px; }
.top-search { flex: 1; max-width: 440px; }
.top-search input { min-height: 38px; font-size: .86rem; }
.pill-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--ink-line); color: var(--ink-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.pill-link svg { width: 15px; height: 15px; }
.pill-link:hover { color: #fff; border-color: rgba(255,255,255,.16); }
.pill-link.hot { color: #f0cf8c; border-color: rgba(224,182,106,.35); background: rgba(224,182,106,.08); }
.who-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: 12px; padding: 4px 8px 4px 4px; color: var(--ink-text); cursor: pointer; font: inherit; }
.who-btn:hover { border-color: var(--ink-line); }
.who-btn svg { width: 15px; height: 15px; color: var(--ink-muted); }
.who-text { text-align: left; line-height: 1.2; }
.who-text b { display: block; font-size: .84rem; }
.who-text small { color: var(--ink-muted); font-size: .72rem; }
.dd-menu .item svg { width: 16px; height: 16px; }
.dd-menu form .item { justify-content: flex-start; }

.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.kpi .label { color: var(--muted); font-size: .78rem; font-weight: 500; }
.kpi .value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .sub { color: var(--dim); font-size: .76rem; margin-top: 3px; }
.kpi > div { min-width: 0; }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ic svg { width: 20px; height: 20px; }
.kpi-ic.gold { background: var(--gold-soft); color: var(--gold); }
.kpi-ic.blue { background: var(--info-soft); color: var(--info); }
.kpi-ic.green { background: var(--pos-soft); color: var(--pos); }
.kpi-ic.violet { background: rgba(179,156,255,.12); color: var(--violet); }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; color: var(--text) !important; text-decoration: none !important; background: rgba(255,255,255,.015); transition: border-color .15s, background .15s; }
.queue-row:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.queue-row .grow { flex: 1; min-width: 0; }
.queue-row b { display: block; font-size: .92rem; }
.queue-row small { color: var(--muted); font-size: .74rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-logo.sm { width: 30px; height: 30px; }
.health { display: grid; gap: 4px; }
.health a { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; color: var(--muted); font-size: .88rem; text-decoration: none !important; }
.health a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.health a b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.list-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row > div:first-child { min-width: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .tabs { margin-bottom: 0; }
.toolbar .search-box { flex: 1; max-width: 360px; min-width: 220px; }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); font-size: .7rem; text-align: center; }
.tabs a.on .count { background: var(--gold-soft); color: var(--gold); }
.user-cell { display: flex; align-items: center; gap: 11px; color: var(--text) !important; text-decoration: none !important; min-width: 0; }
.user-cell b { display: block; }
.user-cell .xs { display: block; }
.avatar.sm { width: 32px; height: 32px; font-size: .74rem; box-shadow: none; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.3rem; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; margin-bottom: 14px; }
.back-link:hover { color: var(--gold); }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head .grow { flex: 1; min-width: 220px; }
.profile-head h1 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.5rem; }
.profile-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .86rem; }
.form-card { max-width: 860px; padding: 0; }
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.form-section h3 { margin: 0 0 14px; color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: rgba(255,255,255,.015); border-radius: 0 0 var(--radius) var(--radius); }
.imp-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 32px; background: linear-gradient(90deg, rgba(240,182,90,.18), rgba(240,182,90,.06)); border-bottom: 1px solid rgba(240,182,90,.35); color: #fbe0b0; font-size: .86rem; }
.imp-banner span { display: inline-flex; align-items: center; gap: 8px; }
.imp-banner svg { width: 17px; height: 17px; }

@media (max-width: 1200px) { .pill-link { display: none; } }
@media (max-width: 920px) {
  .top-title { display: none; }
  .imp-banner { padding: 10px 14px; }
}
@media (max-width: 720px) {
  .kpi .value { font-size: 1.25rem; }
  .toolbar .search-box { max-width: none; width: 100%; }
  .form-section { padding: 18px; } .form-actions { padding: 14px 18px; }
  .form-actions .btn { flex: 1; }
  .profile-head .row { width: 100%; } .profile-head .row > * { flex: 1; } .profile-head .row .btn, .profile-head .row form .btn { width: 100%; }
  .row-actions { flex-wrap: wrap; }
}

/* Tables become stacked cards on phones and tablets */
@media (max-width: 1024px) {
  .table-wrap.stackable { border: 0; background: transparent; overflow: visible; box-shadow: none; }
  .stackable table, .stackable tbody, .stackable tr, .stackable td { display: block; width: 100%; }
  .stackable thead { display: none; }
  .stackable tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
  .stackable tbody tr:hover td { background: transparent; }
  .stackable td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: right !important; min-width: 0; }
  .stackable td > * { min-width: 0; }
  .stackable tr td:last-child { border-bottom: 0; }
  .stackable td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 500; text-align: left; flex: none; max-width: 45%; }
  .stackable td:not([data-label])::before, .stackable td[data-label=""]::before { display: none; }
  .stackable td:not([data-label]), .stackable td[data-label=""] { justify-content: flex-end; }
  .stackable td.empty { display: block; text-align: center !important; }
  .stackable td.empty::before { display: none; }
  .stackable td input, .stackable td select { max-width: 60%; }
  .stackable td .bar { flex: 1; max-width: 55%; }
  .card .table-wrap.stackable { margin: 0; }
  .card .stackable tr { background: var(--surface-2); box-shadow: none; }

}

/* Denser desktop tables */
th, td { padding: 12px 14px; }
td .cell-sub { display: block; color: var(--dim); font-size: .74rem; }
@media (min-width: 1025px) { .table-wrap.wide table { min-width: 1100px; } }

/* Notifications: long hashes wrap, date drops under the text on phones */
.notif > div { min-width: 0; }
.notif .small { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .notif { flex-wrap: wrap; padding: 14px 16px; }
  .notif > div { flex: 1 1 calc(100% - 26px) !important; }
  .notif > .xs { flex-basis: 100%; padding-left: 22px; }
}
/* any card text with very long tokens (hashes, addresses) wraps instead of pushing the page wide */
.card, .list-row, .kv dd { overflow-wrap: anywhere; }
@media (max-width: 720px) { .top-search { display: none; } .admin-top .grow { display: block; } }

/* ==========================================================================
   Member auth (login / register / verify / password reset) v2
   ========================================================================== */
.auth-form { padding: 40px 28px; }
.auth-wrap { width: 100%; max-width: 448px; }
.auth-card { padding: 28px !important; border-color: var(--line-2); box-shadow: 0 30px 70px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(224,182,106,.05); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: -4px 0 22px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.auth-tabs a { text-align: center; padding: 9px 0; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .88rem; text-decoration: none !important; transition: background .15s, color .15s; }
.auth-tabs a:hover { color: var(--text); }
.auth-tabs a.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.auth-head { margin-bottom: 22px; }
.auth-head h1 { font-size: 1.55rem !important; margin: 0 0 6px; }
.auth-head p { color: var(--muted); margin: 0; font-size: .92rem; }
.auth-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); }
.auth-ic svg { width: 22px; height: 22px; }
.auth-form-body .field { margin-bottom: 16px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--dim); pointer-events: none; transition: color .15s; }
.input-icon input { padding-left: 44px; min-height: 48px; }
.input-icon:focus-within > svg { color: var(--gold); }
.input-icon.has-error input { border-color: rgba(243,123,123,.55); }
.input-icon .eye { position: absolute; right: 6px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--dim); cursor: pointer; }
.input-icon .eye:hover { color: var(--text); background: rgba(255,255,255,.05); }
.input-icon .eye svg { width: 18px; height: 18px; }
.input-icon:has(.eye) input { padding-right: 48px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 20px; }
.switch.small { font-size: .84rem; color: var(--muted); }
.btn.lg { min-height: 50px; font-size: .95rem; border-radius: 12px; }
.auth-alt { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; display: grid; gap: 10px; }
.auth-alt > span { color: var(--muted); font-size: .86rem; }
.auth-alt p { margin: 0; }
.auth-foot { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--dim); font-size: .74rem; text-align: center; }
.auth-foot svg { width: 13px; height: 13px; flex: none; }
.auth-pair { gap: 0 14px !important; }
.sponsor-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.sponsor-chip > span:nth-child(2) { flex: 1; min-width: 0; font-size: .9rem; }
.sponsor-chip small { display: block; color: var(--muted); font-size: .72rem; }
.sponsor-chip > svg { width: 18px; height: 18px; color: var(--pos); }
.verify-block { border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: rgba(255,255,255,.015); }
.verify-block.done { border-color: rgba(79,211,154,.3); }
.verify-to { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.verify-block.done .verify-to { margin-bottom: 0; }
.verify-to > span:nth-child(2) { flex: 1; min-width: 0; }
.verify-to small { display: block; color: var(--muted); font-size: .72rem; }
.verify-to b { display: block; overflow-wrap: anywhere; font-size: .9rem; }
.verify-to .kpi-ic { width: 38px; height: 38px; border-radius: 11px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { text-align: center; font-size: 1.35rem; font-weight: 700; padding: 0; min-height: 54px; font-variant-numeric: tabular-nums; }
.otp input:focus { border-color: var(--gold-line); }
.mobile-brand p { display: none; }

@media (max-width: 920px) {
  .auth-body .auth { min-height: 100dvh; background:
    radial-gradient(90% 40% at 50% 0%, rgba(224,182,106,.14), transparent 70%), var(--bg); }
  .auth-form { place-items: start center; padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
  .auth-form .mobile-brand { display: block; text-align: center; padding: 8px 0 22px; margin: 0; }
  .auth-form .mobile-brand .brand-logo { max-width: 220px; margin: 0 auto; }
  .mobile-brand p { display: block; margin: 12px 0 0; color: var(--muted); font-size: .92rem; }
  .mobile-brand p em { font-style: normal; color: var(--gold); }
}
@media (max-width: 480px) {
  .auth-card { padding: 22px 18px !important; border-radius: 18px; }
  .auth-pair { grid-template-columns: 1fr !important; }
  .otp { gap: 6px; } .otp input { min-height: 50px; font-size: 1.2rem; }
  .auth-head h1 { font-size: 1.4rem !important; }
}

/* Auth left panel: pinned to the viewport so it never stretches or drifts with a long form */
@media (min-width: 921px) {
  .auth { align-items: start; }
  .auth-art { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 48px 56px 40px; }
  .auth-form { min-height: 100vh; min-height: 100dvh; }
}
.auth-art-body { max-width: 540px; margin: auto 0; padding: 24px 0; }
.auth-art-body h1 { margin: 0 0 18px !important; }
.auth-art-body h1 + .feature { margin-top: 34px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.07); }
.auth-art .feature { margin-top: 22px; align-items: flex-start; }
.auth-art .feature b { font-size: 1rem; }
.auth-art .feature .ic { width: 42px; height: 42px; border-radius: 12px; }
@media (max-height: 760px) and (min-width: 921px) {
  .auth-art h1 { font-size: 2.3rem; }
  .auth-art-body h1 + .feature { margin-top: 22px; padding-top: 20px; }
  .auth-art .feature { margin-top: 14px; }
}
/* placeholders keep normal case even in upper-cased inputs */
input::placeholder { text-transform: none; }

/* ---------- Admin sign-in ---------- */
.auth-art-sub { color: rgba(255,255,255,.7); font-size: 1rem; max-width: 460px; margin: -4px 0 0; }
.auth-art-body .auth-art-sub + .feature { margin-top: 30px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.07); }
.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.steps i { flex: 1; height: 1px; background: var(--line-2); }
.step { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; border: 1px solid var(--line-3); }
.step span svg { width: 13px; height: 13px; }
.step.on { color: var(--text); } .step.on span { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.step.done { color: var(--muted); } .step.done span { border-color: rgba(79,211,154,.5); color: var(--pos); background: var(--pos-soft); }
.console-badge { margin-bottom: 12px; text-transform: none; letter-spacing: .02em; }
.console-badge svg { width: 13px; height: 13px; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.02); border: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.auth-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }
.setup-steps { list-style: none; counter-reset: s; margin: 0 0 6px; padding: 0; }
.setup-steps li { counter-increment: s; position: relative; padding: 0 0 18px 40px; }
.setup-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 700; color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold-line); }
.setup-steps li::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--line-2); }
.setup-steps li:last-child::after { display: none; }
.setup-steps b { display: block; font-size: .92rem; margin-bottom: 2px; }
.setup-steps li > span { color: var(--muted); font-size: .82rem; }
.qr-box { width: fit-content; margin: 12px 0 8px; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px -12px rgba(0,0,0,.8); }
.qr-box svg { display: block; width: 168px; height: 168px; }
.manual-key summary { cursor: pointer; color: var(--gold); font-size: .82rem; }
.otp.has-error input { border-color: rgba(243,123,123,.55); }

/* Amounts never break mid-number; they shrink a little on tight cards instead */
.kpi .value, .stat .value, .hero-figure, .trio .fig, .leg .amt, td.num, .kv dd, .donut-legend .v { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
.kpi .value { font-size: clamp(1.05rem, 1.6vw, 1.45rem); }
.kpi > div { overflow: hidden; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .value { font-size: 1.4rem; } }
@media (max-width: 480px) { .kpis { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Company wallets ---------- */
.wallet-live { display: flex; gap: 18px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); margin-bottom: 14px; }
.wallet-live .grow { flex: 1; min-width: 0; }
.wallet-qr { width: 132px; height: 132px; flex: none; padding: 8px; border-radius: 12px; background: #fff; object-fit: contain; }
.wallet-addr { font-size: .86rem; overflow-wrap: anywhere; margin-top: 4px; color: var(--text); }
.wallet-row { padding: 12px 0; border-top: 1px solid var(--line); }
.wallet-edit { margin-top: 12px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
@media (max-width: 480px) { .wallet-live { flex-direction: column; align-items: center; text-align: center; } .wallet-live .row { justify-content: center; } }

/* Member deposit: pay-to block with QR */
.pay-to { display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); margin-bottom: 22px; }
.pay-to .grow { flex: 1; min-width: 0; }
.pay-to .wallet-qr { width: 148px; height: 148px; }
@media (max-width: 560px) { .pay-to { flex-direction: column; text-align: center; } .pay-to .input-group { text-align: left; } }

/* Reward programme master switch */
.program-switch { display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid; }
.program-switch.on { background: var(--pos-soft); border-color: rgba(79,211,154,.3); }
.program-switch.off { background: var(--neg-soft); border-color: rgba(243,123,123,.35); }
.program-switch .grow { flex: 1; min-width: 0; }
.program-switch h2 { margin: 0 0 4px; font-size: 1.05rem; }
.program-switch.on h2 { color: var(--pos); } .program-switch.off h2 { color: var(--neg); }
.program-switch p { margin: 0; color: var(--muted); font-size: .86rem; }
.switch.big span { width: 54px; height: 30px; }
.switch.big span::after { width: 24px; height: 24px; }
.switch.big input:checked + span::after { transform: translateX(24px); }
.is-paused .table-wrap { opacity: .55; }
tr.row-off td { opacity: .55; }
tr.row-off td:last-child { opacity: 1; }

/* Top-bar menus (ID switcher, admin profile) drop down full-width on phones instead of running off-screen */
@media (max-width: 720px) {
  .top .dd-menu { position: fixed; left: 10px !important; right: 10px !important; width: auto; top: calc(62px + env(safe-area-inset-top)); max-height: calc(100dvh - 180px); }
}

/* ---------- Member UI polish ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.mini-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-progress .bar { flex: 1; min-width: 60px; }
.support-card { display: flex; flex-direction: column; gap: 8px; }
.support-card h3 { margin: 6px 0 0; }
.support-card p { margin: 0 0 6px; }
.support-card .btn, .support-card .input-group { margin-top: auto; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq details[open] { border-color: var(--gold-line); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }

/* Phones & tablets: secondary columns hidden in card view, so lists stay short */
@media (max-width: 1024px) {
  .stackable td.opt { display: none !important; }
  .stackable td { padding: 8px 0; }
}
@media (max-width: 720px) {
  .stats-trio { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stats-trio > :first-child { grid-column: 1 / -1; }
  .stats-trio .stat .value { font-size: 1.15rem; }
  .stats-trio .stat .sub { font-size: .7rem; }
}
.badge.nc { text-transform: none; }

/* ---------- Member header v2 ---------- */
.member-top { gap: 12px; }
.member-top .top-title { min-width: 0; max-width: 260px; }
.top-logo-link { display: none; }
.top-logo { display: block; height: 26px; width: auto; }
.top-id .idchip { padding: 5px 10px 5px 5px; }
.idchip small { display: inline-flex; align-items: center; gap: 5px; }
.idchip small .dot { width: 6px; height: 6px; }
.id-bal { padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--ink-line); font-weight: 600; font-size: .86rem; color: #f0cf8c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-cta { min-height: 36px !important; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--ink-line); background: rgba(255,255,255,.03); color: var(--ink-text); cursor: pointer; transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: rgba(224,182,106,.4); background: rgba(255,255,255,.06); }
.icon-btn svg { width: 19px; height: 19px; }
.count-dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--brand-grad); color: #1d1405; font-size: .64rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ink); }
.notif-menu { width: 330px; }
.note-item { text-decoration: none !important; }
.note-item > span { display: grid; gap: 2px; min-width: 0; }
.note-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.note-item.unread { background: rgba(224,182,106,.06); }
.note-item.unread b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: middle; }
.dd-menu a.item { color: var(--text); text-decoration: none; }
.dd-menu .item svg { width: 16px; height: 16px; }

@media (max-width: 920px) {
  .member-top { flex-wrap: wrap; row-gap: 10px; padding-bottom: 12px; }
  .top-logo-link { display: block; }
  .member-top .top-id { order: 10; flex: 1 1 100%; }
  .member-top .top-id .idchip { width: 100%; }
  .member-top .top-id .idchip .t { flex: 1; }
  .member-top .top-id .id-bal { display: inline; }
}
@media (max-width: 380px) { .top-logo { height: 22px; } }
@media (max-width: 720px) {
  .member-top .top-id .dd-menu { position: absolute; top: calc(100% + 6px); left: 0 !important; right: 0 !important; width: auto; }
}

/* ---------- Team page ---------- */
.levels { display: grid; gap: 8px; }
.lvl { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.lvl.open { border-color: rgba(224,182,106,.22); background: linear-gradient(90deg, rgba(224,182,106,.07), transparent 60%); }
.lvl-no { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .9rem; background: var(--surface-3); color: var(--dim); }
.lvl.open .lvl-no { background: var(--brand-grad); color: #1d1405; }
.lvl-main { flex: 1; min-width: 0; }
.lvl-rate { font-weight: 800; font-size: 1.05rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.lvl.locked .lvl-rate { color: var(--dim); }
.lvl-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.lvl-meta b { color: var(--text); font-weight: 600; }
.lvl-state { flex: none; }
.lvl-state .badge svg { width: 12px; height: 12px; }
.unlock-card { background: radial-gradient(120% 120% at 100% 0%, rgba(224,182,106,.14), transparent 60%), var(--surface); border-color: var(--gold-line); }
.unlock-title { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.person { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.person-main { flex: 1; min-width: 0; }
.person-main b, .person-main span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-side { display: grid; justify-items: end; gap: 4px; }
.person-tag { position: absolute; top: -9px; left: 12px; }
.empty-state { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 34px 20px; }
.level-tabs { width: 100%; }
.level-tabs a.is-empty { opacity: .5; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); font-size: .8rem; }
.mchip b { font-weight: 600; }
.mchip .dim { font-size: .72rem; }
.mchip .dot { width: 7px; height: 7px; }
@media (max-width: 720px) {
  .lvl { padding: 10px 12px; gap: 10px; }
  .lvl-no { width: 32px; height: 32px; }
  .lvl-state .badge { font-size: .64rem; padding: 2px 7px; }
  .people { grid-template-columns: 1fr; }
  .toolbar .row { width: 100%; }
  .toolbar .row .tabs { width: 100%; }
}
/* Summary tiles: compact 2×2 on phones */
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .kpis .kpi { flex-direction: column; gap: 10px; padding: 14px; }
  .kpis .kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpis .kpi-ic svg { width: 17px; height: 17px; }
  .kpis .kpi .value { font-size: 1.1rem !important; }
  .kpis .kpi .sub { font-size: .7rem; }
}

/* ---------- Rank & rewards page ---------- */
.next-rank { background: radial-gradient(120% 120% at 100% 0%, rgba(224,182,106,.12), transparent 60%), var(--surface); border-color: var(--gold-line); }
.leg-progress { margin-top: 16px; display: grid; gap: 6px; }
.bar.blue > span { background: linear-gradient(90deg, #4c74d8, var(--info)); }
.bar.gold > span { background: linear-gradient(90deg, #a8772f, #f0cf8c); }
.schedule { padding: 12px 0; border-bottom: 1px solid var(--line); }
.schedule:last-child { border-bottom: 0; padding-bottom: 0; }
.ranks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rank-tile { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.rank-tile .lvl-no { width: 30px; height: 30px; border-radius: 9px; font-size: .82rem; }
.rank-tile.done { border-color: rgba(224,182,106,.28); background: linear-gradient(180deg, rgba(224,182,106,.08), transparent); }
.rank-tile.done .lvl-no { background: var(--brand-grad); color: #1d1405; }
.rank-tile.next { border-color: var(--gold-line); box-shadow: inset 0 0 0 1px rgba(224,182,106,.2); }
.rank-income { font-weight: 750; font-size: 1.05rem; margin-top: 10px; font-variant-numeric: tabular-nums; }
.reward-list { display: grid; gap: 6px; }
.reward-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.reward-row:hover { background: rgba(255,255,255,.02); }
.reward-row .lvl-no { width: 30px; height: 30px; border-radius: 9px; font-size: .78rem; }
.reward-row.done .lvl-no { background: var(--brand-grad); color: #1d1405; }
.reward-row .grow { flex: 1; min-width: 0; }
.reward-row .grow b, .reward-row .grow span { display: block; }
@media (max-width: 720px) {
  .ranks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward-row { padding: 8px 4px; }
}
.grid.top-align { align-items: start; }

/* ==========================================================================
   Rank journey (gamified)
   ========================================================================== */
.medal { display: block; flex: none; }
.medal-done { filter: drop-shadow(0 6px 14px rgba(214,169,92,.35)); }
.medal-next { filter: drop-shadow(0 0 14px rgba(224,182,106,.45)); animation: medal-pulse 2.4s ease-in-out infinite; }
@keyframes medal-pulse { 0%,100% { filter: drop-shadow(0 0 6px rgba(224,182,106,.25)); } 50% { filter: drop-shadow(0 0 18px rgba(224,182,106,.6)); } }

.rank-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; padding: 28px; border-radius: 22px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(70% 120% at 0% 0%, rgba(224,182,106,.18), transparent 60%), radial-gradient(60% 100% at 100% 100%, rgba(224,182,106,.08), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013);
  border: 1px solid var(--gold-line); }
.rank-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); }
.rank-hero > * { position: relative; z-index: 1; }
.rank-hero-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.hero-medal { position: relative; flex: none; }
.hero-glow { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(224,182,106,.35), transparent 65%); z-index: -1; animation: medal-pulse 3s ease-in-out infinite; }
.rank-title { font-size: 2.6rem !important; font-weight: 800; letter-spacing: -.04em; margin: 2px 0 4px !important; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.hero-stats div { display: grid; gap: 2px; }
.hero-stats span { color: var(--muted); font-size: .74rem; }
.hero-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-stats small { color: var(--dim); font-weight: 500; margin-left: 2px; }
.rank-hero-right { display: flex; align-items: center; gap: 22px; padding: 18px; border-radius: 18px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dashoffset: var(--off); animation: ring-in 1.2s var(--ease) both; }
@keyframes ring-in { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: var(--off); } }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }
.ring-center span { font-size: .7rem; color: var(--muted); }
.next-info { flex: 1; min-width: 0; }
.next-prize { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--gold-3); margin: 2px 0 2px; }
.leg-line { margin-top: 10px; display: grid; gap: 5px; }

.journey-card { padding-bottom: 14px; }
.journey { overflow-x: auto; padding: 8px 4px 6px; scroll-behavior: smooth; scrollbar-width: thin; }
.journey-track { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(92px, 1fr)); min-width: calc(var(--cols) * 92px); }
.track-line { position: absolute; left: calc(100% / var(--cols) / 2); right: calc(100% / var(--cols) / 2); top: 34px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.track-line span { display: block; height: 100%; border-radius: 4px; background: var(--brand-grad); box-shadow: 0 0 12px rgba(224,182,106,.5); }
.jnode { position: relative; display: grid; justify-items: center; text-align: center; gap: 2px; padding: 4px 4px 0; }
.jmedal { height: 68px; display: grid; place-items: center; }
.jlabel { font-size: .78rem; font-weight: 700; margin-top: 4px; }
.jnode.locked .jlabel { color: var(--dim); }
.jprize { font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }
.jnode.done .jprize, .jnode.next .jprize { color: var(--gold-3); }
.jnode.locked .jprize { color: var(--muted); }
.jreq { font-size: .66rem; color: var(--dim); }
.jtag { margin-top: 6px; font-size: .64rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.jtag.paying { background: var(--pos-soft); color: var(--pos); }
.jtag.paid { background: var(--surface-3); color: var(--muted); }
.jtag.next { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-line); }
.jtag.pause { background: var(--warn-soft); color: var(--warn); }

.streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stream { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stream .grow { flex: 1; min-width: 0; }
.stream small { font-size: .7rem; margin-left: 2px; }

.next-trophy { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--gold-line); background: radial-gradient(100% 140% at 0% 50%, rgba(224,182,106,.12), transparent 60%), var(--surface); }
.next-trophy .grow { flex: 1; min-width: 0; }
.cabinet { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.trophy-card { position: relative; display: grid; justify-items: center; gap: 3px; text-align: center; padding: 14px 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: transform .15s var(--ease), border-color .15s; }
.trophy-card:hover { transform: translateY(-2px); }
.trophy-card.won { border-color: rgba(224,182,106,.35); background: radial-gradient(90% 70% at 50% 0%, rgba(224,182,106,.16), transparent 70%), var(--surface); }
.trophy-card.won .trophy { filter: drop-shadow(0 6px 12px rgba(214,169,92,.4)); }
.trophy-card.is-next { border-color: var(--gold-line); box-shadow: 0 0 0 1px rgba(224,182,106,.25), 0 0 22px -6px rgba(224,182,106,.5); }
.tlevel { font-size: .64rem; font-weight: 700; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.trophy-card.won .tlevel { color: var(--gold); }
.tprize { font-size: 1rem; font-weight: 800; margin-top: 4px; }
.trophy-card.won .tprize { color: var(--gold-3); }
.trophy-card.locked .tprize { color: var(--muted); }
.treq { font-size: .64rem; color: var(--dim); }
.tprog { width: 70%; height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.tprog span { display: block; height: 100%; background: linear-gradient(90deg, #a8772f, #f0cf8c); }

.single-card { padding: 22px; }
.single-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; }
.sstep { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 6px 10px; border-radius: 14px; }
.sstep b { font-size: .95rem; color: var(--muted); }
.sstep.reached b { color: var(--text); }
.sstep.top { background: radial-gradient(80% 80% at 50% 0%, rgba(224,182,106,.18), transparent 70%); border: 1px solid var(--gold-line); }
.sstep.top b { color: var(--gold-3); font-size: 1.1rem; }
.crown { position: absolute; top: -9px; padding: 2px 8px; border-radius: 999px; background: var(--brand-grad); color: #1d1405; font-size: .56rem; font-weight: 800; letter-spacing: .08em; }
.single-foot { display: flex; align-items: center; gap: 22px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.single-foot > div:first-child { display: grid; }
.single-foot b { font-size: 1.2rem; }
.single-foot .grow { flex: 1; min-width: 0; }

@media (max-width: 1100px) { .rank-hero { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .rank-hero { padding: 20px 16px; gap: 16px; border-radius: 18px; }
  .rank-hero-left { gap: 14px; }
  .hero-medal .medal { width: 84px; height: 84px; }
  .rank-title { font-size: 2rem !important; }
  .hero-stats { gap: 8px 18px; }
  .hero-stats b { font-size: .95rem; }
  .rank-hero-right { flex-direction: column; text-align: center; padding: 16px; gap: 14px; }
  .rank-hero-right .leg-line { text-align: left; }
  .cabinet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .trophy-card { padding: 12px 6px 10px; }
  .trophy-card .trophy { width: 34px; height: 34px; }
  .tprize { font-size: .86rem; }
  .single-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .sstep { padding: 12px 2px 8px; }
  .sstep .medal { width: 38px; height: 38px; }
  .sstep b { font-size: .78rem; } .sstep.top b { font-size: .86rem; }
  .sstep .xs { font-size: .58rem; }
  .crown { font-size: .48rem; padding: 2px 5px; }
  .single-foot { flex-direction: column; align-items: stretch; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .medal-next, .hero-glow, .ring-fg { animation: none !important; } }

/* ==========================================================================
   Strong / Other Leg page
   ========================================================================== */
.leg-hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; padding: 26px; border-radius: 22px; border: 1px solid var(--gold-line);
  background: radial-gradient(60% 120% at 0% 0%, rgba(133,173,255,.12), transparent 60%), radial-gradient(60% 120% at 100% 0%, rgba(224,182,106,.14), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.leg-hero-left { display: grid; gap: 18px; align-content: center; min-width: 0; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.vs-side { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.vs-side.strong { border-color: rgba(133,173,255,.35); box-shadow: inset 0 2px 0 rgba(133,173,255,.5); }
.vs-side.other { border-color: rgba(224,182,106,.35); box-shadow: inset 0 2px 0 rgba(224,182,106,.6); text-align: right; }
.vs-tag { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.vs-side.strong .vs-tag { color: var(--info); } .vs-side.other .vs-tag { color: var(--gold); }
.vs-amt { font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vs-side span.xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-mid { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .8rem; letter-spacing: .04em; color: #1d1405; background: var(--brand-grad); box-shadow: 0 0 0 5px rgba(224,182,106,.12); }
.balance-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.06); }
.balance-bar .b-strong { background: linear-gradient(90deg, #4c74d8, var(--info)); }
.balance-bar .b-other { flex: 1; background: linear-gradient(90deg, #f0cf8c, #a8772f); }
.weak-callout { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px dashed rgba(255,255,255,.12); }
.leg-chart { display: flex; flex-direction: column; padding: 18px; border-radius: 18px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); min-height: 290px; }
.chart-head { display: grid; gap: 2px; margin-bottom: 10px; }
.chart-area { position: relative; height: 220px; margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 0 18px; border-bottom: 1px solid var(--line-2); margin-bottom: 26px; }
.col { position: relative; height: 100%; }
.col-bar { position: absolute; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 92px; border-radius: 12px 12px 4px 4px; min-height: 6px; animation: grow-up .9s var(--ease) both; transform-origin: bottom; }
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.col-bar.strong { background: linear-gradient(180deg, #a9c4ff, #4c74d8); box-shadow: 0 10px 30px -10px rgba(133,173,255,.6); }
.col-bar.other { background: linear-gradient(180deg, #f4d896, #a8772f); box-shadow: 0 10px 30px -10px rgba(224,182,106,.6); }
.col-bar span { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: .76rem; font-weight: 800; color: rgba(0,0,0,.72); }
.col-note { position: absolute; left: 50%; transform: translateX(-50%); z-index: 3; padding: 1px 8px; border-radius: 999px; background: rgba(15,16,19,.92); text-align: center; font-size: .7rem; font-weight: 700; color: var(--warn); white-space: nowrap; }
.col-note.ok { color: var(--pos); }
.col-label { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; }
.target-line { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(240,207,140,.7); z-index: 2; pointer-events: none; }
.target-line span { position: absolute; right: 0; top: -22px; font-size: .66rem; font-weight: 700; color: #f0cf8c; background: rgba(15,16,19,.9); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--gold-line); }
.tip-card { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--gold-line); }
.tip-card .grow { flex: 1; min-width: 0; }
.tip-card .grow > b { display: block; margin-bottom: 3px; }
.tip-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--brand-grad); color: #1d1405; }
.tip-ic svg { width: 22px; height: 22px; }
.dist-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.04); }
.dist-bar span { display: block; height: 100%; min-width: 3px; }
.line-list { display: grid; gap: 4px; margin-top: 16px; }
.line-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; }
.line-row:hover { background: rgba(255,255,255,.02); }
.line-row.strong { background: linear-gradient(90deg, rgba(133,173,255,.1), transparent 70%); border: 1px solid rgba(133,173,255,.22); }
.line-rank { width: 28px; font-size: .74rem; font-weight: 700; color: var(--dim); text-align: center; flex: none; }
.line-main { flex: 1; min-width: 0; }
.line-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.gold.nc, .badge.blue.nc { flex: none; }
@media (max-width: 1100px) { .leg-hero { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .leg-hero { padding: 16px; gap: 16px; border-radius: 18px; }
  .versus { grid-template-columns: 1fr 1fr; }
  .vs-mid { display: none; }
  .vs-side { padding: 12px; }
  .leg-chart { min-height: 250px; padding: 14px; }
  .chart-area { gap: 18px; padding: 0 8px; }
  .tip-card { flex-direction: column; align-items: flex-start; }
  .tip-card .btn { width: 100%; }
  .line-row { padding: 10px 4px; gap: 10px; }
  .line-rank { display: none; }
  .line-row .badge { display: none; }
  .target-line span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .col-bar { animation: none; } }

/* Legs page — game layer */
.vs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vs-lvl { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 800; color: var(--text); padding: 1px 8px 1px 2px; border-radius: 999px; background: rgba(255,255,255,.05); }
.vs-side.other .vs-lvl { padding: 1px 2px 1px 8px; flex-direction: row-reverse; }
.xp { height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 4px; }
.xp span { display: block; height: 100%; border-radius: inherit; animation: xp-fill 1.1s var(--ease) both; transform-origin: left; }
.vs-side.other .xp span { margin-left: auto; transform-origin: right; }
.xp.blue span { background: linear-gradient(90deg, #4c74d8, #a9c4ff); box-shadow: 0 0 12px rgba(133,173,255,.6); }
.xp.gold span { background: linear-gradient(270deg, #a8772f, #f4d896); box-shadow: 0 0 12px rgba(224,182,106,.6); }
@keyframes xp-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ach-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ach { font-size: .72rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px dashed rgba(255,255,255,.12); color: var(--dim); filter: grayscale(1); opacity: .6; }
.ach.on { filter: none; opacity: 1; color: #f0cf8c; border: 1px solid var(--gold-line); background: rgba(224,182,106,.1); }

.road-card { margin-top: 18px; }
.road-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.road { position: relative; min-width: 720px; height: 124px; margin: 0 26px 0 14px; }
.road-track { position: absolute; left: 0; right: 0; top: 46px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.road-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; animation: xp-fill 1.3s var(--ease) both; transform-origin: left; }
.road-fill.blue { background: linear-gradient(90deg, rgba(76,116,216,.4), var(--info)); top: -0px; height: 4px; }
.road-fill.gold { background: linear-gradient(90deg, rgba(168,119,47,.4), #f0cf8c); top: 4px; height: 4px; }
.road-stop { position: absolute; top: 50px; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; z-index: 2; }
.road-stop .road-amt { position: absolute; top: calc(100% + 2px); font-size: .64rem; font-weight: 700; color: var(--dim); white-space: nowrap; }
.road-stop.done .road-amt { color: #f0cf8c; }
.road-stop.next .road-amt { color: var(--text); }
.road-stop.next svg { filter: drop-shadow(0 0 10px rgba(224,182,106,.55)); animation: pulse-glow 2s ease-in-out infinite; }
@keyframes pulse-glow { 50% { filter: drop-shadow(0 0 2px rgba(224,182,106,.2)); } }
.road-marker { position: absolute; transform: translateX(-50%); z-index: 3; display: grid; justify-items: center; }
.road-marker span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 900; border: 2px solid #0f1013; }
.road-marker::after { content: ''; width: 2px; height: 10px; }
.road-marker.strong { top: 6px; }
.road-marker.strong span { background: linear-gradient(135deg, #a9c4ff, #4c74d8); color: #0b1630; box-shadow: 0 0 0 4px rgba(133,173,255,.18); }
.road-marker.strong::after { background: var(--info); }
.road-marker.other { top: 60px; flex-direction: column-reverse; display: flex; align-items: center; }
.road-marker.other span { background: var(--brand-grad); color: #1d1405; box-shadow: 0 0 0 4px rgba(224,182,106,.18); }
.road-marker.other::after { background: linear-gradient(var(--gold), rgba(224,182,106,.3)); height: 38px; }
.road-marker.other { top: 54px; }
.road-stop .road-amt { background: var(--surface); padding: 0 3px; border-radius: 4px; z-index: 1; }

.trophy-shelf { margin-top: 18px; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.shelf-item { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--line); min-width: 0; }
.shelf-item .grow { flex: 1; min-width: 0; }
.shelf-item svg { flex: none; }
.shelf-item.won { border-color: var(--gold-line); background: linear-gradient(135deg, rgba(224,182,106,.12), transparent); }
.shelf-item.near { border-color: rgba(224,182,106,.35); }
.shelf-item.locked { opacity: .65; }
@media (max-width: 1100px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .shelf { grid-template-columns: 1fr; } .vs-lvl span { display: none; } .vs-lvl { padding: 1px !important; } }
@media (prefers-reduced-motion: reduce) { .xp span, .road-fill { animation: none; } .road-stop.next svg { animation: none; } }

/* ==========================================================================
   Deposit / Top-up page
   ========================================================================== */
.dep-hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 24px; border-radius: 22px; border: 1px solid var(--gold-line);
  background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.16), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.dep-ring { display: flex; align-items: center; gap: 18px; }
.dep-ring-info { display: grid; gap: 5px; justify-items: start; max-width: 230px; }
.dep-ring-info > b { font-size: 1.15rem; }
.dep-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dep-stat { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.dep-stat > div { display: grid; gap: 1px; min-width: 0; }
.dep-stat .label { font-size: .72rem; color: var(--muted); }
.dep-stat b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }

.tier-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tier { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.tier-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tier-rate { color: var(--gold); font-size: 1.05rem; }
.tier.owned { border-color: var(--gold-line); background: linear-gradient(135deg, rgba(224,182,106,.12), var(--surface) 70%); }
.tier-flag { position: absolute; top: -8px; right: 10px; font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--brand-grad); color: #1d1405; }

.wizard { padding: 0; overflow: hidden; }
.stepper { list-style: none; margin: 0; padding: 16px 22px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--dim); flex: 1; }
.stepper li:not(:last-child)::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--line-2); margin-left: 4px; }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .74rem; font-weight: 800; border: 1.5px solid var(--line-3); }
.stepper li.on { color: var(--text); }
.stepper li.on span { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 4px rgba(224,182,106,.12); }
.stepper li.done { color: var(--muted); }
.stepper li.done span { background: var(--brand-grad); border-color: transparent; color: #1d1405; }
.stepper li.done::after { background: var(--gold); }
.wizard form { padding: 6px 22px 22px; }
.wz-block { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.wz-block h3 { margin: 0 0 12px; font-size: .95rem; }
.net-opt { position: relative; }
.net-check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-3); color: transparent; flex: none; }
.net-check svg { width: 12px; height: 12px; }
.net-opt.on .net-check { background: var(--brand-grad); border-color: transparent; color: #1d1405; }
.amt-input { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); transition: border-color .15s, box-shadow .15s; }
.amt-input:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(224,182,106,.1); }
.amt-input > span:first-child { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.amt-input input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; padding: 6px 0; color: var(--text); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.on { color: #1d1405; background: var(--brand-grad); border-color: transparent; }
.tier-live { margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--gold-line); background: linear-gradient(135deg, rgba(224,182,106,.1), transparent 70%); }
.tier-live.locked { border-style: dashed; border-color: var(--line-2); background: none; }
.tl-row { display: flex; gap: 12px; align-items: flex-start; }
.tl-row .grow { flex: 1; min-width: 0; }
.tl-medal { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-weight: 900; color: #2a1d07; background: var(--brand-grad); clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.tl-earn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tl-earn > div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.25); min-width: 0; }
.tl-earn b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-amt { margin-top: 10px; font-size: .84rem; padding: 8px 12px; border-radius: 10px; background: rgba(224,182,106,.08); border: 1px solid var(--gold-line); display: inline-block; }
.wizard .pay-to { margin-bottom: 16px; }
.wz-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 18px; }
.wz-submit .btn { min-width: 220px; justify-content: center; }
.wz-submit .btn svg { width: 16px; height: 16px; }

.track-item { padding: 10px 0; border-top: 1px solid var(--line); }
.track-item:first-of-type { border-top: 0; }
.track-steps { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .68rem; font-weight: 700; color: var(--dim); }
.track-steps i { flex: 1; height: 2px; border-radius: 2px; background: var(--gold); }
.track-steps i.off { background: var(--line-2); }
.track-steps .done { color: var(--gold); }
.track-steps .on { color: var(--warn); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.side-tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.side-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; color: var(--muted); }
.side-tips li svg { width: 16px; height: 16px; flex: none; color: var(--gold); margin-top: 2px; }

.stakes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.stake { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.stake .grow { flex: 1; min-width: 0; }
.dep-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; }
.dep-row + .dep-row { border-top: 1px solid var(--line); border-radius: 0; }
.dep-row .grow { flex: 1; min-width: 0; }
.dep-net { width: 34px; height: 34px; flex: none; }
.dep-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.dep-meta a { color: var(--muted); }
.dep-meta a:hover { color: var(--gold); }
.dep-status { flex: none; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid; }
.dep-status.pending { color: var(--warn); border-color: rgba(245,183,85,.35); background: rgba(245,183,85,.08); }
.dep-status.approved { color: var(--pos); border-color: rgba(70,200,140,.35); background: rgba(70,200,140,.08); }
.dep-status.rejected { color: var(--neg); border-color: rgba(240,100,100,.35); background: rgba(240,100,100,.08); }
@media (max-width: 1200px) { .dep-hero { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tier-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dep-stats { grid-template-columns: 1fr 1fr; } .dep-stats .dep-stat:first-child { grid-column: span 2; } }
@media (max-width: 560px) { .dep-stats { gap: 8px; } .dep-stat { padding: 12px; } .dep-stats .dep-stat:not(:first-child) .kpi-ic { display: none; } .dep-stat b { font-size: 1.05rem; } }
@media (max-width: 560px) {
  .dep-hero { padding: 16px; gap: 16px; }
  .dep-ring .ring-wrap { width: 108px; height: 108px; }
  .dep-ring .ring-center b { font-size: 1.35rem; }
  .stepper { padding: 12px 14px; }
  .stepper li { font-size: 0; gap: 0; }
  .stepper li span { font-size: .74rem; }
  .wizard form { padding: 0 14px 16px; }
  .tl-earn { grid-template-columns: 1fr 1fr; }
  .tl-earn > div:last-child { grid-column: span 2; }
  .wz-submit .btn { width: 100%; min-width: 0; }
  .tier { padding: 10px; gap: 8px; }
  .tier svg { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .tl-medal, .track-steps .on { animation: none; } }

/* ==========================================================================
   Wallet page
   ========================================================================== */
.vault { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; }
.vault-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 210px; padding: 24px; border-radius: 22px; isolation: isolate;
  background: radial-gradient(120% 140% at 100% 0%, rgba(240,207,140,.35), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(168,119,47,.35), transparent 60%), linear-gradient(135deg, #2a2216, #121110 70%);
  border: 1px solid rgba(240,207,140,.35); box-shadow: 0 24px 60px -30px rgba(224,182,106,.55); }
.vault-card::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .18; background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.08) 0 1px, transparent 1px 14px); }
.vault-logo { height: 22px; width: auto; }
.vault-label { margin-top: auto; font-size: .76rem; color: rgba(255,255,255,.6); letter-spacing: .04em; }
.vault-amt { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: linear-gradient(180deg, #fff5dc, #e8c27e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vault-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: .72rem; color: rgba(255,255,255,.55); letter-spacing: .06em; }
.vault-shine { position: absolute; top: -50%; left: -60%; width: 40%; height: 200%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); animation: shine 4.5s ease-in-out 1s infinite; pointer-events: none; }
@keyframes shine { 0% { left: -60%; } 40%, 100% { left: 130%; } }
.vault-side { display: grid; gap: 10px; }
.vs-mini { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.vs-mini > div { display: grid; min-width: 0; }
.vs-mini .label { font-size: .72rem; color: var(--muted); }
.vs-mini b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.earn-mix { grid-column: 1 / -1; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mix-bar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; margin: 12px 0; background: rgba(255,255,255,.05); }
.mix-bar span { display: block; height: 100%; min-width: 3px; animation: xp-fill 1.1s var(--ease) both; transform-origin: left; }
.mix-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mix-legend > div { display: grid; grid-template-columns: auto 1fr; column-gap: 7px; align-items: center; font-size: .74rem; min-width: 0; }
.mix-legend .dot { margin: 0; }
.mix-legend b { grid-column: 2; font-size: .88rem; }

.action-card { padding: 0; overflow: hidden; }
.action-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.action-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); background: transparent; border: 0; cursor: pointer; position: relative; }
.action-tabs button svg { width: 16px; height: 16px; }
.action-tabs button.on { color: var(--gold); background: rgba(224,182,106,.05); }
.action-tabs button.on::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.action-body { padding: 20px 22px 22px; }
.receipt { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px dashed var(--line-2); display: grid; gap: 6px; }
.receipt > div { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.receipt > div span { color: var(--muted); }
.receipt .total { padding-top: 8px; border-top: 1px solid var(--line); font-size: .95rem; }
.receipt .total b { font-size: 1.15rem; }
.receipt.warn { border-color: rgba(245,183,85,.4); }
.action-body .btn svg { width: 16px; height: 16px; }
.act-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.act-row + .act-row { border-top: 1px solid var(--line); }
.act-row .grow { flex: 1; min-width: 0; }
.act-row .grow > b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.act-ic svg { width: 17px; height: 17px; }
.act-ic.in { background: rgba(70,200,140,.12); color: var(--pos); }
.act-ic.out { background: rgba(240,100,100,.1); color: var(--neg); }
@media (max-width: 1000px) { .vault { grid-template-columns: 1fr; } .vault-side { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mix-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .vault-card { padding: 18px; min-height: 180px; border-radius: 18px; }
  .vault-side { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vault-side .vs-mini:first-child { grid-column: span 2; }
  .vs-mini { padding: 12px; }
  .vault-side .vs-mini:not(:first-child) .kpi-ic { display: none; }
  .vs-mini b { font-size: 1rem; }
  .mix-legend { grid-template-columns: 1fr 1fr; }
  .action-body { padding: 16px 14px; }
  .action-body .btn.block-sm { width: 100%; justify-content: center; }
  .chips .xs { width: 100%; margin: 4px 0 0 !important; }
  .act-row { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .vault-shine, .mix-bar span { animation: none; } }

/* ==========================================================================
   Dashboard (home base)
   ========================================================================== */
.player { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.player-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.player-id h1 { margin: 4px 0 2px; font-size: 1.6rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player-medal { position: relative; display: grid; flex: none; filter: drop-shadow(0 6px 18px rgba(224,182,106,.35)); }
.player-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pchip { font-size: .76rem; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.pchip b { color: var(--gold); }
.dash-vault { min-height: 230px; }
.dash-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.dash-trio > div { display: grid; gap: 2px; min-width: 0; }
.dash-trio span { font-size: .7rem; color: rgba(255,255,255,.55); letter-spacing: .03em; }
.dash-trio b { font-size: 1.02rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-trio b.green { color: #7be0b0; }
.roi-clock { display: flex; flex-direction: column; gap: 8px; }
.clock { display: flex; gap: 8px; margin: 10px 0 4px; }
.clock > div { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: 12px; background: rgba(0,0,0,.28); border: 1px solid var(--line); }
.clock b { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.clock span { font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.xp.green span { background: linear-gradient(90deg, #2f9e74, #7be0b0); box-shadow: 0 0 12px rgba(70,200,140,.5); }
.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-actions > a, .quick-actions > button { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s, border-color .15s; }
.quick-actions > a:hover, .quick-actions > button:hover { transform: translateY(-2px); border-color: var(--gold-line); }
.qa-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--gold); }
.qa-ic svg { width: 19px; height: 19px; }
.qa-ic.gold { background: var(--brand-grad); color: #1d1405; box-shadow: 0 8px 20px -8px rgba(224,182,106,.7); }
.missions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mission { display: flex; flex-direction: column; gap: 9px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; min-width: 0; }
.mission:hover { transform: translateY(-2px); border-color: var(--gold-line); }
.mission > b { font-size: .95rem; }
.m-top { display: flex; align-items: center; justify-content: space-between; }
.m-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.m-ic svg { width: 18px; height: 18px; }
.m-ic.violet { background: rgba(179,156,255,.12); color: var(--violet); }
.m-ic.blue { background: rgba(133,173,255,.12); color: var(--info); }
.m-ic.green { background: rgba(70,200,140,.12); color: var(--pos); }
.m-tag { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--gold-line); }
.m-reward { margin-top: auto; font-size: .76rem; font-weight: 600; color: #f0cf8c; padding: 7px 10px; border-radius: 10px; background: rgba(224,182,106,.08); }
.cap-body { display: flex; align-items: center; gap: 18px; }
.cap-facts { display: grid; gap: 8px; flex: 1; min-width: 0; }
.cap-facts > div { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; }
.cap-facts span { color: var(--muted); }
.cap-facts b { white-space: nowrap; }
.dash-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.dash-links a { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.dash-links a:hover { border-color: var(--gold-line); }
.dash-links b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .missions { grid-template-columns: 1fr 1fr; } .missions .mission:last-child { grid-column: span 2; } }
@media (max-width: 900px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .player { margin-bottom: 14px; }
  .player-id h1 { font-size: 1.3rem; }
  .player-medal svg { width: 48px; height: 48px; }
  .player-chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .dash-vault { min-height: 0; }
  .dash-trio { gap: 8px; }
  .dash-trio b { font-size: .88rem; }
  .missions { grid-template-columns: 1fr; }
  .missions .mission:last-child { grid-column: auto; }
  .quick-actions { gap: 8px; }
  .quick-actions > a, .quick-actions > button { padding: 12px 4px; }
  .dash-links { grid-template-columns: 1fr; }
  .cap-body .ring-wrap { width: 112px; height: 112px; }
}
.clock-due { display: flex; gap: 12px; align-items: center; margin: 10px 0 6px; padding: 14px; border-radius: 14px; background: rgba(70,200,140,.07); border: 1px solid rgba(70,200,140,.25); }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pos); flex: none; box-shadow: 0 0 0 0 rgba(70,200,140,.6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(70,200,140,0); } 100% { box-shadow: 0 0 0 0 rgba(70,200,140,0); } }

/* ==========================================================================
   Income history
   ========================================================================== */
.inc-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; padding: 22px; border-radius: 22px; border: 1px solid var(--gold-line);
  background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.16), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.inc-total { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.inc-total .vault-amt { margin: 4px 0 8px; }
.inc-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inc-mini > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.inc-mini span { font-size: .68rem; color: var(--muted); }
.inc-mini b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); }
.streak .streak-fire { font-size: 1.5rem; filter: grayscale(1); opacity: .5; }
.streak.on { border: 1px solid rgba(240,140,106,.35); background: linear-gradient(90deg, rgba(240,140,106,.12), transparent); }
.streak.on .streak-fire { filter: none; opacity: 1; animation: flicker 1.8s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.12) rotate(-4deg); } }
.inc-chart { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.bars14 { flex: 1; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; min-height: 170px; }
.b14 { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.b14-stack { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 3px 3px; overflow: hidden; animation: grow-up .8s var(--ease) both; transform-origin: bottom; }
.b14-stack span { display: block; min-height: 2px; }
.b14-day { font-size: .62rem; color: var(--dim); font-weight: 600; white-space: nowrap; }
.b14.wknd .b14-day { opacity: .5; }
.b14.today .b14-day { color: var(--gold); }
.b14.today .b14-stack { box-shadow: 0 0 0 2px rgba(224,182,106,.35); }
.inc-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.inc-type { display: grid; gap: 4px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; min-width: 0; }
.inc-type:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.inc-type.on { border-color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), var(--surface) 70%); box-shadow: 0 10px 30px -18px var(--c); }
.it-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 4px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.it-ic svg { width: 17px; height: 17px; }
.it-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.inc-type b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 4px; }
.it-bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.inc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; }
.inc-tag { padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); font-weight: 600; }
.inc-tag.warn { background: rgba(245,183,85,.1); color: var(--warn); }
@media (max-width: 1100px) { .inc-hero { grid-template-columns: 1fr; } .inc-types { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .inc-hero { padding: 16px; border-radius: 18px; }
  .inc-types { display: flex; overflow-x: auto; scrollbar-width: none; margin: 14px 0 0; padding: 2px 0 6px; scroll-snap-type: x mandatory; }
  .inc-type { flex: 0 0 46%; scroll-snap-align: start; }
  .bars14 { gap: 3px; min-height: 140px; }
  .b14-day { font-size: .56rem; }
  .inc-mini b { font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { .b14-stack, .streak.on .streak-fire { animation: none; } }

/* ==========================================================================
   Team page — game layer
   ========================================================================== */
.squad-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; padding: 22px; border-radius: 22px; border: 1px solid rgba(133,173,255,.3);
  background: radial-gradient(70% 140% at 0% 0%, rgba(133,173,255,.14), transparent 60%), radial-gradient(60% 120% at 100% 100%, rgba(224,182,106,.1), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.squad-unlock { display: flex; gap: 20px; align-items: center; min-width: 0; }
.squad-next { min-width: 0; }
.squad-next .btn svg { width: 14px; height: 14px; }
.squad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.squad-stats .dep-stat b small { font-size: .8rem; font-weight: 600; }
.lvl-road { min-width: 640px; }
.lvl-road .road-marker.strong span { width: 26px; height: 26px; }
.lvl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lvl-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.lvl-card .grow { flex: 1; min-width: 0; }
.lvl-card.open { border-color: var(--gold-line); background: linear-gradient(120deg, rgba(224,182,106,.08), var(--surface) 60%); }
.lvl-card.locked { opacity: .78; }
.lvl-card.is-next { opacity: 1; border-color: rgba(133,173,255,.45); box-shadow: 0 0 0 3px rgba(133,173,255,.08); }
.lvl-card .lvl-meta { display: flex; gap: 12px; font-size: .74rem; color: var(--muted); margin-top: 3px; }
@media (max-width: 1100px) { .squad-hero { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .lvl-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .squad-hero { padding: 16px; }
  .squad-unlock { flex-direction: column; align-items: flex-start; gap: 14px; }
  .squad-next .row .btn { flex: 1; justify-content: center; }
  .squad-stats { gap: 8px; }
  .squad-stats .dep-stat { padding: 12px; }
  .squad-stats .dep-stat .kpi-ic { display: none; }
  .squad-stats .dep-stat b { font-size: 1.05rem; }
}
.ref-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: center; margin-top: 16px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--gold-line);
  background: linear-gradient(120deg, rgba(224,182,106,.1), var(--surface) 55%); }
.ref-info { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ref-link { min-width: 0; }
.ref-link .input-group input { min-width: 0; text-overflow: ellipsis; }
.ref-link .btn svg { width: 15px; height: 15px; }
@media (max-width: 900px) { .ref-card { grid-template-columns: 1fr; gap: 12px; } }
@media (max-width: 560px) { .ref-link .row .btn { flex: 1; justify-content: center; } }

/* Quick actions — compact */
.quick-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.quick-actions > a, .quick-actions > button { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 10px; border-radius: 12px; font-size: .82rem; }
.quick-actions > a:hover, .quick-actions > button:hover { transform: none; }
.qa-ic { width: 28px; height: 28px; border-radius: 8px; }
.qa-ic svg { width: 15px; height: 15px; }
.qa-ic.gold { box-shadow: none; }
@media (max-width: 900px) { .quick-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .quick-actions { gap: 6px; }
  .quick-actions > a, .quick-actions > button { flex-direction: column; gap: 5px; padding: 9px 2px; font-size: .68rem; }
  .qa-ic { width: 30px; height: 30px; }
}

/* Dashboard — Next ROI card */
.roi-card { display: flex; flex-direction: column; gap: 14px; }
.roi-state { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.roi-state .live-dot { width: 8px; height: 8px; background: var(--dim); animation: none; }
.roi-state.live { color: var(--pos); border-color: rgba(70,200,140,.3); background: rgba(70,200,140,.08); }
.roi-state.live .live-dot { background: var(--pos); animation: live 1.6s infinite; }
.roi-main { display: flex; align-items: center; gap: 16px; }
.roi-ring { position: relative; width: 104px; height: 104px; flex: none; }
.roi-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 7; }
.rr-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.roi-ring.spinning svg { animation: spin 1.4s linear infinite; }
@keyframes spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
.rr-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rr-center b { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rr-center span { font-size: .62rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.roi-amt { display: grid; gap: 4px; min-width: 0; }
.roi-amt b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; color: #7be0b0; white-space: nowrap; }
.roi-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.rw-day { display: grid; justify-items: center; gap: 5px; }
.rw-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: var(--dim); border: 1.5px dashed var(--line-3); }
.rw-dot svg { width: 13px; height: 13px; }
.rw-lbl { font-size: .62rem; font-weight: 700; color: var(--dim); }
.rw-day.paid .rw-dot { border: 0; background: linear-gradient(135deg, #7be0b0, #2f9e74); color: #062417; box-shadow: 0 4px 12px -4px rgba(70,200,140,.7); }
.rw-day.today .rw-dot { border: 2px solid var(--gold); }
.rw-day.today .rw-lbl { color: var(--gold); }
.rw-day.paid.today .rw-dot { box-shadow: 0 0 0 3px rgba(224,182,106,.35); }
.rw-day.wknd .rw-dot { border-style: solid; border-color: transparent; background: rgba(255,255,255,.03); }
.rw-day.wknd { opacity: .55; }
.rw-day.miss .rw-dot { border-style: solid; border-color: rgba(255,255,255,.08); }
.roi-empty { display: grid; justify-items: start; gap: 8px; padding: 6px 0; }
@media (prefers-reduced-motion: reduce) { .roi-ring.spinning svg { animation: none; } }

/* Inline SVG icon (replaces emoji) */
.ic { display: inline-flex; vertical-align: -0.16em; flex: none; }
.ic svg { width: 1.05em; height: 1.05em; }
.ic.fire { color: #f08c6a; }
.ic.gold { color: var(--gold); }
.ic.green { color: var(--pos); }
.streak .streak-fire { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.04); color: var(--dim); font-size: 0; }
.streak .streak-fire svg { width: 22px; height: 22px; }
.streak.on .streak-fire { color: #f08c6a; background: rgba(240,140,106,.14); }
.col-note svg { width: 11px; height: 11px; vertical-align: -1px; }
.ach .ic svg { width: 13px; height: 13px; }
.m-reward .ic { margin-right: 2px; }

/* ID switcher v2 */
.idchip.id2 { gap: 10px; height: 44px; padding: 4px 6px 4px 4px; border-radius: 12px; background: rgba(255,255,255,.03); border-color: var(--line-2); box-shadow: none; }
.idchip.id2:hover { border-color: var(--gold-line); background: rgba(224,182,106,.05); }
.id2-av { position: relative; width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #1d1405; background: var(--brand-grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.idchip .id2-av svg, .id2-av svg { width: 17px; height: 17px; color: #1d1405; }
.id2-av.sm { width: 30px; height: 30px; border-radius: 9px; }
.id2-av.sm svg { width: 15px; height: 15px; }
.id2-status { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid #121316; }
.id2-t { display: grid; text-align: left; min-width: 0; line-height: 1.15; }
.id2-t b { font-size: .86rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.idchip .id2-t small, .id2-t small { display: block; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id2-bal { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; margin-left: 4px; border-radius: 9px; background: rgba(224,182,106,.1); border: 1px solid var(--gold-line); color: #f0cf8c; font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.idchip .id2-bal svg { width: 14px; height: 14px; color: var(--gold); }
.id2-chev { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; transition: transform .2s; }
.idchip .id2-chev svg { width: 15px; height: 15px; color: var(--muted); }
.id2-chev.open { transform: rotate(180deg); }
.id2-menu { min-width: 300px; }
.id2-row { display: flex !important; align-items: center; gap: 10px; width: 100%; text-align: left; }
.id2-row .id2-t { flex: 1; }
.id2-row.on { background: rgba(224,182,106,.07); }
.id2-check { color: var(--gold); display: grid; }
.id2-check svg { width: 16px; height: 16px; }
@media (max-width: 920px) {
  .member-top .top-id .idchip.id2 { height: 48px; }
  .member-top .top-id .id2-t { flex: 1; }
  .member-top .top-id .id2-bal { display: inline-flex; }
}
@media (max-width: 360px) { .id2-bal svg { display: none; } }

/* Mobile header: ID switcher replaces the logo */
.id2-mbal { display: none; }
@media (max-width: 920px) {
  .member-top { flex-wrap: nowrap; row-gap: 0; padding-bottom: 10px; gap: 8px; }
  .member-top .top-logo-link { display: none !important; }
  .member-top .top-id { order: 0; flex: 1 1 auto; min-width: 0; position: static; }
  .member-top .top-id .idchip.id2 { width: 100%; height: 46px; }
  .member-top .top-id .id2-t { flex: 1; }
  .member-top .top-id .idchip .id2-t small { display: none; }
  .member-top .top-id .id2-mbal { display: block; font-size: .74rem; font-weight: 700; color: #f0cf8c; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .member-top .top-id .id2-bal { display: none; }
  .member-top .grow { display: none; }
  .member-top .who-btn { padding: 2px; }
  .member-top .who-btn > svg { display: none; }
  .member-top .top-id .dd-menu { position: absolute; top: calc(100% - 4px); left: 12px !important; right: 12px !important; width: auto; min-width: 0; }
  .member-top { position: relative; }
}
@media (max-width: 380px) { .dash-vault > .row { flex-wrap: wrap !important; gap: 8px; } .vault-logo { height: 18px; } }

/* Next ROI card — compact */
.dash-top { align-items: stretch; }
.dash-top .dash-vault { min-height: 0; }
.roi-card { gap: 12px; padding: 18px; justify-content: space-between; }
.roi-main { gap: 14px; }
.roi-ring { width: 78px; height: 78px; }
.rr-fg, .rr-bg { stroke-width: 8; }
.rr-center b { font-size: .9rem; }
.rr-center span { font-size: .56rem; }
.roi-amt b { font-size: 1.5rem; }
.roi-amt span { font-size: .78rem; }
.roi-foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.roi-week { flex: 1; min-width: 0; padding: 0; background: none; border: 0; gap: 2px; }
.rw-day { gap: 3px; }
.rw-dot { width: 20px; height: 20px; font-size: .6rem; }
.rw-dot svg { width: 11px; height: 11px; }
.rw-lbl { font-size: .58rem; }
.roi-wk-total { display: grid; justify-items: end; gap: 1px; flex: none; padding-left: 12px; border-left: 1px solid var(--line); }
.roi-wk-total b { font-size: .9rem; }

/* ==========================================================================
   Admin dashboard
   ========================================================================== */
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-head h1 { margin: 6px 0 10px; }
.adm-status { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); }
.sys-pill .live-dot { width: 8px; height: 8px; }
.sys-pill.ok { color: #7be0b0; border-color: rgba(70,200,140,.3); background: rgba(70,200,140,.07); }
.sys-pill.warn { color: #f5c46b; border-color: rgba(245,183,85,.35); background: rgba(245,183,85,.08); }
.sys-pill.warn .live-dot { background: var(--warn); box-shadow: none; animation: none; }
.sys-pill.bad { color: #ff9a8a; border-color: rgba(240,100,100,.35); background: rgba(240,100,100,.08); }
.sys-pill.bad .live-dot { background: var(--neg); animation: none; }
.btn-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.25); font-size: .72rem; font-weight: 800; }
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.akpi { display: grid; gap: 8px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.akpi:first-child { border-color: var(--gold-line); background: linear-gradient(140deg, rgba(224,182,106,.12), var(--surface) 60%); }
.akpi-top { display: flex; align-items: center; gap: 10px; }
.akpi-top .kpi-ic { width: 32px; height: 32px; border-radius: 10px; }
.akpi-top .kpi-ic svg { width: 16px; height: 16px; }
.akpi .label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.akpi > b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akpi > b small { font-size: .95rem; color: var(--dim); font-weight: 600; }
.akpi-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted); }
.akpi-sub b { color: var(--text); }
.trend { font-weight: 700; }
.trend.up { color: var(--pos); } .trend.down { color: var(--neg); }

.queues { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.queue { min-width: 0; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.18); border: 1px solid var(--line); }
.queue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.queue-head > div { display: grid; gap: 2px; }
.q-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; color: var(--text); text-decoration: none; transition: background .15s; }
.q-row:hover { background: rgba(255,255,255,.04); }
.q-row .grow { flex: 1; min-width: 0; display: grid; }
.q-row small { font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-net { width: 28px; height: 28px; flex: none; }
.q-age { font-size: .68rem; font-weight: 700; color: var(--dim); padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.04); white-space: nowrap; }
.q-age.warm { color: var(--warn); background: rgba(245,183,85,.1); }
.q-age.old { color: var(--neg); background: rgba(240,100,100,.1); }
.q-go { font-size: .72rem; font-weight: 700; color: var(--gold); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--gold-line); opacity: 0; transition: opacity .15s; }
.q-row:hover .q-go { opacity: 1; }
.q-empty { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 22px 8px; color: var(--pos); font-size: .82rem; font-weight: 600; }
.q-empty svg { width: 16px; height: 16px; }

.health-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); margin-bottom: 12px; }
.health-bar span { display: block; height: 100%; }
.health2 { display: grid; gap: 2px; }
.health2 a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .84rem; }
.health2 a:hover { background: rgba(255,255,255,.04); }
.health2 a > span:nth-child(2) { flex: 1; color: var(--muted); }
.health2 a .dot { margin: 0; }

.chart-sum { display: flex; gap: 18px; }
.chart-sum > div { display: grid; text-align: right; }
.chart-sum b { font-size: 1.05rem; }
.vchart { position: relative; height: 200px; padding-left: 44px; margin-top: 6px; }
.vgrid { position: absolute; inset: 0 0 0 44px; }
.vgrid div { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,.07); }
.vgrid span { position: absolute; left: -44px; top: -8px; width: 38px; text-align: right; font-size: .62rem; color: var(--dim); }
.vbars { position: relative; height: 100%; display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 2px; align-items: end; }
.vb { height: 100%; display: flex; align-items: flex-end; cursor: default; }
.vb span { display: block; width: 100%; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #f4d896, #a8772f); animation: grow-up .8s var(--ease) both; transform-origin: bottom; }
.vb:hover span { filter: brightness(1.2); }
.vb.zero::after { content: ''; display: block; width: 100%; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); }
.vb.today span { box-shadow: 0 0 0 2px rgba(224,182,106,.35); }
.type-list { display: grid; gap: 8px; }
.type-list > div { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; font-size: .82rem; }
.type-list .dot { margin: 0; }
.type-list b { min-width: 90px; text-align: right; }

.job-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.job-row:first-of-type { border-top: 0; }
.job-row .grow { flex: 1; min-width: 0; }
.job-row b { font-size: .86rem; }
.job-row .right { text-align: right; }
.job-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dim); }
.job-dot.ok { background: var(--pos); box-shadow: 0 0 0 4px rgba(70,200,140,.12); }
.job-dot.bad { background: var(--neg); box-shadow: 0 0 0 4px rgba(240,100,100,.12); }
.job-dot.run { background: var(--warn); animation: live 1.6s infinite; }
.act-ic.neutral { background: rgba(255,255,255,.05); color: var(--muted); }

@media (max-width: 1200px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .queues { grid-template-columns: 1fr; } .q-go { opacity: 1; } }
@media (max-width: 560px) {
  .adm-kpis { gap: 8px; }
  .akpi { padding: 14px; }
  .akpi > b { font-size: 1.25rem; }
  .adm-head .row { width: 100%; }
  .adm-head .row .btn { flex: 1; justify-content: center; }
  .vchart { height: 160px; padding-left: 36px; }
  .vgrid { left: 36px; }
  .vgrid span { left: -36px; width: 32px; }
  .vbars { gap: 1px; }
  .chart-sum { gap: 10px; }
  .q-go { display: none; }
}

/* ==========================================================================
   Admin — deposits queue + review
   ========================================================================== */
.akpi.warn { border-color: rgba(245,183,85,.4); background: linear-gradient(140deg, rgba(245,183,85,.12), var(--surface) 60%); }
.dq-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.dq-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dq-search .search-box { min-width: 230px; }
.net-filter button { padding: 6px 12px; }
.dq-list { padding: 6px; }
.dq-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .15s; }
.dq-row + .dq-row { border-top: 1px solid var(--line); border-radius: 0; }
.dq-row:hover { background: rgba(255,255,255,.03); border-radius: 12px; }
.dq-row.pending { box-shadow: inset 3px 0 0 var(--warn); }
.dq-net { width: 36px; height: 36px; flex: none; }
.dq-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.dq-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dq-amt { font-size: 1.05rem; }
.dq-line2 { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: .74rem; color: var(--dim); }
.dq-line2 b { color: var(--muted); }
.dq-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); white-space: nowrap; }
.dq-tag svg { width: 11px; height: 11px; }
.dq-tag.blue { background: rgba(133,173,255,.12); color: var(--info); }
.dq-tag.gold { background: rgba(224,182,106,.12); color: var(--gold); }
.dq-tag.green { background: rgba(70,200,140,.12); color: var(--pos); }
.dq-tag.warn { background: rgba(245,183,85,.12); color: var(--warn); }
.dq-tag.dim { color: var(--dim); }
.dq-side { display: flex; align-items: center; gap: 10px; flex: none; }
.dq-side .xs { white-space: nowrap; }

.dv-head { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--gold-line); background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.14), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); flex-wrap: wrap; }
.dv-head h1 { font-size: 2rem; letter-spacing: -.03em; }
.dv-head .grow { flex: 1; min-width: 220px; }
.dv-net { width: 52px; height: 52px; flex: none; }
.dv-member { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.dv-member:hover { border-color: var(--gold-line); }
.dv-member > span:last-child { display: grid; }
.dv-member small { font-size: .72rem; color: var(--dim); }
.vlist { display: grid; gap: 8px; }
.vstep { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.015); cursor: pointer; transition: border-color .15s, background .15s; margin: 0; font-weight: 400; color: var(--text); }
.vstep input { position: absolute; opacity: 0; pointer-events: none; }
.vstep:hover { border-color: var(--line-3); }
.vstep.ok { border-color: rgba(70,200,140,.35); background: rgba(70,200,140,.05); }
.vbox { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-3); color: transparent; margin-top: 1px; transition: all .15s; }
.vbox svg { width: 14px; height: 14px; }
.vstep.ok .vbox { background: var(--pos); border-color: var(--pos); color: #062417; }
.vstep .grow { flex: 1; min-width: 0; }
.vstep b { display: block; font-size: .9rem; margin-bottom: 4px; }
.vval { font-size: .78rem; color: var(--muted); padding: 7px 10px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.vstep .btn svg { width: 13px; height: 13px; }
.dv-receipt { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.dv-receipt img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.chain-card.ok { border-color: rgba(70,200,140,.35); }
.chain-card.bad { border-color: rgba(240,100,100,.35); }
.chain-res { display: flex; gap: 10px; align-items: flex-start; }
.chain-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--muted); }
.chain-ic svg { width: 17px; height: 17px; }
.chain-card.ok .chain-ic { background: rgba(70,200,140,.14); color: var(--pos); }
.chain-card.bad .chain-ic { background: rgba(240,100,100,.12); color: var(--neg); }
.btn.block { width: 100%; justify-content: center; }
.impact { display: grid; gap: 2px; }
.impact > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.impact > div:first-child { border-top: 0; }
.impact span { color: var(--muted); }
.impact b { text-align: right; }
.decide { border-color: var(--gold-line); }
.decide .btn svg { width: 15px; height: 15px; }
.btn.primary.dim { filter: saturate(.4) brightness(.8); }
.or-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: .72rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chips .chip { font-size: .72rem; padding: 5px 10px; }
.reason-chips .chip.on { background: rgba(240,100,100,.14); color: #ff9a8a; border-color: rgba(240,100,100,.4); }
@media (max-width: 720px) {
  .dq-row { flex-wrap: wrap; gap: 10px; padding: 12px 10px; }
  .dq-side { width: 100%; justify-content: space-between; padding-left: 50px; }
  .dq-search, .dq-search .search-box { width: 100%; }
  .dv-head { padding: 14px; gap: 12px; }
  .dv-head h1 { font-size: 1.6rem; }
  .dv-member { width: 100%; }
}

/* ==========================================================================
   Admin — deposit detail (ticket layout)
   ========================================================================== */
.dx { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dx-main { display: grid; gap: 16px; min-width: 0; }
.dx-side { display: grid; gap: 14px; position: sticky; top: 84px; }
.ticket { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--gold-line);
  background: radial-gradient(80% 120% at 50% -20%, rgba(224,182,106,.16), transparent 60%), linear-gradient(180deg, #1b1c20, #111214); }
.ticket-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 20px 0; }
.ticket-top .grow { flex: 1; }
.ticket-amt { display: grid; justify-items: center; gap: 4px; padding: 18px 20px 6px; text-align: center; }
.ticket-amt > b { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; background: linear-gradient(180deg, #fff5dc, #e0b66a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ticket-cur { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.05); }
.ticket-cur img { width: 20px; height: 20px; }
.flow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr) minmax(0, 1fr); align-items: center; gap: 10px; padding: 18px 20px 20px; }
.flow-end { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
a.flow-end:hover { border-color: var(--gold-line); }
.flow-end.to { flex-direction: row-reverse; text-align: right; }
.flow-end > span:last-child { display: grid; min-width: 0; }
.flow-end small { font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.flow-end b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-end em { font-style: normal; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-wallet { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--brand-grad); color: #1d1405; }
.flow-wallet svg { width: 16px; height: 16px; }
.flow-line { position: relative; height: 34px; display: flex; align-items: center; }
.flow-line::before { content: ''; position: absolute; left: 0; right: 10px; top: 50%; border-top: 2px dashed rgba(224,182,106,.45); }
.flow-dot { position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--gold); }
.flow-coin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #111214; box-shadow: 0 0 0 4px #111214; animation: coin 2.6s ease-in-out infinite; }
.flow-coin img { width: 30px; height: 30px; }
@keyframes coin { 0%, 100% { left: 30%; } 50% { left: 70%; } }
.flow-arrow { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); color: var(--gold); display: grid; }
.flow-arrow svg { width: 18px; height: 18px; }
.ticket-perf { position: relative; height: 0; border-top: 2px dashed rgba(255,255,255,.08); margin: 0 18px; }
.ticket-perf::before, .ticket-perf::after { content: ''; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg, #0a0b0d); }
.ticket-perf::before { left: -30px; } .ticket-perf::after { right: -30px; }
.ticket-hash { display: grid; gap: 6px; padding: 16px 20px 14px; }
.hash-row { display: flex; align-items: center; gap: 8px; }
.hash-row code { flex: 1; min-width: 0; font-size: .8rem; color: var(--text); padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.ticket-chain { display: flex; align-items: center; gap: 12px; margin: 0 14px 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.ticket-chain .grow { flex: 1; min-width: 0; }
.ticket-chain b { font-size: .86rem; }
.ticket-chain.ok { background: rgba(70,200,140,.07); border-color: rgba(70,200,140,.3); }
.ticket-chain.ok .chain-ic { background: rgba(70,200,140,.15); color: var(--pos); }
.ticket-chain.bad { background: rgba(240,100,100,.07); border-color: rgba(240,100,100,.3); }
.ticket-chain.bad .chain-ic { background: rgba(240,100,100,.14); color: var(--neg); }

.dx-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dx-receipt, .dx-check { padding: 16px 18px; }
.rc-thumb { position: relative; display: block; width: 100%; height: 260px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #000; cursor: zoom-in; }
.rc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.rc-zoom { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.7); color: #fff; }
.rc-zoom svg { width: 12px; height: 12px; }
.rc-empty { height: 260px; display: grid; place-content: center; justify-items: center; gap: 6px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--muted); text-decoration: none; text-align: center; }
.rc-empty svg { width: 26px; height: 26px; color: var(--dim); }
.ck-count { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); }
.ck-count.full { background: rgba(70,200,140,.14); color: var(--pos); }
.ck-list { display: grid; gap: 4px; }
.ck { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 12px; cursor: pointer; margin: 0; font-weight: 400; color: var(--text); transition: background .15s; }
.ck:hover { background: rgba(255,255,255,.03); }
.ck input { position: absolute; opacity: 0; pointer-events: none; }
.ck-box { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-3); color: transparent; transition: all .15s; }
.ck-box svg { width: 13px; height: 13px; }
.ck.on .ck-box { background: var(--pos); border-color: var(--pos); color: #062417; transform: scale(1.05); }
.ck-t { display: grid; min-width: 0; }
.ck-t b { font-size: .86rem; font-weight: 600; }
.ck.on .ck-t b { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(70,200,140,.6); }
.ck-t small { font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-progress { height: 4px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 10px; }
.ck-progress span { display: block; height: 100%; background: linear-gradient(90deg, #2f9e74, #7be0b0); transition: width .3s var(--ease); }

.hist { display: grid; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.hist-row:first-child { border-top: 0; }
.hist-row:hover b { color: var(--gold); }
.hist-row .grow { flex: 1; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.hist-dot.approved { background: var(--pos); } .hist-dot.rejected { background: var(--neg); } .hist-dot.pending { background: var(--warn); }

.decide2 { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(224,182,106,.1), var(--surface) 55%); }
.decide2.rejected { border-color: rgba(240,100,100,.35); background: linear-gradient(180deg, rgba(240,100,100,.08), var(--surface) 55%); }
.decide2.approved { border-color: rgba(70,200,140,.35); background: linear-gradient(180deg, rgba(70,200,140,.08), var(--surface) 55%); }
.d2-amt { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
.d2-who { font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
.d2-dots { display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.d2-dots span { width: 22px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); transition: background .2s; }
.d2-dots span.on { background: var(--pos); }
.d2-dots em { font-style: normal; font-size: .72rem; color: var(--dim); margin-left: 6px; }
.btn.lg { padding: 13px 18px; font-size: .95rem; }
.d2-reject { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.d2-result { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; font-size: 1.3rem; }
.decide2.approved .chain-ic { background: rgba(70,200,140,.15); color: var(--pos); }
.decide2.rejected .chain-ic { background: rgba(240,100,100,.14); color: var(--neg); }
.d2-reason { font-size: .84rem; color: #ff9a8a; padding: 10px 12px; border-radius: 10px; background: rgba(240,100,100,.08); }
.effects { display: grid; gap: 2px; }
.effects > div { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .82rem; color: var(--muted); }
.effects b { color: var(--text); }
.ef-ic { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); }
.ef-ic svg { width: 14px; height: 14px; }
.ef-ic.gold { color: var(--gold); background: rgba(224,182,106,.12); } .ef-ic.green { color: var(--pos); background: rgba(70,200,140,.12); }
.ef-ic.blue { color: var(--info); background: rgba(133,173,255,.12); } .ef-ic.violet { color: var(--violet); background: rgba(179,156,255,.12); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(5,5,7,.88); backdrop-filter: blur(6px); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 18px; right: 22px; font-size: .78rem; color: rgba(255,255,255,.7); }
@media (max-width: 1180px) { .dx { grid-template-columns: 1fr; } .dx-side { position: static; grid-row: 2; } }
@media (max-width: 760px) {
  .dx-pair { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .flow-line { height: 30px; justify-self: center; width: 2px; }
  .flow-line::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed rgba(224,182,106,.45); }
  .flow-dot, .flow-arrow { display: none; }
  .flow-coin { animation: none; left: 50%; }
  .flow-end.to { flex-direction: row; text-align: left; }
  .ticket-top, .ticket-hash { padding-left: 14px; padding-right: 14px; }
  .ticket-chain { flex-wrap: wrap; }
  .rc-thumb, .rc-empty { height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .flow-coin { animation: none; } }
.ticket-hash { grid-template-columns: minmax(0, 1fr); }
.hash-row { min-width: 0; }
@media (max-width: 760px) { .hash-row { flex-wrap: wrap; } .hash-row code { flex: 1 1 100%; } .hash-row .btn { flex: 1; justify-content: center; } }

/* Admin — withdrawals payout panel */
.wq + .wq { border-top: 1px solid var(--line); }
.wq .dq-line2 a { color: inherit; text-decoration: none; }
.wq .dq-line2 a:hover { color: var(--gold); }
.payout { margin: 0 10px 12px 60px; border-radius: 16px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, rgba(224,182,106,.07), rgba(0,0,0,.2)); overflow: hidden; }
.po-tabs { display: flex; border-bottom: 1px solid var(--line); }
.po-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer; position: relative; }
.po-tabs button svg { width: 15px; height: 15px; }
.po-tabs button.on { color: var(--gold); }
.po-tabs button.on::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.po-tabs button:last-child.on { color: #ff9a8a; }
.po-tabs button:last-child.on::after { background: var(--neg); }
.po-body { padding: 14px 16px 16px; }
.po-steps { display: grid; gap: 4px; }
.po-step { position: relative; display: flex; gap: 12px; padding: 8px 0; margin: 0; }
.po-step:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 38px; bottom: -6px; width: 2px; background: var(--line-2); }
.po-n { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #1d1405; background: var(--brand-grad); position: relative; z-index: 1; }
.po-step .grow { flex: 1; min-width: 0; }
.po-step small { display: block; font-size: .72rem; color: var(--dim); margin-bottom: 5px; }
.po-val { display: flex; align-items: center; gap: 8px; min-width: 0; }
.po-val b { font-size: 1.25rem; }
.po-val code { flex: 1; min-width: 0; font-size: .8rem; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid var(--line); overflow-wrap: anywhere; }
.po-val input { flex: 1; min-width: 0; }
.po-val .btn svg { width: 15px; height: 15px; }
.po-val .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 720px) {
  .payout { margin: 0 4px 12px; }
  .po-val { flex-wrap: wrap; }
  .po-val code, .po-val input { flex: 1 1 100%; }
  .po-val .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Admin — company wallets
   ========================================================================== */
.cw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cw-net { display: grid; gap: 12px; align-content: start; min-width: 0; }
.cw-card { position: relative; overflow: hidden; border-radius: 22px; padding: 18px; border: 1px solid var(--line-2); isolation: isolate; }
.cw-card::before { content: ''; position: absolute; inset: 0; z-index: -1; }
.cw-card.bep { border-color: rgba(240,185,11,.35); }
.cw-card.bep::before { background: radial-gradient(90% 120% at 100% 0%, rgba(240,185,11,.16), transparent 60%), linear-gradient(135deg, #1c1b17, #0f1013); }
.cw-card.trc { border-color: rgba(235,0,41,.3); }
.cw-card.trc::before { background: radial-gradient(90% 120% at 100% 0%, rgba(235,0,41,.14), transparent 60%), linear-gradient(135deg, #1d1718, #0f1013); }
.cw-card.empty { border-style: dashed; }
.cw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.cw-net-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.cw-net-name img { width: 32px; height: 32px; }
.cw-live { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; color: #7be0b0; padding: 5px 11px; border-radius: 999px; background: rgba(70,200,140,.1); border: 1px solid rgba(70,200,140,.3); }
.cw-live .live-dot { width: 8px; height: 8px; }
.cw-off { font-size: .72rem; font-weight: 700; color: #ff9a8a; padding: 5px 11px; border-radius: 999px; background: rgba(240,100,100,.08); border: 1px solid rgba(240,100,100,.3); }
.cw-body { display: flex; gap: 18px; align-items: center; }
.cw-qr { flex: none; display: grid; justify-items: center; gap: 6px; padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); }
.cw-qr img { width: 132px; height: 132px; display: block; }
.cw-qr span { font-size: .6rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .08em; }
.cw-info { flex: 1; min-width: 0; display: grid; gap: 8px; }
.cw-info small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.cw-info code { display: block; font-size: .86rem; line-height: 1.45; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); overflow-wrap: anywhere; color: var(--text); }
.cw-info .btn svg { width: 13px; height: 13px; }
.cw-note { display: flex; gap: 7px; align-items: flex-start; font-size: .76rem; color: var(--muted); font-style: italic; }
.cw-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.cw-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 22px 10px; }
.cw-empty .kpi-ic { background: rgba(240,100,100,.1); color: var(--neg); }
.cw-empty .btn svg { width: 14px; height: 14px; }
.cw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.cw-stats > div { display: grid; gap: 2px; min-width: 0; }
.cw-stats span { font-size: .66rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.cw-stats b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-backups { padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; font-weight: 700; }
.cw-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cw-row:first-of-type { border-top: 0; }
.cw-row .grow { flex: 1; min-width: 0; display: grid; }
.cw-row .grow b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-row .grow span { font-size: .72rem; color: var(--dim); }
.cw-row-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--muted); }
.cw-row-ic svg { width: 14px; height: 14px; }
.icon-btn.danger-ic:hover { color: var(--neg); border-color: rgba(240,100,100,.4); }
.cw-none { font-size: .78rem; color: var(--dim); padding: 6px 0; }
.cw-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 14px; font-size: .82rem; color: var(--muted); background: rgba(133,173,255,.06); border: 1px solid rgba(133,173,255,.2); }
.cw-tip svg { width: 17px; height: 17px; color: var(--info); flex: none; margin-top: 1px; }
.cw-tip b { color: var(--text); }

.modal-back { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(5,5,7,.75); backdrop-filter: blur(6px); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--gold-line); box-shadow: 0 40px 100px -20px rgba(0,0,0,.7); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-head .icon-btn svg { transform: rotate(45deg); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-foot .btn[disabled] { opacity: .45; cursor: not-allowed; }
.cw-netpick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cw-netpick button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.cw-netpick button.on { border-color: var(--gold-line); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(224,182,106,.08); }
.cw-netpick img { width: 28px; height: 28px; }
.cw-netpick span { display: grid; }
.cw-netpick small { font-size: .7rem; color: var(--muted); }
.addr-input { position: relative; }
.addr-input input { width: 100%; padding-right: 40px; }
.addr-input.ok input { border-color: rgba(70,200,140,.5); }
.addr-input.bad input { border-color: rgba(240,100,100,.5); }
.addr-state { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: grid; }
.addr-state svg { width: 17px; height: 17px; }
@media (max-width: 1100px) { .cw-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .cw-body { flex-direction: column; align-items: stretch; }
  .cw-qr { align-self: center; }
  .cw-stats { grid-template-columns: 1fr 1fr; }
  .cw-row { flex-wrap: wrap; }
  .cw-row .grow { flex: 1 1 calc(100% - 40px); }
  .cw-row form:first-of-type { margin-left: 40px; }
  .modal-card { padding: 18px; border-radius: 18px; }
  .cw-netpick { grid-template-columns: 1fr; }
}
.modal-back { z-index: 400; }
@media (max-width: 560px) { .modal-back { place-items: end center; padding: 10px; } .modal-card { max-height: calc(100vh - 20px); } }

/* ==========================================================================
   Admin — users list
   ========================================================================== */
.sort-select { width: auto; min-width: 150px; padding: 8px 12px; border-radius: 10px; }
.ul-list { padding: 6px; }
.ul-head, .ul-row { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(160px, 1.4fr) 120px 120px 180px; gap: 14px; align-items: center; }
.ul-head { padding: 8px 14px; font-size: .66rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.ul-head .num { text-align: right; }
.ul-row { padding: 12px 14px; border-radius: 12px; transition: background .15s; }
.ul-row + .ul-row { border-top: 1px solid var(--line); border-radius: 0; }
.ul-row:hover { background: rgba(255,255,255,.025); border-radius: 12px; }
.ul-row.off { opacity: .72; }
.ul-user { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.ul-user:hover b { color: var(--gold); }
.ul-av { position: relative; width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; color: #0f1013; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 100%, #fff 25%), var(--c)); }
.ul-flag { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--neg); color: #fff; border: 2px solid var(--surface); }
.ul-flag svg { width: 9px; height: 9px; }
.ul-who { display: grid; min-width: 0; }
.ul-who b { display: inline-flex; align-items: center; gap: 5px; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-who small { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-who small.dim { color: var(--dim); }
.ul-ok { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--info); color: #0b1630; flex: none; }
.ul-ok svg { width: 9px; height: 9px; stroke-width: 3; }
.ul-ids { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.id-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.id-chip:hover { border-color: var(--gold-line); }
.id-chip .dot { margin: 0; width: 6px; height: 6px; }
.id-chip.more { color: var(--muted); }
.ul-num { display: grid; text-align: right; }
.ul-num small { display: none; font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ul-num b { font-size: .9rem; }
.ul-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.ul-actions .icon-btn svg { width: 15px; height: 15px; }
@media (max-width: 1200px) {
  .ul-head { display: none; }
  .ul-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "user inv wal" "ids ids act"; row-gap: 10px; }
  .ul-user { grid-area: user; } .ul-ids { grid-area: ids; } .ul-actions { grid-area: act; }
  .ul-inv { grid-area: inv; } .ul-wal { grid-area: wal; }
  .ul-num small { display: block; }
}
@media (max-width: 640px) {
  .ul-row { grid-template-columns: 1fr 1fr; grid-template-areas: "user user" "inv wal" "ids act"; padding: 12px 8px; }
  .ul-num { text-align: left; }
  .dq-search .sort-select { flex: 1; }
}

/* ==========================================================================
   Admin — member IDs list
   ========================================================================== */
.mini-split { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); }
.mini-split span { display: block; min-width: 2px; }
.ml-list { padding: 6px; }
.ml-head, .ml-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(220px, 1.6fr) 110px minmax(150px, 1fr) 90px 24px; gap: 16px; align-items: center; }
.ml-head { padding: 8px 14px; font-size: .66rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.ml-head .num { text-align: right; }
.ml-row { padding: 12px 14px; color: var(--text); text-decoration: none; border-radius: 12px; transition: background .15s; }
.ml-row + .ml-row { border-top: 1px solid var(--line); border-radius: 0; }
.ml-row:hover { background: rgba(255,255,255,.025); border-radius: 12px; }
.ml-row:hover .ml-go { color: var(--gold); transform: translateX(2px); }
.ml-row.closed { opacity: .7; }
.ml-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ml-medal { display: grid; flex: none; }
.ml-code { display: grid; gap: 1px; min-width: 0; }
.ml-code b { font-size: .95rem; letter-spacing: .02em; }
.ml-code small { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-status { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; }
.ml-status .dot { width: 6px; height: 6px; margin: 0; }
.ml-status.active { color: var(--pos); } .ml-status.active .dot { background: var(--pos); }
.ml-status.pending { color: var(--warn); } .ml-status.pending .dot { background: var(--warn); }
.ml-status.closed { color: var(--neg); } .ml-status.closed .dot { background: var(--neg); }
.ml-owner { display: grid; min-width: 0; }
.ml-owner b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-owner small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-owner small.dim { color: var(--dim); }
.ml-num { display: grid; text-align: right; }
.ml-num small { display: none; font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ml-num b { font-size: .9rem; }
.ml-cap { display: grid; gap: 6px; min-width: 0; }
.ml-cap .bar.warn span { background: linear-gradient(90deg, #d9902f, #ffd58a); }
.ml-cap .bar.full span { background: linear-gradient(90deg, #b8383a, #ff8a7a); }
.ml-go { display: grid; color: var(--dim); transition: all .15s; }
.ml-go svg { width: 16px; height: 16px; }
@media (max-width: 1200px) {
  .ml-head { display: none; }
  .ml-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "id owner go" "cap cap cap" "inv team team"; row-gap: 10px; }
  .ml-id { grid-area: id; } .ml-owner { grid-area: owner; } .ml-go { grid-area: go; } .ml-cap { grid-area: cap; }
  .ml-inv { grid-area: inv; text-align: left; } .ml-team { grid-area: team; }
  .ml-num small { display: block; }
}
@media (max-width: 640px) {
  .ml-row { grid-template-columns: 1fr 1fr auto; grid-template-areas: "id id go" "owner owner owner" "cap cap cap" "inv team team"; padding: 12px 8px; }
}

/* ==========================================================================
   Admin — member detail
   ========================================================================== */
.mp-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 20px; border-radius: 22px; border: 1px solid var(--gold-line);
  background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.15), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.mp-medal { display: grid; flex: none; filter: drop-shadow(0 8px 20px rgba(224,182,106,.3)); }
.mp-main { flex: 1; min-width: 260px; display: grid; gap: 10px; }
.mp-main h1 { font-size: 1.8rem; letter-spacing: .01em; }
.mp-owner { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; color: var(--text); text-decoration: none; }
.mp-owner > span:last-child { display: grid; min-width: 0; }
.mp-owner b { font-size: .92rem; }
.mp-owner small { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-owner:hover b { color: var(--gold); }
.mp-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .76rem; color: var(--dim); }
.mp-facts a { color: var(--gold); text-decoration: none; }
.mp-facts b { color: var(--muted); }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-start; }
.mp-actions .btn svg { width: 14px; height: 14px; }
.mp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 10px; margin-top: 14px; }
.mpk { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.mpk span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.mpk b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpk small { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpk.cap { display: flex; align-items: center; gap: 12px; }
.mpk.cap > div:last-child { display: grid; gap: 2px; min-width: 0; }
.mpk-ring { position: relative; width: 58px; height: 58px; flex: none; }
.mpk-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mpk-ring .ring-bg, .mpk-ring .ring-fg { stroke-width: 12; }
.mpk-fg { stroke: var(--gold); }
.mpk.cap.warn .mpk-fg { stroke: var(--warn); }
.mpk.cap.full .mpk-fg { stroke: var(--neg); }
.mpk-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; }
.mpk.cap.warn { border-color: rgba(245,183,85,.4); }
.mpk.cap.full { border-color: rgba(240,100,100,.4); }
.mp-tabs { display: flex; gap: 4px; margin: 20px 0 14px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mp-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 9px 14px; border-radius: 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.mp-tabs button.on { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-line); }
.mp-tabs .count { font-size: .68rem; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.07); }
.mp-legs { display: grid; gap: 12px; }
.mp-legs .bar { margin-top: 6px; }
.mp-ranks { display: flex; flex-wrap: wrap; gap: 4px; }
.upline { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.upline a { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .84rem; }
.upline a:hover { background: rgba(255,255,255,.03); color: var(--gold); }
.ledger-head, .ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px 210px; gap: 14px; align-items: center; padding: 10px 14px; }
.ledger-head { font-size: .66rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.ledger-head .num, .ledger-row .num { text-align: right; }
.ledger-row + .ledger-row { border-top: 1px solid var(--line); }
.ledger-row .grow { display: grid; min-width: 0; }
.ledger-row .grow b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-row .grow small { font-size: .7rem; color: var(--dim); }
.ledger-row code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { display: grid; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0 8px 2px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 22px; bottom: -6px; width: 2px; background: var(--line); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; box-shadow: 0 0 0 3px var(--surface); }
.tl-item > div { display: grid; min-width: 0; }
.tl-item b { font-size: .84rem; }
.tl-item small { font-size: .72rem; color: var(--dim); }
.tool-block { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.tool-block + .tool-block { margin-top: 12px; }
.tool-block.danger { border-color: rgba(240,100,100,.3); }
.tool-block h3 { margin: 0 0 8px; font-size: .95rem; }
@media (max-width: 1200px) { .mp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mpk.cap { grid-column: span 2; } }
@media (max-width: 760px) {
  .mp-head { padding: 16px; gap: 14px; }
  .mp-medal svg { width: 54px; height: 54px; }
  .mp-main { min-width: 0; flex: 1 1 calc(100% - 70px); }
  .mp-actions { width: 100%; }
  .mp-actions .btn, .mp-actions form { flex: 1; }
  .mp-actions form .btn { width: 100%; justify-content: center; }
  .mpk b { font-size: 1.02rem; }
  .mp-tabs button { flex: none; }
  .ledger-head { display: none; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .ledger-row code, .ledger-row .dq-tag { display: none; }
}

/* ==========================================================================
   Admin — sponsor tree
   ========================================================================== */
.tr-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-jump, .tr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-jump .search-box { min-width: 240px; }
.tr-tools .search-box { min-width: 200px; }
.tr-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: .8rem; }
.tr-crumbs a { color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.04); font-variant-numeric: tabular-nums; }
.tr-crumbs a:hover { color: var(--gold); }
.tr-crumbs .sep { color: var(--dim); }
.tr-crumbs b { color: var(--gold); }
.tr-root { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--gold-line);
  background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.14), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); margin-bottom: 14px; }
.tr-root-id { display: flex; align-items: center; gap: 14px; }
.tr-root-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 22px; justify-content: center; }
.tr-root-stats > div { display: grid; gap: 2px; }
.tr-root-stats span { font-size: .68rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.tr-root-stats b { font-size: 1.1rem; white-space: nowrap; }
.tr-root-stats small { font-size: .7rem; font-weight: 600; }
.tr-levels { display: flex; gap: 6px; align-items: flex-end; }
.tl-col { display: grid; justify-items: center; gap: 2px; width: 28px; }
.tl-bar { position: relative; width: 12px; height: 46px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.tl-bar span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(224,182,106,.35); border-radius: 4px; }
.tl-bar span.act { background: var(--gold); }
.tl-col b { font-size: .72rem; }
.tl-col small { font-size: .6rem; color: var(--dim); }
.tl-col.none { opacity: .4; }

.tree2 { padding: 16px; overflow-x: auto; }
.tree2 ul { list-style: none; margin: 0; padding: 0; }
.tree2 ul ul { position: relative; margin-left: 22px; padding-left: 18px; }
.tree2 ul ul::before { content: ''; position: absolute; left: 0; top: 0; bottom: 22px; border-left: 1.5px solid var(--line-2); }
.tree2 ul ul > li { position: relative; }
.tree2 ul ul > li::before { content: ''; position: absolute; left: -18px; top: 24px; width: 16px; border-top: 1.5px solid var(--line-2); }
.tn-li { padding: 3px 0; }
.tn { display: flex; align-items: center; gap: 10px; min-width: 520px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--surface-2, rgba(255,255,255,.02)); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.tn:hover { border-color: var(--line-3); background: rgba(255,255,255,.035); }
.tn.hit { border-color: var(--gold); background: rgba(224,182,106,.1); box-shadow: 0 0 0 3px rgba(224,182,106,.12); }
.tn.closed { opacity: .6; }
.tn-tog { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 0; border-radius: 7px; background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer; padding: 0; transition: transform .2s; transform: rotate(-90deg); }
.tn-tog.open { transform: rotate(0); color: var(--gold); }
.tn-tog svg { width: 14px; height: 14px; }
.tn-tog.leaf { background: none; cursor: default; }
.tn-tog.leaf::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--line-3); }
.tn-av { position: relative; width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: rgba(255,255,255,.06); color: var(--text); }
.tn-av i { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--dim); }
.tn.active .tn-av, .tn-av.active { background: var(--brand-grad); color: #1d1405; }
.tn.active .tn-av i, .tn-av.active i { background: var(--pos); }
.tn.pending .tn-av i, .tn-av.pending i { background: var(--warn); }
.tn.closed .tn-av i, .tn-av.closed i { background: var(--neg); }
.tn-av.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.2rem; }
.tn-av.lg i { width: 14px; height: 14px; border-width: 3px; }
.tn-main { display: grid; min-width: 120px; flex: 1; color: var(--text); text-decoration: none; }
.tn-main b { font-size: .86rem; }
.tn-main small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-main:hover b { color: var(--gold); }
.tn-stats { display: flex; gap: 16px; }
.tn-stats > span { display: grid; text-align: right; min-width: 52px; }
.tn-stats em { font-style: normal; font-size: .6rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.tn-stats b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.tn-focus { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--dim); border: 1px solid transparent; }
.tn-focus:hover { color: var(--gold); border-color: var(--gold-line); }
.tn-focus svg { width: 14px; height: 14px; }
.tn-more { display: inline-block; margin: 4px 0 2px 58px; font-size: .74rem; color: var(--gold); text-decoration: none; }
@media (max-width: 1100px) { .tr-root { grid-template-columns: 1fr; gap: 14px; } .tr-root-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; } }
@media (max-width: 640px) {
  .tr-jump, .tr-tools, .tr-jump .search-box, .tr-tools .search-box { width: 100%; min-width: 0; }
  .tr-root { padding: 14px; }
  .tn { min-width: 0; }
  .tn-stats > span:nth-child(3) { display: none; }
  .tn-stats { gap: 10px; }
  .tree2 ul ul { margin-left: 10px; padding-left: 12px; }
  .tree2 ul ul > li::before { left: -12px; width: 10px; }
  .tree2 { padding: 10px; }
}
@media (max-width: 640px) {
  .tn { gap: 8px; padding: 5px 6px 5px 4px; }
  .tn-stats > span:first-child { display: none; }
  .tn-stats > span { min-width: 44px; }
  .tn-av { width: 28px; height: 28px; font-size: .72rem; }
  .tn-tog { width: 20px; height: 20px; }
  .tn-main { min-width: 0; }
  .tn-focus { display: none; }
  .tn-more { margin-left: 30px; }
}

/* ==========================================================================
   Admin — ranks
   ========================================================================== */
.rk-ladder-card { margin-top: 16px; padding: 16px 18px; }
.rk-ladder { display: grid; grid-template-columns: repeat(13, minmax(74px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.rk-step { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.015); color: var(--text); text-decoration: none; text-align: center; transition: border-color .15s, background .15s; }
.rk-step:hover { border-color: var(--line-3); }
.rk-step.has { border-color: rgba(224,182,106,.25); background: linear-gradient(180deg, rgba(224,182,106,.07), transparent); }
.rk-step.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,182,106,.12); }
.rk-step b { font-size: .8rem; margin-top: 4px; }
.rk-step small { font-size: .6rem; color: var(--dim); }
.rk-pay { margin-top: 4px; font-size: .68rem; font-weight: 700; color: var(--pos); }
.rk-count { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; background: rgba(255,255,255,.06); color: var(--dim); }
.rk-step.has .rk-count { background: var(--brand-grad); color: #1d1405; }
.rk-list { padding: 6px; }
.rk-row { display: grid; grid-template-columns: 48px minmax(150px, 1fr) minmax(200px, 1.3fr) 150px minmax(200px, 1.2fr); gap: 16px; align-items: center; padding: 12px 14px; }
.rk-row + .rk-row { border-top: 1px solid var(--line); }
.rk-row.completed { opacity: .75; }
.rk-medal { display: grid; }
.rk-who { display: grid; min-width: 0; color: var(--text); text-decoration: none; }
.rk-who:hover b { color: var(--gold); }
.rk-who small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-who small.dim { color: var(--dim); }
.rk-legs { display: grid; gap: 6px; }
.rk-legs > div { display: grid; grid-template-columns: 44px 1fr 56px; gap: 8px; align-items: center; font-size: .7rem; }
.rk-legs b { font-size: .76rem; text-align: right; }
.rk-money { display: grid; gap: 1px; }
.rk-money small { font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.rk-money b { font-size: .95rem; }
.rk-sched { display: grid; gap: 5px; min-width: 0; }
.bar.green span { background: linear-gradient(90deg, #2f9e74, #7be0b0); }
@media (max-width: 1200px) {
  .rk-row { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "m who money" "legs legs legs" "sched sched sched"; row-gap: 10px; }
  .rk-medal { grid-area: m; } .rk-who { grid-area: who; } .rk-money { grid-area: money; text-align: right; } .rk-legs { grid-area: legs; } .rk-sched { grid-area: sched; }
}
@media (max-width: 560px) { .rk-row { padding: 12px 8px; gap: 10px; } .rk-ladder { grid-template-columns: repeat(13, 74px); } }

/* ==========================================================================
   Admin — rewards
   ========================================================================== */
.prog-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.prog { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #ff9a8a; background: rgba(240,100,100,.08); border: 1px solid rgba(240,100,100,.3); }
.prog .live-dot { width: 7px; height: 7px; background: var(--neg); animation: none; }
.prog.on { color: #7be0b0; background: rgba(70,200,140,.08); border-color: rgba(70,200,140,.3); }
.prog.on .live-dot { background: var(--pos); animation: live 1.6s infinite; }
.rw-shelves { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.rw-shelf { padding: 16px 18px; min-width: 0; }
.rw-shelf.off { opacity: .7; }
.rw-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.rw-item { position: relative; flex: 0 0 76px; display: grid; justify-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.015); color: var(--text); text-decoration: none; text-align: center; transition: border-color .15s; }
.rw-item:hover { border-color: var(--line-3); }
.rw-item.has { border-color: rgba(224,182,106,.25); background: linear-gradient(180deg, rgba(224,182,106,.07), transparent); }
.rw-item.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,182,106,.12); }
.rw-item.inactive { opacity: .45; }
.rw-item small { font-size: .62rem; color: var(--dim); margin-top: 3px; }
.rw-item b { font-size: .78rem; }
.rw-item.has .rk-count { background: var(--brand-grad); color: #1d1405; }
.rw-rec { display: grid; grid-template-columns: 44px minmax(130px, 1fr) minmax(150px, 1fr) minmax(180px, 1.3fr) 170px; gap: 16px; align-items: center; padding: 12px 14px; }
.rw-rec + .rw-rec { border-top: 1px solid var(--line); }
.rw-what { display: grid; gap: 4px; justify-items: start; }
.rw-what small { font-size: .72rem; color: var(--dim); }
.rw-basis { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-basis span { display: inline-flex; gap: 5px; align-items: baseline; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rw-basis em { font-style: normal; font-weight: 600; font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 1200px) {
  .rw-shelves { grid-template-columns: 1fr; }
  .rw-rec { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "m who money" "what what what" "basis basis basis"; row-gap: 8px; }
  .rw-rec .rk-medal { grid-area: m; } .rw-rec .rk-who { grid-area: who; } .rw-rec .rk-money { grid-area: money; } .rw-what { grid-area: what; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; } .rw-basis { grid-area: basis; }
}
@media (max-width: 560px) { .rw-rec { padding: 12px 8px; gap: 10px; } }

/* ==========================================================================
   Admin — caps & inactivity
   ========================================================================== */
.cap-flow { display: flex; align-items: stretch; gap: 8px; }
.cf-step { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s; }
a.cf-step:hover { border-color: var(--line-3); }
.cf-step > div { display: grid; min-width: 0; }
.cf-step b { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.cf-step span:not(.cf-ic) { font-size: .82rem; font-weight: 700; }
.cf-step small { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.cf-ic svg { width: 18px; height: 18px; }
.cf-step.pos .cf-ic { background: rgba(70,200,140,.12); color: var(--pos); }
.cf-step.warn .cf-ic { background: rgba(245,183,85,.12); color: var(--warn); }
.cf-step.neg .cf-ic { background: rgba(240,100,100,.12); color: var(--neg); }
.cf-step.dim .cf-ic { background: rgba(255,255,255,.05); color: var(--muted); }
.cf-step.on.warn { border-color: rgba(245,183,85,.55); background: linear-gradient(140deg, rgba(245,183,85,.1), var(--surface) 60%); }
.cf-step.on.neg { border-color: rgba(240,100,100,.55); background: linear-gradient(140deg, rgba(240,100,100,.1), var(--surface) 60%); }
.cf-step.on.dim { border-color: var(--line-3); background: rgba(255,255,255,.04); }
.cf-arrow { display: grid; place-items: center; color: var(--dim); flex: none; }
.cf-arrow svg { width: 16px; height: 16px; }
.cap-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 11px 14px; border-radius: 12px; font-size: .82rem; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.cap-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.cap-note.alert svg { color: var(--warn); } .cap-note.window svg { color: var(--neg); } .cap-note.closed svg { color: var(--muted); }
.cap-note b { color: var(--text); }
.cp-list { padding: 6px; }
.cp-row { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(200px, 1.4fr) 120px 170px 20px; gap: 18px; align-items: center; padding: 12px 14px; color: var(--text); text-decoration: none; border-radius: 12px; }
.cp-row + .cp-row { border-top: 1px solid var(--line); border-radius: 0; }
.cp-row:hover { background: rgba(255,255,255,.025); border-radius: 12px; }
.cp-row:hover .ml-go { color: var(--gold); }
.cp-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cp-who > span:last-child { display: grid; min-width: 0; }
.cp-who small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-who small.dim { color: var(--dim); }
.cp-ring { --c: var(--warn); width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.07) 0); position: relative; }
.cp-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.cp-ring b { position: relative; font-size: .7rem; }
.cp-row.window .cp-ring, .cp-row.closed .cp-ring { --c: var(--neg); }
.cp-cap { display: grid; gap: 6px; min-width: 0; }
.cp-stat { display: grid; text-align: right; }
.cp-stat small { font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.cp-when { display: grid; gap: 3px; justify-items: end; text-align: right; }
.cp-when small { font-size: .7rem; color: var(--dim); }
.cp-clock { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #ff9a8a; background: rgba(240,100,100,.1); }
.cp-clock svg { width: 12px; height: 12px; }
.cp-clock.urgent { color: #fff; background: var(--neg); animation: blink 1.6s ease-in-out infinite; }
.cp-clock.warn { color: var(--warn); background: rgba(245,183,85,.1); }
.cp-clock.dim { color: var(--muted); background: rgba(255,255,255,.05); }
@media (max-width: 1200px) {
  .cap-flow { display: grid; grid-template-columns: 1fr 1fr; }
  .cf-arrow { display: none; }
  .cp-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who when" "cap cap" "stat stat"; row-gap: 10px; }
  .cp-who { grid-area: who; } .cp-when { grid-area: when; } .cp-cap { grid-area: cap; } .cp-stat { grid-area: stat; text-align: left; grid-auto-flow: column; justify-content: start; gap: 8px; align-items: baseline; } .cp-row .ml-go { display: none; }
}
@media (max-width: 560px) { .cf-step { padding: 12px; gap: 10px; } .cf-step b { font-size: 1.25rem; } .cf-step small { white-space: normal; } .cp-row { padding: 12px 8px; } }
@media (prefers-reduced-motion: reduce) { .cp-clock.urgent { animation: none; } }

/* ==========================================================================
   Admin — reports
   ========================================================================== */
.rp-groups { display: grid; grid-template-columns: 1fr 2.4fr 1fr; gap: 14px; }
.rp-group { display: grid; gap: 8px; align-content: start; min-width: 0; }
.rp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rp-group:first-child .rp-items, .rp-group:last-child .rp-items { grid-template-columns: 1fr; }
.rp-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s; }
.rp-item:hover { border-color: var(--line-3); }
.rp-item.on { border-color: var(--gold); background: linear-gradient(140deg, rgba(224,182,106,.12), var(--surface) 65%); box-shadow: 0 0 0 3px rgba(224,182,106,.1); }
.rp-item > span:last-child { display: grid; min-width: 0; }
.rp-item b { font-size: .84rem; }
.rp-item small { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-ic { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--muted); }
.rp-ic svg { width: 16px; height: 16px; }
.rp-item.on .rp-ic { background: var(--brand-grad); color: #1d1405; }
.rp-filter { margin-top: 16px; padding: 14px 16px; display: grid; gap: 12px; }
.rp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-presets .chip { text-decoration: none; }
.rp-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rp-fields label { display: grid; gap: 4px; margin: 0; font-weight: 400; min-width: 150px; }
.rp-fields label span { font-size: .7rem; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.rp-actions { display: flex; gap: 8px; margin-left: auto; }
.rp-actions .btn svg { width: 15px; height: 15px; }
.rp-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
.rp-summary > div { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 120px; }
.rp-summary > div.hl { border-color: var(--gold-line); }
.rp-summary span { font-size: .66rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.rp-summary b { font-size: .98rem; }
.rp-table-card { padding: 0; overflow: hidden; }
.rp-scroll { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.rp-table th { position: sticky; top: 0; z-index: 1; background: #16171b; text-align: left; font-size: .66rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.rp-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text); }
.rp-table tr:hover td { background: rgba(255,255,255,.02); }
.rp-table .num { text-align: right; }
.rp-table td.mono { font-size: .76rem; }
.rp-table .net-img { width: 16px; height: 16px; vertical-align: -3px; }
.rp-st { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); }
.rp-st.approved, .rp-st.paid, .rp-st.active, .rp-st.completed, .rp-st.credited { color: var(--pos); background: rgba(70,200,140,.1); }
.rp-st.pending { color: var(--warn); background: rgba(245,183,85,.1); }
.rp-st.rejected, .rp-st.closed, .rp-st.locked { color: var(--neg); background: rgba(240,100,100,.1); }
@media (max-width: 1200px) { .rp-groups { grid-template-columns: 1fr; } .rp-group:first-child .rp-items, .rp-group:last-child .rp-items { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
@media (max-width: 640px) {
  .rp-items { display: flex; overflow-x: auto; scrollbar-width: none; }
  .rp-item { flex: 0 0 auto; }
  .rp-item small { display: none; }
  .rp-fields label { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .rp-actions { width: 100%; margin: 0; }
  .rp-actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Admin — settings
   ========================================================================== */
.st-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.st-nav { position: sticky; top: 84px; display: grid; gap: 4px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.st-nav a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .15s; }
.st-nav a:hover { background: rgba(255,255,255,.03); }
.st-nav a.on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
.st-nav a > span:last-child { display: grid; min-width: 0; }
.st-nav b { font-size: .86rem; }
.st-nav small { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ic { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--muted); }
.st-ic svg { width: 16px; height: 16px; }
.st-nav a.on .st-ic { background: var(--brand-grad); color: #1d1405; }
.st-ic.sm { width: 34px; height: 34px; background: var(--gold-soft); color: var(--gold); }
.st-body { display: grid; gap: 14px; min-width: 0; }
.st-body form { display: grid; gap: 14px; }
.st-sec { padding: 18px; }
.st-sec-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.st-sec-head > div:not(.lv-total) { flex: 1; min-width: 0; }
.st-sec-head h3 { margin: 0; font-size: 1rem; }
.st-sec-head small { font-size: .76rem; color: var(--dim); }
.st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.st-field { margin: 0; }
.st-field .hint { font-size: .72rem; }
.st-input { position: relative; display: flex; align-items: center; }
.st-input input { width: 100%; }
.st-input .u { position: absolute; right: 12px; font-size: .78rem; font-weight: 700; color: var(--dim); pointer-events: none; }
.st-input.has-unit input { padding-right: 56px; }
.st-input.pre .u { left: 12px; right: auto; }
.st-input.pre input { padding-left: 26px; padding-right: 12px; }
.st-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); margin: 0; cursor: pointer; font-weight: 400; color: var(--text); }
.st-toggle > span:first-child { display: grid; }
.st-toggle b { font-size: .86rem; }
.st-toggle small { font-size: .72rem; color: var(--dim); }
.st-foot { display: flex; justify-content: flex-end; }
.st-savebar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: #1d1e22; border: 1px solid var(--gold-line); box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); font-size: .84rem; font-weight: 600; transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .2s var(--ease); }
.st-savebar.show { transform: none; opacity: 1; pointer-events: auto; }
.st-savebar .live-dot { width: 8px; height: 8px; background: var(--warn); display: inline-block; margin-right: 6px; vertical-align: 1px; }
.sf { display: grid; gap: 4px; margin: 0; font-weight: 400; min-width: 0; }
.sf > span { font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.slab-list { display: grid; gap: 8px; }
.slab-row { display: grid; grid-template-columns: 36px minmax(110px, 1fr) 130px 130px 110px minmax(130px, auto) 44px; gap: 10px; align-items: end; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.slab-row > svg, .slab-row .slab-plus { align-self: center; }
.slab-row.off { opacity: .6; }
.slab-row.new { border-style: dashed; }
.slab-row .switch { align-self: center; }
.slab-plus { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--gold); }
.slab-plus svg { width: 16px; height: 16px; }
.slab-prev { align-self: center; font-size: .74rem; color: var(--pos); font-weight: 600; white-space: nowrap; }
.lv-total { display: grid; justify-items: end; text-align: right; padding: 8px 12px; border-radius: 12px; background: rgba(224,182,106,.08); border: 1px solid var(--gold-line); }
.lv-total b { font-size: 1.3rem; color: var(--gold); line-height: 1.1; }
.lv-total small { font-size: .64rem; }
.lv-list { display: grid; gap: 6px; }
.lv-row { display: grid; grid-template-columns: 36px minmax(80px, 1fr) 140px 150px; gap: 12px; align-items: end; padding: 8px 10px; border-radius: 12px; }
.lv-row:hover { background: rgba(255,255,255,.02); }
.lv-row .lvl-no { align-self: center; }
.lv-bar { align-self: center; height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.lv-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); transition: width .2s; }
.rkset-list { display: grid; gap: 4px; }
.rkset-head, .rkset-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 120px; gap: 12px; align-items: center; }
.rkset-head { padding: 0 8px 6px; font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.rkset-head .num, .rkset-row .num { text-align: right; justify-self: end; }
.rkset-row { padding: 6px 8px; border-radius: 12px; }
.rkset-row:hover { background: rgba(255,255,255,.02); }
.rkset-row.off { opacity: .55; }
@media (max-width: 1100px) {
  .st-layout { grid-template-columns: 1fr; }
  .st-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .st-nav a { flex: none; }
  .st-nav small { display: none; }
  .slab-row { grid-template-columns: 36px 1fr 1fr; }
  .slab-row .sf:first-of-type { grid-column: span 2; }
  .slab-prev { grid-column: 1 / -2; }
}
@media (max-width: 640px) {
  .st-sec { padding: 14px; }
  .st-fields { grid-template-columns: 1fr; }
  .slab-row { grid-template-columns: 1fr 1fr; }
  .slab-row > svg, .slab-row .slab-plus { display: none; }
  .slab-row .sf:first-of-type { grid-column: span 2; }
  .slab-prev { grid-column: 1; }
  .lv-row { grid-template-columns: 30px 1fr 1fr; }
  .lv-bar { display: none; }
  .rkset-head, .rkset-row { grid-template-columns: 34px 1fr 1fr; }
  .rkset-head .num, .rkset-row .num { grid-column: 2 / -1; justify-self: start; }
  .rkset-head .num { display: none; }
  .st-sec-head { flex-wrap: wrap; }
  .lv-total { width: 100%; justify-items: start; text-align: left; }
  .st-savebar { bottom: 84px; }
}

/* Settings v2 — overview + rows */
.ov { padding: 18px 20px; border-radius: 20px; border: 1px solid var(--gold-line); background: radial-gradient(70% 140% at 0% 0%, rgba(224,182,106,.15), transparent 60%), linear-gradient(135deg, #1a1c21, #0f1013); }
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ov-head h3 { margin: 4px 0 0; font-size: 1.1rem; }
.ov-tz { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); padding: 5px 11px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.ov-tz svg { width: 13px; height: 13px; color: var(--gold); }
.ov-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ov-tile { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.06); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s, transform .15s; }
.ov-tile:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.ov-tile small { font-size: .66rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ov-tile b { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tile em { font-style: normal; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cols { columns: 2 420px; column-gap: 14px; }
.st-card { break-inside: avoid; margin: 0 0 14px; padding: 16px 18px; scroll-margin-top: 90px; }
.st-card:target { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,182,106,.15); }
.st-card-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.st-card-head h3 { margin: 0; font-size: .98rem; }
.st-card-head small { font-size: .74rem; color: var(--dim); }
.st-rows { display: grid; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; font-weight: 400; color: var(--text); cursor: default; }
.st-row:last-child { border-bottom: 0; }
.st-row-text { display: grid; gap: 2px; min-width: 0; }
.st-row-text b { font-size: .86rem; font-weight: 600; }
.st-row-text small { font-size: .72rem; color: var(--dim); }
.st-row-ctl { flex: none; display: flex; justify-content: flex-end; }
.st-row-ctl .st-input { width: 150px; }
.st-row-ctl .st-input input { text-align: right; padding-top: 8px; padding-bottom: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-row-ctl .st-input.has-unit input { padding-right: 46px; }
.st-row-ctl .st-input.pre input { padding-right: 12px; }
.st-row-ctl select { width: 220px; padding-top: 8px; padding-bottom: 8px; }
.st-row.wide { flex-wrap: wrap; }
.st-row.wide .st-row-ctl { flex: 1 1 220px; }
.st-row.wide .st-row-ctl .st-input, .st-row.wide .st-row-ctl select { width: 100%; }
.st-row.wide .st-row-ctl .st-input input { text-align: left; font-weight: 500; }
.st-example { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: .78rem; color: var(--muted); background: rgba(224,182,106,.06); border: 1px dashed var(--gold-line); }
.st-example svg { width: 15px; height: 15px; flex: none; color: var(--gold); margin-top: 1px; }
.st-example b { color: var(--text); }
.st-foot { justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1300px) { .ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .ov { padding: 14px; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .st-cols { columns: 1; }
  .st-row { flex-wrap: wrap; gap: 8px; }
  .st-row-ctl { flex: 1 1 100%; }
  .st-row-ctl .st-input, .st-row-ctl select { width: 100%; }
  .st-row:has(.switch) { flex-wrap: nowrap; }
  .st-row:has(.switch) .st-row-ctl { flex: none; }
}

/* Settings v2 — other tabs */
.ov-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-calc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px dashed var(--gold-line); font-size: .82rem; color: var(--muted); }
.ov-calc > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.ov-calc > span:first-child svg { width: 15px; height: 15px; color: var(--gold); }
.ov-calc .st-input { width: 140px; }
.ov-calc .st-input.sm { width: 120px; }
.ov-calc .st-input input { padding-top: 7px; padding-bottom: 7px; font-weight: 700; }
.ov-calc-out b { color: var(--text); }
.ov-calc-out.red { color: #ff9a8a; }
.lv-row .lv-n { background: rgba(255,255,255,.06); color: var(--dim); transition: all .15s; }
.lv-row.open .lv-n { background: var(--brand-grad); color: #1d1405; }
.rkset-row.hit { background: rgba(224,182,106,.07); box-shadow: inset 3px 0 0 var(--gold); }
@media (max-width: 1000px) { .ov-grid.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .ov-calc .st-input, .ov-calc .st-input.sm { width: 100%; } .ov-calc > span { flex: 1 1 100%; } }
@media (max-width: 1350px) and (min-width: 641px) {
  .slab-row { grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .slab-row .sf:first-of-type { grid-column: 2 / span 3; }
  .slab-row > svg, .slab-row .slab-plus { grid-row: span 2; }
  .slab-prev { grid-column: 2 / span 3; }
  .slab-row .switch { grid-column: 5; grid-row: 1; }
}
.st-body, .st-body form, .ov, .ov-head { min-width: 0; }

/* Settings — horizontal section menu (all screen sizes) */
.st-layout { grid-template-columns: 1fr; gap: 16px; }
.st-nav { position: sticky; top: 72px; z-index: 15; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 5px; border-radius: 16px; background: rgba(20,21,24,.92); backdrop-filter: blur(10px); }
.st-nav a { flex-direction: row; gap: 9px; padding: 8px 10px; min-width: 0; }
.st-nav a > span:last-child { min-width: 0; }
.st-nav b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-nav small { display: block; font-size: .66rem; }
.st-nav .st-ic { width: 30px; height: 30px; border-radius: 9px; }
.st-nav .st-ic svg { width: 15px; height: 15px; }
@media (max-width: 1250px) {
  .st-nav { display: flex; overflow-x: auto; scrollbar-width: none; }
  .st-nav::-webkit-scrollbar { display: none; }
  .st-nav a { flex: none; }
  .st-nav small { display: none; }
}
@media (max-width: 640px) { .st-nav { top: 62px; } .st-nav .st-ic { width: 26px; height: 26px; } }

/* ==========================================================================
   Admin — job runs
   ========================================================================== */
.sched { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: 20px; border: 1px solid; }
.sched.ok { border-color: rgba(70,200,140,.35); background: linear-gradient(135deg, rgba(70,200,140,.1), var(--surface) 60%); }
.sched.warn { border-color: rgba(245,183,85,.4); background: linear-gradient(135deg, rgba(245,183,85,.1), var(--surface) 60%); }
.sched.bad { border-color: rgba(240,100,100,.45); background: linear-gradient(135deg, rgba(240,100,100,.12), var(--surface) 60%); }
.sched-ic { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; }
.sched-ic svg { width: 22px; height: 22px; }
.sched.ok .sched-ic { background: rgba(70,200,140,.15); color: var(--pos); }
.sched.warn .sched-ic { background: rgba(245,183,85,.15); color: var(--warn); }
.sched.bad .sched-ic { background: rgba(240,100,100,.15); color: var(--neg); }
.sched .grow { flex: 1; min-width: 0; }
.sched h2 { margin: 2px 0 4px; font-size: 1.1rem; }
.sched p { margin: 0; font-size: .84rem; color: var(--muted); }
.sched-fix { display: grid; gap: 6px; margin-top: 12px; }
.sched-fix .input-group input { min-width: 0; }
.sched-tz { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .74rem; color: var(--muted); padding: 5px 11px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.sched-tz svg { width: 13px; height: 13px; }
.job-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.jc { padding: 16px 18px; display: grid; gap: 14px; }
.jc-head { display: flex; align-items: center; gap: 12px; }
.jc-head .grow { flex: 1; min-width: 0; }
.jc-head h3 { margin: 0; font-size: .98rem; }
.jc-head small { font-size: .74rem; color: var(--dim); }
.jc-ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.jc-ic svg { width: 18px; height: 18px; }
.jc-ic.sm { width: 30px; height: 30px; border-radius: 9px; }
.jc-ic.sm svg { width: 14px; height: 14px; }
.jc-state { font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.jc.ok .jc-state { color: var(--pos); background: rgba(70,200,140,.12); }
.jc.warn .jc-state { color: var(--warn); background: rgba(245,183,85,.12); }
.jc.bad .jc-state { color: var(--neg); background: rgba(240,100,100,.12); }
.jc.idle .jc-state { color: var(--muted); background: rgba(255,255,255,.06); }
.jc.bad { border-color: rgba(240,100,100,.4); }
.jc.warn { border-color: rgba(245,183,85,.35); }
.jc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.jc-facts > div { display: grid; gap: 1px; padding: 9px 10px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid var(--line); min-width: 0; }
.jc-facts span { font-size: .62rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.jc-facts b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-facts small { font-size: .68rem; color: var(--dim); }
.jc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jc-foot .btn svg { width: 13px; height: 13px; }
.jc-dots { display: flex; gap: 4px; }
.jc-dots span { width: 12px; height: 12px; border-radius: 4px; background: rgba(255,255,255,.06); }
.jc-dots span.ok { background: var(--pos); }
.jc-dots span.bad { background: var(--neg); }
.jc-dots span.run { background: var(--warn); }
.run-list { padding: 6px; }
.run-row { display: grid; grid-template-columns: 10px 30px minmax(0, 1fr) 90px 80px 60px; gap: 12px; align-items: center; padding: 10px 12px; }
.run-row + .run-row { border-top: 1px solid var(--line); }
.run-row .grow { display: grid; min-width: 0; }
.run-row .grow b { font-size: .86rem; }
.run-row .grow small { font-size: .72rem; color: var(--dim); }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.run-row.ok .run-dot { background: var(--pos); } .run-row.bad .run-dot { background: var(--neg); } .run-row.run .run-dot { background: var(--warn); }
.run-row.bad { background: rgba(240,100,100,.04); }
.run-n { display: grid; text-align: right; }
.run-n small { font-size: .62rem; color: var(--dim); }
.run-row .rp-st { justify-self: start; }
.run-row .linkish, .run-nomsg { justify-self: end; }
.run-msg { grid-column: 3 / -1; margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: .74rem; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
@media (max-width: 1100px) { .job-cards { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .sched { flex-wrap: wrap; padding: 14px; }
  .sched-tz { order: -1; margin-left: auto; }
  .jc-facts { grid-template-columns: 1fr 1fr; }
  .run-row { grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "dot main st" "dot n more"; row-gap: 4px; }
  .run-row .jc-ic { display: none; }
  .run-dot { grid-area: dot; } .run-row .grow { grid-area: main; } .run-row .rp-st { grid-area: st; justify-self: end; } .run-n { grid-area: n; text-align: left; grid-auto-flow: column; justify-content: start; gap: 4px; align-items: baseline; } .run-row .linkish, .run-nomsg { grid-area: more; }
  .run-msg { grid-column: 1 / -1; }
}
@media (max-width: 1500px) and (min-width: 1101px) { .jc-facts { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   Admin — audit log
   ========================================================================== */
a.akpi:hover { border-color: var(--gold-line); }
.au-filter { margin: 16px 0 6px; padding: 12px 14px; display: grid; gap: 10px; }
.au-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.au-cat { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 12px; border-radius: 10px; font-size: .8rem; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.au-cat svg { width: 14px; height: 14px; }
.au-cat:hover { color: var(--text); background: rgba(255,255,255,.03); }
.au-cat.on { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.au-cat .count { font-size: .66rem; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.07); }
.au-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.au-row .search-box { margin-left: auto; min-width: 230px; }
.au-check { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin: 0; font-weight: 500; cursor: pointer; }
.au-day { display: flex; align-items: baseline; gap: 10px; margin: 18px 4px 8px; }
.au-day b { font-size: .9rem; }
.au-day span { font-size: .72rem; color: var(--dim); }
.au-list { padding: 4px 6px; }
.au-row-item + .au-row-item { border-top: 1px solid var(--line); }
.au-main { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px; border-radius: 10px; }
.au-main:hover { background: rgba(255,255,255,.02); }
.au-main .grow { flex: 1; min-width: 0; }
.au-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.au-title b { font-size: .88rem; }
.au-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: .74rem; color: var(--dim); }
.au-meta a { color: var(--gold); text-decoration: none; }
.au-who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.avatar.xs { width: 18px; height: 18px; font-size: .6rem; border-radius: 6px; }
.au-reason { margin-top: 6px; font-size: .78rem; color: var(--muted); font-style: italic; }
.au-toggle { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.05); margin-top: 2px; }
.au-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
.au-toggle.open svg { transform: rotate(180deg); }
.au-diff { margin: 0 8px 12px 56px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; font-size: .76rem; }
.au-diff-head, .au-diff-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 7px 12px; }
.au-diff-head { background: rgba(255,255,255,.03); font-size: .62rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.au-diff-row + .au-diff-row { border-top: 1px solid var(--line); }
.au-diff-row .k { color: var(--muted); font-weight: 600; }
.au-diff-row .b, .au-diff-row .a { word-break: break-all; }
.au-diff-row .b { color: var(--dim); }
.au-diff-row.chg .b { color: #ff9a8a; text-decoration: line-through; text-decoration-color: rgba(255,154,138,.5); }
.au-diff-row.chg .a { color: #7be0b0; }
@media (max-width: 640px) {
  .au-row .search-box { margin: 0; width: 100%; min-width: 0; }
  .au-main { flex-wrap: wrap; }
  .au-toggle { margin-left: 46px; }
  .au-diff { margin-left: 8px; }
  .au-diff-head, .au-diff-row { grid-template-columns: 1fr 1fr; }
  .au-diff-head span:first-child { display: none; }
  .au-diff-row .k { grid-column: 1 / -1; }
}

/* ==========================================================================
   Admin — email & SMTP
   ========================================================================== */
.mail-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; flex: none; }
.mail-stats > div { display: grid; justify-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); min-width: 70px; }
.mail-stats b { font-size: 1.1rem; }
.mail-stats span { font-size: .62rem; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.mail-stats .bad b { color: var(--neg); }
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0 4px; }
.presets .chip { font-size: .74rem; padding: 4px 11px; }
.st-rows.dimmed { opacity: .78; }
.mail-tips { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .8rem; color: var(--muted); }
.mail-tips b { color: var(--text); }
.tpl-groups { columns: 2 380px; column-gap: 14px; }
.tpl-group { break-inside: avoid; margin: 0 0 14px; padding: 8px 10px; }
.tpl-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 6px 10px; font-size: .86rem; border-bottom: 1px solid var(--line); }
.tpl-group-head svg { width: 16px; height: 16px; color: var(--gold); }
.tpl { display: flex; align-items: center; gap: 8px; padding: 10px 6px; border-radius: 10px; }
.tpl + .tpl { border-top: 1px solid var(--line); border-radius: 0; }
.tpl .grow { flex: 1; min-width: 0; display: grid; }
.tpl b { font-size: .86rem; }
.tpl small { font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl.off b { color: var(--muted); }
.tpl form { display: flex; margin-left: 4px; }
.mail-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 80px; gap: 12px; align-items: center; padding: 10px 12px; }
.mail-row + .mail-row { border-top: 1px solid var(--line); }
.mail-row .grow { display: grid; min-width: 0; }
.mail-row .grow b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row .grow small { font-size: .72rem; color: var(--dim); }
.mail-row .grow small.red { color: #ff9a8a; }
.mail-row.ok .run-dot { background: var(--pos); } .mail-row.bad .run-dot { background: var(--neg); }
.mail-row .rp-st { justify-self: end; }
.tpl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-body { min-height: 300px; font-family: inherit; line-height: 1.6; resize: vertical; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ph { display: grid; gap: 1px; text-align: left; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s; }
.ph:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.ph code { font-size: .76rem; color: var(--gold); }
.ph small { font-size: .66rem; color: var(--dim); }
.tpl-preview-wrap { position: sticky; top: 84px; display: grid; gap: 8px; }
.tpl-preview-bar { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; }
.tpl-preview-bar .live-dot { width: 8px; height: 8px; }
.mail-preview { padding: 16px; border-radius: 18px; background: #0f1013; border: 1px solid var(--line); }
.mp-inbox { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: rgba(255,255,255,.04); }
.mp-inbox > div { display: grid; min-width: 0; }
.mp-inbox b { font-size: .8rem; }
.mp-inbox span { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card { max-width: 520px; margin: 0 auto; border-radius: 16px; overflow: hidden; border: 1px solid #23252b; }
.mp-logo { background: #0a0b0d; padding: 20px 22px; }
.mp-logo img { width: 150px; display: block; }
.mp-bar { height: 3px; background: linear-gradient(90deg, #a8772f, #f4d896, #a8772f); }
.mp-body { background: #16181d; padding: 22px; }
.mp-body h3 { margin: 0 0 14px; font-size: 1.05rem; color: #fff; }
.mp-text { white-space: pre-wrap; font-size: .86rem; line-height: 1.65; color: #d6d3cc; min-height: 60px; word-break: break-word; }
.mp-btn { display: inline-block; margin-top: 20px; padding: 10px 18px; border-radius: 10px; background: #d6a95c; color: #1d1405; font-weight: 700; font-size: .82rem; }
@media (max-width: 1200px) { .mail-grid, .tpl-edit { grid-template-columns: 1fr; } .tpl-preview-wrap { position: static; } .sched .mail-stats { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); } .sched { flex-wrap: wrap; } }
@media (max-width: 640px) {
  .mail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mail-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .mail-row > .xs { display: none; }
  .tpl-groups { columns: 1; }
}

/* ==========================================================================
   Admin — sidebar v2
   ========================================================================== */
.side2 { padding: 16px 12px 12px; background: linear-gradient(180deg, #0c0d10, #08090b); border-right: 1px solid rgba(255,255,255,.05); }
.sd-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 0; }
.sd-brand .brand { margin: 0; display: block; }
.brand-mark { display: none; width: 36px; height: 36px; border-radius: 11px; place-items: center; font-weight: 900; color: #1d1405; background: var(--brand-grad); }
.sd-collapse { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; flex: none; }
.sd-collapse svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .2s; }
.sd-collapse:hover { color: var(--gold); border-color: var(--gold-line); }
.side2 .console-tag { margin: 6px 6px 12px; }
.side2 .console-tag span { display: inline-block; padding: 3px 9px; border-radius: 999px; background: rgba(224,182,106,.08); border: 1px solid var(--gold-line); }
.sd-status { display: flex; align-items: center; gap: 10px; margin: 0 2px 6px; padding: 9px 11px; border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid; }
.sd-status.ok { border-color: rgba(70,200,140,.25); background: rgba(70,200,140,.06); }
.sd-status.bad { border-color: rgba(240,100,100,.35); background: rgba(240,100,100,.08); }
.sd-status .live-dot { width: 8px; height: 8px; flex: none; }
.sd-status.bad .live-dot { background: var(--neg); }
.sd-status-text { display: grid; min-width: 0; }
.sd-status-text b { font-size: .78rem; }
.sd-status-text small { font-size: .68rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav2 .sec { padding: 14px 10px 6px; font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5f5b54; }
.nav2 a { gap: 10px; padding: 6px 8px; margin: 1px 0; font-size: .86rem; border-radius: 11px; }
.nav2 a.on::before { display: none; }
.nav2 a.on { background: rgba(224,182,106,.1); box-shadow: inset 0 0 0 1px rgba(224,182,106,.22); }
.ni { position: relative; width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--ink-muted); transition: all .15s; }
.ni svg { width: 15px; height: 15px; }
.nav2 a:hover .ni { color: #fff; background: rgba(255,255,255,.07); }
.nav2 a.on .ni { background: var(--brand-grad); color: #1d1405; box-shadow: 0 6px 16px -6px rgba(224,182,106,.6); }
.nav2 a.on .ni svg { color: #1d1405; }
.ni-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); border: 2px solid #0a0b0d; display: none; }
.nl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: .68rem; font-weight: 800; color: #1d1405; background: var(--warn); }
.sd-me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.sd-me-text { display: grid; flex: 1; min-width: 0; }
.sd-me-text b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-me-text small { font-size: .68rem; color: var(--gold); }
.sd-me form { display: flex; }
.side2 .side-foot { border: 0; margin-top: 8px; padding: 4px 8px 0; font-size: .66rem; }
.side2 .nav { flex: 0 0 auto; }

/* collapsed rail (desktop only) */
@media (min-width: 921px) {
  body.side-mini { --side-w: 78px; }
  body.side-mini .side2 { padding-left: 10px; padding-right: 10px; }
  body.side-mini .brand-logo, body.side-mini .console-tag, body.side-mini .sd-status-text, body.side-mini .nl, body.side-mini .nc, body.side-mini .nav2 .sec, body.side-mini .sd-me-text, body.side-mini .side-foot { display: none; }
  body.side-mini .brand-mark { display: grid; }
  body.side-mini .sd-brand { flex-direction: column; padding: 0; }
  body.side-mini .sd-collapse svg { transform: rotate(-90deg); }
  body.side-mini .sd-status { justify-content: center; padding: 10px; margin: 10px 0; }
  body.side-mini .nav2 a { justify-content: center; padding: 6px; }
  body.side-mini .nav2 .sec + a { margin-top: 10px; }
  body.side-mini .ni-dot { display: block; }
  body.side-mini .sd-me { flex-direction: column; padding: 8px 4px; }
}
@media (max-width: 920px) { .sd-collapse { display: none; } }
.admin .nav2 a .ni, .admin .nav2 a .nc { flex: none; } .admin .nav2 a .nl { flex: 1 1 auto; }
.admin .nav.nav2 a span.ni, .admin .nav.nav2 a span.nc { flex: 0 0 auto; } .admin .nav.nav2 a span.nl { flex: 1 1 auto; }

/* Admin dashboard v2 */
.today-strip { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); gap: 8px; align-items: stretch; margin-top: 12px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ts-label { display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: .78rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.ts-label svg { width: 15px; height: 15px; }
.today-strip > div { display: grid; gap: 1px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.22); min-width: 0; }
.today-strip small { font-size: .62rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.today-strip b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-strip em { font-style: normal; font-size: .68rem; color: var(--dim); }
.lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 3px 0 6px; vertical-align: 0; }
.lg-dot.gold { background: var(--gold); } .lg-dot.blue { background: var(--info); }
.vb.dual { gap: 1px; }
.vb.dual span { width: 50%; }
.vb.dual span.out { background: linear-gradient(180deg, #a9c4ff, #4c74d8); }
.owed-total { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.owed-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); margin: 12px 0 6px; }
.owed-bar span { display: block; height: 100%; }
.owed-card .impact span { display: inline-flex; align-items: center; gap: 6px; }
.owed-card .impact .dot { margin: 0; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.lb-row:first-of-type { border-top: 0; }
.lb-row:hover b { color: var(--gold); }
.lb-row .grow { flex: 1; min-width: 0; display: grid; }
.lb-row .grow b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .grow small { font-size: .7rem; color: var(--dim); }
.lb-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: .72rem; font-weight: 800; background: rgba(255,255,255,.06); color: var(--muted); }
.lb-n.first { background: var(--brand-grad); color: #1d1405; }
@media (max-width: 1200px) { .today-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ts-label { grid-column: 1 / -1; padding: 4px 6px; } }
@media (max-width: 640px) { .today-strip { grid-template-columns: 1fr 1fr; } .today-strip > div:last-child { grid-column: 1 / -1; } }

/* Admin sidebar: logo + status stay at the top, admin card stays at the bottom, only the menu scrolls */
.side2 { overflow: hidden; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.side2 .sd-brand, .side2 .console-tag, .side2 .sd-status, .side2 .sd-me, .side2 .side-foot { flex: none; }
.side2 .nav.nav2 { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; margin: 0 -6px; padding: 0 6px 10px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); }
.side2 .nav.nav2::-webkit-scrollbar { width: 6px; }
.side2 .nav.nav2::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.side2 .sd-me { margin-top: 8px; }

/* ==========================================================================
   Admin dashboard — bento
   ========================================================================== */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.b-hero { grid-column: span 8; position: relative; overflow: hidden; display: grid; gap: 14px; padding: 22px 24px 20px; border-radius: 24px; border: 1px solid rgba(240,207,140,.3);
  background: radial-gradient(90% 120% at 100% 0%, rgba(224,182,106,.22), transparent 55%), radial-gradient(70% 120% at 0% 100%, rgba(133,173,255,.08), transparent 60%), linear-gradient(140deg, #1c1a15, #0e0f12 65%);
  box-shadow: 0 30px 70px -40px rgba(224,182,106,.5); }
.bh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bh-date { font-size: .72rem; color: rgba(255,255,255,.55); letter-spacing: .04em; }
.bh-top h1 { margin: 2px 0 0; font-size: 1.5rem; }
.bh-figure { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bh-figure > span:first-child { flex-basis: 100%; font-size: .78rem; color: rgba(255,255,255,.6); }
.bh-figure b { font-size: clamp(2.2rem, 4.2vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; background: linear-gradient(180deg, #fff5dc, #e0b66a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bh-trend { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.bh-trend svg { width: 13px; height: 13px; }
.bh-trend.up { color: #7be0b0; background: rgba(70,200,140,.12); }
.bh-trend.down { color: #ff9a8a; background: rgba(240,100,100,.12); }
.bh-chart svg { display: block; width: 100%; height: 140px; overflow: visible; }
.bh-chart .gl { stroke: rgba(255,255,255,.06); stroke-dasharray: 3 5; }
.bh-chart .ln-in { fill: none; stroke: #f0cf8c; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bh-chart .ln-out { fill: none; stroke: #85adff; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; stroke-linejoin: round; }
.bh-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: .68rem; color: rgba(255,255,255,.45); }
.bh-axis .k { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: 2px; margin: 0 4px 0 8px; }
.bh-axis .k.in { background: #f0cf8c; } .bh-axis .k.out { background: #85adff; }
.bh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bh-stats > div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.bh-stats small { font-size: .62rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.bh-stats b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.b-actions { grid-column: span 4; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.ba-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; }
.ba-head b { font-size: 1rem; }
.ba-pill { font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.ba-pill.hot { color: #1d1405; background: var(--warn); }
.ba-pill.ok { color: var(--pos); background: rgba(70,200,140,.12); }
.ba-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.ba-tile:hover { transform: translateY(-1px); border-color: var(--line-3); }
.ba-tile.hot { border-color: rgba(245,183,85,.45); background: linear-gradient(120deg, rgba(245,183,85,.12), transparent 70%); }
.ba-tile.warn { border-color: rgba(245,183,85,.3); }
.ba-tile .grow { flex: 1; min-width: 0; display: grid; }
.ba-tile small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ba-tile b { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.ba-tile em { font-style: normal; font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-tile.small { padding: 9px 12px; }
.ba-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--muted); }
.ba-ic svg { width: 18px; height: 18px; }
.ba-tile.hot .ba-ic { background: var(--brand-grad); color: #1d1405; }
.ba-tile.small .ba-ic { width: 32px; height: 32px; }
.ba-go { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: .74rem; font-weight: 700; color: var(--gold); }
.ba-go svg { width: 13px; height: 13px; }
.ba-keep { margin-top: auto; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px dashed var(--gold-line); display: grid; gap: 2px; }
.ba-keep small { font-size: .66rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ba-keep b { font-size: 1.3rem; }
.ba-keep .owed-bar { margin: 6px 0; }
.ba-keep em { font-style: normal; font-size: .68rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.ba-keep em i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: -6px; }

.b-kpi { grid-column: span 3; position: relative; display: grid; gap: 3px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; overflow: hidden; transition: border-color .15s, transform .15s; }
.b-kpi:hover { border-color: var(--line-3); transform: translateY(-2px); }
.bk-top { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.bk-top .kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
.bk-top .kpi-ic svg { width: 15px; height: 15px; }
.b-kpi > b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.b-kpi > b small { font-size: .9rem; color: var(--dim); font-weight: 600; }
.b-kpi > small { font-size: .72rem; color: var(--dim); }
.spark { width: 100%; height: 34px; margin-top: 8px; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.bk-meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; margin: 12px 0 4px; }
.bk-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f9e74, #7be0b0); }

.b-card { padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.b-third { grid-column: span 4; }
.b-wide { grid-column: span 8; }
.bc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.bc-head b { font-size: .95rem; }
.donut-wrap { position: relative; width: 150px; height: 150px; margin: 6px auto 14px; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 11; }
.donut .d-bg { stroke: rgba(255,255,255,.06); }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 1.15rem; font-weight: 800; }
.donut-c small { font-size: .66rem; color: var(--dim); }
.d-legend { display: grid; gap: 2px; }
.d-legend > * { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.d-legend a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.d-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.d-legend span { flex: 1; }
.d-legend b { color: var(--text); }
.lb { display: grid; gap: 4px; }
.lb2 { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 10px; color: var(--text); text-decoration: none; }
.lb2:hover { background: rgba(255,255,255,.03); }
.lb2 .grow { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lb2 b { font-size: .84rem; }
.lb2 small { font-size: .7rem; color: var(--dim); }
.lb-bar { display: block; height: 5px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.lb-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); }
.tl2 { display: grid; }
.tl2-item { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.tl2-item:first-child { border-top: 0; }
.tl2-item .grow { flex: 1; min-width: 0; display: grid; }
.tl2-item b { font-size: .84rem; }
.tl2-item small { font-size: .72rem; color: var(--dim); }
@media (max-width: 1250px) {
  .b-hero, .b-actions { grid-column: span 12; }
  .b-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ba-head, .ba-keep { grid-column: 1 / -1; }
  .b-kpi { grid-column: span 6; }
  .b-third { grid-column: span 6; }
  .b-wide { grid-column: span 12; }
}
@media (max-width: 760px) {
  .bento { gap: 10px; }
  .b-hero { padding: 16px; border-radius: 20px; }
  .bh-stats { grid-template-columns: 1fr 1fr; }
  .bh-chart svg { height: 110px; }
  .b-actions { grid-template-columns: 1fr; }
  .b-kpi { grid-column: span 6; padding: 12px; }
  .b-kpi > b { font-size: 1.2rem; }
  .b-third { grid-column: span 12; }
}

/* ==========================================================================
   Admin dashboard — simple
   ========================================================================== */
.sd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.sd-head h1 { margin: 4px 0 4px; font-size: 1.7rem; }
.sd-head p { margin: 0; font-size: .9rem; }
.sd-head .btn svg { width: 15px; height: 15px; }
.sd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sd-stat { display: grid; gap: 4px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s; }
a.sd-stat:hover { border-color: var(--line-3); }
.sd-stat > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.sd-stat > b { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-stat > b small { font-size: 1rem; color: var(--dim); font-weight: 600; }
.sd-stat > small { font-size: .76rem; color: var(--dim); }
.sd-stat.gold { border-color: var(--gold-line); background: linear-gradient(140deg, rgba(224,182,106,.14), var(--surface) 65%); }
.sd-stat.gold > b { color: #f0cf8c; }
.sd-queues { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.sd-queue { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.sd-q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.sd-q-head h2 { margin: 0; font-size: 1.05rem; }
.sd-q-head small { font-size: .78rem; color: var(--dim); }
.sd-count { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; background: rgba(255,255,255,.05); color: var(--muted); }
.sd-count.hot { background: var(--brand-grad); color: #1d1405; }
.sd-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; color: var(--text); text-decoration: none; }
.sd-row + .sd-row { border-top: 1px solid var(--line); border-radius: 0; }
.sd-row:hover { background: rgba(255,255,255,.03); border-radius: 12px; }
.sd-row .grow { flex: 1; min-width: 0; display: grid; }
.sd-row b { font-size: .95rem; }
.sd-row small { font-size: .74rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-queue .btn.block { margin-top: auto; }
.sd-queue .sd-row:last-of-type { margin-bottom: 10px; }
.sd-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 8px; color: var(--pos); font-size: .86rem; font-weight: 600; }
.sd-empty svg { width: 16px; height: 16px; }
.sd-activity { margin-top: 14px; padding: 18px 20px; }
.sd-act { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.sd-act:first-of-type { border-top: 0; }
.sd-act .grow { flex: 1; min-width: 0; display: grid; }
.sd-act b { font-size: .86rem; }
.sd-act small { font-size: .72rem; color: var(--dim); }
@media (max-width: 1100px) { .sd-stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .sd-queues { grid-template-columns: 1fr; } .sd-stat { padding: 14px; } .sd-stat > b { font-size: 1.3rem; } .sd-head h1 { font-size: 1.4rem; } }

/* ==========================================================================
   Admin — admin team
   ========================================================================== */
.akpi > b small { font-size: .95rem; color: var(--dim); font-weight: 600; }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.at-card { display: grid; gap: 12px; padding: 16px 18px; }
.at-card.off { opacity: .6; }
.at-top { display: flex; align-items: center; gap: 12px; }
.at-top .grow { flex: 1; min-width: 0; display: grid; }
.at-top b { font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.at-top small { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-av { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .9rem; background: rgba(255,255,255,.07); color: var(--text); }
.at-av.gold { background: var(--brand-grad); color: #1d1405; }
.at-av.blue { background: linear-gradient(135deg, #a9c4ff, #4c74d8); color: #0b1630; }
.at-av.green { background: linear-gradient(135deg, #7be0b0, #2f9e74); color: #062417; }
.at-av.violet { background: linear-gradient(135deg, #d3c2ff, #8a6fe0); color: #1b1030; }
.at-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.at-tags .dq-tag svg { width: 11px; height: 11px; }
.role-pill { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); white-space: nowrap; }
.role-pill.gold { background: rgba(224,182,106,.14); color: var(--gold); }
.role-pill.blue { background: rgba(133,173,255,.14); color: var(--info); }
.role-pill.green { background: rgba(70,200,140,.14); color: var(--pos); }
.role-pill.violet { background: rgba(179,156,255,.14); color: var(--violet); }
.at-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--dim); }
.at-foot b { color: var(--text); font-weight: 600; }
.at-foot a { margin-left: auto; text-decoration: none; }
.role-guide { margin-top: 18px; padding: 16px 18px; }
.rg-scroll { overflow-x: auto; margin-top: 12px; }
.rg-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 560px; }
.rg-table th { padding: 8px 10px; text-align: center; vertical-align: bottom; border-bottom: 1px solid var(--line-2); }
.rg-table th small { display: block; margin-top: 4px; font-size: .66rem; color: var(--dim); font-weight: 500; }
.rg-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.rg-table tr:hover td { background: rgba(255,255,255,.02); }
.rg-table td.c { text-align: center; }
.rg-table .yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(70,200,140,.14); color: var(--pos); }
.rg-table .yes svg { width: 13px; height: 13px; }
.rg-table .no { color: var(--line-3); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-opt { position: relative; display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); cursor: pointer; margin: 0; font-weight: 400; color: var(--text); }
.rp-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rp-opt.on { border-color: var(--gold-line); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(224,182,106,.08); }
.rp-opt .role-pill { justify-self: start; }
.rp-opt small { font-size: .72rem; color: var(--dim); }
.pw-meter { height: 5px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.pw-meter span { display: block; height: 100%; border-radius: inherit; transition: width .2s, background .2s; background: var(--neg); }
.pw-meter span.s2 { background: var(--warn); } .pw-meter span.s3 { background: #7be0b0; } .pw-meter span.s4 { background: var(--pos); }
@media (max-width: 560px) { .role-pick { grid-template-columns: 1fr; } .at-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Admin sign-in (password, 2FA setup, 2FA code)
   ========================================================================== */
.aa-body { min-height: 100vh; min-height: 100dvh; margin: 0; background: #07080a; color: var(--text); display: grid; place-items: center; padding: 28px 16px; position: relative; overflow-x: hidden; }
.aa-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 40% at 50% 0%, rgba(224,182,106,.18), transparent 70%),
    radial-gradient(40% 35% at 90% 100%, rgba(133,173,255,.07), transparent 70%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 100%); mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 100%); }
.aa-wrap { position: relative; z-index: 1; width: min(440px, 100%); display: grid; gap: 16px; }
.aa-wrap.wide { width: min(700px, 100%); }
.aa-brand { display: grid; justify-items: center; gap: 12px; }
.aa-logo { width: 210px; height: auto; }
.aa-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); padding: 5px 12px; border-radius: 999px; background: rgba(224,182,106,.08); border: 1px solid var(--gold-line); }
.aa-badge svg { width: 12px; height: 12px; }
.aa-card { padding: 26px 26px 22px; border-radius: 24px; background: linear-gradient(180deg, rgba(26,27,31,.92), rgba(16,17,20,.95)); border: 1px solid rgba(240,207,140,.22); box-shadow: 0 40px 90px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.02) inset; backdrop-filter: blur(10px); }
.aa-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.aa-step { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--dim); white-space: nowrap; }
.aa-step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; border: 1.5px solid var(--line-3); }
.aa-step span svg { width: 12px; height: 12px; }
.aa-step.on { color: var(--text); }
.aa-step.on span { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 4px rgba(224,182,106,.12); }
.aa-step.done { color: var(--muted); }
.aa-step.done span { background: var(--brand-grad); border-color: transparent; color: #1d1405; }
.aa-steps > i { flex: 1; height: 2px; border-radius: 2px; background: var(--line-2); }
.aa-steps > i.done { background: var(--gold); }
.aa-head { margin-bottom: 18px; }
.aa-head h1 { margin: 0 0 6px; font-size: 1.55rem; letter-spacing: -.02em; }
.aa-head p { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.aa-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; background: var(--brand-grad); color: #1d1405; box-shadow: 0 10px 24px -10px rgba(224,182,106,.7); }
.aa-ic svg { width: 22px; height: 22px; }
.aa-card .btn.lg svg { width: 16px; height: 16px; }
.aa-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.aa-note > span { display: grid; color: var(--warn); margin-top: 1px; }
.aa-note svg { width: 15px; height: 15px; }
.aa-note p { margin: 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }
.aa-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: .72rem; color: var(--dim); }
.aa-foot span { display: inline-flex; align-items: center; gap: 6px; }
.aa-foot svg { width: 13px; height: 13px; color: var(--gold); }
.aa-copy { text-align: center; font-size: .68rem; color: #4d4a45; }
.aa-setup { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.aa-qr-col { display: grid; gap: 10px; }
.aa-qr-col .qr-box { margin: 0; padding: 12px; border-radius: 16px; background: #fff; }
.aa-qr-col .qr-box svg { width: 100%; height: auto; display: block; }
.aa-howto { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.aa-howto li { counter-increment: s; position: relative; padding-left: 38px; display: grid; gap: 2px; }
.aa-howto li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 800; color: #1d1405; background: var(--brand-grad); }
.aa-howto b { font-size: .88rem; }
.aa-howto span { font-size: .76rem; color: var(--dim); }
@media (max-width: 640px) {
  .aa-body { padding: 18px 12px; place-items: start center; }
  .aa-card { padding: 20px 16px 18px; border-radius: 20px; }
  .aa-logo { width: 170px; }
  .aa-setup { grid-template-columns: 1fr; }
  .aa-qr-col { max-width: 220px; margin: 0 auto; }
}
