:root {
  --bg: #0b0716;
  --bg2: #150c2b;
  --glass: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3eefe;
  --muted: #a99cc6;
  --purple: #8b5cf6;
  --purple2: #6d28d9;
  --gold: #f5c451;
  --gold2: #d99a1e;
  --red: #f05267;
  --green: #34d399;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Cairo', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, .28), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, rgba(245, 196, 81, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
a { color: var(--gold); }

/* brand */
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 18px; }
.logo {
  font-weight: 800; font-size: 28px; letter-spacing: 3px;
  background: linear-gradient(135deg, var(--gold), #fff3c9 45%, var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand small { color: var(--muted); font-size: 13px; }
.brand.big { align-items: center; padding-bottom: 8px; }
.brand.big .logo { font-size: 44px; }

/* buttons & inputs */
.btn {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px;
  color: var(--text); background: rgba(255, 255, 255, .06); transition: .15s;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #241500; border: 0; }
.btn.purple { background: linear-gradient(135deg, var(--purple), var(--purple2)); border: 0; }
.btn.red { background: rgba(240, 82, 103, .18); border-color: rgba(240, 82, 103, .4); color: #ffc2cb; }
.btn.green { background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .4); color: #b7f5dd; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); }
select option { background: var(--bg2); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; accent-color: var(--purple); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--red); min-height: 20px; margin: 0; font-size: 14px; }

/* layout */
#app { display: flex; min-height: 100vh; }
.side { width: 230px; margin: 14px; padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 14px; height: calc(100vh - 28px); }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow: auto; }
#nav button {
  font: inherit; text-align: right; background: none; border: 0; color: var(--muted); padding: 10px 12px;
  border-radius: 11px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
#nav button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
#nav button.on { background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(245, 196, 81, .12)); color: var(--text); }
.pill { background: var(--red); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
main { flex: 1; min-width: 0; padding: 14px 18px 40px 14px; }
.top { display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: 22px; margin: 8px 0 16px; }
.menu { display: none; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat .v { font-size: 26px; font-weight: 800; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat.gold .v { color: var(--gold); }
.card { padding: 16px; margin-top: 14px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--gold), var(--purple)); }
.bar span { font-size: 10px; color: var(--muted); }
.bar b { font-size: 11px; }

/* toolbar + table */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 160px; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(255, 255, 255, .03); }
.u { display: flex; align-items: center; gap: 10px; }
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--purple), var(--gold)); flex: none; }
.av.lg { width: 64px; height: 64px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.tag.vip { color: var(--gold); border-color: rgba(245, 196, 81, .4); }
.tag.ban { color: #ffc2cb; border-color: rgba(240, 82, 103, .5); }
.tag.mod { color: #d6c6ff; border-color: rgba(139, 92, 246, .6); }
.pos { color: var(--green); } .neg { color: var(--red); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 30px; text-align: center; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; direction: ltr; unicode-bidi: plaintext; }

/* forms */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sect { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.sect h4 { margin: 0 0 10px; font-size: 14px; color: var(--gold); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5, 2, 12, .7); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-card { width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 20px; background: rgba(21, 12, 43, .92); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 12px; background: #24173f; border: 1px solid var(--line); z-index: 30; }
.toast.bad { border-color: var(--red); }

@media (max-width: 860px) {
  .side { position: fixed; z-index: 10; inset: 0 auto 0 0; margin: 0; height: 100vh; border-radius: 0; transform: translateX(-110%); transition: .2s; background: rgba(21, 12, 43, .97); right: 0; left: auto; transform: translateX(110%); }
  .side.open { transform: none; }
  .menu { display: inline-block; }
  main { padding: 12px 16px 40px; }
}
.mt8 { margin-top: 10px; }
.mt0 { margin: 0 0 4px; }
.row > input, .row > select { flex: 1; width: auto; min-width: 140px; }
.gicon { font-size: 26px; line-height: 1; }
.gold-t { color: var(--gold); font-weight: 700; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.li .end { margin-inline-start: auto; }
a.stat.lnk { text-decoration: none; color: inherit; }
a.stat.lnk:hover { border-color: var(--purple); }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.imgc { margin: 0; overflow: hidden; display: flex; flex-direction: column; }
.imgc img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.imgc figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.inl { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; margin: 4px 6px 0 0; color: var(--text); }
.inl input { width: 70px; padding: 4px 6px; }
.wrap-t { white-space: normal; min-width: 220px; }
.sel { user-select: all; }
@media (max-width: 860px) { .cols2 { grid-template-columns: minmax(0, 1fr); } }
