/* ── ADMIN BASE ──────────────────────────────────────────────────────────── */
.admin-body {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top right, rgba(200,16,46,0.07) 0%, transparent 60%);
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-logo {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.login-emblem {
  width: 110px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(200,16,46,0.4));
}
.login-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.login-error {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: -4px;
}
.login-back {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 12px;
  display: block;
  transition: color 0.2s;
}
.login-back:hover { color: var(--text); }

/* ── ADMIN TOP BAR ───────────────────────────────────────────────────────── */
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.admin-bar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-bar__logo-img {
  height: 30px;
  width: auto;
  display: block;
}
.admin-bar__sep { color: var(--border); }
.admin-bar__page { font-size: 0.9rem; color: var(--text-muted); }
.admin-bar__right { display: flex; align-items: center; gap: 16px; }
.admin-bar__link {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.admin-bar__link:hover { color: var(--text); }
.admin-bar__logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.admin-bar__logout:hover { border-color: var(--accent); color: var(--accent); }

/* ── ADMIN MAIN ──────────────────────────────────────────────────────────── */
.admin-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.admin-toolbar__title {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 10px;
  min-width: 28px;
}
.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
  font-size: 0.95rem;
}

/* ── POST LIST ───────────────────────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 20px 20px;
  transition: border-color 0.2s;
}
.post-row:hover { border-color: #3a3a3a; }
.post-row__thumb {
  flex-shrink: 0;
  width: 70px;
  height: 55px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.4rem;
  border: 1px solid var(--border);
  overflow: hidden;
}
.post-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-row__info { flex: 1; min-width: 0; }
.post-row__badges {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.post-row__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-row__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.post-row__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 2px;
}
.btn--edit {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn--edit:hover { border-color: #fff; color: #fff; }
.btn--danger {
  background: rgba(200,16,46,0.1);
  border: 1px solid rgba(200,16,46,0.3);
  color: var(--accent);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn--danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge-attach {
  font-size: 0.68rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 99px;
}

/* ── ADMIN MODAL ─────────────────────────────────────────────────────────── */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.admin-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 700px;
  margin: auto;
  position: relative;
}
.admin-modal--sm { max-width: 440px; }
.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.admin-modal__header h3 { font-size: 1.1rem; font-weight: 700; }
.admin-modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.admin-modal__close:hover { color: var(--text); }
.admin-modal__body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.admin-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── FORM FIELDS ─────────────────────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; }
.opt { font-weight: 400; }
.req { color: var(--accent); }
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  width: 100%;
}
.form-field select { cursor: pointer; appearance: auto; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 140px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-error { color: var(--accent); font-size: 0.84rem; margin-top: -4px; }

/* ── FILE UPLOAD ─────────────────────────────────────────────────────────── */
.file-drop {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--accent);
  background: rgba(200,16,46,0.04);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: none !important;
  padding: 0 !important;
}
.file-drop__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  pointer-events: none;
  color: var(--text-muted);
  text-align: center;
}
.file-drop__inner p { font-size: 0.88rem; margin: 0; }
.file-hint { font-size: 0.76rem !important; color: #666; }
.file-preview {
  margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.file-preview img {
  max-height: 100px;
  border-radius: 4px;
  object-fit: cover;
}
.file-preview__info { display: flex; flex-direction: column; gap: 4px; }
.file-preview__name { font-size: 0.88rem; font-weight: 600; }
.file-preview__size { font-size: 0.76rem; color: var(--text-muted); }
.file-preview__pdf { font-size: 2rem; }
.file-remove {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.2s;
  width: fit-content;
}
.file-remove:hover { opacity: 0.7; }

/* ── DELETE CONFIRM ──────────────────────────────────────────────────────── */
.del-msg { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.del-msg strong { color: var(--text); }

/* ── TABS ────────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 0 32px;
}
.admin-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-tab svg { flex-shrink: 0; }

/* ── GALLERY ADMIN GRID ──────────────────────────────────────────────────── */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.admin-gal-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-gal-card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.admin-gal-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-gal-card__del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  line-height: 1;
}
.admin-gal-card:hover .admin-gal-card__del { opacity: 1; }
.admin-gal-card__del:hover { background: var(--accent); border-color: var(--accent); }
.admin-gal-card__caption {
  padding: 8px;
}
.admin-gal-card__caption input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.admin-gal-card__caption input:focus {
  outline: none;
  border-color: var(--accent);
}
/* Drag & drop reorder */
.admin-gal-card { cursor: default; }
.admin-gal-card__drag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.admin-gal-card:hover .admin-gal-card__drag { opacity: 0.8; }
.admin-gal-card__drag:active { cursor: grabbing; }
.admin-gal-card.dragging {
  opacity: 0.4;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* ── UPLOAD QUEUE ────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
.upload-queue {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.upload-queue__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.upload-queue__header h4 { font-size: 0.95rem; font-weight: 700; }
.upload-queue__hint { font-size: 0.78rem; color: var(--text-muted); }
.upload-queue__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.upload-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.upload-card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.upload-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-card__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.upload-card__remove:hover { background: var(--accent); }
.upload-card__caption {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-family: var(--font);
}
.upload-card__caption:focus { outline: none; background: var(--bg); }
.upload-queue__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── SITE CONTENT SECTIONS ───────────────────────────────────────────────── */
.site-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.site-section__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.site-section__toggle:hover { background: var(--bg3); }
.site-section__toggle svg {
  transition: transform 0.2s;
  color: var(--text-muted);
}
.site-section__toggle.open svg { transform: rotate(180deg); }
.site-section__body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.site-section__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.site-save-ok {
  font-size: 0.82rem;
  color: #22c55e;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}
.site-save-ok.visible { opacity: 1; }
.site-sub-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: -4px;
  letter-spacing: 0.3px;
}
.site-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}
.field-hint strong {
  color: var(--text);
}
.hero-bg-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.hero-bg-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.hero-bg-remove {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-bg-remove:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-bar { padding: 12px 16px; }
  .admin-bar__page { display: none; }
  .admin-tabs { padding: 0 16px; }
  .admin-tab { padding: 12px 14px; font-size: 0.82rem; }
  .admin-main { padding: 24px 16px 60px; }
  .admin-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .post-row { flex-wrap: wrap; }
  .post-row__thumb { width: 100%; height: 120px; }
  .login-card { padding: 32px 24px; }
  .admin-modal__body { padding: 16px; }
  .admin-modal__footer { padding: 12px 16px; }
}
