:root {
  --bg:      #06060e;
  --surface: rgba(255,255,255,0.045);
  --surface-2: rgba(255,255,255,0.072);
  --border:  rgba(255,255,255,0.08);
  --accent:  rgb(238,130,238);
  --ah:      238,130,238;
  --text:    #e8e8f0;
  --muted:   #7a7a9a;
  --good:    #4ade80;
  --warn:    #fbbf24;
  --bad:     #f87171;
  --radius:  16px;
  --blur:    28px;
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ah),.5) transparent;
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--ah),.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--ah),.6); }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
input, button, select, textarea { font-family: inherit; }
button { cursor: pointer; }

/* ---------- animated backdrop ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(140px); }
.b1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(var(--ah),.45) 0%, transparent 70%);
  top: -220px; left: -180px; opacity: .5;
  animation: blobDrift 22s ease-in-out infinite;
}
.b2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(160,40,140,.5) 0%, transparent 70%);
  bottom: -140px; right: -100px; opacity: .35;
  animation: blobDrift 28s ease-in-out infinite reverse;
}
.b3 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(var(--ah),.3) 0%, transparent 70%);
  top: 55%; left: 50%; transform: translate(-50%,-50%); opacity: .28;
  animation: blobDrift 18s ease-in-out infinite 5s;
}
@keyframes blobDrift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(28px,-48px) scale(1.05); }
  66%     { transform: translate(-22px,32px) scale(.97); }
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 64px 64px;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
}

/* ===================== shared buttons ===================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  background: var(--accent);
  border: none; border-radius: 12px;
  font-size: .92rem; font-weight: 700; color: #fff;
  box-shadow: 0 0 28px rgba(var(--ah),.3);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .3s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(var(--ah),.5); opacity: .94; }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-full { width: 100%; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  font-size: .88rem; font-weight: 600; color: var(--text);
  transition: background .35s var(--ease), border-color .35s ease, transform .35s var(--ease);
}
.btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); transform: translateY(-2px); }
.btn-ghost svg { width: 16px; height: 16px; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 11px;
  font-size: .88rem; font-weight: 600; color: #fca5a5;
  transition: background .3s ease, border-color .3s ease, transform .3s var(--ease);
}
.btn-danger:hover { background: rgba(248,113,113,.18); border-color: rgba(248,113,113,.5); color: #fff; transform: translateY(-2px); }
.btn-danger svg { width: 16px; height: 16px; }

/* ===================== AUTH SCREENS ===================== */
.auth-screen {
  position: fixed; inset: 0; z-index: 10;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-screen.active { display: flex; animation: authFade .6s var(--ease); }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

.auth-card {
  position: relative;
  width: 100%; max-width: 420px;
  padding: 42px 38px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(var(--ah),.04);
  animation: cardIn .7s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-logo {
  height: 56px; width: auto; margin: 0 auto 4px;
  filter: drop-shadow(0 0 22px rgba(var(--ah),.55));
  animation: glowPulse 3.5s ease-in-out infinite alternate;
}
@keyframes glowPulse {
  from { filter: drop-shadow(0 0 14px rgba(var(--ah),.35)); }
  to   { filter: drop-shadow(0 0 40px rgba(var(--ah),.8)); }
}

.auth-mfa-icon {
  width: 60px; height: 60px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: rgba(var(--ah),.1);
  border: 1px solid rgba(var(--ah),.22);
  color: var(--accent);
  box-shadow: 0 0 28px rgba(var(--ah),.25);
}
.auth-mfa-icon svg { width: 28px; height: 28px; }

.auth-head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.auth-head h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.auth-head p { font-size: .9rem; color: var(--muted); line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.field-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field-input:focus-within {
  border-color: rgba(var(--ah),.55);
  box-shadow: 0 0 0 3px rgba(var(--ah),.12);
  background: rgba(0,0,0,.35);
}
.field-input svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.field-input input {
  flex: 1; width: 100%;
  padding: 13px 0;
  background: none; border: none; outline: none;
  color: var(--text); font-size: .95rem;
}
.field-input input::placeholder { color: rgba(122,122,154,.7); }
.reveal-btn { background: none; border: none; color: var(--muted); display: flex; padding: 4px; transition: color .2s ease; }
.reveal-btn:hover { color: var(--text); }
.reveal-btn svg { width: 18px; height: 18px; }

.auth-error {
  display: none;
  padding: 10px 14px;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.28);
  border-radius: 10px;
  color: #fca5a5; font-size: .84rem; font-weight: 500;
}
.auth-error.show { display: block; animation: shake .4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

.auth-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .78rem; color: var(--muted); line-height: 1.5;
  padding-top: 4px;
}
.auth-hint code {
  font-family: ui-monospace, monospace;
  background: rgba(var(--ah),.12); color: var(--accent);
  padding: 1px 6px; border-radius: 5px; font-size: .76rem;
}
.hint-tag {
  font-size: .64rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent); background: rgba(var(--ah),.1);
  border: 1px solid rgba(var(--ah),.2);
  padding: 2px 7px; border-radius: 6px; flex-shrink: 0;
}

.auth-back {
  position: absolute; top: 22px; left: 22px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px; color: var(--muted);
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.auth-back:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(-2px); }
.auth-back svg { width: 18px; height: 18px; }

/* OTP */
.otp-row { display: flex; gap: 10px; justify-content: center; }
.otp-cell {
  width: 48px; height: 58px;
  text-align: center;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  color: #fff; font-size: 1.5rem; font-weight: 700;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s var(--ease);
}
.otp-cell:focus { border-color: rgba(var(--ah),.6); box-shadow: 0 0 0 3px rgba(var(--ah),.14); transform: translateY(-2px); }
.otp-cell.filled { border-color: rgba(var(--ah),.4); background: rgba(var(--ah),.06); }

/* auth alt line (login <-> register) */
.auth-alt {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .82rem; color: var(--muted); padding-top: 2px;
}
.auth-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--accent);
  transition: opacity .2s ease;
}
.auth-link:hover { opacity: .8; text-decoration: underline; }

