:root {
  --bg: #05040d; --bg2: #0a0820; --panel: rgba(20, 15, 48, .66); --panel2: rgba(30, 22, 68, .55);
  --line: rgba(130, 100, 255, .26); --line2: rgba(130, 100, 255, .5);
  --cyan: #19f2ff; --pink: #ff3df0; --violet: #8a5bff; --green: #2bff9a; --red: #ff4d6d; --amber: #ffc53d;
  --text: #ecebff; --muted: #8f8bbd; --radius: 16px;
  --glow-c: 0 0 12px rgba(25, 242, 255, .55), 0 0 32px rgba(25, 242, 255, .25);
  --glow-p: 0 0 12px rgba(255, 61, 240, .55), 0 0 32px rgba(255, 61, 240, .25);
  --font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
body { overflow-x: hidden; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(255, 61, 240, .4); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(138, 91, 255, .45); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- latar neon ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: radial-gradient(900px 500px at 12% -10%, rgba(138, 91, 255, .30), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255, 61, 240, .18), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(25, 242, 255, .16), transparent 60%), var(--bg); }
.bg::after { content: ""; position: absolute; left: -50%; right: -50%; bottom: -30%; height: 75%;
  background-image: linear-gradient(rgba(138, 91, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 91, 255, .22) 1px, transparent 1px);
  background-size: 54px 54px; transform: perspective(520px) rotateX(62deg); transform-origin: top;
  mask-image: linear-gradient(to bottom, transparent, #000 40%); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%);
  animation: grid 6s linear infinite; opacity: .55; }
@keyframes grid { to { background-position: 0 54px; } }

/* ---------- logo / teks neon ---------- */
.logo { font-weight: 900; letter-spacing: .14em; font-size: 28px; color: #fff;
  text-shadow: 0 0 6px var(--cyan), 0 0 18px var(--cyan), 0 0 42px var(--violet); }
.logo b { color: var(--pink); text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 42px var(--pink); font-weight: 900; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- kartu ---------- */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); transition: border-color .25s, box-shadow .25s, transform .25s; }
.card.glow:hover { border-color: var(--line2); box-shadow: 0 10px 40px rgba(0, 0, 0, .4), 0 0 26px rgba(138, 91, 255, .25); }
.card h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .gap { gap: 16px; }

