*{box-sizing:border-box}
body.admin{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:#0b1220;
  color:#e8eefc;
}
a{color:#9ad0ff}
.topbar{
  display:flex; justify-content:space-between; align-items:center;
  padding: 14px 16px;
  background:#0f1a31;
  border-bottom:1px solid rgba(255,255,255,.08);
  position:sticky; top:0;
}
.toplink{margin-left:12px; text-decoration:none; opacity:.9}
.toplink:hover{opacity:1}
.adminwrap{
  width:min(1050px, calc(100% - 28px));
  margin: 18px auto 40px;
}
.tabs{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-bottom: 14px;
}
.tabs a{
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  text-decoration:none;
  border:1px solid rgba(255,255,255,.10);
  color:#e8eefc;
}
.tabs a.on{background: rgba(154,208,255,.18); border-color: rgba(154,208,255,.35)}
.notice,.alert{
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0 14px;
  border:1px solid rgba(255,255,255,.12);
}
.notice{background: rgba(80, 200, 120, .14)}
.alert{background: rgba(255, 120, 120, .14)}
.panel{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 14px 14px 16px;
}
h2{margin: 4px 0 10px}
h3{margin: 6px 0 10px}
hr{border:0; border-top:1px solid rgba(255,255,255,.10); margin: 14px 0}
label{display:block; font-size: 14px; margin-bottom: 10px}
input,select,textarea{
  width:100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color:#e8eefc;
  padding: 10px 10px;
  border-radius: 12px;
  outline:none;
}
textarea{resize:vertical}
small{opacity:.8}
.chk{display:flex; align-items:center; gap:10px; margin-top: 6px}
.chk input{width:auto}
button,.btn{
  background: #1d7bd7;
  color:#fff;
  border:0;
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
}
button:hover{filter:brightness(1.05)}
button:disabled{opacity:.5; cursor:not-allowed}
button.ghost{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
}
button.danger{
  background: rgba(255,0,0,.25);
  border:1px solid rgba(255,0,0,.35);
}
.muted{opacity:.75}
.card{
  width:min(520px, calc(100% - 28px));
  margin: 52px auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 18px;
}
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.grid .span2{grid-column: 1 / -1}
@media (max-width: 720px){
  .grid{grid-template-columns: 1fr}
}
@media (max-width: 720px){
  .row{flex-wrap: wrap; align-items:flex-start}
  .row__left{min-width:0; width:100%}
  .row__mid{width:auto}
  .row__right{width:100%; justify-content:flex-end; flex-wrap:wrap}
}
@media (max-width: 520px){
  .row__right{justify-content:flex-start}
  .row__right button{padding: 10px 12px}
  .thumbprev{height: 44px; width: 44px}
}

.dangerbox{
  margin-top: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,0,0,.25);
  background: rgba(255,0,0,.06);
  padding: 12px 12px;
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:space-between;
}
.dangerbox form{margin:0}
.addbox{
  margin: 0 0 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
}
.addbox summary{cursor:pointer; font-weight: 800; margin-bottom: 8px}
.list{display:flex; flex-direction:column; gap: 10px; margin-top: 12px}
.row{
  display:flex; gap: 12px; align-items:center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.row__left{flex:1}
.row__mid{width:70px; display:flex; justify-content:center}
.row__right{display:flex; gap:6px; align-items:center}
.inline{display:inline}
.meta{margin-top:6px; font-size:12px; opacity:.8; display:flex; gap:10px; flex-wrap:wrap}
.pill{padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12)}
.thumbprev{width:56px;height:56px; object-fit:cover; border-radius: 12px; border:1px solid rgba(255,255,255,.10)}
.edit{
  margin-top: 8px;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(154,208,255,.25);
  background: rgba(154,208,255,.06);
}
.socialgrid{display:flex; flex-direction:column; gap:10px}
.socialrow{display:grid; grid-template-columns: 1fr 2fr auto; gap:10px; align-items:center}
@media (max-width: 720px){
  .socialrow{grid-template-columns: 1fr}
}
.medialist{display:flex; flex-direction:column; gap:10px; margin-top: 12px}
.mediaitem{
  display:grid; grid-template-columns: 80px 1fr auto;
  gap: 10px; align-items:center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
}
.mediaitem img{width:70px;height:70px; object-fit:cover; border-radius: 12px}
.badge{
  width:70px;height:70px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  font-weight: 800;
  opacity:.8;
}

/* ---------------- Stats ---------------- */
.stats-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}
.statcard{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:12px}
.statcard .k{font-size:12px;opacity:.75}
.statcard .v{font-size:22px;font-weight:800;margin-top:4px}

.bars{display:flex;flex-direction:column;gap:8px}
.barrow{display:grid;grid-template-columns:120px 1fr 52px;gap:10px;align-items:center}
.barlabel{font-family:ui-monospace, Menlo, Consolas, monospace;font-size:12px;opacity:.9}
.barwrap{height:10px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden}
.bar{height:100%;background:rgba(255,255,255,.55)}
.barval{text-align:right;font-weight:700;font-variant-numeric:tabular-nums}

.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
.toplist{list-style:none;padding:0;margin:0}
.toplist li{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.07)}
.toplist li.muted{opacity:.7}

@media (max-width: 720px){
  .stats-cards{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr}
  .barrow{grid-template-columns:100px 1fr 44px}
}


.wysiwyg{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.wysiwyg__toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:8px;
  border-radius:12px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
}
.wysiwyg__sizewrap{
  display:flex;
  align-items:center;
  margin:0;
}
.wysiwyg__size{
  width:auto;
  min-width:130px;
  height:40px;
  padding:8px 34px 8px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  color:#e8eefc;
}
.wysiwyg__size:focus{
  border-color:rgba(154,208,255,.5);
}
.wysiwyg__btn{
  min-width:42px;
  padding:8px 10px;
}
.wysiwyg__sep{
  width:1px;
  align-self:stretch;
  background:rgba(255,255,255,.12);
  margin:0 2px;
}
.wysiwyg__editor{
  min-height:140px;
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  color:#e8eefc;
  outline:none;
  line-height:1.55;
}
.wysiwyg__editor:focus{
  border-color:rgba(154,208,255,.45);
  box-shadow:0 0 0 3px rgba(154,208,255,.12);
}
.wysiwyg__editor:empty::before{
  content:attr(data-placeholder);
  opacity:.55;
}
.wysiwyg__editor p,
.wysiwyg__editor div{
  margin:0 0 .65em;
}
.wysiwyg__editor p:last-child,
.wysiwyg__editor div:last-child{
  margin-bottom:0;
}

.sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}
