/* Admin MRD - police, propre, editeurs visuels */
:root {
  --admin-bg: #eef2f6;
  --admin-panel: #ffffff;
  --admin-sidebar: #0c1b2a;
  --admin-border: #d5dde6;
  --admin-text: #121820;
  --admin-muted: #5c6b7a;
  --admin-accent: #1a6fb5;
  --admin-accent-soft: rgba(26, 111, 181, 0.1);
  --admin-danger: #c0392b;
  --admin-radius: 10px;
  --admin-bar-h: 64px;
  --font-admin: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body.admin-body {
  margin: 0;
  font-family: var(--font-admin);
  background: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
}

.admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--admin-bar-h);
  display: flex;
  align-items: center;
  background: var(--admin-sidebar);
  border-bottom: 3px solid var(--admin-accent);
  box-shadow: 0 2px 12px rgba(12, 27, 42, 0.2);
}

.admin-bar__inner {
  display: flex;
  align-items: center;
  width: min(100% - 2rem, 1400px);
  margin-inline: auto;
  height: 100%;
}

.admin-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.admin-bar__logo {
  width: 44px;
  height: 44px;
  min-width: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.admin-bar__mark {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 2px solid var(--admin-accent);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  border-radius: 6px;
}

.admin-bar__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - var(--admin-bar-h));
  margin-top: var(--admin-bar-h);
  align-items: stretch;
}

.admin-sidebar {
  position: sticky;
  top: var(--admin-bar-h);
  align-self: start;
  height: calc(100vh - var(--admin-bar-h));
  max-height: calc(100vh - var(--admin-bar-h));
  background: var(--admin-sidebar);
  border-right: 3px solid var(--admin-accent);
  padding: 1.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.admin-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
}

.admin-nav a {
  display: block;
  padding: 0.6rem 0.85rem;
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  flex-shrink: 0;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  background: rgba(26, 111, 181, 0.38);
  color: #fff;
}

.admin-logout {
  flex-shrink: 0;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.admin-logout .btn {
  width: 100%;
}

.admin-sidebar .btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-sidebar .btn--ghost:hover {
  border-color: #fff;
  color: #fff;
}

.admin-main {
  padding: 1.75rem 2rem 3rem;
  min-width: 0;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-top h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--admin-sidebar);
}

.admin-user {
  font-size: 0.85rem;
  color: var(--admin-muted);
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-card {
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  border-top: 3px solid var(--admin-accent);
  padding: 1.1rem 1.2rem;
}

.admin-card strong {
  display: block;
  font-size: 1.6rem;
  color: var(--admin-accent);
}

.admin-card span {
  font-size: 0.78rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.panel {
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-sidebar);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head .panel-title { margin-bottom: 0.25rem; }

.panel-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--admin-muted);
  line-height: 1.45;
}

.page-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

table.data th {
  color: var(--admin-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
}

.badge--ok { border-color: #1e7a4c; color: #1e7a4c; background: rgba(30, 122, 76, 0.08); }
.badge--scheduled { border-color: #c47d12; color: #a66a0d; background: rgba(196, 125, 18, 0.1); }
.badge--draft { color: var(--admin-muted); background: #f3f5f7; }

.muted { color: var(--admin-muted); margin: 0; font-size: 0.9rem; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #fff;
  padding: 0 0.35rem;
  text-decoration: none;
}
.admin-brand__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--admin-border);
  background: #fff;
  font-size: 0.9rem;
  border-radius: 8px;
}
.flash__close {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--admin-muted);
  line-height: 1;
}

.publish-options {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.publish-option {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  background: #f8fafc;
}
.publish-option:has(input:checked) {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}
.publish-option strong { display: block; color: var(--admin-sidebar); }
.publish-option small { color: var(--admin-muted); font-size: 0.82rem; }
.publish-option input[type="radio"] {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  margin: 0.2rem 0 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
}
.publish-option > span {
  flex: 1 1 auto;
  min-width: 0;
}
.schedule-fields { margin-top: 0.5rem; }
.schedule-fields[hidden] { display: none !important; }

.page-card__badge {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  background: var(--admin-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.page-card--pending {
  outline: 2px dashed var(--admin-accent);
  outline-offset: -2px;
}

.form-grid { display: grid; gap: 1rem; }
.form-grid--2 { grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-row {
  display: grid;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.82rem;
  color: var(--admin-muted);
  font-weight: 600;
}

.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--admin-text);
  font: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row.checkbox,
.check-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--admin-muted);
  margin-top: 0.75rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.row-actions form {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: 2px solid var(--admin-accent);
  background: var(--admin-accent);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.03em;
  border-radius: 8px;
  outline: none;
  box-shadow: none;
}

.btn:hover { filter: brightness(1.06); }

.btn:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 3px;
}

.btn--ghost {
  background: #fff;
  color: var(--admin-text);
  border-color: var(--admin-border);
}

.btn--ghost:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.btn--danger {
  background: var(--admin-danger);
  border-color: var(--admin-danger);
  color: #fff;
}

.btn--danger:focus-visible {
  outline-color: var(--admin-danger);
}

.btn--sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.btn--block { width: 100%; }

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border: 1px solid var(--admin-border);
  background: #fff;
  font-size: 0.9rem;
  border-radius: 8px;
}

.flash--success { border-color: #1e7a4c; background: rgba(30, 122, 76, 0.06); }
.flash--error { border-color: var(--admin-danger); background: rgba(192, 57, 43, 0.06); }

.perm-groups { display: grid; gap: 1rem; }

.perm-group {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0.85rem;
}

.perm-group h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--admin-accent);
}

