/* ══════════════════════════════════════════════════════
   Т‑ФИТ · Панель управления · Стили
   Версия 2.0 — Тёмная премиум-тема
══════════════════════════════════════════════════════ */

:root {
  --accent:        #6f00b7;
  --accent-light:  #9b30ff;
  --accent-dim:    rgba(111,0,183,.12);
  --accent-border: rgba(111,0,183,.35);
  --accent-glow:   rgba(111,0,183,.20);
  --bg:            #080808;
  --surface:       #111111;
  --surface2:      #181818;
  --surface3:      #202020;
  --border:        rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.12);
  --text:          #f2f2f2;
  --text-muted:    #888;
  --text-faint:    #444;
  --danger:        #ef4444;
  --danger-dim:    rgba(239,68,68,.12);
  --ok:            #4ade80;
  --ok-dim:        rgba(74,222,128,.12);
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-card:   0 2px 8px rgba(0,0,0,.6), 0 8px 32px rgba(0,0,0,.4);
}

/* ── СБРОС ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════
   ШАПКА
══════════════════════════════════════════════════════ */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 60px;
  background: rgba(8,8,8,.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.admin-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.admin-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-header h1::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent-light);
  flex-shrink: 0;
}
.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

body.admin-menu-open {
  overflow: hidden;
  touch-action: none;
}

/* ══════════════════════════════════════════════════════
   BURGER MENU
════════════════════════════════════════════════════ */
.admin-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 0 -8px 0 0;
  z-index: 210;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.admin-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.admin-burger span + span { margin-top: 5px; }
.admin-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-burger.is-open span:nth-child(2) { opacity: 0; }
.admin-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════
   ОБЁРТКА И КОНТЕЙНЕР
══════════════════════════════════════════════════════ */
.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ══════════════════════════════════════════════════════
   ТАБЫ НАВИГАЦИИ
══════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  position: relative;
}
.admin-tab:hover {
  color: var(--text);
  background: var(--surface2);
}
.admin-tab.is-active {
  color: var(--accent-light);
  background: var(--accent-dim);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px rgba(111,0,183,.10) inset;
}
.admin-tab--right {
  margin-left: auto;
}

/* ══════════════════════════════════════════════════════
   СЕКЦИИ
══════════════════════════════════════════════════════ */
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.admin-section h2 {
  font-size: 1.05rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.admin-section-head,
.admin-subblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-section-head h2,
.admin-subblock-head h3 { margin: 0; }

.admin-section-actions,
.admin-subblock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   ПОЛЯ ФОРМЫ
══════════════════════════════════════════════════════ */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
}

.admin-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.admin-label > span {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.admin-input,
.admin-textarea,
.admin-select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.admin-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}
.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(111,0,183,.15);
  background: var(--surface3);
}
.admin-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.84rem;
  cursor: pointer;
}
.admin-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-light);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   КНОПКИ
══════════════════════════════════════════════════════ */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  touch-action: manipulation;
}
.admin-btn:hover {
  background: var(--surface3);
  border-color: var(--border-strong);
  color: var(--text);
}
.admin-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(111,0,183,.30);
}
.admin-btn--primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 6px 28px rgba(111,0,183,.45);
}
.admin-btn--danger {
  border-color: rgba(239,68,68,.30);
  color: #fca5a5;
  background: var(--danger-dim);
}
.admin-btn--danger:hover {
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.50);
}
.admin-btn--small { padding: 6px 12px; font-size: 0.76rem; }

.admin-btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
  position: relative;
}
.admin-btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.85);
  display: inline-block;
  margin-left: 8px;
  animation: adminSpin .75s linear infinite;
}
@keyframes adminSpin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   КАРТОЧКИ-РЕПИТЕРЫ
══════════════════════════════════════════════════════ */
.admin-repeater-item {
  border: 1px solid rgba(111,0,183,.22);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  background: rgba(111,0,183,.03);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  transition: border-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.admin-repeater-item:hover {
  border-color: rgba(111,0,183,.40);
  box-shadow: 0 4px 20px rgba(0,0,0,.4), 0 0 0 1px rgba(111,0,183,.08) inset;
}
/* Полупрозрачность для скрытых карточек */
.admin-repeater-item.is-hidden-item {
  opacity: 0.45;
}
.admin-repeater-item h3 {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-light);
}

