.admin-top,
.admin {
  position: relative;
  z-index: 1;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 24px 8px;
  max-width: 1100px;
  margin: 0 auto;
}
.admin-title {
  margin: 2px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-title span {
  color: var(--brand);
}
.tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}
.lead {
  color: var(--dim);
  margin: 8px 0 12px;
  max-width: 70ch;
}
.lead strong {
  color: var(--text);
}
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid transparent;
  border-image: var(--hazard-stripes) 0 0 0 6;
  font-size: 14px;
  color: var(--dim);
}
.notice img {
  width: 54px;
  flex: none;
}
.notice strong {
  color: var(--hazard);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.stat-value {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.3;
}
.stat-value small {
  font-family: var(--font);
  font-size: 14px;
  color: var(--placeholder);
}
.stat.zero .stat-value {
  color: var(--red);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg button {
  background: var(--card);
  border: 0;
  border-right: 1px solid var(--line);
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--dim);
}
.seg button:last-child {
  border-right: 0;
}
.seg button:hover {
  background: var(--hover);
  color: var(--text);
}
.seg button[aria-selected='true'] {
  background: rgba(231, 0, 255, 0.12);
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.seg button span {
  font-weight: 400;
  color: var(--placeholder);
  margin-left: 4px;
}
#search {
  flex: 1 1 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font: inherit;
}
#search::placeholder {
  color: var(--placeholder);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px 8px 8px;
  transition:
    opacity 0.15s,
    border-color 0.15s;
}
.row.off {
  opacity: 0.6;
  border-style: dashed;
}
.row.off .thumb img {
  filter: grayscale(1);
}
.thumb {
  width: 60px;
  height: 80px;
  border-radius: 3px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(231, 0, 255, 0.3), transparent 70%), #120e1c;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb.nophoto img {
  object-fit: contain;
  padding: 6px;
}
.row-main {
  min-width: 0;
}
.row-name {
  font-weight: 600;
  line-height: 1.25;
}
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--placeholder);
}
.tag {
  color: var(--accent);
  border: 1px solid rgba(0, 150, 255, 0.45);
  border-radius: 3px;
  padding: 0 5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}
.row-note {
  font-size: 13px;
  color: var(--dim);
  margin-top: 3px;
}

.switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  min-width: 70px;
}
.switch-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: rgba(64, 192, 87, 0.25);
  border: 1px solid var(--green);
  transition: background 0.15s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 27px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  transition: left 0.15s;
}
.switch[aria-checked='false'] {
  color: var(--red);
}
.switch[aria-checked='false'] .switch-track {
  background: rgba(250, 82, 82, 0.15);
  border-color: var(--red);
}
.switch[aria-checked='false'] .switch-track::after {
  left: 3px;
  background: var(--red);
}
.switch:disabled {
  cursor: wait;
  opacity: 0.6;
}

.empty-list {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--placeholder);
  padding: 32px;
}

@media (max-width: 640px) {
  .admin-top,
  .admin {
    padding-left: 16px;
    padding-right: 16px;
  }
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .list {
    grid-template-columns: 1fr;
  }
}
