/* ==========================================================================
   Admin surfaces — dashboard and moderation.

   Different job from the guest and wall surfaces. Those are celebratory; this
   is a cockpit someone drives for four hours under pressure while a room full
   of people watches the output. So: same warm palette for brand coherence,
   but denser, calmer, and with the destructive controls visually quarantined
   from the ones used every few seconds.
   ========================================================================== */

/* -- shell ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 249, 240, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #F0E2CE;
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 0;
}
.brand {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.topbar a { color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: .9rem; }
.topbar a:hover { color: var(--accent-deep); }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.25rem;
}
.page-head h1 {
  font-family: var(--font-hand);
  font-size: 2.6rem;
  margin: 0;
  line-height: 1.1;
  margin-right: auto;
}

/* -- event cards ---------------------------------------------------------- */

.events { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }

.event-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--lift-2);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--lift-3); }
.event-card h2 { margin: 0; font-size: 1.15rem; }
.event-card__row { display: flex; align-items: center; gap: .5rem; }
.event-card__stats { display: flex; gap: 1.25rem; margin-top: auto; padding-top: .5rem; }
.stat b { display: block; font-size: 1.5rem; line-height: 1; }
.stat span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.stat--pending b { color: var(--accent-deep); }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Copyable guest link. */
.linkbox {
  display: flex;
  gap: .4rem;
  align-items: center;
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  padding: .4rem .4rem .4rem .8rem;
}
.linkbox input {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  flex: 1;
  min-width: 0;
}

/* -- moderation ----------------------------------------------------------- */

.mod-grid { display: grid; grid-template-columns: 1fr 17rem; gap: 1.5rem; align-items: start; }
@media (max-width: 60rem) { .mod-grid { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  font: inherit;
  font-weight: 800;
  font-size: .85rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: .5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: #FFF6E8; }
.tab .n { opacity: .65; margin-left: .3rem; }

.queue { display: grid; gap: .75rem; }

.sub {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--lift-1);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .85rem;
  align-items: start;
  border-left: 5px solid var(--note-0);
  animation: sub-in .35s var(--ease) both;
}
@keyframes sub-in { from { opacity: 0; transform: translateY(-6px); } }

/* Leaving the queue is the confirmation. No toast needed for the common case. */
.sub.is-going { animation: sub-out .3s var(--ease) both; }
@keyframes sub-out { to { opacity: 0; transform: translateX(1.5rem); } }

.sub__msg {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 .4rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.sub__meta { font-size: .8rem; font-weight: 700; color: var(--ink-faint); }
.sub__acts { display: flex; flex-direction: column; gap: .4rem; }

.sub.is-flagged { border-left-color: var(--alert); background: #FFF7F7; }
.flag {
  display: inline-block;
  background: #FFE3E3;
  color: #A3262A;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .5rem;
  border-radius: 999px;
  margin-bottom: .3rem;
}

/* -- live controls -------------------------------------------------------- */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--lift-2);
  padding: 1.1rem;
  position: sticky;
  top: 4.5rem;
}
.panel h3 {
  margin: 0 0 .75rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
}
.panel + .panel { margin-top: 1rem; }

.seg { display: flex; background: var(--surface-sunk); border-radius: 999px; padding: .25rem; }
.seg button {
  font: inherit;
  flex: 1;
  font-size: .8rem;
  font-weight: 800;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: .45rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--lift-1); }

/* The danger zone is deliberately at the bottom, muted until hovered, and
   confirmed before it fires. Clearing the wall is instantly visible to a room
   full of people — it should never be a reflex click. */
.danger {
  margin-top: 1rem;
  border-top: 1px dashed #F0E2CE;
  padding-top: 1rem;
}
.danger .btn { width: 100%; background: transparent; color: var(--ink-faint); box-shadow: none; border: 2px solid #F5E6E6; }
.danger .btn:hover:not(:disabled) { background: var(--alert); color: #fff; border-color: var(--alert); }

.empty-queue { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); }
.empty-queue .e { font-size: 3rem; display: block; margin-bottom: .5rem; }

[hidden] { display: none !important; }