.admin-category-block {
  border: 1px solid rgba(111,0,183,.30);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  background: rgba(111,0,183,.04);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  transition: border-color 0.2s, opacity 0.2s;
}
.admin-category-block:hover {
  border-color: rgba(111,0,183,.45);
}
.admin-category-block.is-hidden-item {
  opacity: 0.45;
}

/* ══════════════════════════════════════════════════════
   ЗАГОЛОВОК КАРТОЧКИ (перетащить / скрыть / удалить)
══════════════════════════════════════════════════════ */
.admin-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.admin-card-head h3 {
  flex: 1;
  min-width: 80px;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-light);
}

/* ══════════════════════════════════════════════════════
   СОРТИРОВКА
══════════════════════════════════════════════════════ */
.sortable-ghost {
  opacity: 0.35;
  border-style: dashed !important;
  background: rgba(111,0,183,.06) !important;
}
.sortable-drag { cursor: grabbing !important; }
.drag-handle {
  cursor: grab;
  padding: 7px 10px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.drag-handle:hover { color: var(--text-muted); border-color: var(--border-strong); }
.drag-handle:active { cursor: grabbing; }

/* ══════════════════════════════════════════════════════
   САББЛОКИ (подсекции с границей)
══════════════════════════════════════════════════════ */
.admin-hide-toggle {
  font-size: 0.76rem !important;
  white-space: nowrap;
  color: var(--text-muted);
}
.admin-subblock {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.015);
  transition: opacity 0.2s;
}
.admin-subblock--off { opacity: 0.50; }
.admin-subblock-head h3 {
  font-size: 0.88rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--accent-light);
}

/* ══════════════════════════════════════════════════════
   ТУЛБАР СНИЗУ
══════════════════════════════════════════════════════ */
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-toolbar--bottom {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}



/* ══════════════════════════════════════════════════════
   ЗОНЫ ЗАГРУЗКИ — ОБНОВЛЁННЫЙ ДИЗАЙН
══════════════════════════════════════════════════════ */
.upload-field { margin-bottom: 16px; }
.upload-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.upload-zone {
  border: 2px dashed rgba(111,0,183,.35);
  border-radius: var(--radius);
  padding: 0;
  text-align: center;
  background: rgba(111,0,183,.04);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.upload-zone.is-dragover {
  border-color: var(--accent-light);
  background: rgba(111,0,183,.12);
}
.upload-zone.is-loading { opacity: 0.6; pointer-events: none; }
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
/* Превью — увеличенное */
.upload-preview-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  position: relative;
}
.upload-preview {
  max-width: 260px;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  margin: 0 auto;
}
.upload-preview-video {
  max-width: 320px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}
/* Оверлей «Заменить» при наведении на превью */
.upload-preview-wrap:has(img):hover::after,
.upload-preview-wrap:has(video):hover::after {
  content: '↑ Заменить';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  letter-spacing: 0.04em;
}
.upload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
  padding: 16px;
  line-height: 1.5;
}
.upload-hint--empty { color: var(--text-faint); }
.upload-url-row {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  flex-wrap: wrap;
}
.upload-url-row .admin-input { flex: 1; min-width: 0; }

/* ══════════════════════════════════════════════════════
   ГАЛЕРЕЯ ЗАГРУЗОК
══════════════════════════════════════════════════════ */
.upload-gallery { margin-top: 10px; }
.upload-gallery-title {
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.upload-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.upload-gallery-item {
  position: relative;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
  cursor: pointer;
  aspect-ratio: 1;
  transition: border-color 0.15s;
}
.upload-gallery-item:hover { border-color: var(--accent-border); }
.upload-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-gallery-vid {
  font-size: 0.55rem;
  padding: 6px;
  word-break: break-all;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}
.upload-gallery-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239,68,68,.92);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* ══════════════════════════════════════════════════════
   МЕДИАТЕКА — WordPress-like
