:root {
  --bg: #07070c;
  --bg2: #0b0b14;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-brd: rgba(255, 255, 255, 0.09);
  --glass-brd2: rgba(255, 255, 255, 0.14);
  --text: #ececf5;
  --muted: #9498ad;
  --faint: #6a6d82;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --accent: #8b5cf6;
  --accent-2: #6d5cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 55%, #4f46e5 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,92,246,.22), rgba(99,102,241,.12));
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sidebar-w: 244px;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  position: relative; overflow-x: hidden;
}
h1, h2, h3, .brand-name, .num { font-family: "Lexend", "Inter", sans-serif; }
h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 1.2rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 1.8rem 0 .7rem; }
h3 { margin: 0; font-weight: 600; }
a { color: var(--text); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); }
.breakall { word-break: break-all; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* Ambient background glow like a premium cheat client */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(139,92,246,.28), transparent 60%),
    radial-gradient(700px 500px at 105% 10%, rgba(79,70,229,.20), transparent 55%),
    radial-gradient(500px 500px at 50% 120%, rgba(109,92,255,.12), transparent 60%),
    var(--bg);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(18,18,28,.92), rgba(10,10,18,.92));
  border-right: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; padding: 1.1rem .85rem; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem 1.1rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; background: var(--grad); color: #fff; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(139,92,246,.5);
}
.brand-mark.big { width: 54px; height: 54px; font-size: 1.5rem; border-radius: 16px; }
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.side-nav { display: flex; flex-direction: column; gap: .18rem; margin-top: .4rem; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem;
  border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .92rem;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--glass); color: var(--text); }
.side-nav a.active {
  color: #fff; background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px var(--glass-brd2);
}
.side-nav a.active .ic { stroke: var(--violet); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; padding-top: 1rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem;
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 10px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: .85rem; }
.uname { font-weight: 600; font-size: .9rem; line-height: 1.15; }
.role-line { display: block; font-size: .68rem; color: var(--faint); font-weight: 500; text-transform: capitalize; }
.role-line .cred { color: var(--violet); }
.cred-num { color: var(--violet); }

/* ---------- Main content ---------- */
.content { margin-left: var(--sidebar-w); padding: 2rem 2.2rem 4rem; max-width: 1200px; }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }

/* ---------- Flash ---------- */
.flash {
  background: var(--grad-soft); border: 1px solid var(--glass-brd2);
  color: #e9e6ff; padding: .7rem 1rem; border-radius: 11px; margin-bottom: 1.2rem;
  font-size: .9rem;
}
.flash.inline { margin: .2rem 0 1rem; }

/* ---------- Glass / cards ---------- */
.glass, .app-block, .panel, .card, table.grid {
  background: var(--glass); border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px); border-radius: var(--radius);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.card { padding: 1.2rem 1.3rem; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: 0; transition: opacity .2s; }
.card:hover::after { opacity: .5; }
.card .num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.card .lbl { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Tables ---------- */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: .8rem; overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: .7rem .8rem; vertical-align: top; }
table.grid thead th {
  color: var(--faint); font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: 1px solid var(--glass-brd);
  background: rgba(255,255,255,.02);
}
table.grid tbody tr { border-bottom: 1px solid rgba(255,255,255,.05); }
table.grid tbody tr:hover { background: rgba(255,255,255,.025); }
table.grid tbody td { border-top: 1px solid rgba(255,255,255,.04); }
table.grid tr.row-banned { background: rgba(251,113,133,.07); }

/* ---------- Tags ---------- */
.tag {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem;
  font-weight: 600; background: rgba(255,255,255,.06); border: 1px solid var(--glass-brd);
  color: var(--muted);
}
.tag.ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.tag.danger { color: var(--danger); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  cursor: pointer; border: 1px solid var(--glass-brd2); background: var(--glass);
  color: var(--text); padding: .5rem .9rem; border-radius: 10px; font-size: .88rem;
  font-weight: 600; font-family: inherit; transition: all .15s; line-height: 1.1;
}
.btn:hover { border-color: var(--accent); background: rgba(139,92,246,.12); }
.btn.small { padding: .32rem .6rem; font-size: .78rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--grad); border: none; color: #fff;
  box-shadow: 0 8px 24px rgba(109,92,255,.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(109,92,255,.5); }
