:root {
  --bg: #0d1220;
  --panel: #151c2e;
  --panel2: #1b2338;
  --line: rgba(255, 255, 255, .08);
  --text: #e8edf6;
  --muted: #8f9bb3;
  --accent: #4ade80;
  --accent2: #38bdf8;
  --danger: #f87171;
  --warn: #fbbf24;
  --purple: #c084fc;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent2); text-decoration: none; }
h1, h2, h3 { margin: 0; }
h3 { font-size: 15px; margin-bottom: 10px; }
.mt { margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--danger); min-height: 18px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

input, select, textarea { font: inherit; color: var(--text); background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent2); }
textarea { width: 100%; resize: vertical; margin: 6px 0; }
.btn { font: inherit; color: var(--text); cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 9px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.primary { background: var(--accent); color: #0b2414; border: none; font-weight: 700; }
.btn.danger { border-color: rgba(248,113,113,.4); color: #fecaca; }
.btn.danger:hover { background: rgba(248,113,113,.18); }
.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card.flush { padding: 0; overflow-x: auto; }

/* giriş */
.gate { max-width: 380px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 8px; }
.gate h1 { font-size: 34px; }
.gate h1 span, .brand span { color: var(--accent); }
.gate h1 small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.gate label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.gate .btn.primary { justify-content: center; padding: 11px; margin-top: 8px; }

/* yerleşim */
#app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
#side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 22px; font-weight: 800; padding: 0 8px; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
#tabs { display: flex; flex-direction: column; gap: 3px; flex: 1; }
#tabs button { text-align: left; font: inherit; color: var(--muted); background: transparent; border: none; border-radius: 9px; padding: 9px 12px; cursor: pointer; }
#tabs button:hover { background: rgba(255,255,255,.05); color: var(--text); }
#tabs button.active { background: rgba(56,189,248,.14); color: var(--text); font-weight: 600; }
.me { border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; flex-direction: column; gap: 8px; }
main { padding: 22px 26px 40px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
header { display: flex; justify-content: space-between; align-items: center; }
.hdr-right { display: flex; gap: 10px; align-items: center; }
.tab { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* istatistik kartları */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--muted); }

/* tablolar */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255,255,255,.03); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn { margin-left: 4px; }
.tbl td.msg { max-width: 520px; word-break: break-word; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }

/* rozetler */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); }
.badge.admin { background: rgba(248,113,113,.18); color: #fecaca; }
.badge.dev { background: rgba(192,132,252,.18); color: #e9d5ff; }
.badge.mod { background: rgba(56,189,248,.18); color: #bae6fd; }
.badge.on { background: rgba(74,222,128,.16); color: #bbf7d0; }
.badge.ban { background: rgba(248,113,113,.25); color: #fecaca; }
.badge.public { background: rgba(56,189,248,.16); color: #bae6fd; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; box-shadow: 0 0 8px var(--accent); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-right: 3px; border: 1px solid rgba(255,255,255,.2); }

/* çekmece (kullanıcı detayı) */
#drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.section { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.section h4 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.section input, .section select { flex: 1; min-width: 0; }

/* modal */
#modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; }
.modal-box input { width: 100%; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--accent2); padding: 10px 14px; border-radius: 10px; animation: slide .2s; max-width: 360px; }
.toast.good { border-left-color: var(--accent); }
.toast.bad { border-left-color: var(--danger); }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  #tabs { flex-direction: row; flex-wrap: wrap; }
  .me { border: none; padding: 0; flex-direction: row; }
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
}
