:root {
  --navy-dark: #0f1d33;
  --navy: #1b2a4a;
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --red: #dc2626;
  --bg: #f4f6f8;
  --card: #fff;
  --border: #e9ecef;
  --muted: #6c757d;
  --text: #2d3436;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(27, 42, 74, 0.08);
  --sidebar-w: 240px;
  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: Inter, system-ui, sans-serif;
  font-family: var(--font-sans);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
body.is-sorting { user-select: none; cursor: grabbing; }
body.is-sorting .sortable-list { cursor: grabbing; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); font-size: 0.9rem; }
.tip { margin-top: 1.5rem; font-size: 0.9rem; }

.screen { min-height: 100vh; }

/* Login — matches public site hero / footer */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.login-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    var(--navy-dark) 0%,
    var(--navy) 45%,
    #152038 100%
  );
}

.login-bg-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(72vw, 520px);
  height: auto;
  opacity: 0.12;
  filter: brightness(0) invert(1);
  pointer-events: none;
  user-select: none;
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(15, 29, 51, 0.35);
  overflow: hidden;
}

.login-brand {
  padding: 2rem 2rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
}

.login-logo {
  display: block;
  margin: 0 auto;
  height: auto;
  max-width: 180px;
  width: 100%;
}

.login-brand h1 {
  margin: 1rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.login-tagline {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-fields {
  padding: 1.5rem 2rem 2rem;
}

.login-fields label {
  text-align: left;
}

.login-fields .btn-login {
  width: 100%;
  margin-top: 1.25rem;
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-foot {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=date]:focus, input[type=time]:focus, input[type=number]:focus, input[type=url]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.25);
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, monospace; font-size: 0.9rem; }
textarea.body-field { min-height: 200px; }
textarea.rich-text-source { display: none !important; }

.art-body-editor {
  margin-top: 0.35rem;
}
.art-body-editor-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.art-body-editor-hint,
.field-hint.rich-editor-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted, #6b7280);
}

.rich-text-host {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rich-text-host:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}
.rich-text-host--legal { margin-top: 0.25rem; }
.rich-text-host .tox-tinymce {
  border: none !important;
  border-radius: 10px;
}
.rich-text-host .tox .tox-edit-area__iframe {
  background: #fff;
}
.rich-text-host .tox .tox-toolbar-overlord,
.rich-text-host .tox .tox-toolbar__primary {
  background: #f8f9fb !important;
  border-bottom: 1px solid var(--border) !important;
}
.rich-text-host .tox .tox-statusbar {
  border-top: 1px solid var(--border) !important;
}

.md-content h2, .md-content h3, .preview-box h2, .preview-box h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
  margin: 1rem 0 0.5rem;
}
.md-embed {
  position: relative;
  width: 100%;
  margin: 0.85rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}
.md-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.md-embed--video {
  background: #111;
}
.md-embed--facebook {
  width: 100%;
  background: #fff;
}
.md-embed--facebook .fb-post,
.md-embed--facebook .fb-post > span {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}
.md-embed--facebook .fb-post iframe {
  width: 100% !important;
  max-width: 100% !important;
}

#perf-id-preview,
#mem-id-preview {
  color: rgba(27, 42, 74, 0.52);
  background: #f8f9fa;
  cursor: default;
}
#perf-id-preview:focus,
#mem-id-preview:focus {
  border-color: var(--border);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #152038; }
.btn-login {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 40%, #f5ead0 50%, var(--gold-light) 60%, var(--gold) 100%);
  background-size: 200% 200%;
  animation: shimmer 3s ease-in-out infinite;
  color: var(--navy);
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.45);
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn-secondary { background: #fff; border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-back { font-size: 0.85rem; }

/* App shell — sidebar + workspace */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--navy-dark);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.sidebar-logo {
  display: block;
  margin: 0 auto;
  max-width: 130px;
  height: auto;
}
.sidebar-title {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.65rem;
  flex: 1;
}

.sidebar-foot {
  padding: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-foot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  position: relative;
  padding: 0;
}
.sidebar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateY(-1px);
}
.sidebar-icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}
.sidebar-icon-btn.hidden { display: none; }

.sidebar-preview-btn.is-maintenance {
  background: rgba(234, 88, 12, 0.28);
  color: #fdba74;
}
.sidebar-preview-btn.is-maintenance:hover {
  background: rgba(234, 88, 12, 0.42);
  color: #fff;
}