.btn-warn { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.4); color: var(--warn); }
.btn-warn:hover { background: rgba(251,191,36,.24); }
.btn-danger { background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(251,113,133,.26); }
.btn-ghost { background: transparent; }

/* ---------- Forms ---------- */
form { margin: 0; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .5rem; }
.field span { display: block; margin-bottom: .35rem; font-weight: 500; }
input, select {
  display: block; width: 100%; padding: .55rem .7rem; color: var(--text);
  background: rgba(0,0,0,.28); border: 1px solid var(--glass-brd);
  border-radius: 10px; font-size: .9rem; font-family: inherit; transition: border .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
input.tiny { width: 120px; display: inline-block; }

/* ---------- Panels / details ---------- */
.panel { padding: 1rem 1.2rem; margin: 1.1rem 0; }
.panel > summary { cursor: pointer; font-weight: 600; list-style: none; }
.panel > summary::before { content: "▸ "; color: var(--accent); }
.panel[open] > summary::before { content: "▾ "; }
.row-form { display: flex; gap: .9rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.row-form label { margin-bottom: 0; flex: 1; min-width: 140px; }
.row-form label.wide { flex: 2; min-width: 220px; }
.filterbar { display: flex; gap: .6rem; align-items: center; margin: 1.2rem 0; }
.filterbar input { width: 280px; }
.filterbar select { width: auto; }

/* ---------- App blocks ---------- */
.app-block { padding: 1.2rem 1.4rem; margin: 1.1rem 0; }
.app-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .3rem; }
.app-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }

/* ---------- App tabs ---------- */
.apptabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.apptab { padding: .45rem .95rem; border: 1px solid var(--glass-brd); border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: .85rem; background: var(--glass); }
.apptab:hover { color: var(--text); border-color: var(--glass-brd2); }
.apptab.active { background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(109,92,255,.4); }

/* ---------- Row actions ---------- */
td.actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
td.actions form { display: inline; }
.inline-form { display: inline-flex; gap: .3rem; align-items: center; }
details.inline > summary { list-style: none; display: inline-block; cursor: pointer; }
details.inline .stack { background: rgba(0,0,0,.35); border: 1px solid var(--glass-brd);
  padding: .8rem; border-radius: 10px; margin-top: .4rem; min-width: 250px; }
.stack label { margin-bottom: .5rem; }

/* ---------- Login ---------- */
.login-shell { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
.login-card { width: 100%; padding: 2.4rem 2.2rem; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.login-brand { display: flex; justify-content: center; margin-bottom: 1rem; }
.login-card h1 { margin: 0; font-size: 2rem; }
.login-card p { margin: .3rem 0 1.6rem; }
.login-card .field { text-align: left; margin-bottom: 1rem; }
.login-card .btn { margin-top: .6rem; }
.login-foot { margin-top: 1.4rem; font-size: .8rem; }

/* ---------- Pager ---------- */
.pager { display: flex; gap: .6rem; margin-top: 1.2rem; }

/* ---------- Account ---------- */
.narrow { max-width: 520px; }
.stack-form .field { margin-bottom: 1rem; }
.stack-form .btn { margin-top: .4rem; }
.offers-grid input { width: 100%; }
.offers-grid td { padding: .35rem .4rem; }
.offer-edit { display: flex; gap: .35rem; align-items: center; margin-bottom: .45rem; flex-wrap: wrap; }
.offer-edit input { width: auto; flex: 1; min-width: 70px; }
.offer-edit input[name="level"] { max-width: 70px; flex: 0 0 auto; }

@media (max-width: 820px) {
  .sidebar { width: 66px; padding: 1rem .5rem; }
  .brand-name, .side-nav a span, .uname { display: none; }
  .side-nav a { justify-content: center; }
  .content { margin-left: 66px; padding: 1.3rem 1rem 3rem; }
}