══════════════════════════════════════════════════════ */
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.admin-media-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.admin-media-item:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px rgba(111,0,183,.08) inset;
}
.admin-media-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-media-vid-icon {
  font-size: 2rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.admin-media-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-media-filename {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-media-meta {
  font-size: 0.68rem;
  color: var(--text-faint);
}
.admin-media-url {
  font-size: 0.68rem;
  color: var(--accent-light);
  word-break: break-all;
  cursor: default;
  line-height: 1.4;
  margin-top: 2px;
}
.admin-media-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px 12px;
  flex-wrap: wrap;
}
.admin-media-actions .admin-btn {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  padding: 6px 8px;
}

@media (max-width: 600px) {
  .admin-media-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  .admin-media-info { padding: 8px 10px; }
  .admin-media-actions { padding: 6px 10px 10px; }
}

/* ══════════════════════════════════════════════════════
   АЛЕРТЫ
══════════════════════════════════════════════════════ */
.admin-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.admin-alert--ok {
  background: var(--ok-dim);
  border: 1px solid rgba(74,222,128,.3);
  color: var(--ok);
}
.admin-alert--error {
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}

/* ══════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════ */
.admin-empty {
  border: 1px dashed rgba(155,48,255,.35);
  background: rgba(155,48,255,.05);
  border-radius: var(--radius);
  padding: 16px 14px;
  margin: 10px 0 14px;
}
.admin-empty-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-light);
  margin-bottom: 6px;
}
.admin-empty-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════
   СТРАНИЦА ВХОДА
══════════════════════════════════════════════════════ */
.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(111,0,183,.10) 0%, transparent 60%);
}
.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(111,0,183,.08) inset;
}
.admin-login-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.admin-login-title {
  font-size: 1.35rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.admin-login-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   ФОРМА ВХОДА
══════════════════════════════════════════════════════ */
.admin-form { display: flex; flex-direction: column; gap: 0; }
.admin-back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.admin-back-link:hover { color: var(--accent-light); }

/* ══════════════════════════════════════════════════════
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
══════════════════════════════════════════════════════ */

/* Кнопка сохранения — обычный блок в конце страницы */
.admin-sticky-save {
  position: relative;
  margin: 40px auto 20px auto;
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(111,0,183,.15);
}

.admin-sticky-save button {
  width: 100%;
  min-height: 44px;
}

.admin-wrap {
  padding-bottom: 60px;
}

/* подсветка несохранённых изменений */
body.is-dirty .admin-sticky-save {
  border-color: var(--accent-light);
  box-shadow: 0 0 20px rgba(111,0,183,.35), 0 0 0 1px rgba(111,0,183,.2) inset;
  animation: adminDirtyPulse 2s ease-in-out infinite;
}
@keyframes adminDirtyPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(111,0,183,.35), 0 0 0 1px rgba(111,0,183,.2) inset; }
  50% { box-shadow: 0 0 30px rgba(155,48,255,.50), 0 0 0 1px rgba(155,48,255,.3) inset; }
}
body.is-dirty .admin-sticky-save .admin-btn--primary {
  box-shadow: 0 4px 24px rgba(111,0,183,.55);
}

@media (max-width: 1100px) {
  .admin-header-inner { padding: 0 16px; gap: 10px; }
  .admin-header-actions { gap: 6px; }
  .admin-header-actions .admin-btn { padding: 8px 14px; font-size: 0.76rem; }
}