.sidebar-preview-maint-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #f97316;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #1a2744;
  pointer-events: none;
}
.sidebar-preview-maint-badge svg {
  width: 0.78rem;
  height: 0.78rem;
  display: block;
}
.sidebar-preview-maint-badge.hidden { display: none; }

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-btn.active {
  background: rgba(201, 168, 76, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-btn-logout { color: rgba(255, 255, 255, 0.65); }
.nav-btn-logout:hover { background: rgba(220, 38, 38, 0.25); color: #fff; }

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.view h2 { margin: 0; color: var(--navy); font-family: var(--font-display); }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.dash-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.dash-num { display: block; font-size: 2rem; font-weight: 700; color: var(--navy); }

.item-list { display: flex; flex-direction: column; gap: 0.65rem; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.list-row-main { flex: 1; min-width: 0; }
.list-row strong { color: var(--navy); }
.list-row small { display: block; color: var(--muted); margin-top: 0.15rem; }
.list-row small.art-list-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.art-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 14.5rem auto;
  align-items: center;
  gap: 0.75rem;
}
.art-list-row .list-row-main {
  flex: unset;
  min-width: 0;
}
.art-row-badges {
  display: grid;
  grid-template-columns: 4.75rem 9.25rem;
  column-gap: 0;
  align-items: center;
  width: 100%;
}
.art-list-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.art-list-category-slot {
  visibility: hidden;
  pointer-events: none;
}
.art-row-status {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  min-width: 0;
}
.art-row-status .perf-status-picker,
.art-row-status .perf-badge {
  max-width: 100%;
}
.art-editor-status-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.art-editor-status {
  min-height: 2rem;
  display: flex;
  align-items: center;
}
.art-editor-meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  width: 100%;
}
.art-editor-meta-row label {
  min-width: 0;
}
.art-editor-meta-row select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--navy);
  background: #fff;
}
.art-badge-published { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.art-badge-draft { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.art-badge-scheduled { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.art-dot-published { background: #22c55e; }
.art-dot-draft { background: #9ca3af; }
.art-dot-scheduled { background: #3b82f6; }

.perf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.perf-toolbar-left,
.perf-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem;
}

.export-menu-wrap {
  position: relative;
}
.export-menu-trigger {
  white-space: nowrap;
}
.export-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9.5rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 29, 51, 0.12);
}
.view-head .export-menu-wrap .export-menu {
  top: calc(100% + 0.35rem);
}
.export-menu-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.export-menu-option:hover,
.export-menu-option:focus-visible {
  background: #f3f5f8;
  outline: none;
}
.perf-toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.perf-toolbar-label select {
  min-width: 11rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--navy);
  background: #fff;
}
.perf-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 6.25rem 14.5rem auto;
  align-items: center;
  gap: 0.75rem 0.55rem;
}
.perf-list-row .list-row-main {
  flex: unset;
  min-width: 0;
}
.perf-countdown-col {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 0.2rem;
  text-align: right;
  pointer-events: none;
}
.perf-row-badges {
  display: grid;
  grid-template-columns: 4rem 10.25rem;
  column-gap: 0rem;
  align-items: right;
  width: 100%;
}
.perf-row-private,
.perf-row-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.perf-row-status .perf-status-picker,
.perf-row-status .perf-badge {
  max-width: 100%;
}
.perf-row-edit {
  justify-self: end;
  white-space: nowrap;
}
.perf-countdown {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.perf-status-picker {
  position: relative;
  flex-shrink: 0;
}
.perf-status-trigger {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  border-radius: 8px;
}
.perf-status-trigger:hover:not(:disabled) .perf-badge {
  filter: brightness(0.97);
}
.perf-status-trigger:disabled {
  cursor: wait;
  opacity: 0.7;
}
.perf-status-chevron {
  margin-left: 0.15rem;
  font-size: 0.7rem;
  opacity: 0.65;
}
.perf-status-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 11.5rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 29, 51, 0.12);
}
.perf-status-option {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
}
.perf-status-option:hover .perf-badge {
  filter: brightness(0.96);
}
.perf-status-option[aria-selected='true'] .perf-badge {
  box-shadow: inset 0 0 0 2px rgba(27, 42, 74, 0.18);
}
.perf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  white-space: nowrap;
}
.perf-badge.dim { opacity: 0.82; }
.perf-badge-live { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.perf-badge-upcoming { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.perf-badge-negotiating { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.perf-badge-past { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.perf-badge-canceled { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.perf-badge-canceled.dim {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  opacity: 0.55;
}
.perf-badge-canceled.dim .perf-dot-canceled {
  background: #dc2626;
  opacity: 0.55;
}
.perf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.perf-dot-live { background: #eab308; }
.perf-dot-upcoming { background: #22c55e; }
.perf-dot-negotiating { background: #f97316; }
.perf-dot-past { background: #9ca3af; }
.perf-dot-canceled { background: #dc2626; }
.perf-past-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.perf-past-divider::before,
.perf-past-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.perf-past-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.list-thumb {
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8f9fa;
}
.list-thumb--16x9 {
  width: 72px;
  aspect-ratio: 16 / 9;
  height: auto;
}
.list-thumb--3x4 {
  width: 48px;
  aspect-ratio: 3 / 4;
  height: auto;
}
.list-thumb-empty {
  display: block;
  background: linear-gradient(135deg, #f8f9fa, #eef1f4);
}
.list-thumb-broken {
  visibility: hidden;
}

.image-upload-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.image-upload-field .image-preview-wrap {
  margin-top: 0;
}
.image-upload-field .upload-zone {
  margin-top: 0;
}

.image-preview-wrap {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.image-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  align-self: stretch;
  width: 100%;
}
.image-preview-toolbar .image-preview-label {
  margin: 0;
}
.image-preview-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.image-preview-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.image-preview-frame--16x9 {
  aspect-ratio: 16 / 9;
}
.image-preview-frame--3x4 {
  aspect-ratio: 3 / 4;
  max-width: 280px;
}
.image-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.image-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.upload-zone.is-uploading {
  opacity: 0.7;
  pointer-events: none;
}

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8f9fa; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* Inline editor panel */
.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
}
.editor-panel form {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: calc(100vh - 2.5rem);
}
.editor-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  border-radius: var(--radius) var(--radius) 0 0;
}
.editor-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--navy);
  font-family: var(--font-display);
  flex: 1;
}
.editor-body {
  padding: 1rem 1.25rem 1.5rem;
  flex: 1;
  overflow-y: auto;
}
.editor-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}
.spacer { flex: 1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: span 2; }
.perf-editor-meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  width: 100%;
}
.perf-editor-meta-row label {
  min-width: 0;
}
.perf-editor-status-label > .perf-editor-status {
  margin-top: 0.35rem;
}
.perf-editor-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
}
.perf-editor-status-row > .perf-editor-status {
  margin-top: 0;
}
.perf-private-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}
.perf-private-check input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.perf-badge-private {
  background: #4a5568;
  color: #fff;
  border: 1px solid #374151;
}
.perf-badge-slot {
  visibility: hidden;
  pointer-events: none;
}
.perf-map-wrap {
  margin-top: 0.25rem;
}
.perf-map-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fa;
  min-height: 220px;
}
.perf-map-preview iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
}
.perf-map-preview iframe.hidden {
  display: none;
}
.perf-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.legal-doc-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.25rem 0 0.5rem; }
.legal-doc-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.legal-lang-tabs { margin-top: 0.75rem; }
.legal-editor-fields { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.legal-save-row { margin-top: 1.25rem; }

.settings-panel { max-width: 36rem; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-label { font-size: 1.05rem; font-weight: 600; margin: 0; }
.settings-row-label {
  flex: 1;
  min-width: 0;
  line-height: 1.75rem;
  transform: translateY(2px);
}
.settings-status {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #2d6a4f;
}
.settings-status.is-error { color: #b42318; }
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.25rem;
}
.settings-field label { font-weight: 600; font-size: 0.95rem; }
.settings-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  resize: vertical;
  min-height: 3.5rem;
}
.settings-field-hint { margin: 0; font-size: 0.85rem; }
.settings-preview-row {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}
.settings-preview-hint { margin: 0; font-size: 0.85rem; max-width: 32rem; }
#settings-save { margin-top: 1.25rem; }
#settings-open-preview.is-maintenance-preview {
  border-color: #fdba74;
  color: #c2410c;
  background: #fff7ed;
}
#settings-open-preview.is-maintenance-preview:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
}
.settings-social-section { margin-top: 1.5rem; }
.settings-social-section .settings-label { margin: 0 0 0.35rem; }
.settings-social-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.settings-social-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}
.settings-social-field input { font-weight: 400; }

