/* SkaiaCraft Admin Dashboard */
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Segoe UI',system-ui,sans-serif;background:#0f1117;color:#e2e8f0;min-height:100vh}

/* ── Header ── */
header{background:#1a1d27;border-bottom:1px solid #2d3748;padding:0 1.5rem;
  display:flex;align-items:center;gap:1rem;height:52px;position:sticky;top:0;z-index:10}
.logo{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:.92rem;
  color:#e2e8f0;white-space:nowrap;text-decoration:none;flex-shrink:0}
.logo-img{width:24px;height:24px;border-radius:4px;object-fit:contain;flex-shrink:0}
.logo-sub{color:#4299e1;font-weight:400}
nav{display:flex;gap:.15rem;margin-left:.5rem}
.nav-link{padding:.3rem .75rem;border-radius:5px;font-size:.78rem;color:#718096;
  text-decoration:none;transition:background .12s,color .12s;white-space:nowrap}
.nav-link:hover{background:#2d3748;color:#e2e8f0}
.nav-active{background:#2d3748;color:#e2e8f0;font-weight:600}
.header-right{display:flex;align-items:center;gap:.6rem;margin-left:auto;
  font-size:.78rem;color:#a0aec0;flex-shrink:0}

/* ── Layout ── */
main{padding:1.25rem 1.75rem;max-width:1280px;margin:0 auto}
footer{text-align:center;padding:1.25rem;color:#4a5568;font-size:.68rem}
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.25rem}
.page-header h1{font-size:1.1rem;font-weight:700}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;margin-top:.25rem}
@media(max-width:900px){.two-col{grid-template-columns:1fr}
  header{padding:0 1rem}nav{display:none}}

/* ── Section Headers ── */
.section-header{font-size:.65rem;color:#718096;text-transform:uppercase;letter-spacing:.1em;
  margin:1.25rem 0 .5rem;display:flex;align-items:center;gap:.4rem}
.count-badge{background:#2d3748;color:#a0aec0;font-size:.65rem;padding:.08rem .4rem;
  border-radius:9999px;font-weight:600;text-transform:none;letter-spacing:0}

/* ── Health Bar ── */
.health-bar{background:#1a1d27;border:1px solid #2d3748;border-radius:8px;
  padding:.6rem 1.1rem;display:flex;flex-wrap:wrap;gap:1.25rem;
  margin-bottom:.75rem;align-items:center}
.health-item{text-align:center;min-width:60px}
.h-label{font-size:.56rem;color:#718096;text-transform:uppercase;
  letter-spacing:.07em;margin-bottom:.15rem}
.h-val{font-size:.9rem;font-weight:700;color:#e2e8f0}
.h-val.green{color:#68d391}.h-val.yellow{color:#f6e05e}.h-val.red{color:#fc8181}

/* ── Cards ── */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.5rem}
.card{background:#1a1d27;border:1px solid #2d3748;border-radius:7px;padding:.8rem .9rem}
.card .label{font-size:.65rem;color:#718096;margin-bottom:.15rem}
.card .value{font-size:1.3rem;font-weight:700;color:#fc8181}
.card.ok .value{color:#68d391}

/* ── Tables ── */
table{width:100%;border-collapse:collapse;background:#1a1d27;border-radius:7px;overflow:hidden}
th{background:#13151c;padding:.45rem .9rem;text-align:left;
  font-size:.6rem;color:#718096;text-transform:uppercase;letter-spacing:.06em}
td{padding:.42rem .9rem;border-top:1px solid #1f2330;font-size:.78rem}
tr.clickable:hover td{background:#1f2330;cursor:pointer}

/* ── Log Box ── */
.log-box{background:#0d0f14;border:1px solid #2d3748;border-radius:7px;padding:.65rem;
  font-family:'JetBrains Mono','Fira Code','Consolas',monospace;font-size:.66rem;
  max-height:320px;overflow-y:auto;color:#a0aec0;line-height:1.6}
.log-line{border-bottom:1px solid #161920;padding:.15rem 0}
.log-line:last-child{border:none}
.log-line.err{color:#fc8181}.log-line.audit{color:#76e4f7}.log-line.hidden{display:none}

/* ── Badges ── */
.badge{font-size:.58rem;font-weight:700;padding:.1rem .42rem;border-radius:9999px;letter-spacing:.04em}
.badge-on{background:#1c4532;color:#68d391}
.badge-off{background:#2d1515;color:#fc8181}
.badge-yellow{background:#2d2500;color:#f6e05e}
#sse-badge{font-size:.6rem;font-weight:700;padding:.15rem .45rem;border-radius:9999px}

/* ── Buttons ── */
.btn-sm{font-size:.68rem;background:#2d3748;color:#a0aec0;border:none;
  padding:.2rem .55rem;border-radius:5px;cursor:pointer;
  text-decoration:none;display:inline-block;transition:background .12s,color .12s}
.btn-sm:hover{background:#3a4558;color:#e2e8f0}
.btn-danger{background:#2d1515 !important;color:#fc8181 !important;border:1px solid #5a1e1e}
.btn-danger:hover{background:#742a2a !important;color:#fff !important}
.btn-warn{background:#2d2500 !important;color:#f6e05e !important;border:1px solid #5a4a00}
.btn-warn:hover{background:#7b5e00 !important;color:#fff !important}
.btn-primary{background:#1a365d !important;color:#90cdf4 !important;border:1px solid #2b6cb0}
.btn-primary:hover{background:#2b6cb0 !important;color:#fff !important}

/* ── Misc ── */
.muted{color:#718096}.err{color:#fc8181}

/* ── Toggle Switch ── */
.toggle{position:relative;width:32px;height:18px;cursor:pointer;flex-shrink:0}
.toggle input{opacity:0;width:0;height:0}
.slider{position:absolute;inset:0;background:#4a5568;border-radius:18px;transition:.2s}
.slider:before{content:'';position:absolute;width:12px;height:12px;left:3px;bottom:3px;
  background:white;border-radius:50%;transition:.2s}
input:checked+.slider{background:#276749}
input:checked+.slider:before{transform:translateX(14px)}

/* ── Online Grid ── */
.online-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.5rem;margin-bottom:.25rem}
.online-card{background:#1a1d27;border:1px solid #2d3748;border-radius:7px;
  padding:.6rem .85rem;display:flex;align-items:center;gap:.65rem;
  cursor:pointer;transition:border-color .12s}
.online-card:hover{border-color:#4299e1}
.online-dot{width:7px;height:7px;border-radius:50%;background:#68d391;
  flex-shrink:0;box-shadow:0 0 5px #68d391}
.online-name{font-weight:600;font-size:.82rem;color:#e2e8f0}
.online-meta{font-size:.65rem;color:#718096;margin-top:.08rem}
.online-info{flex:1;min-width:0;overflow:hidden}
.flag-badge{background:#2d1515;color:#fc8181;font-size:.6rem;font-weight:700;
  padding:.08rem .32rem;border-radius:4px;white-space:nowrap;flex-shrink:0}

/* ── Status Dots ── */
.status-dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:.3rem;flex-shrink:0}
.dot-online{background:#68d391;box-shadow:0 0 4px #68d391}
.dot-offline{background:#4a5568}

/* ── Login Page ── */
.login-wrap{display:flex;align-items:center;justify-content:center;min-height:100vh}
.login-card{background:#1a1d27;border:1px solid #2d3748;border-radius:12px;
  padding:2rem 1.75rem;width:300px;text-align:center}
.login-logo{width:52px;height:52px;border-radius:8px;object-fit:contain;margin-bottom:.85rem}
.login-card h1{color:#e2e8f0;font-size:1rem;font-weight:700;margin-bottom:.15rem}
.login-sub{color:#718096;font-size:.76rem;margin-bottom:1.4rem}
.login-card input{width:100%;background:#111318;border:1px solid #2d3748;
  color:#e2e8f0;border-radius:6px;padding:.6rem .8rem;font-size:.85rem;
  margin-bottom:.7rem;display:block}
.login-card input:focus{outline:none;border-color:#4299e1}
.login-card button{width:100%;background:#4299e1;color:white;border:none;
  border-radius:6px;padding:.6rem;font-size:.85rem;font-weight:600;cursor:pointer}
.login-card button:hover{background:#3182ce}
.login-card button:disabled{background:#4a5568;cursor:not-allowed}
.login-error{color:#fc8181;font-size:.72rem;margin-bottom:.7rem;background:#2d1515;
  border:1px solid #742a2a;padding:.3rem .55rem;border-radius:5px;text-align:left}

/* ── Player Profile ── */
.profile-hero{background:#1a1d27;border:1px solid #2d3748;border-radius:8px;
  padding:1.1rem 1.3rem;margin-bottom:1.1rem;
  display:flex;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.profile-avatar{width:48px;height:48px;background:#2d3748;border-radius:7px;
  display:flex;align-items:center;justify-content:center;font-size:1.5rem;flex-shrink:0}
.profile-name{font-size:1.05rem;font-weight:700;color:#e2e8f0;
  display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.profile-uuid{font-size:.65rem;color:#4a5568;font-family:monospace;
  margin-top:.12rem;word-break:break-all}
.profile-badges{display:flex;gap:.3rem;flex-wrap:wrap;margin-top:.4rem}
.profile-actions{display:flex;gap:.35rem;flex-wrap:wrap;margin-left:auto;align-self:flex-start}

/* ── Breakdown Grid ── */
.breakdown-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.4rem;margin-bottom:1.1rem}
.bk-item{background:#1a1d27;border:1px solid #2d3748;border-radius:6px;
  padding:.45rem .7rem;display:flex;justify-content:space-between;
  align-items:center;font-size:.75rem}
.bk-count{font-weight:700;color:#fc8181}.bk-count.zero{color:#4a5568}

/* ── Staff Notes ── */
.note-box{background:#1a1d27;border:1px solid #2d3748;border-radius:7px;
  padding:.8rem .9rem;margin-bottom:1.1rem}
.note-box textarea{width:100%;background:#111318;border:1px solid #2d3748;
  color:#e2e8f0;border-radius:5px;padding:.5rem .7rem;font-size:.78rem;
  resize:vertical;min-height:64px;font-family:inherit;margin-bottom:.5rem;display:block}
.note-box textarea:focus{outline:none;border-color:#4299e1}

/* ── Punish Modal ── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.8);z-index:100;
  display:flex;align-items:center;justify-content:center;padding:1rem}
.modal{background:#1a1d27;border:1px solid #2d3748;border-radius:9px;
  padding:1.25rem;width:340px;max-width:100%}
.modal h3{font-size:.9rem;font-weight:700;margin-bottom:.8rem;color:#e2e8f0}
.modal input{width:100%;background:#111318;border:1px solid #2d3748;
  color:#e2e8f0;border-radius:5px;padding:.5rem .7rem;font-size:.8rem;
  margin-bottom:.6rem;display:block}
.modal input:focus{outline:none;border-color:#4299e1}
.modal-actions{display:flex;gap:.4rem;justify-content:flex-end}

/* ── Protections Grid ── */
.prot-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:.5rem}
.prot-card{background:#1a1d27;border:1px solid #2d3748;border-radius:7px;
  padding:.7rem .9rem;display:flex;align-items:center;justify-content:space-between;
  gap:.75rem;transition:border-color .12s}
.prot-card:hover{border-color:#4299e1}
.prot-name{font-size:.8rem;font-weight:500;color:#e2e8f0}
.prot-count{font-size:.65rem;color:#718096;margin-top:.1rem}