@media (max-width: 768px) {
  .admin-burger { display: flex; }

  .admin-header-actions {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px 28px;
    gap: 12px;
    z-index: 190;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(calc(-100% - 60px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }
  .admin-header-actions.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .admin-header-actions .admin-btn,
  .admin-header-actions a.admin-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.88rem;
  }
  .admin-header-actions .admin-draft-status {
    display: block;
    max-width: none;
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    font-size: 0.78rem;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid rgba(155, 48, 255, 0.18);
    border-radius: var(--radius-sm);
  }

  .admin-header-inner { padding: 0 12px; }
  .admin-header h1 { font-size: 0.78rem; letter-spacing: 0.06em; }
  .admin-wrap { padding: 18px 12px 80px; }

  .admin-tabs {
    display: flex;
    gap: 3px;
    padding: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab {
    font-size: 0.75rem;
    padding: 8px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .admin-tab--right { margin-left: 0; }

  .admin-section { padding: 16px 14px; border-radius: 12px; }
  .admin-category-block { padding: 14px 12px; }
  .admin-repeater-item { padding: 12px 10px; }

  .admin-card-head { gap: 7px; }
  .admin-card-head h3 { font-size: 0.78rem; }

  .admin-grid-2 { grid-template-columns: 1fr; }

  .admin-sticky-save,
  .admin-static-save-container {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0;
    border-radius: 12px;
    z-index: 180;
    padding: 12px 14px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  }
  .admin-sticky-save .admin-btn,
  .admin-static-save-container .admin-btn {
    flex: 1;
    justify-content: center;
    min-height: 48px;
  }

  .upload-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  }
  .upload-url-row { flex-direction: column; }
  .upload-url-row .admin-input { width: 100%; }

  .admin-btn--small { padding: 8px 12px; font-size: 0.8rem; }

  .dash-hero-actions { justify-content: center; }
}

@media (max-width: 480px) {
  .admin-header h1 { font-size: 0.72rem; }
  .admin-wrap { padding: 16px 10px 80px; }
}

/* ══════════════════════════════════════════════════════
   DASHBOARD · AUDIT · UX
══════════════════════════════════════════════════════ */
.glass-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(155, 48, 255, 0.22);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-draft-status {
  font-size: 0.72rem;
  color: var(--accent-light);
  max-width: 140px;
  text-align: right;
  line-height: 1.3;
}

.admin-btn--glow {
  border-color: var(--accent-border);
  box-shadow: 0 0 20px var(--accent-glow);
}

.admin-btn--glow:hover {
  box-shadow: 0 0 28px rgba(155, 48, 255, 0.45);
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.dash-hero h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.dash-hero p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 520px;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stats-grid--compact .dash-stat-card {
  padding: 14px 16px;
}

.dash-stat-card {
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-stat-card--accent {
  border-color: rgba(155, 48, 255, 0.35);
  box-shadow: 0 0 24px rgba(111, 0, 183, 0.12);
}

.dash-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dash-stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.dash-stat-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.dash-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 8px 0 12px;
}

.dash-toggles {
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.dash-toggle-info strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.dash-toggle-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dash-toggle-ui {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.dash-toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #888;
  transition: transform 0.2s, background 0.2s;
}

.dash-toggle-input:checked + .dash-toggle-ui {
  background: rgba(155, 48, 255, 0.35);
  border-color: var(--accent-border);
}

.dash-toggle-input:checked + .dash-toggle-ui::after {
  transform: translateX(22px);
  background: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-light);
}

.dash-maint-msg.is-collapsed {
  display: none;
}

.dash-toggle-note {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.dash-actions {
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dash-link-card {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--accent-light);
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.15s, border-color 0.15s;
}

.dash-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(155, 48, 255, 0.5);
}

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.audit-filter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.audit-filter.is-active,
.audit-filter:hover {
  color: var(--text);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.audit-timeline {
  position: relative;
  padding-left: 8px;
}

.audit-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.audit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 12px var(--accent-light);
  margin-top: 18px;
}

.audit-card {
  padding: 14px 16px;
}

.audit-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.audit-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.audit-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.audit-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
}

.audit-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.45;
}

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.admin-input.is-invalid {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

@media (max-width: 900px) {
  .dash-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-quick-links { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-stats-grid { grid-template-columns: 1fr; }
  .admin-input,
  .admin-textarea,
  .admin-select {
    font-size: 16px;
  }
}