body.cms-site-hidden {
  --bg: #fff4e6;
  background: #fff4e6;
}
body.cms-site-hidden .workspace {
  background: #fff4e6;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 3.25rem;
  height: 1.75rem;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  position: absolute;
  content: '';
  height: 1.25rem;
  width: 1.25rem;
  left: 0.25rem;
  bottom: 0.25rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--navy);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(1.5rem);
}
.settings-visibility-toggle input:checked + .toggle-slider {
  background: var(--navy);
}
body.cms-site-hidden .settings-visibility-toggle input:not(:checked) + .toggle-slider {
  background: #ea580c;
}
body.cms-site-hidden .settings-visibility-toggle input:checked + .toggle-slider {
  background: #f97316;
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.lang-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin: 1rem 0 0.75rem; }
.lang-tab-row { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.lang-tab {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.lang-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.lang-panel.hidden { display: none; }

.lang-panel .upload-zone {
  margin-top: 0.875rem;
}

.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin: 0.5rem 0;
}
.upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.upload-zone.dragover { border-color: var(--gold); background: #fffbeb; }
.preview-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  min-height: 120px;
  background: #fafbfc;
  font-size: 0.95rem;
  line-height: 1.6;
}
.preview-box img { max-width: 100%; border-radius: 6px; margin: 0.75rem 0; box-shadow: 0 2px 12px rgba(27, 42, 74, 0.08); }
.preview-toggle { margin: 0.5rem 0; font-size: 0.85rem; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 9999;
  font-size: 0.9rem;
}

/* Drag-and-drop sortable lists */
.sortable-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.sortable-hint-grip {
  display: inline-flex;
  width: 10px;
  height: 14px;
  background-image: radial-gradient(circle, var(--gold) 1.5px, transparent 1.5px);
  background-size: 5px calc(14px / 3);
  background-position: 0 0;
  opacity: 0.85;
}

.sortable-list {
  position: relative;
  gap: 0.75rem;
}

.sortable-item {
  position: relative;
  cursor: default;
  touch-action: none;
  transition:
    box-shadow 0.25s var(--ease, cubic-bezier(0.25, 0.46, 0.45, 0.94)),
    transform 0.25s var(--ease, cubic-bezier(0.25, 0.46, 0.45, 0.94)),
    opacity 0.2s ease,
    border-color 0.2s ease;
  will-change: transform, box-shadow;
}

.sortable-item.is-dragging {
  opacity: 0.96;
  z-index: 1000;
  cursor: grabbing;
  box-shadow:
    0 20px 50px rgba(15, 29, 51, 0.22),
    0 0 0 2px rgba(201, 168, 76, 0.45);
  transform: scale(1.02) rotate(-0.4deg);
}

.sortable-item.is-drop-target {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.35);
}

