:root {
  --bg: #0f0f0f;
  --panel: #181818;
  --panel-2: #222;
  --text: #f4f4f4;
  --muted: #aaa;
  --line: #303030;
  --brand: #ff2d2d;
  font-family: Inter, Roboto, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #111;
}
.brand img { width: 160px; margin-bottom: 28px; }
.admin-side nav { display: grid; gap: 8px; }
.admin-side a:not(.brand) {
  padding: 13px 14px;
  border-radius: 10px;
  color: #ddd;
  font-weight: 800;
}
.admin-side a.active, .admin-side a:hover { background: #272727; }

.admin-main { padding: 28px; max-width: 1320px; width: 100%; }
.admin-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.eyebrow { color: #ffaaaa; text-transform: uppercase; font-size: 12px; font-weight: 900; }
h1, h2 { margin: 6px 0 0; }

input, textarea, select {
  width: 100%;
  color: var(--text);
  background: #111;
  border: 1px solid #363636;
  border-radius: 10px;
  padding: 12px 13px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: #666; }
#adminSearch { max-width: 380px; border-radius: 999px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat, .editor, .table-wrap {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}
.stat { padding: 18px; }
.stat strong { display: block; font-size: 28px; margin-bottom: 4px; }
.stat span { color: var(--muted); }

.editor { padding: 18px; margin-bottom: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
label { display: grid; gap: 8px; color: #ddd; font-weight: 800; }
.span-2 { grid-column: 1 / -1; }
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #141414;
  border: 1px solid #303030;
  padding: 12px;
  border-radius: 10px;
}
.toggle input { width: auto; accent-color: var(--brand); }
.preview {
  margin-top: 14px;
  min-height: 130px;
  display: grid;
  place-items: center;
  background: #101010;
  border: 1px dashed #3a3a3a;
  border-radius: 12px;
  color: var(--muted);
  overflow: hidden;
}
.preview img { width: 100%; max-height: 260px; object-fit: cover; display: block; }

.form-actions { display: flex; gap: 10px; margin-top: 14px; }
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 900;
}
.primary { background: var(--brand); color: white; }
.ghost { background: #2a2a2a; color: var(--text); }
.danger { background: #3a1515; color: #ff9f9f; }
.message { color: #9fffb5; min-height: 20px; }

.table-wrap { padding: 18px; overflow-x: auto; }
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.video-row {
  display: grid;
  grid-template-columns: 130px minmax(230px, 1fr) 120px 110px 210px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.video-row img {
  width: 130px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
}
.video-title { font-weight: 900; margin-bottom: 5px; }
.muted { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #263828;
  color: #abffb7;
  font-weight: 900;
  font-size: 12px;
}
.badge.private { background: #3b2525; color: #ffb2b2; }
.row-actions { display: flex; gap: 8px; justify-content: end; flex-wrap: wrap; }
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { grid-template-columns: repeat(3, 1fr); }
  .admin-main { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .video-row { grid-template-columns: 110px minmax(180px, 1fr); }
  .video-row > :nth-child(n+3) { grid-column: 2; }
  .row-actions { justify-content: start; }
}

@media (max-width: 640px) {
  .admin-top { align-items: stretch; flex-direction: column; }
  #adminSearch { max-width: none; }
  .form-grid, .stats { grid-template-columns: 1fr; }
  .video-row { grid-template-columns: 1fr; }
  .video-row img { width: 100%; }
  .video-row > :nth-child(n+3) { grid-column: auto; }
}
