/* ============================================================
   POMPEUFARRA ADMIN — STYLES
   ============================================================ */

:root {
  --pf-red: #C8332E;
  --pf-red-deep: #8E1F1B;
  --pf-cream: #F2EBDC;
  --pf-cream-2: #E8DEC9;
  --pf-ink: #141210;
  --pf-ink-2: #3E3830;
  --pf-gold: #D9A93B;

  --bg: #F7F4ED;
  --surface: #FFFFFF;
  --border: #E0DAD0;
  --border-soft: #ECE6DB;
  --text: #141210;
  --text-soft: #5C5447;
  --text-mute: #8B8170;
  --danger: #B23A2A;

  --shadow-sm: 0 1px 2px rgba(20,18,16,0.06);
  --shadow-md: 0 4px 12px rgba(20,18,16,0.08);
  --shadow-lg: 0 16px 40px rgba(20,18,16,0.18);

  --bar-h: 60px;
  --radius: 8px;
  --radius-lg: 12px;

  --display: 'Anton', Impact, sans-serif;
  --black: 'Archivo Black', sans-serif;
  --body: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; }
a { color: inherit; }

/* ============================================================
   SCREENS (auth, loading, app)
   ============================================================ */

.screen { min-height: 100vh; }
.screen[hidden] { display: none !important; }

#auth, #loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--pf-cream) 0%, #fff 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 56px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.auth-card__brand {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: 0.08em;
  color: var(--pf-red);
}
.auth-card__sub {
  margin: 8px 0 28px;
  font-size: 14px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.auth-card__error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.loader {
  text-align: center;
}
.loader__brand {
  font-family: var(--display);
  font-size: 28px;
  color: var(--pf-red);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}
.loader__bar {
  width: 280px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 12px;
}
.loader__bar-fill {
  height: 100%;
  width: 0;
  background: var(--pf-red);
  transition: width 0.3s ease;
}
.loader__msg {
  font-size: 12px;
  color: var(--text-mute);
  font-family: var(--mono);
}

/* ============================================================
   TOP BAR
   ============================================================ */

.bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bar__mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pf-red);
  color: #fff;
  font-family: var(--display);
  font-size: 14px;
  border-radius: 6px;
  letter-spacing: 0;
}
.bar__name {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.04em;
}
.bar__sections {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bar__sections::-webkit-scrollbar { display: none; }
.bar__section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.bar__section:hover { background: var(--bg); color: var(--text); }
.bar__section--active { background: var(--pf-ink); color: #fff; }
.bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--text); }
.btn--primary {
  background: var(--pf-red);
  color: #fff;
  border-color: var(--pf-red);
}
.btn--primary:hover {
  background: var(--pf-red-deep);
  border-color: var(--pf-red-deep);
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
}
.btn--ghost:hover {
  background: var(--bg);
  color: var(--text);
}
.btn--danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #f5d4cf;
}
.btn--danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
/* Publish: green when there are unpublished edits, muted while idle or busy. */
.btn--publish {
  background: var(--ok, #15803d);
  color: #fff;
  border-color: var(--ok, #15803d);
}
.btn--publish:hover { filter: brightness(0.92); border-color: var(--ok, #15803d); }
.btn--publish[disabled] {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--border);
  cursor: default;
  filter: none;
}
.bar__publish-info {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-soft);
  max-width: 190px;
  white-space: normal;
}
.btn--large {
  padding: 14px 22px;
  font-size: 15px;
}
.btn--block {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

#main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.section {
  scroll-margin-top: calc(var(--bar-h) + 16px);
  margin-bottom: 56px;
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.section__title {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}
.section__sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-mute);
  flex: 1 1 100%;
}

/* ============================================================
   FIELD SEARCH
   ============================================================ */

.search {
  position: relative;
  margin-bottom: 24px;
}
.search__box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search__box:focus-within { border-color: var(--text); }
.search__icon { font-size: 15px; line-height: 1; opacity: 0.6; }
.search__input {
  flex: 1;
  padding: 14px 0;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}
.search__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-mute);
}
.search__results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 56vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.search__hit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  font-family: inherit;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.search__hit:last-child { border-bottom: none; }
.search__hit:hover { background: var(--bg); }
.search__hit-label { font-size: 14px; font-weight: 600; color: var(--text); }
.search__hit-where { font-size: 12px; color: var(--pf-red); font-weight: 600; }
.search__hit-key {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}
.search__empty { padding: 14px; font-size: 13px; color: var(--text-mute); }

/* ============================================================
   STATS STRIP
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s;
}
.stat:hover { border-color: var(--text); }
.stat__icon { font-size: 26px; line-height: 1; }
.stat__num {
  font-family: var(--display);
  font-size: 28px;
  line-height: 0.9;
}
.stat__lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   BLOCK GRID — section blocks
   ============================================================ */

.blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  font-family: inherit;
  color: var(--text);
}
.block:hover {
  border-color: var(--pf-red);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.block__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.block__title-icon { font-size: 16px; }
.block__count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-mute);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.block__body {
  padding: 14px 16px;
  flex: 1;
  font-size: 13px;
  color: var(--text-soft);
}
.block__foot {
  padding: 8px 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* Empty preview */
.empty {
  font-size: 13px;
  color: var(--text-mute);
  font-style: italic;
  padding: 8px 0;
}

/* ============================================================
   HOME SECTION PREVIEWS — match the live site
   ============================================================ */

.p-hero {
  position: relative;
  background: var(--pf-ink);
  color: var(--pf-cream);
  border-radius: 6px;
  overflow: hidden;
  min-height: 200px;
  isolation: isolate;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.p-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.55;
}
.p-hero__stamps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.p-stamp {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  border: 1px solid var(--pf-ink);
}
.p-stamp--red { background: var(--pf-red); color: #fff; border-color: var(--pf-red); }
.p-stamp--gold { background: var(--pf-gold); color: var(--pf-ink); border-color: var(--pf-gold); }
.p-stamp--out { background: transparent; color: var(--pf-cream); border-color: var(--pf-cream); }
.p-hero__title {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 0.9;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}
.p-hero__count {
  font-family: var(--mono);
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.75;
  position: relative;
  z-index: 1;
}

.p-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.p-quick__cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--pf-ink);
  border: 1px solid var(--pf-ink);
  overflow: hidden;
}
.p-quick__cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.p-quick__cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,18,16,0.1), rgba(20,18,16,0.85));
}
.p-quick__title {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  z-index: 2;
  color: var(--pf-cream);
  font-family: var(--display);
  font-size: 11px;
  line-height: 0.95;
}

.p-events {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.p-event {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 4px;
}
.p-event__img {
  aspect-ratio: 16/10;
  background: var(--bg);
  position: relative;
}
.p-event__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-event__date {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #fff;
  color: var(--pf-ink);
  border: 1px solid var(--pf-ink);
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
}
.p-event__body {
  padding: 6px 8px;
  font-size: 11px;
}
.p-event__title {
  font-weight: 700;
  font-family: var(--black);
  line-height: 1.2;
  color: var(--text);
}

.p-about {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: stretch;
}
.p-about__photo {
  aspect-ratio: 4/5;
  background: var(--bg);
  border: 1px solid var(--pf-ink);
  box-shadow: 4px 4px 0 var(--pf-red);
  overflow: hidden;
}
.p-about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.p-about__heading {
  font-family: var(--display);
  font-size: 24px;
  line-height: 0.9;
  color: var(--text);
}
.p-about__body {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-soft);
  margin-top: 6px;
}
.p-about__stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px dashed var(--pf-ink);
  padding-top: 8px;
}
.p-about__stat-num {
  font-family: var(--display);
  font-size: 18px;
  color: var(--pf-red);
  line-height: 0.9;
}
.p-about__stat-lbl {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

.p-mission {
  background: var(--pf-red);
  color: #fff;
  padding: 14px;
  border-radius: 4px;
  text-align: center;
}
.p-mission__amount {
  font-family: var(--display);
  font-size: 48px;
  line-height: 0.85;
  color: var(--pf-gold);
  text-shadow: 2px 2px 0 var(--pf-ink);
}
.p-mission__sub {
  font-family: var(--black);
  font-size: 11px;
  margin-top: 4px;
}

.p-pillars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.p-pillar {
  background: var(--pf-ink);
  border: 1px solid var(--pf-ink);
  overflow: hidden;
  aspect-ratio: 1/1.1;
  position: relative;
}
.p-pillar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 60%;
  object-fit: cover;
}
.p-pillar__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: var(--pf-cream);
  border-top: 1px solid var(--pf-ink);
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-family: var(--display);
  font-size: 10px;
  color: var(--pf-ink);
}

