.admin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  gap: 0;
}

.admin-sidebar {
  padding: 1.5rem 1rem;
  border-radius: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-sub { font-size: .75rem; color: var(--muted); margin-bottom: 1rem; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.admin-sidebar nav a {
  padding: .55rem .75rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .88rem;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(139,61,255,.12); color: #fff;
}
.admin-user { font-size: .75rem; color: var(--muted); margin-top: auto; }

.admin-main { padding: 1.5rem 2rem 3rem; overflow-x: auto; }
.admin-header { margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.5rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card { padding: 1.25rem; text-align: center; }
.stat-card span { display: block; font-size: 2rem; font-weight: 800; color: var(--accent2); }
.stat-card label { font-size: .75rem; color: var(--muted); }
.stat-card.active span { color: #6ee7b7; }
.stat-card.expired span { color: #fca5a5; }

.admin-panel { padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-panel h2 { font-size: 1rem; margin-bottom: 1rem; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem 1rem;
}
.grid-form label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .3rem; }
.grid-form input {
  width: 100%; padding: .55rem .75rem; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(0,0,0,.25); color: #fff; font-family: inherit;
}
.grid-form .span2 { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th, .admin-table td {
  padding: .65rem .5rem; text-align: right; border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--muted); font-size: .75rem; font-weight: 700; }
.admin-table code {
  background: rgba(139,61,255,.12); padding: .15rem .4rem; border-radius: 6px; font-size: .78rem;
}
.row-off { opacity: .55; }
.row-expired { background: rgba(239,68,68,.04); }

.days-badge {
  display: block; font-size: .65rem; margin-top: .15rem;
}
.days-badge.ok { color: #6ee7b7; }
.days-badge.warn { color: #fcd34d; }
.days-badge.bad { color: #fca5a5; }

.pill {
  display: inline-block; padding: .2rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700;
}
.pill.on { background: rgba(16,185,129,.15); color: #6ee7b7; }
.pill.off { background: rgba(239,68,68,.12); color: #fca5a5; }
.pill.expired { background: rgba(245,158,11,.12); color: #fcd34d; }

.actions-cell { white-space: nowrap; }
.inline-form { display: inline; }
.btn-xs {
  display: inline-block; padding: .25rem .45rem; border-radius: 8px; font-size: .68rem;
  border: 1px solid var(--border); background: rgba(255,255,255,.04); color: #fff;
  cursor: pointer; font-family: inherit; margin-left: .2rem;
}
.btn-xs.accent { border-color: rgba(139,61,255,.4); background: rgba(139,61,255,.15); }
.btn-xs.wa { border-color: rgba(37,211,102,.3); }
.btn-xs.danger { border-color: rgba(239,68,68,.3); color: #fca5a5; }

.more-actions { display: inline-block; position: relative; }
.more-actions summary { list-style: none; }
.more-menu {
  position: absolute; left: 0; top: 100%; z-index: 10;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .75rem; min-width: 200px; margin-top: .25rem;
}
.more-menu input {
  width: 100%; margin-bottom: .5rem; padding: .4rem; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0,0,0,.3); color: #fff;
}
.admin-table .empty { text-align: center; color: var(--muted); padding: 2rem; }

.file-hint { font-size: .75rem; margin-top: .35rem; }

.upload-progress-wrap {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 61, 255, .35);
  background: rgba(139, 61, 255, .08);
}
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
  font-size: .88rem;
  font-weight: 700;
}
.upload-progress-head span:last-child {
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}
.upload-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b3dff, #6366f1);
  transition: width .25s ease;
}
.upload-progress-detail {
  margin-top: .5rem;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

#release-submit-btn:disabled {
  opacity: .65;
  cursor: wait;
}

@media (max-width: 800px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar { height: auto; position: relative; }
}