.sortable-placeholder {
  border: 2px dashed rgba(201, 168, 76, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(232, 212, 139, 0.12));
  transition: height 0.2s ease, opacity 0.2s ease;
  animation: sortable-pulse 1.6s ease-in-out infinite;
}

@keyframes sortable-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.75rem;
  margin: -0.35rem 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.drag-handle:hover {
  background: rgba(201, 168, 76, 0.12);
  color: var(--navy);
}
.drag-handle:active {
  cursor: grabbing;
  transform: scale(0.96);
}
.drag-handle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.5);
}

.drag-handle-icon {
  display: grid;
  grid-template-columns: repeat(2, 4px);
  gap: 4px;
  pointer-events: none;
}
.drag-handle-icon span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.drag-handle:hover .drag-handle-icon span {
  opacity: 0.9;
}
.sortable-item.is-dragging .drag-handle-icon span {
  opacity: 1;
  background: var(--gold);
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: none;
    padding: 0.75rem 1rem;
    text-align: left;
  }
  .sidebar-logo { max-width: 80px; margin: 0; }
  .sidebar-title { margin: 0; font-size: 1rem; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    padding: 0.5rem;
  }
  .sidebar-foot {
    border-top: none;
    padding: 0.5rem;
    width: 100%;
  }
  .sidebar-foot-actions {
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
  }
  .nav-btn { width: auto; font-size: 0.8rem; padding: 0.45rem 0.65rem; }
  .nav-btn.active { box-shadow: inset 0 -3px 0 var(--gold); }
  .form-grid { grid-template-columns: 1fr; }
  .perf-editor-meta-row,
  .art-editor-meta-row { grid-template-columns: 1fr 1fr; row-gap: 0.75rem; }
  .content, .editor-panel { padding: 1rem; }
  .editor-panel form { min-height: auto; }
}