/* ---------- tombol & input ---------- */
.btn { appearance: none; border: 1px solid var(--line2); background: rgba(138, 91, 255, .12); color: var(--text); font: inherit; font-weight: 600;
  padding: 9px 16px; border-radius: 12px; cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover:not(:disabled) { border-color: var(--cyan); box-shadow: var(--glow-c); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { border: none; color: #07040f; background: linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--pink)); background-size: 160% 100%; box-shadow: 0 0 22px rgba(138, 91, 255, .5); }
.btn.primary:hover:not(:disabled) { background-position: 100% 0; box-shadow: 0 0 30px rgba(255, 61, 240, .6); }
.btn.danger { border-color: rgba(255, 77, 109, .6); color: #ffd0d8; background: rgba(255, 77, 109, .1); }
.btn.danger:hover:not(:disabled) { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 77, 109, .5); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 9px; } .btn.block { width: 100%; }
.btn .spin { width: 15px; height: 15px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: rgba(8, 6, 24, .7); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; transition: all .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(25, 242, 255, .15), var(--glow-c); }
textarea { resize: vertical; min-height: 110px; } select option { background: #120e2e; }
label.f { display: block; margin-bottom: 14px; } label.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; }
input[type=checkbox] { width: auto; }
.codeinput { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; text-transform: uppercase; }

/* ---------- switch ---------- */
.sw { position: relative; width: 44px; height: 24px; flex: none; display: inline-block; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw i { position: absolute; inset: 0; background: rgba(120, 110, 170, .25); border: 1px solid var(--line); border-radius: 24px; cursor: pointer; transition: .25s; }
.sw i::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #9b97c8; border-radius: 50%; transition: .25s; }
.sw input:checked + i { background: rgba(43, 255, 154, .18); border-color: var(--green); box-shadow: 0 0 14px rgba(43, 255, 154, .4); }
.sw input:checked + i::before { transform: translateX(20px); background: var(--green); box-shadow: 0 0 10px var(--green); }
.sw input:disabled + i { opacity: .4; cursor: not-allowed; }

/* ---------- badge / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: rgba(138, 91, 255, .12); white-space: nowrap; }
.badge.ok { color: var(--green); border-color: rgba(43, 255, 154, .5); background: rgba(43, 255, 154, .1); }
.badge.bad { color: var(--red); border-color: rgba(255, 77, 109, .5); background: rgba(255, 77, 109, .1); }
.badge.warn { color: var(--amber); border-color: rgba(255, 197, 61, .5); background: rgba(255, 197, 61, .1); }
.badge.cy { color: var(--cyan); border-color: rgba(25, 242, 255, .5); background: rgba(25, 242, 255, .08); }
.badge.pk { color: var(--pink); border-color: rgba(255, 61, 240, .5); background: rgba(255, 61, 240, .08); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- statistik ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: .02em; color: #fff; text-shadow: 0 0 14px rgba(138, 91, 255, .8); }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; } .kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; text-align: right; word-break: break-word; }
.ring { position: relative; width: 116px; height: 116px; margin: 0 auto; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .bgc { stroke: rgba(138, 91, 255, .18); } .ring .fg { stroke: var(--cyan); filter: drop-shadow(0 0 6px currentColor); transition: stroke-dashoffset .8s ease; }
.ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 21px; }
.ring .lbl small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .1em; }
.bar { height: 8px; background: rgba(138, 91, 255, .16); border-radius: 8px; overflow: hidden; } .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 10px var(--pink); border-radius: 8px; transition: width .6s; }
canvas.chart { width: 100%; height: 130px; display: block; }

/* ---------- tabel ---------- */
.tablewrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(130, 100, 255, .14); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: rgba(138, 91, 255, .08); position: sticky; top: 0; }
tbody tr:hover { background: rgba(138, 91, 255, .08); } tr:last-child td { border-bottom: 0; }

/* ---------- segmented / tab ---------- */
.seg { display: inline-flex; background: rgba(8, 6, 24, .7); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: .2s; }
.seg button.on { background: linear-gradient(110deg, rgba(25, 242, 255, .25), rgba(255, 61, 240, .25)); color: #fff; box-shadow: 0 0 14px rgba(138, 91, 255, .5); }

/* ---------- layout app ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(8, 6, 24, .72); backdrop-filter: blur(16px); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; z-index: 30; }
.side .brand { padding: 4px 10px 18px; } .side .brand .logo { font-size: 24px; } .side .brand small { display: block; color: var(--muted); letter-spacing: .12em; font-size: 11px; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: .2s; border: 1px solid transparent; cursor: pointer; }
.nav a:hover { color: #fff; background: rgba(138, 91, 255, .12); text-decoration: none; }
.nav a.on { color: #fff; background: linear-gradient(100deg, rgba(25, 242, 255, .16), rgba(255, 61, 240, .14)); border-color: var(--line2); box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(138, 91, 255, .25); }
.nav a .ic { width: 20px; text-align: center; font-size: 17px; }
.side .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; max-width: 1400px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 24px; letter-spacing: .03em; } .top .sub { color: var(--muted); font-size: 13px; }
.burger { display: none; }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 197, 61, .08); border-color: rgba(255, 197, 61, .5); color: #ffe7a8; margin-bottom: 16px; }
.notice.info { background: rgba(25, 242, 255, .07); border-color: rgba(25, 242, 255, .4); color: #c9fbff; }
.notice.err { background: rgba(255, 77, 109, .08); border-color: rgba(255, 77, 109, .5); color: #ffd0d8; }
.empty { text-align: center; padding: 38px 10px; color: var(--muted); }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 2, 12, .72); backdrop-filter: blur(5px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s; }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: #0d0a26; border: 1px solid var(--line2); border-radius: 18px; padding: 22px; box-shadow: 0 0 60px rgba(138, 91, 255, .35); animation: pop .2s; }
.modal h2 { margin: 0 0 14px; font-size: 18px; } .modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.94); opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast { padding: 12px 16px; border-radius: 12px; background: #120e2e; border: 1px solid var(--line2); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: slide .25s; max-width: 380px; }
.toast.ok { border-color: var(--green); box-shadow: 0 0 18px rgba(43, 255, 154, .3); } .toast.err { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 77, 109, .35); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--cyan); animation: rot .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 50px; color: var(--muted); }

/* ---------- konsol ---------- */
.console { background: #04030c; border: 1px solid var(--line); border-radius: 12px; padding: 12px; height: 460px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.console div { white-space: pre-wrap; word-break: break-word; } .console .t { color: #5b5790; margin-right: 8px; }
.console .warn { color: var(--amber); } .console .error { color: var(--red); } .console .info { color: var(--cyan); } .console .log { color: #d8d6ff; }

/* ---------- fitur/pengaturan list ---------- */
.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 6, 24, .45); }
.item .grow .ttl { font-weight: 700; word-break: break-word; } .item .grow .desc { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.list { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cmdcard { padding: 14px; } .cmdcard .name { font-weight: 800; color: var(--cyan); font-family: var(--mono); word-break: break-all; }
.rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: rgba(138, 91, 255, .2); border: 1px solid var(--line2); flex: none; }
.rank.r1 { background: rgba(255, 197, 61, .2); border-color: var(--amber); color: var(--amber); box-shadow: 0 0 14px rgba(255, 197, 61, .5); }
.rank.r2 { color: #dfe7ff; border-color: #cfd8ff; } .rank.r3 { color: #ffb98a; border-color: #ffb98a; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 440px; }
.login .head { text-align: center; margin-bottom: 22px; } .login .head .logo { font-size: 44px; } .login .head p { color: var(--muted); margin: 6px 0 0; }
.login .card { padding: 26px; border-color: var(--line2); box-shadow: 0 0 50px rgba(138, 91, 255, .25), 0 20px 60px rgba(0, 0, 0, .5); }
.login .seg { display: flex; width: 100%; margin-bottom: 20px; } .login .seg button { flex: 1; }
.err-msg { color: #ffb3c0; background: rgba(255, 77, 109, .1); border: 1px solid rgba(255, 77, 109, .45); padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.ok-msg { color: #b9ffd9; background: rgba(43, 255, 154, .08); border: 1px solid rgba(43, 255, 154, .4); padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }
@keyframes flick { 0%, 19%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 21%, 63% { opacity: .55; } }
.login .head .logo { animation: flick 5s infinite; }

/* ---------- join grup ---------- */
.joinrow { display: grid; grid-template-columns: 2.2fr .8fr 1.1fr auto; gap: 10px; align-items: end; }
.joinrow label.f { margin-bottom: 0; }

/* ---------- responsif ---------- */
@media (max-width: 860px) { .joinrow { grid-template-columns: 1fr 1fr; } .joinrow .lnk, .joinrow button { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-102%); transition: transform .25s; width: 270px; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
  .side.open { transform: none; }
  .burger { display: inline-flex; }
  .main { padding: 16px 14px 70px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .top h1 { font-size: 20px; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 25; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