.p-collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.p-collage__cell {
  aspect-ratio: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.p-collage__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-credits {
  background: var(--pf-ink);
  color: var(--pf-cream);
  padding: 14px;
  border-radius: 4px;
}
.p-credits__title {
  font-family: var(--display);
  font-size: 22px;
  color: var(--pf-gold);
  line-height: 0.9;
}
.p-credits__body {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.85;
}

.p-join {
  background: var(--pf-ink);
  color: var(--pf-cream);
  padding: 14px;
  border-radius: 4px;
}
.p-join__heading {
  font-family: var(--display);
  font-size: 18px;
  color: var(--pf-gold);
  line-height: 0.9;
}
.p-join__heading--red { color: var(--pf-red); }
.p-join__body {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.75;
}

.p-footer {
  background: var(--pf-red);
  color: #fff;
  padding: 14px;
  border-radius: 4px;
}
.p-footer__lock {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 0.85;
}
.p-footer__email {
  font-family: var(--black);
  font-size: 11px;
  margin-top: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px;
  display: inline-block;
}
.p-footer__tag {
  font-family: var(--black);
  font-size: 10px;
  margin-top: 6px;
  opacity: 0.8;
}

.p-kv {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.p-kv__row {
  display: flex;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.p-kv__k {
  font-weight: 700;
  color: var(--text-mute);
  min-width: 110px;
  flex-shrink: 0;
}
.p-kv__v { color: var(--text); flex: 1; word-break: break-word; }

/* ============================================================
   EVENTS / MEMBERS / GALLERY LISTS
   ============================================================ */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list__search {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font-family: inherit;
  margin-bottom: 8px;
}
.list__search:focus {
  outline: 2px solid var(--pf-red);
  outline-offset: 1px;
  border-color: var(--pf-red);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.row:hover {
  border-color: var(--pf-red);
  transform: translateX(2px);
}
.row__thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row__info { flex: 1; min-width: 0; }
.row__title {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
.row__meta {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.row__arrow {
  color: var(--text-mute);
  font-size: 22px;
  flex-shrink: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.member {
  position: relative;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.member:hover {
  border-color: var(--pf-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.member__photo {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.member__name {
  font-weight: 700;
  font-size: 13px;
}
.member__role {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}
.member__order {
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--pf-ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================
   MEDIA LIBRARY
   ============================================================ */

.media-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.media-folder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #555);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.media-folder:hover { background: var(--bg, #f4f4f4); color: var(--text, #111); }
.media-folder--active {
  background: var(--text, #111);
  color: var(--surface, #fff);
  border-color: var(--text, #111);
}
.media-folder--used {
  background: #e6f7ec;
  color: #14532d;
  border-color: #86efac;
}
.media-folder--used:hover { background: #d1fae5; color: #065f46; }
.media-folder--used.media-folder--active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.media-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-item__img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  object-fit: cover;
  display: block;
}
.media-item__name {
  padding: 6px 8px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-soft);
  word-break: break-word;
  flex: 1;
}
.media-item__actions {
  display: flex;
  border-top: 1px solid var(--border);
}
.media-item__btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-soft);
}
.media-item__btn:last-child { border-right: none; }
.media-item__btn:hover { background: var(--bg); color: var(--text); }
.media-item__btn--danger { color: var(--danger); }
.media-item__btn--danger:hover { background: #fef2f2; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 14px;
}
.dropzone:hover, .dropzone--active {
  border-color: var(--pf-red);
  background: var(--pf-cream);
}
.dropzone__title { font-weight: 700; }
.dropzone__hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
}
.dropzone input[type=file] { display: none; }

/* ============================================================
   PANEL (slide-in editor)
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,16,0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 640px;
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}
.panel--open { transform: translateX(0); }
.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel__head h2 {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.panel__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-soft);
}
.panel__icon:hover {
  background: var(--bg);
  color: var(--text);
}
.panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 80px;
}
.panel__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.field__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field__hint {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s;
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: 2px solid var(--pf-red);
  outline-offset: 1px;
  border-color: var(--pf-red);
}
.field__textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}
.field__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.field__toggle input { transform: scale(1.2); accent-color: var(--pf-red); }

.field-section {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--pf-red);
  text-transform: uppercase;
  border-top: 2px solid var(--pf-red);
  padding-top: 16px;
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Image picker */
.imgfield {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.imgfield__preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.imgfield__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.imgfield__preview--empty { color: var(--text-mute); font-size: 13px; }
.imgfield__actions {
  display: flex;
  gap: 6px;
}
.imgfield__path {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  word-break: break-all;
}

/* List fields (object-list, string-list, image-list) */
.objlist__item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 8px;
}
.imgmove { margin-bottom: 10px; }
.imgmove__select { margin-bottom: 0; }
.imgmove--off {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.objlist__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.objlist__remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.objlist__remove:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.objlist__add {
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.objlist__add:hover {
  border-color: var(--pf-red);
  color: var(--pf-red);
}

.strlist__row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.strlist__row .field__input { margin-bottom: 0; }

/* Image picker modal */
.picker {
  position: fixed;
  inset: 0;
  background: rgba(20,18,16,0.6);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.picker--open { display: flex; }
.picker__panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.picker__head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
}
.picker__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--pf-ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 300;
}
.toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success { background: #2D7D44; }
.toast--error { background: var(--danger); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .bar { padding: 0 12px; gap: 12px; }
  .bar__sections { display: none; }
  .bar__name { display: none; }
  .bar__actions .btn { padding: 6px 10px; font-size: 12px; }
  #main { padding: 20px 16px 80px; }
  .section__title { font-size: 24px; }
  .blocks { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .p-quick { grid-template-columns: repeat(2, 1fr); }
  .p-pillars { grid-template-columns: repeat(3, 1fr); }
  .p-events { grid-template-columns: 1fr; }
  .stat__num { font-size: 22px; }
}

/* ---- Image picker: multi-select + upload destination ---- */
.dropzone__dest {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.dropzone__folder {
  width: auto;
  min-width: 160px;
  padding: 4px 8px;
  font-size: 12px;
}
.media-item { position: relative; }
.media-item--selected { outline: 3px solid var(--primary, #C8332E); outline-offset: -3px; }
.media-item__check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-item--selected .media-item__check { background: var(--primary, #C8332E); }
.picker__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card, #fff);
}
.picker__foot > div { display: flex; gap: 8px; }
.picker__foot-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.objlist__add--primary {
  font-weight: 700;
  border-color: var(--primary, #C8332E);
  color: var(--primary, #C8332E);
}