.perm-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.thumb-sm {
  width: 52px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
}

.mode-panels[hidden] { display: none !important; }

/* Editor layout */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}

.editor-main { min-width: 0; }

.sticky-actions {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.sticky-actions .btn { margin: 0; }

/* Pages board */
.pages-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-height: 80px;
}

.pages-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--admin-muted);
  border: 1px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  background: #f8fafc;
}

.page-card {
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  cursor: grab;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.page-card:hover {
  border-color: var(--admin-accent);
  box-shadow: 0 8px 24px rgba(12, 27, 42, 0.1);
}

.page-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.page-card__preview {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #e8eef4;
  cursor: zoom-in;
}

.page-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-card__num {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--admin-sidebar);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.page-card__actions {
  display: flex;
  gap: 0.25rem;
  padding: 0.45rem;
  justify-content: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--admin-border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--admin-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.icon-btn--danger:hover {
  border-color: var(--admin-danger);
  color: var(--admin-danger);
}

/* Upload zone */
.upload-zone {
  position: relative;
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.is-dragover,
.upload-zone:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone__ui {
  display: grid;
  gap: 0.25rem;
  pointer-events: none;
}

.upload-zone__ui strong {
  color: var(--admin-sidebar);
}

.upload-zone__ui span {
  font-size: 0.85rem;
  color: var(--admin-muted);
}

.pending-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
  pointer-events: none;
}

.pending-item {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}

.pending-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.pending-item span {
  display: block;
  font-size: 0.65rem;
  padding: 0.3rem;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-preview,
.logo-stage {
  aspect-ratio: 3 / 4;
  background: #eef2f6;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  margin-bottom: 0.85rem;
  display: grid;
  place-items: center;
}

.logo-stage {
  aspect-ratio: 1;
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #fff;
}

.cover-preview img,
.logo-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.cover-preview__empty,
.logo-stage__empty {
  color: var(--admin-muted);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.palette-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.palette-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.palette-card.is-active,
.palette-card:has(input:checked) {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.palette-card__swatches {
  display: flex;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

.palette-card__swatches i {
  flex: 1;
  display: block;
}

.palette-card__swatches--custom i:nth-child(1) { background: #0c1b2a; }
.palette-card__swatches--custom i:nth-child(2) { background: #1a6fb5; }
.palette-card__swatches--custom i:nth-child(3) {
  background: repeating-linear-gradient(45deg, #eee, #eee 4px, #ccc 4px, #ccc 8px);
}

.palette-card__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-sidebar);
}

.theme-custom {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

.theme-custom[hidden] { display: none !important; }

.theme-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.theme-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.82rem;
  color: var(--admin-text);
}

.theme-picker input[type="color"] {
  width: 40px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.theme-actions {
  margin-top: 1rem;
}

.theme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1.25rem;
  align-items: start;
}

.theme-preview {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  background: var(--bg, #f4f6f8);
  box-shadow: 0 8px 24px rgba(12, 27, 42, 0.08);
}

.theme-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--navy, #0c1b2a);
  color: #fff;
}

.theme-preview__mark {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--blue-bright, #2180d0);
  padding: 0.25rem 0.4rem;
}

.theme-preview__nav {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.theme-preview__body {
  padding: 1.1rem 0.95rem 1.25rem;
}

.theme-preview__title {
  display: block;
  color: var(--navy, #0c1b2a);
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.theme-preview__text {
  margin: 0 0 1rem;
  color: var(--text-muted, #5c6b7a);
  font-size: 0.85rem;
  line-height: 1.45;
}

.theme-preview__btn {
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  background: var(--blue, #1a6fb5);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
}

.badge--owner {
  margin-left: 0.4rem;
  border-color: var(--admin-accent);
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
  vertical-align: middle;
}

@media (max-width: 960px) {
  .theme-layout { grid-template-columns: 1fr; }
}

.pdf-current {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #f8fafc;
}

.pdf-current__icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--admin-danger);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.pdf-current p { margin: 0.2rem 0 0; font-size: 0.88rem; }
.pdf-current a { color: var(--admin-accent); font-weight: 600; }

/* RTE */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #f3f6f9;
  border: 1px solid var(--admin-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.rte-toolbar button {
  border: 1px solid var(--admin-border);
  background: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.rte-toolbar button:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.rte-editor {
  min-height: 220px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--admin-border);
  border-radius: 0 0 8px 8px;
  background: #fff;
  line-height: 1.6;
  outline: none;
}

.rte-editor:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.rte-editor p { margin: 0 0 0.75em; }
.rte-editor h2 {
  margin: 0 0 0.5em;
  font-size: 1.2rem;
  color: var(--admin-sidebar);
}

/* Media field (upload unifié) */
.media-field {
  display: grid;
  gap: 0.75rem;
}

.media-field__label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-sidebar);
}

.media-field__stage {
  min-height: 180px;
  border: 1px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}

.media-field--logo .media-field__stage,
.media-field--cover .media-field__stage {
  min-height: 160px;
  max-height: 240px;
}

.media-field--photo .media-field__stage {
  min-height: 220px;
  max-height: 280px;
  max-width: 280px;
}

.media-field__stage img,
.media-field__stage img[data-media-img] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 220px !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #fff;
}

.media-field__empty {
  color: var(--admin-muted);
  font-size: 0.88rem;
  padding: 1rem;
  text-align: center;
}

.media-field__zone {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 0.95rem 1rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.media-field__zone.is-dragover,
.media-field__zone:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.media-field__zone-ui strong {
  display: block;
  color: var(--admin-sidebar);
  margin-bottom: 0.2rem;
}

.media-field__zone-ui span {
  font-size: 0.82rem;
  color: var(--admin-muted);
}

.media-field__actions {
  display: flex;
  gap: 0.5rem;
}

/* Author picker */
.author-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  max-width: 100%;
}

.author-picker__item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  width: auto !important;
  box-sizing: border-box;
}

.author-picker__item.is-checked,
.author-picker__item:has(input:checked) {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.author-picker__check {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  accent-color: var(--admin-accent);
}

.author-picker__avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: #e2e8f0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-muted);
  border: 1px solid var(--admin-border);
}

.author-picker__avatar img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  object-fit: cover;
  display: block;
}

.author-picker__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.author-picker__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-sidebar);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-picker__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--admin-muted);
  line-height: 1.3;
}

.admin-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 220;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--admin-sidebar);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--admin-accent);
}

.admin-toast--error {
  border-left-color: var(--admin-danger);
}

.admin-toast[hidden] {
  display: none !important;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 27, 42, 0.88);
  display: grid;
  place-items: center;
  padding: 2rem;
}

.lightbox[hidden] { display: none !important; }

.lightbox img {
  max-width: min(90vw, 700px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.login-wrap {
  min-height: calc(100vh - var(--admin-bar-h));
  margin-top: var(--admin-bar-h);
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(160deg, #0c1b2a 0%, #143049 55%, #1a6fb5 140%);
}

.admin-body--login {
  min-height: 100vh;
}

.login-box {
  width: min(100%, 400px);
  background: #fff;
  border-radius: var(--admin-radius);
  border-top: 4px solid var(--admin-accent);
  padding: 2rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.login-box h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--admin-sidebar);
}

.login-box p {
  margin: 0 0 1.5rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .editor-layout { grid-template-columns: 1fr; }
  .sticky-actions { position: static; }
  .form-grid--2 { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 3px solid var(--admin-accent);
  }
  .admin-nav {
    overflow: visible;
  }
}