/* MFA enrollment */
.enroll-qr {
  display: flex; align-items: center; justify-content: center;
  width: 204px; height: 204px; margin: 2px auto 0;
  padding: 8px; background: #fff; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.enroll-qr img, .enroll-qr canvas { display: block; border-radius: 6px; }
.enroll-qr-fallback {
  font-size: .8rem; color: #555; text-align: center; padding: 12px; line-height: 1.4;
}
.enroll-secret {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.enroll-secret-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
}
.enroll-secret-code {
  font-family: ui-monospace, monospace; font-size: .95rem; font-weight: 600;
  letter-spacing: 2px; color: var(--accent);
  background: rgba(var(--ah),.1); border: 1px solid rgba(var(--ah),.2);
  padding: 8px 14px; border-radius: 9px; user-select: all; word-break: break-all; text-align: center;
}

/* ===================== APP SHELL ===================== */
.app-shell { display: none; position: relative; z-index: 1; min-height: 100vh; }
.app-shell.active { display: flex; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 256px; z-index: 30;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  background: rgba(10,10,20,.72);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}

.side-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px 28px; }
.side-logo img { height: 68px; width: auto; filter: drop-shadow(0 0 14px rgba(var(--ah),.5)); }
.side-logo-tag {
  font-size: .62rem; font-weight: 800; letter-spacing: 2px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 11px;
  font-size: .92rem; font-weight: 600; color: rgba(255,255,255,.55);
  border: 1px solid transparent;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
  position: relative;
}
.side-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-link.active {
  color: #fff;
  background: rgba(var(--ah),.12);
  border-color: rgba(var(--ah),.22);
  box-shadow: 0 0 22px rgba(var(--ah),.12);
}
.side-link.active::before {
  content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--ah),.7);
}
.side-link-tag {
  margin-left: auto; font-size: .58rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--accent);
  background: rgba(var(--ah),.12); border: 1px solid rgba(var(--ah),.2);
  padding: 2px 6px; border-radius: 5px;
}

.side-user {
  display: flex; align-items: center; gap: 11px;
  padding: 12px; margin-top: 8px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 13px;
}
.side-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), rgb(150,40,150));
  box-shadow: 0 0 18px rgba(var(--ah),.35);
}
.side-user-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.side-user-meta strong { font-size: .9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-pill {
  display: inline-block;
  font-size: .66rem; font-weight: 700; letter-spacing: .4px; width: fit-content;
  text-transform: uppercase; color: var(--accent);
  background: rgba(var(--ah),.1); border: 1px solid rgba(var(--ah),.2);
  padding: 1px 7px; border-radius: 5px;
}
.role-pill + .role-pill { margin-left: 5px; }
.role-pill.role-none {
  color: var(--muted);
  background: rgba(255,255,255,.05); border-color: var(--border);
}
.side-logout {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 9px; color: var(--muted);
  transition: background .25s, color .25s, border-color .25s;
}
.side-logout:hover { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); color: #fca5a5; }
.side-logout svg { width: 17px; height: 17px; }

/* content */
.content { flex: 1; margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 36px;
  background: rgba(6,6,14,.55);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-titles { flex: 1; }
.topbar-titles h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.topbar-titles p { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger { display: none; background: none; border: none; color: var(--text); padding: 4px; }
.hamburger svg { width: 24px; height: 24px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.2);
  border-radius: 99px; font-size: .76rem; font-weight: 600; color: var(--good); white-space: nowrap;
}
.status-dot {
  --dot-rgb: 74,222,128;
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  animation: ping 2.5s ease infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(var(--dot-rgb,74,222,128), .6); }
  70%  { box-shadow: 0 0 0 7px rgba(var(--dot-rgb,74,222,128), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--dot-rgb,74,222,128), 0); }
}
.status-badge.offline {
  background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.25); color: var(--bad);
}
.status-badge.offline .status-dot { --dot-rgb: 248,113,113; background: var(--bad); animation: none; }

.pages { padding: 32px 36px 60px; }
.page { display: none; animation: pageIn .55s var(--ease); }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- generic section heads ---------- */
.block { margin-bottom: 28px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.block-head h3 { font-size: 1.05rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 9px; }
.block-head h3 svg { width: 18px; height: 18px; color: var(--accent); }
.block-head p { font-size: .82rem; color: var(--muted); }

/* ---------- stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card {
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .4s var(--ease), border-color .4s ease, background .4s ease, box-shadow .4s var(--ease);
}
.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--ah),.22);
  background: var(--surface-2);
  box-shadow: 0 22px 48px rgba(0,0,0,.4), 0 0 0 1px rgba(var(--ah),.05);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--ah),.1); border: 1px solid rgba(var(--ah),.18); color: var(--accent);
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-trend { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 7px; }
.stat-trend.up { color: var(--good); background: rgba(74,222,128,.1); }
.stat-trend.down { color: var(--bad); background: rgba(248,113,113,.1); }
.stat-trend.flat { color: var(--muted); background: rgba(255,255,255,.05); }
.stat-value { font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat-card.selected-game {
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(var(--ah),.18), 0 18px 40px rgba(0,0,0,.35);
}

/* ---------- info rows (profile / home meta) ---------- */
.info-card { padding: 8px 0; }
.info-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 24px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.info-row:last-child { border-bottom: none; }
.info-row .ir-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--accent);
}
.info-row .ir-icon svg { width: 17px; height: 17px; }
.info-row .ir-label { font-size: .86rem; color: var(--muted); flex: 1; }
.info-row .ir-value { font-size: .92rem; font-weight: 600; color: #fff; text-align: right; }
.info-row .ir-value.mono { font-family: ui-monospace, monospace; letter-spacing: .3px; }

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }

/* ---------- forms / selects ---------- */
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.form-row label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px; color: var(--text); font-size: .92rem; outline: none;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: rgba(var(--ah),.55); box-shadow: 0 0 0 3px rgba(var(--ah),.12); background: rgba(0,0,0,.35);
}
.input::placeholder, textarea.input::placeholder { color: rgba(122,122,154,.7); }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }

/* Browser autofill paints a solid blue/yellow background that ignores our border-radius,
   so it bleeds past the rounded corners. The ~infinite background transition keeps that
   fill from ever becoming visible, so each field keeps its own themed, rounded background. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 600000s 0s, color 600000s 0s;
  -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,0) inset !important;
  box-shadow: 0 0 0 1000px rgba(0,0,0,0) inset !important;
}
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7a9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 17px;
  padding-right: 40px; cursor: pointer;
}
.select option { background: #14141f; color: var(--text); }

/* commerce timeframe controls */
.range-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.range-btn {
  padding: 9px 18px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--muted); font-size: .84rem; font-weight: 700; letter-spacing: .3px;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s var(--ease);
}
.range-btn:hover { color: var(--text); border-color: rgba(var(--ah),.35); transform: translateY(-1px); }
.range-btn.active { color: #fff; background: rgba(var(--ah),.16); border-color: rgba(var(--ah),.5); }
.range-custom { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.range-custom[hidden] { display: none; }
.range-custom input[type="date"] { width: auto; background-image: none; padding-right: 12px; color-scheme: dark; }
.range-sep { color: var(--muted); font-size: .85rem; }
.range-apply { padding: 10px 20px; font-size: .85rem; }

/* lookup page: search row + master-detail layout */
.user-search-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.users-layout { display: flex; gap: 20px; align-items: flex-start; }
.users-list-panel { width: 340px; flex-shrink: 0; max-height: calc(100vh - 230px); }
.users-list-panel.panel { overflow-y: auto; overflow-x: hidden; } /* beats .panel { overflow:hidden } */
.users-detail { flex: 1; min-width: 0; }
.list-loader { padding: 12px; text-align: center; color: var(--muted); font-size: .82rem; }
@media (max-width: 900px) {
  .users-layout { flex-direction: column; }
  .users-list-panel { width: 100%; max-height: 60vh; }
}

/* connection & hardware blocks (multiple IPs / old HWIDs) */
.hw-block { padding: 11px 24px; display: flex; flex-direction: column; gap: 8px; }
.hw-block + .hw-block { border-top: 1px solid var(--border); } /* divider only between blocks, not under the header */
.hw-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hw-label svg { width: 14px; height: 14px; }
.scroll-box { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.sb-item { background: rgba(0,0,0,.22); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: .82rem; color: var(--text); word-break: break-all; }
.sb-empty { color: var(--muted); font-size: .85rem; }

/* clickable license keys + key detail */
.key-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  text-align: left; background: rgba(0,0,0,.22); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: .84rem; cursor: pointer; word-break: break-all;
  transition: border-color .2s ease, background .2s ease;
}
.key-chip:hover { border-color: rgba(var(--ah),.4); background: rgba(var(--ah),.06); }
.key-chip svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.key-info { display: flex; flex-direction: column; }
.ki-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.ki-row:last-child { border-bottom: none; }
.ki-label { color: var(--muted); }
.ki-value { color: var(--text); font-weight: 600; text-align: right; }
.key-avatar svg { width: 18px; height: 18px; color: #fff; }
.profile-avatar.key-avatar svg { width: 24px; height: 24px; }

/* ===================== custom animated dropdown ===================== */
.cselect { position: relative; width: 100%; }
.cselect-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px; color: var(--text); font-size: .92rem; font-weight: 500; cursor: pointer; text-align: left;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.cselect-trigger:hover { border-color: rgba(var(--ah),.35); }
.cselect.open .cselect-trigger {
  border-color: rgba(var(--ah),.55); box-shadow: 0 0 0 3px rgba(var(--ah),.12); background: rgba(0,0,0,.35);
}
.cselect-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cselect-caret { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; transition: transform .3s var(--ease); }
.cselect.open .cselect-caret { transform: rotate(180deg); color: var(--accent); }
.cselect-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #14141f; border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top center; pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  max-height: 280px; overflow-y: auto;
}
.cselect.open .cselect-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.cselect-option {
  padding: 9px 12px; border-radius: 8px; font-size: .88rem; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: background .15s ease, color .15s ease;
}
.cselect-option:hover { background: rgba(var(--ah),.1); }
.cselect-option.selected { color: var(--accent); background: rgba(var(--ah),.08); }
.cselect-option.selected::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
/* staggered option entrance */
.cselect.open .cselect-option { animation: cselectOptIn .26s var(--ease) backwards; }
.cselect.open .cselect-option:nth-child(1) { animation-delay: .02s; }
.cselect.open .cselect-option:nth-child(2) { animation-delay: .05s; }
.cselect.open .cselect-option:nth-child(3) { animation-delay: .08s; }
.cselect.open .cselect-option:nth-child(4) { animation-delay: .11s; }
.cselect.open .cselect-option:nth-child(5) { animation-delay: .14s; }
.cselect.open .cselect-option:nth-child(n+6) { animation-delay: .16s; }
@keyframes cselectOptIn { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }
.cselect-host { width: 170px; flex-shrink: 0; }

/* groupbox (developer / generic) */
.groupbox { padding: 24px; }
.groupbox-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.groupbox-head svg { width: 19px; height: 19px; color: var(--accent); }
.groupbox-head h4 { font-size: 1rem; font-weight: 700; color: #fff; }
.groupbox-head .gb-sub { font-size: .78rem; color: var(--muted); margin-left: auto; }
.field-hint { font-size: .76rem; color: var(--muted); margin-top: -2px; }

/* ---------- tables / user lists ---------- */
.panel { overflow: hidden; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; margin-bottom: 16px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  transition: border-color .25s, box-shadow .25s;
}
.search-bar:focus-within { border-color: rgba(var(--ah),.5); box-shadow: 0 0 0 3px rgba(var(--ah),.1); }
.search-bar svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-bar input { flex: 1; padding: 12px 0; background: none; border: none; outline: none; color: var(--text); font-size: .92rem; }
.search-bar input::placeholder { color: rgba(122,122,154,.7); }

.user-list { display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, transform .2s var(--ease);
}
.user-row:hover { background: rgba(255,255,255,.05); border-color: var(--border); transform: translateX(3px); }
.user-row.selected { background: rgba(var(--ah),.1); border-color: rgba(var(--ah),.25); }
.avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: #fff; position: relative;
}
.avatar .av-status {
  position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid #0c0c16;
}
.av-status.active { background: var(--good); }
.av-status.offline { background: #555; }
.user-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-row-main .urm-name { font-size: .92rem; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; }
.user-row-main .urm-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chip {
  font-size: .68rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.chip.product { color: #c4b5fd; background: rgba(167,139,250,.12); border: 1px solid rgba(167,139,250,.22); }
.chip.active { color: var(--good); background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.2); }
.chip.offline { color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.chip.banned { color: var(--bad); background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.28); }
.user-row .chev { color: var(--muted); transition: transform .2s var(--ease); }
.user-row .chev svg { width: 16px; height: 16px; }
.user-row:hover .chev { transform: translateX(3px); color: var(--accent); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 56px 24px; text-align: center; color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; opacity: .4; }
.empty-state p { font-size: .9rem; max-width: 320px; line-height: 1.5; }

/* ---------- profile detail (mod / reseller) ---------- */
.profile { display: flex; flex-direction: column; gap: 18px; animation: pageIn .4s var(--ease); }
.profile-head {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; flex-wrap: wrap;
}
.profile-avatar {
  width: 68px; height: 68px; flex-shrink: 0; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.5rem; color: #fff; position: relative;
  box-shadow: 0 0 24px rgba(var(--ah),.25);
}
.profile-head-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.profile-head-main h3 { font-size: 1.3rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.discord-inline { display: inline-flex; align-items: center; gap: 7px; color: #a5b0ff; font-weight: 600; }
.discord-inline svg { width: 15px; height: 15px; }
.profile-back {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px;
  font-size: .85rem; font-weight: 600; color: var(--muted);
  background: none; border: none; transition: color .2s, gap .2s var(--ease);
}
.profile-back:hover { color: #fff; gap: 11px; }
.profile-back svg { width: 16px; height: 16px; }

.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }

.note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 11px; font-size: .82rem; line-height: 1.55;
  background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.2); color: #fcd34d;
}
.note svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

/* ---------- profit / payment split ---------- */
.split-card { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.split-legend { display: flex; flex-direction: column; gap: 14px; }
.split-bar { height: 14px; border-radius: 99px; overflow: hidden; display: flex; background: rgba(255,255,255,.05); }
.split-seg { height: 100%; transition: width .8s var(--ease); }
.split-seg.crypto { background: linear-gradient(90deg, var(--accent), rgb(180,70,200)); }
.split-seg.reseller { background: linear-gradient(90deg, rgb(96,165,250), rgb(56,120,220)); }
.split-item { display: flex; align-items: center; gap: 12px; }
.split-key { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.split-key.crypto { background: var(--accent); }
.split-key.reseller { background: rgb(96,165,250); }
.split-item .si-label { font-size: .88rem; color: var(--text); font-weight: 600; flex: 1; }
.split-item .si-val { font-size: .95rem; font-weight: 700; color: #fff; }
.split-item .si-pct { font-size: .78rem; color: var(--muted); width: 46px; text-align: right; }

/* ===================== MODAL ===================== */
.modal-host { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-host.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,4,10,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: authFade .3s ease; }
.modal {
  position: relative; width: 100%; max-width: 440px;
  padding: 28px; box-shadow: 0 40px 90px rgba(0,0,0,.6);
  animation: cardIn .45s var(--ease);
}
.modal-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.modal-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.modal-icon svg { width: 22px; height: 22px; }
.modal-icon.accent { background: rgba(var(--ah),.1); border: 1px solid rgba(var(--ah),.2); color: var(--accent); }
.modal-icon.danger { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25); color: #fca5a5; }
.modal-icon.warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.25); color: #fcd34d; }
.modal-head h3 { font-size: 1.15rem; font-weight: 700; color: #fff; }
.modal-head p { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.modal-body { margin-bottom: 22px; }
.modal-body p.modal-text { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.modal-body .target-pill {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  padding: 6px 12px; border-radius: 9px; font-size: .85rem; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
}
.modal-body .target-pill svg { width: 15px; height: 15px; flex-shrink: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.unit-row { display: flex; gap: 10px; }
.unit-row .input { flex: 1; }
.unit-row .select { width: 130px; }

/* ===================== TOASTS ===================== */
.toast-host { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 13px;
  background: rgba(16,16,26,.92); border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  animation: toastIn .45s var(--ease);
}
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.toast-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.toast-ic svg { width: 18px; height: 18px; }
.toast.success .toast-ic { background: rgba(74,222,128,.12); color: var(--good); }
.toast.info .toast-ic { background: rgba(var(--ah),.12); color: var(--accent); }
.toast.warn .toast-ic { background: rgba(251,191,36,.12); color: var(--warn); }
.toast.danger .toast-ic { background: rgba(248,113,113,.12); color: var(--bad); }
.toast-body { flex: 1; }
.toast-body strong { display: block; font-size: .88rem; color: #fff; margin-bottom: 2px; }
.toast-body span { font-size: .8rem; color: var(--muted); line-height: 1.45; }

.scrim { display: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .4s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .hamburger { display: flex; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .pages { padding: 22px 18px 50px; }
  .topbar { padding: 16px 18px; }
  .topbar-right { display: none; }
}
@media (max-width: 540px) {
  .auth-card { padding: 32px 22px; }
  .otp-cell { width: 42px; height: 52px; font-size: 1.3rem; }
  .action-bar { width: 100%; }
  .action-bar .btn-ghost, .action-bar .btn-danger { flex: 1; }
}

/* ===================== KEY GENERATION ===================== */
.kg-key-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.kg-key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(0,0,0,.22); border: 1px solid var(--border);
  transition: border-color .2s ease;
}
.kg-key-row:hover { border-color: rgba(var(--ah),.3); }
.kg-key-text { font-size: .85rem; color: var(--text); word-break: break-all; user-select: all; }
.kg-copy-btn { padding: 6px 10px; min-width: 0; }
.kg-copy-btn svg { width: 14px; height: 14px; }
.kg-cost-line {
  margin-top: 14px; font-size: .88rem; color: var(--muted);
  display: flex; align-items: center; gap: 8px; min-height: 22px;
}
.kg-cost-line svg { width: 16px; height: 16px; color: var(--accent); }
.kg-cost-line strong { color: #fff; }
.kg-cost-line:empty { display: none; } /* don't reserve space when there's no cost line (admins) */

/* ---------- Key Generation: balanced two-column layout ---------- */
.kg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;     /* right column matches the left column's height */
  margin-bottom: 28px;
}
@media (max-width: 980px) { .kg-grid { grid-template-columns: 1fr; } }
.kg-col-left, .kg-col-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; min-height: 0; }
.kg-col-left > div:empty, .kg-col-right > div:empty { display: none; } /* hide unused placeholders */

/* Top-Up History fills the right column and scrolls internally instead of stretching the page. */
#kg-orders-block { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#kg-orders-block:empty { display: none; } /* admins have no history — don't let it push the codes panel down */
.kg-orders-card { display: flex; flex-direction: column; min-height: 0; flex: 1; margin-bottom: 0; }
.kg-orders-scroll { flex: 1; min-height: 120px; max-height: 70vh; overflow-y: auto; padding: 4px 0; }

/* compact reseller account card (right column) */
.kg-account { display: flex; flex-direction: column; }
.kg-account-hero { padding: 20px 22px 16px; display: flex; flex-direction: column; gap: 3px; }
.kg-account-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kg-account-amt { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.1; }
.kg-account-terms { padding: 0 22px; }
.kg-term {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-size: .88rem; border-top: 1px solid var(--border);
}
.kg-term span { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); }
.kg-term span svg { width: 15px; height: 15px; color: var(--accent); }
.kg-term strong { color: var(--text); font-weight: 700; }
.kg-account-foot { padding: 16px 22px 20px; }

/* ---------- reseller top-up history ---------- */
.tu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; border-top: 1px solid var(--border); font-size: .85rem;
}
.tu-row:first-child { border-top: none; }
.tu-main { display: flex; flex-direction: column; gap: 2px; }
.tu-amt { color: var(--text); font-weight: 600; }
.tu-date { color: var(--muted); font-size: .75rem; }
.tu-end { display: flex; align-items: center; gap: 10px; }
.tu-status { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.tu-status.good  { color: var(--good); background: rgba(74,222,128,.12); }
.tu-status.warn  { color: var(--warn); background: rgba(251,191,36,.12); }
.tu-status.bad   { color: var(--bad);  background: rgba(248,113,113,.12); }
.tu-status.muted { color: var(--muted); background: rgba(255,255,255,.05); }
.tu-pay { color: var(--accent); font-weight: 700; font-size: .78rem; }

/* ---------- Lookup: key filter bar ---------- */
.key-filter-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.key-filter-bar[hidden] { display: none; } /* author display:flex would otherwise beat [hidden] */

/* moderator/reseller daily quota badge */
.mod-quota {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-size: .82rem; color: var(--muted);
}
.mod-quota[hidden] { display: none; }
.mod-quota svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.mod-quota strong { color: var(--text); font-weight: 700; }
.kf-check { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--text); cursor: pointer; }
.kf-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.kf-group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kf-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.kf-actions { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.kf-actions .btn-ghost { padding: 9px 14px; font-size: .82rem; }
.key-filter-bar .cselect { min-width: 160px; }

/* ---------- HWID broken into parts (with change highlighting) ---------- */
.hwid-parts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.hwid-part {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 7px 11px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
}
.hwid-part-k { font-weight: 700; color: var(--muted); min-width: 40px; text-transform: uppercase; font-size: .7rem; letter-spacing: .5px; }
.hwid-part-v { color: var(--text); word-break: break-all; flex: 1; font-size: .82rem; }
.hwid-part.changed { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.08); }
.hwid-part.changed .hwid-part-v { color: #fde68a; }
.hwid-diff { font-size: .72rem; color: var(--warn); font-weight: 600; }

/* ---------- on/off toggle switch (admin controls) ---------- */
.ui-switch {
  width: 40px; height: 22px; border-radius: 11px; padding: 0; flex-shrink: 0;
  background: rgba(255,255,255,.14); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ui-switch.on { background: var(--accent); border-color: transparent; }
.ui-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s var(--ease);
}
.ui-switch.on .ui-switch-knob { transform: translateX(18px); }

/* ---------- live connection indicator ---------- */
.chip.online { color: var(--good); background: rgba(74,222,128,.12); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); flex-shrink: 0; animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Generate-keys confirmation breakdown ---------- */
.kg-confirm { padding: 14px 16px; }
.kg-confirm-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: .9rem; color: var(--muted); gap: 16px; }
.kg-confirm-row strong { color: var(--text); font-weight: 700; text-align: right; }

/* ===================== DEBUG ROLE SWITCHER (debug builds only) ===================== */
.debug-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 22px;
  background:
    repeating-linear-gradient(45deg,
      rgba(251,191,36,.07) 0, rgba(251,191,36,.07) 14px,
      rgba(251,191,36,.13) 14px, rgba(251,191,36,.13) 28px);
  border-bottom: 1px solid rgba(251,191,36,.35);
  color: #fde68a; font-size: .85rem;
}
.debug-tag {
  font-weight: 800; letter-spacing: .6px; font-size: .72rem;
  padding: 3px 9px; border-radius: 7px;
  background: rgba(251,191,36,.2); border: 1px solid rgba(251,191,36,.45);
  color: #fbbf24;
}
.debug-label { color: rgba(253,230,138,.8); font-weight: 600; }
.debug-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.debug-chip {
  padding: 5px 14px; border-radius: 20px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  color: var(--muted); font-size: .8rem; font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.debug-chip:hover { border-color: rgba(251,191,36,.5); color: #fde68a; }
.debug-chip.on {
  background: rgba(251,191,36,.18); border-color: rgba(251,191,36,.6);
  color: #fde68a; box-shadow: 0 0 14px rgba(251,191,36,.18);
}
.debug-bits {
  margin-left: auto; font-size: .76rem; color: rgba(253,230,138,.7);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.debug-bits strong { color: #fbbf24; }

/* ---------- developer: scalable game list ---------- */
.dev-games-wrap { max-height: 268px; overflow-y: auto; padding: 2px; margin: -2px; }
.dev-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.dev-game-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .15s, background .15s, transform .1s;
}
.dev-game-tile:hover { border-color: rgba(var(--ah),.4); transform: translateY(-1px); }
.dev-game-tile.selected-game {
  border-color: rgba(var(--ah),.5);
  box-shadow: 0 0 0 1px rgba(var(--ah),.25), 0 10px 26px rgba(0,0,0,.32);
  background: var(--surface-2);
}
.dgt-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: rgba(var(--ah),.95);
  background: rgba(var(--ah),.12);
}
.dgt-icon svg { width: 20px; height: 20px; }
.dgt-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dgt-name { font-weight: 700; font-size: .95rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dgt-sub { font-size: .76rem; color: var(--muted); }
.dgt-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dgt-dot.dot-active  { background: var(--good, #4ade80); box-shadow: 0 0 8px rgba(74,222,128,.6); }
.dgt-dot.dot-offline { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.5); }
.dgt-dot.dot-banned  { background: var(--bad, #f87171); box-shadow: 0 0 8px rgba(248,113,113,.5); }

/* "+" new-game tile */
.dev-add-tile { border-style: dashed; border-color: rgba(255,255,255,.18); background: transparent; color: var(--muted); }
.dev-add-tile:hover { border-color: rgba(var(--ah),.5); background: rgba(var(--ah),.05); color: #fff; }
.dgt-add-icon { background: rgba(var(--ah),.12); color: rgba(var(--ah),.95); font-size: 1.6rem; font-weight: 300; line-height: 1; }
.dev-add-tile .dgt-name { color: inherit; }

/* new-game modal layout */
.ng-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ng-color-row { display: flex; align-items: center; gap: 10px; }
.ng-color-row input[type="color"] {
  width: 46px; height: 40px; padding: 2px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; background: rgba(0,0,0,.25); cursor: pointer;
}
.ng-color-hex { font-family: ui-monospace, monospace; font-size: .84rem; color: var(--muted); }

.form-hint { font-size: .8rem; color: var(--muted); margin: 2px 0 12px; line-height: 1.5; }

/* ---------- developer: custom builds list ---------- */
.cb-scroll { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.cb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.cb-av { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; font-size: .78rem; }
.cb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cb-name { font-weight: 700; color: #fff; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-meta { font-size: .76rem; color: var(--muted); }
.cb-ext {
  font-family: ui-monospace, monospace; font-size: .72rem; color: var(--accent);
  background: rgba(var(--ah),.1); padding: 1px 6px; border-radius: 5px;
}
.cb-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cb-btn { padding: 7px 12px; font-size: .8rem; }
.cb-btn svg { width: 14px; height: 14px; }
.cb-empty { padding: 18px; color: var(--muted); font-size: .86rem; text-align: center; }
.cb-clear-all {
  margin-left: auto; padding: 6px 12px; font-size: .78rem;
  color: #fff; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04);
}
.cb-clear-all:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.32); color: #fff; }
.cb-clear-all svg { width: 14px; height: 14px; }

/* ---------- staff management page ---------- */
.staff-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .staff-layout { grid-template-columns: 1fr; } }
.staff-list { display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow-y: auto; }
.staff-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; text-align: left; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.staff-row:hover { border-color: rgba(var(--ah),.35); }
.staff-row.active { border-color: rgba(var(--ah),.55); background: rgba(var(--ah),.08); }
.staff-av { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; font-size: .74rem; }
.staff-av.lg { width: 48px; height: 48px; font-size: .95rem; border-radius: 12px; }
.staff-row-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.staff-row-name { font-weight: 700; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-row-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.staff-row-roles .role-pill { font-size: .64rem; padding: 1px 6px; }
.staff-detail-empty { min-height: 220px; display: grid; place-items: center; }
.staff-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.staff-detail-head h3 { font-size: 1.1rem; color: #fff; }
.staff-detail-head p { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.staff-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.staff-section:last-of-type { border-bottom: none; }
.staff-section-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.staff-section-head svg { width: 17px; height: 17px; color: var(--accent); }
.staff-section-head h4 { font-size: .92rem; font-weight: 700; color: #fff; }
.staff-section-head .gb-sub { font-size: .74rem; color: var(--muted); margin-left: auto; }
.role-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 14px; }
.role-toggle { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--text); }
.game-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.game-chip {
  padding: 7px 12px; border-radius: 9px; font-size: .82rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.game-chip:hover { border-color: rgba(var(--ah),.4); color: #fff; }
.game-chip.on { background: rgba(var(--ah),.14); border-color: rgba(var(--ah),.5); color: #fff; font-weight: 600; }
.staff-activity { font-size: .84rem; color: var(--muted); }
.staff-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
.staff-danger { color: var(--bad, #f87171); border-color: rgba(248,113,113,.3); }
.staff-danger:hover { background: rgba(248,113,113,.12); }
.secret-box { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.secret-box code { font-family: ui-monospace, monospace; font-size: .95rem; color: var(--accent); word-break: break-all; flex: 1; user-select: all; }

/* single save footer in the account detail */
.staff-footer { display: flex; align-items: center; gap: 12px; padding-top: 18px; }
.staff-footer .staff-actions { padding-top: 0; flex: 1; }
.staff-footer #staff-save-all { margin-left: auto; flex: 0 0 auto; }

/* segmented control (Accounts / Logs) */
.seg-control { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 12px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 9px;
  background: none; border: none; color: var(--muted); font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg-btn svg { width: 16px; height: 16px; }
.seg-btn:hover { color: #fff; }
.seg-btn.active { background: rgba(var(--ah),.16); color: #fff; }

/* logs view */
.logs-filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logs-filter-bar .log-filter { min-width: 180px; }
.logs-table { display: flex; flex-direction: column; }
.logs-count { font-size: .76rem; color: var(--muted); padding: 0 2px 10px; }
.log-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,.05); }
.log-row:last-child { border-bottom: none; }
.log-time { flex: 0 0 132px; font-size: .76rem; color: var(--muted); padding-top: 2px; }
.log-av { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; font-size: .66rem; }
.log-main { min-width: 0; flex: 1; }
.log-event { font-size: .88rem; color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-ev-tag { font-size: .72rem; font-weight: 600; color: var(--accent); background: rgba(var(--ah),.12); padding: 1px 8px; border-radius: 6px; }
.log-details { font-size: .8rem; color: var(--muted); margin-top: 2px; word-break: break-word; }
@media (max-width: 640px) { .log-time { flex-basis: 96px; } }

/* ---------- orders page ---------- */
.ord-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ord-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ord-filters .cselect-host { min-width: 150px; }
.ord-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ord-chip { font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.ord-chip.good { color: var(--good, #4ade80); border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.08); }
.ord-chip.warn { color: #fbbf24; border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.08); }
.ord-chip.bad { color: var(--bad, #f87171); border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.08); }
.ord-header { display: flex; gap: 8px; padding: 8px 12px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); }
.ord-body { max-height: 60vh; overflow-y: auto; }
.ord-row { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); align-items: center; font-size: .86rem; }
.ord-row:hover { background: rgba(255,255,255,.025); }
.ord-col { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-id { flex: 0 0 70px; color: var(--muted); font-size: .8rem; }
.ord-email { flex: 1 1 180px; }
.ord-game { flex: 0 0 120px; }
.ord-sub { flex: 0 0 80px; }
.ord-pay { flex: 0 0 80px; }
.ord-status { flex: 0 0 90px; }
.ord-status .chip { font-size: .68rem; padding: 2px 8px; }
.ord-key { flex: 1 1 150px; color: var(--muted); font-size: .78rem; user-select: all; }
.ord-time { flex: 0 0 110px; color: var(--muted); font-size: .8rem; }
@media (max-width: 900px) {
  .ord-header { display: none; }
  .ord-row { flex-wrap: wrap; gap: 6px; }
  .ord-col { flex: 1 1 auto !important; }
}

/* ---------- fulfillment page ---------- */
.ff-card { padding: 18px 20px; margin-bottom: 12px; border-left: 3px solid #fbbf24; }
.ff-card.ff-done { border-left-color: var(--good, #4ade80); opacity: .8; }
.ff-head { margin-bottom: 4px; }
.ff-shipping { margin-top: 8px; }
.ff-title { font-size: 1rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ff-title .chip { font-size: .68rem; }
.ff-oid { font-size: .82rem; font-weight: 500; color: var(--muted); }
.ff-meta { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ff-shipping { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.ff-ship-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ff-ship-label { font-size: .78rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ff-ship-label svg { width: 15px; height: 15px; }
.ff-ship-lines { font-size: .9rem; color: var(--text); line-height: 1.6; }
.ff-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ff-actions-end { justify-content: flex-end; }
.ff-tracking { flex: 1; min-width: 200px; }
.ff-complete-btn { flex: 0 0 auto; }
.ff-complete-info { font-size: .84rem; color: var(--good, #4ade80); display: flex; align-items: center; gap: 6px; }
.ff-complete-info svg { width: 15px; height: 15px; }
.ff-complete-info a { color: var(--accent); text-decoration: none; }
.ff-complete-info a:hover { text-decoration: underline; }

/* ---------- permission test (debug only) ---------- */
.pt-banner { padding: 10px 14px; border-radius: 8px; font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pt-banner svg { width: 16px; height: 16px; }
.pt-ok { background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.pt-fail { background: rgba(239,68,68,.12); color: #ef4444; border: 1px solid rgba(239,68,68,.25); }
.pt-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
.pt-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.pt-table th { text-align: left; padding: 8px 10px; background: rgba(0,0,0,.3); color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.pt-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.04); }
.pt-pass { }
.pt-fail-row { background: rgba(239,68,68,.06); }
.pt-skip-row { opacity: .45; }
.pt-mismatch { color: #ef4444; font-weight: 700; }

/* ---------- cheat logs viewer ---------- */
.cl-scroll { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-family: ui-monospace, monospace; font-size: .82rem; }
.cl-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 8px; border-radius: 5px; }
.cl-row:hover { background: rgba(255,255,255,.03); }
.cl-type { flex: 0 0 48px; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; }
.cl-time { flex: 0 0 145px; color: var(--muted); font-size: .74rem; }
.cl-msg { flex: 1; color: var(--text); word-break: break-word; white-space: pre-wrap; }
.cl-info .cl-type { color: #c084fc; }
.cl-debug .cl-type { color: #67e8f9; }
.cl-warn .cl-type { color: #fbbf24; }
.cl-warn .cl-msg { color: #fbbf24; }
.cl-error .cl-type { color: #f87171; }
.cl-error .cl-msg { color: #f87171; }
.cl-fatal .cl-type { color: #f87171; background: rgba(248,113,113,.15); padding: 1px 5px; border-radius: 3px; }
.cl-fatal .cl-msg { color: #f87171; font-weight: 600; }
@media (max-width: 640px) { .cl-time { flex-basis: 100px; } }

/* ---------- stats page + charts ---------- */
.stats-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 18px; }
.stats-toolbar .range-custom { margin-top: 0; }
.stat-chart-box { margin-bottom: 18px; }
.stats-hint { font-size: .8rem; color: var(--muted); margin: 14px 2px 22px; }

/* clickable metric cards that toggle their series on the graph */
.stat-toggle {
  position: relative; overflow: hidden;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid var(--border); outline: none;
}
.stat-toggle::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--series, var(--accent)); transition: opacity .15s ease;
}
.stat-toggle:hover { transform: translateY(-3px); border-color: rgba(var(--ah),.22); }
.stat-toggle:focus-visible { box-shadow: 0 0 0 3px rgba(var(--ah),.18); }
.stat-toggle.off { opacity: .45; }
.stat-toggle.off::before { opacity: .25; }
.stat-toggle.off .stat-value { color: var(--muted); }
.chart-host { position: relative; width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.chart-svg .ax-y { fill: var(--muted); font-size: 13px; text-anchor: end; font-family: inherit; }
.chart-svg .ax-x { fill: var(--muted); font-size: 13px; text-anchor: middle; font-family: inherit; }
.chart-svg .hover-line { stroke: rgba(255,255,255,.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .hover-area { cursor: crosshair; }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none; z-index: 5;
  background: #14141f; border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); min-width: 130px;
}
.chart-tip .tip-date { font-size: .74rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--text); margin-top: 3px; }
.chart-tip .tip-row strong { margin-left: auto; color: #fff; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .8rem; cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease;
}
.legend-chip:hover { border-color: rgba(var(--ah),.4); }
.legend-chip.off { opacity: .4; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- other: IP blacklist manager ---------- */
.bl-add-row { display: flex; gap: 10px; margin-bottom: 16px; }
.bl-add-row .input { flex: 1; }
.bl-add-row .btn-danger { flex: 0 0 auto; }
.bl-list { display: flex; flex-direction: column; gap: 7px; max-height: 360px; overflow-y: auto; }
.bl-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.bl-row .mono { flex: 1; font-family: ui-monospace, monospace; font-size: .86rem; color: var(--text); word-break: break-all; }
.bl-row .bl-remove { flex: 0 0 auto; padding: 5px 12px; font-size: .78rem; }

/* ---------- discord tickets archive ---------- */
.ticket-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 920px) { .ticket-layout { grid-template-columns: 1fr; } }
.ticket-list-box .search-bar { display: flex; align-items: center; gap: 8px; }
.ticket-list { display: flex; flex-direction: column; gap: 7px; max-height: 70vh; overflow-y: auto; }
.tk-row {
  display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  padding: 10px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .15s ease, background .15s ease;
}
.tk-row:hover { border-color: rgba(var(--ah),.35); }
.tk-row.active { border-color: rgba(var(--ah),.55); background: rgba(var(--ah),.08); }
.tk-row-top { display: flex; align-items: center; gap: 8px; }
.tk-name { font-weight: 700; color: #fff; font-size: .9rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-row-top .chip { font-size: .64rem; padding: 1px 7px; }
.tk-topic { font-size: .8rem; color: var(--text); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.tk-preview { font-size: .76rem; color: var(--muted); margin-top: 4px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-empty { min-height: 220px; display: grid; place-items: center; }

/* Discord-style conversation viewer */
.dc-chat { padding: 0; overflow: hidden; }
.tk-convo-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.tk-convo-head h3 { font-size: 1.05rem; color: #fff; }
.tk-convo-head p { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.tk-convo-head .chip { margin-left: auto; }
.dc-messages { padding: 8px 16px 16px; max-height: 68vh; overflow-y: auto; background: #313338; }
.dcm { display: flex; gap: 14px; padding: 8px 4px; }
.dcm:hover { background: rgba(0,0,0,.12); border-radius: 8px; }
.dcm-av { flex: 0 0 auto; width: 40px; height: 40px; }
.dcm-av img, .dcm-av-fallback { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff; }
.dcm-body { min-width: 0; flex: 1; }
.dcm-head { display: flex; align-items: baseline; gap: 8px; }
.dcm-author { font-weight: 600; color: #fff; font-size: .92rem; }
.dcm-bot { font-size: .58rem; font-weight: 700; letter-spacing: .5px; background: #5865F2; color: #fff; padding: 1px 5px; border-radius: 4px; transform: translateY(-1px); }
.dcm-time { font-size: .7rem; color: #949ba4; }
.dcm-content { font-size: .92rem; color: #dbdee1; line-height: 1.45; word-break: break-word; margin-top: 2px; }
.dcm-content code { background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: .85em; }
.dcm-content pre { background: rgba(0,0,0,.35); padding: 8px 12px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: .82rem; white-space: pre-wrap; word-break: break-word; margin: 4px 0; }
.dcm-img { max-width: 380px; max-height: 300px; border-radius: 8px; margin-top: 6px; display: block; }
.dcm-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: #00a8fc; font-size: .85rem; text-decoration: none; }
.dcm-file svg { width: 16px; height: 16px; }
.dcm .dc-embed { margin-top: 6px; }
.dc-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; cursor: default; }
.dc-embed-media, .dcm-bare-media video, .dcm-bare-media img { max-width: 340px; max-height: 280px; border-radius: 8px; margin-top: 8px; display: block; }
.dcm-bare-media { margin-top: 6px; }
.dcm-bare-media video, .dcm-bare-media img { margin-top: 0; }

/* captured message-component buttons (mostly non-interactive in the archive) */
.dcm-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dcm-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-size: .85rem; font-weight: 600; border: none; color: #fff; text-decoration: none; cursor: default;
}
.dcm-btn[disabled] { opacity: .85; }
.dcm-btn.primary { background: #5865F2; }
.dcm-btn.secondary { background: #4e5058; }
.dcm-btn.success { background: #248046; }
.dcm-btn.danger { background: #da373c; }
.dcm-btn.link { background: #4e5058; cursor: pointer; }
a.dcm-btn { cursor: pointer; }

/* close-ticket button on open rows */
.tk-close {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  background: none; border: none; color: var(--muted); font-size: .8rem; line-height: 1; display: grid; place-items: center;
}
.tk-close:hover { color: var(--bad, #f87171); background: rgba(248,113,113,.14); }
.tk-close svg { width: 13px; height: 13px; }

/* Discord-style reply bar (open tickets only) */
.dc-reply { display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px; background: #313338; }
.dc-reply-input {
  flex: 1; background: #383a40; border: none; outline: none; border-radius: 10px;
  padding: 12px 14px; color: #dbdee1; font-size: .92rem; font-family: inherit;
}
.dc-reply-input::placeholder { color: #6d7178; }
.dc-reply-input:disabled { opacity: .6; }
.dc-reply-send {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  border: none; display: grid; place-items: center; color: #fff;
  background: #5865F2; transition: background .15s ease, opacity .15s ease;
}
.dc-reply-send:hover { background: #4752c4; }
.dc-reply-send:disabled { opacity: .5; cursor: default; }
.dc-reply-send svg { width: 19px; height: 19px; }

/* ---------- discord page ---------- */
.discord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .discord-grid { grid-template-columns: 1fr; } }
.lbl-opt { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.cp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dc-divider { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 8px 0 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.dc-check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text); margin-bottom: 8px; cursor: pointer; }
.dc-mentions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.e-field { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.e-field .input { padding: 8px 10px; }
.ef-inline { display: flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.ef-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px 6px; border-radius: 6px; }
.ef-del:hover { color: var(--bad, #f87171); background: rgba(248,113,113,.12); }

/* discord live preview (Discord-styled embed) */
.discord-preview-col { position: sticky; top: 18px; }
.dc-preview-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; }
.dc-preview { background: #313338; border-radius: 12px; padding: 16px; min-height: 120px; }
.dc-content { color: #dbdee1; font-size: .95rem; margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; }
.dc-embed { display: grid; grid-template-columns: 1fr auto; gap: 12px; background: #2b2d31; border-left: 4px solid #5865F2; border-radius: 4px; padding: 12px 16px 12px 12px; max-width: 440px; }
.dc-embed-main { min-width: 0; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: #fff; margin-bottom: 6px; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { font-size: .96rem; font-weight: 700; color: #fff; margin-bottom: 6px; word-break: break-word; }
.dc-title a { color: #00a8fc; text-decoration: none; }
.dc-desc { font-size: .87rem; color: #dbdee1; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.dc-field { flex: 1 1 100%; min-width: 0; }
.dc-field.inline { flex: 1 1 30%; }
.dc-field-name { font-size: .8rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.dc-field-val { font-size: .82rem; color: #dbdee1; word-break: break-word; }
.dc-image { max-width: 100%; border-radius: 6px; margin-top: 10px; display: block; }
.dc-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: #b5bac1; margin-top: 8px; }
.dc-footer img { width: 18px; height: 18px; border-radius: 50%; }

/* ---------- developer: build-file dropzone ---------- */
.dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px; border-radius: 12px; cursor: pointer; outline: none;
  border: 1.5px dashed rgba(255,255,255,.16); background: rgba(0,0,0,.2);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .05s ease;
}
.dropzone:hover { border-color: rgba(var(--ah),.5); background: rgba(var(--ah),.06); }
.dropzone:focus-visible { border-color: rgba(var(--ah),.6); box-shadow: 0 0 0 3px rgba(var(--ah),.14); }
.dropzone.dz-over {
  border-color: rgba(var(--ah),.8); border-style: solid;
  background: rgba(var(--ah),.12); box-shadow: 0 0 0 3px rgba(var(--ah),.14);
}
.dropzone.dz-over .dz-icon { transform: translateY(-2px); }
.dropzone.has-file { border-style: solid; border-color: rgba(var(--ah),.35); background: rgba(var(--ah),.07); }
.dz-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center; color: rgba(var(--ah),.95);
  background: rgba(var(--ah),.12); transition: transform .2s ease;
}
.dz-icon svg { width: 22px; height: 22px; }
.dz-text { font-size: .9rem; color: var(--muted); line-height: 1.45; min-width: 0; }
.dz-text strong { color: #fff; font-weight: 700; word-break: break-all; }
.dz-hint { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.has-file .dz-text strong { color: var(--accent); }

/* ---------- developer: custom-user autocomplete ---------- */
.ac-wrap { position: relative; }
.ac-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #14141f; border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 5px;
}
.ac-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 9px; cursor: pointer;
  background: var(--surface, rgba(255,255,255,.03));
  border: 1px solid var(--border);
  transition: background .15s ease, border-color .15s ease;
}
.ac-item:hover { background: rgba(var(--ah),.12); border-color: rgba(var(--ah),.35); }
.ac-name { font-size: .88rem; color: var(--text); font-weight: 600; }
.ac-av {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff;
}
.ac-av.sm { width: 24px; height: 24px; font-size: .64rem; }
.ac-chip {
  display: flex; align-items: center; gap: 9px; margin-top: 9px;
  padding: 7px 11px; border-radius: 10px; font-size: .82rem; color: var(--text);
  background: rgba(var(--ah),.1); border: 1px solid rgba(var(--ah),.25);
}
.ac-chip strong { color: #fff; }
.ac-clear {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .9rem; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.ac-clear:hover { color: var(--bad, #f87171); background: rgba(248,113,113,.12); }

/* upload-success line */
.up-ok { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: .82rem; color: var(--text); }
.up-ok-ic { display: inline-flex; flex: 0 0 auto; color: var(--good, #4ade80); }
.up-ok-ic svg { width: 15px; height: 15px; }

/* compact custom dropdown (e.g. inline status in the dev overview) */
.cselect-compact { width: auto; min-width: 150px; }
.cselect-compact .cselect-trigger { padding: 7px 11px; font-size: .82rem; border-radius: 9px; }
.cselect-compact .cselect-caret { width: 15px; height: 15px; }
.ir-sub { display: inline-block; margin-top: 2px; font-size: .72rem; color: var(--muted); }
.when-ago { color: var(--muted); font-size: .76rem; font-weight: 500; }

/* developer: top row (overview + pricing), then Upload Build + Custom Builds as two columns */
.dev-two { align-items: start; margin-bottom: 18px; }
.dev-builds-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 28px; }
.dev-builds-cols:empty { display: none; }
.dev-builds-cols > div:empty { display: none; }
.dev-upload-box, .dev-custom-box { margin-bottom: 0; }
.dev-upload-hint {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--muted); min-height: 160px;
}
.dev-upload-hint svg { width: 26px; height: 26px; opacity: .6; }
.dev-upload-hint p { font-size: .86rem; }
@media (max-width: 900px) { .dev-builds-cols { grid-template-columns: 1fr; } }

/* developer: pricing grid + free-until row */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 18px; }
.price-grid .form-row { margin: 0; }
.price-grid .input { width: 100%; }
.free-row { display: flex; gap: 8px; align-items: center; }
.free-row .free-date { flex: 1 1 56%; min-width: 0; }
.free-row .free-time { flex: 1 1 30%; min-width: 0; }
.free-row .free-clear { flex: 0 0 auto; padding: 8px 12px; }
/* the free-until row is the last field; Save sits directly under it with no filler gap */
#dev-save { margin-top: 4px; }
/* style native date/time popups to fit the dark theme */
.free-row input[type="date"]::-webkit-calendar-picker-indicator,
.free-row input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
