:root{
  --bg:#0a0f0d; --card:#111815; --border:#1f2a25; --muted:#8a9a93;
  --primary:#22d3a6; --primary-ink:#04221a; --amber:#fbbf24; --red:#f87171; --green:#34d399;
  --text:#e7efeb;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:'Hind Siliguri',system-ui,Arial,sans-serif;
  -webkit-font-smoothing:antialiased; line-height:1.5;
}
.wrap{max-width:460px; margin:0 auto; padding:24px 16px 64px; display:flex; flex-direction:column; gap:22px}

.hero{text-align:center; margin-top:12px}
.badge{
  width:64px;height:64px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  font-size:30px; background:rgba(34,211,166,.12); border:1px solid rgba(34,211,166,.25);
  box-shadow:0 0 24px rgba(34,211,166,.18); margin-bottom:10px;
}
.hero h1{margin:6px 0 2px; font-size:30px; font-weight:700; letter-spacing:-.5px}
.sub{color:var(--primary); font-weight:600; margin:0}

.card{
  background:var(--card); border:1px solid var(--border); border-radius:18px;
  padding:20px; box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.input-card label{display:block; text-align:center; color:var(--muted); font-weight:600; font-size:14px; margin-bottom:10px}
input[type=text],input[type=password]{
  width:100%; background:var(--bg); color:var(--text);
  border:1px solid var(--border); border-radius:12px; padding:14px 14px;
  font-size:18px; outline:none; transition:.15s; font-family:inherit;
}
.input-card input{ text-align:center; font-size:24px; font-weight:700; letter-spacing:.15em }
input:focus{border-color:var(--primary); box-shadow:0 0 0 3px rgba(34,211,166,.2)}

.btn{
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:100%; border:none; border-radius:12px; padding:14px;
  font-size:16px; font-weight:700; cursor:pointer; text-decoration:none;
  font-family:inherit; transition:.15s; margin-top:14px;
}
.btn-primary{background:var(--primary); color:var(--primary-ink)}
.btn-primary:hover{filter:brightness(1.05); box-shadow:0 0 20px rgba(34,211,166,.3)}
.btn-primary:disabled{opacity:.5; cursor:default; box-shadow:none}
.btn-ghost{background:#16201c; color:var(--text); border:1px solid var(--border)}
.btn-ghost:hover{background:#1b2722}

#result{display:flex; flex-direction:column; gap:16px}
.actions{display:flex; flex-direction:column; gap:0}
.actions .btn{margin-top:0}
.actions .btn + .btn{margin-top:12px}

.status{text-align:center}
.status h2{margin:12px 0 6px; font-size:22px}
.status p{margin:0; color:var(--muted)}
.status-ok{background:#0f2922; border-color:rgba(52,211,153,.3)}
.status-ok h2{color:var(--green)}
.status-bad{background:#2a1318; border-color:rgba(248,113,113,.3)}
.status-bad h2{color:var(--red)}
.status-bad p{color:#fca5a5}
.status-icon{width:60px;height:60px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:30px;font-weight:700}
.status-icon.ok{background:rgba(52,211,153,.18);color:var(--green);border:1px solid rgba(52,211,153,.3)}
.status-icon.bad{background:rgba(248,113,113,.18);color:var(--red);border:1px solid rgba(248,113,113,.3)}

.note{text-align:center; font-weight:500}
.note-amber{background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.3); color:#fde68a}
.note-red{background:rgba(248,113,113,.1); border-color:rgba(248,113,113,.3); color:#fca5a5}
.note-green{background:rgba(52,211,153,.1); border-color:rgba(52,211,153,.3); color:#a7f3d0}

.member .member-head{display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:8px}
.member-head b{font-size:18px; letter-spacing:.08em}
.uid-wrap{display:inline-flex; align-items:center; gap:10px}
.copy-btn{cursor:pointer; border:1px solid var(--border); background:rgba(255,255,255,.05); color:var(--text); border-radius:8px; padding:5px 10px; font-size:12px; font-weight:600; font-family:inherit; white-space:nowrap; transition:.15s}
.copy-btn:hover{border-color:var(--primary); color:var(--primary)}
.copy-btn.copied{border-color:var(--green); color:var(--green); background:rgba(52,211,153,.12)}
.member .row{display:flex; justify-content:space-between; padding:7px 0; font-size:15px}
.member .row span{color:var(--muted)}
.member .daytag{display:flex; align-items:center; gap:6px; margin:-2px 0 10px; font-size:14px; color:var(--primary); font-weight:700}
.green{color:var(--green)} .amber{color:var(--amber)} .red{color:var(--red)} .muted{color:var(--muted)}
.small{font-size:13px}

.hist-controls{display:flex; flex-direction:column; gap:0}
.seg{display:flex; gap:6px; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:5px}
.seg button{flex:1; background:none; border:none; color:var(--muted); font-weight:700; padding:9px; border-radius:7px; cursor:pointer; font-family:inherit; font-size:14px}
.seg button.active{background:#16201c; color:#fff}
.hist-controls .btn{margin-top:12px}

.chips{display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 2px}
.chip{font-size:12px; font-weight:600; padding:4px 9px; border-radius:7px; border:1px solid}
.chip.green{background:rgba(52,211,153,.1); border-color:rgba(52,211,153,.25); color:var(--green)}
.chip.red{background:rgba(248,113,113,.1); border-color:rgba(248,113,113,.25); color:var(--red)}
.chip.amber{background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.25); color:var(--amber)}

.totals{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0}
.tot{background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:8px; display:flex; flex-direction:column; gap:2px}
.tot small{color:var(--muted); font-size:11px}
.tot b{font-size:14px}

.htable{margin-top:8px}
.lvl-badge{display:inline-flex; align-items:center; gap:8px; margin:2px 0 12px; padding:7px 16px; border-radius:999px; background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.35); color:var(--amber); font-size:14px; font-weight:600}
.lvl-badge b{font-size:17px; letter-spacing:.03em}
.hhead,.hrow{display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:6px; align-items:center}
.hhead{padding:8px 10px; font-size:11px; color:var(--muted); text-transform:uppercase; border-bottom:1px solid var(--border)}
.hrow{padding:10px; border-radius:10px; border:1px solid var(--border); margin-top:8px}
.hrow.on{background:rgba(34,211,166,.05); border-color:rgba(34,211,166,.25)}
.hrow.off{background:rgba(30,41,40,.4); opacity:.7}
.hrow .hd{display:flex; flex-direction:column}
.hrow .hd small{font-size:10px}
.hrow .hc{text-align:center; font-weight:700; font-size:14px}

.center{text-align:center}
.center small{display:block; margin-top:4px}
h3{margin:0 0 8px}

.spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;display:inline-block;animation:spin .7s linear infinite;vertical-align:middle}
.spinner.big{width:30px;height:30px;border-width:3px;border-top-color:var(--primary);display:block;margin:0 auto 10px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ===== ADMIN ===== */
body.admin{background:var(--bg)}
.awrap{max-width:640px; margin:0 auto; padding:24px 16px 64px; display:flex; flex-direction:column; gap:18px}
.atitle{text-align:center; margin:8px 0}
.abar{display:flex; gap:10px}
.abar .btn{margin-top:0; width:auto; flex:1}
.admin .card label{display:block; color:var(--muted); font-weight:600; font-size:14px; margin:12px 0 6px}
.admin .card h2{margin:0 0 6px; font-size:18px}
.admin .card .btn{width:auto; display:inline-flex; margin-right:8px}
.admin code{background:var(--bg); border:1px solid var(--border); padding:2px 6px; border-radius:6px; font-size:12px; word-break:break-all}
.logtable,.lhead,.lrow{font-size:13px}
.lhead,.lrow{display:grid; grid-template-columns:1.3fr .6fr .6fr .8fr 1.6fr; gap:6px; padding:8px 6px}
.lhead{color:var(--muted); border-bottom:1px solid var(--border); font-weight:600}
.lrow{border-bottom:1px solid rgba(31,42,37,.5)}
