/* Admin-only styles, layered on the public styles.css */

/* The `hidden` attribute must beat any author display rule. Without this,
   `.gate { display: grid }` outranks the UA's `[hidden] { display: none }`,
   so the sign-in panel never disappeared after a SUCCESSFUL login and the
   app rendered underneath it. Keep this first. */
[hidden] { display: none !important; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-alt); }
.gate-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px; width: min(420px, 100%);
}
.gate-card h1 { font-family: var(--font-display); margin: 0 0 6px; font-size: 26px; }

#tabs button {
  background: none; border: 0; cursor: pointer; padding: 8px 12px;
  border-radius: 9px; color: var(--ink-soft); font-size: 15px;
}
#tabs button:hover { background: var(--surface-2); color: var(--ink); }
#tabs button.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.panel-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 28px 0 18px;
}
.panel-head h1 { font-family: var(--font-display); font-size: 26px; margin: 0; flex: 1; }

.tile-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.tile b { display: block; font-size: 26px; font-family: var(--font-display); line-height: 1.1; }
.tile span { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; }
.tile.warn { border-color: #d9a441; background: color-mix(in srgb, #d9a441 10%, var(--surface)); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; margin: 0 0 2px; }
.row-sub { color: var(--ink-faint); font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; flex: none; }
.row-thumb { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-2); }

.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--surface-2);
}
.tag-active   { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tag-draft    { background: #e9d9b8; color: #6a5220; border-color: transparent; }
.tag-private  { background: #d9c7ec; color: #4a2f6b; border-color: transparent; }
.tag-blocked  { background: #f0c6c0; color: #7d2b20; border-color: transparent; }
.tag-hidden   { background: #d8d8d8; color: #4a4a4a; border-color: transparent; }

.two-col { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }

.pick-map { height: 300px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.pick-hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

.photo-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 10px; }
.photo-item { position: relative; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; }
.photo-item input {
  width: 100%; margin-top: 5px; font-size: 12px; padding: 5px 7px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg);
}
.photo-x {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.62); color: #fff;
  cursor: pointer; font-size: 15px; line-height: 1;
}
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 24px;
  text-align: center; color: var(--ink-soft); cursor: pointer; background: var(--bg);
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

.token-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; overflow-wrap: anywhere; user-select: all;
}
.setup-steps { counter-reset: step; padding-left: 0; list-style: none; }
.setup-steps li {
  counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 16px;
}
.setup-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}

.tag-await  { background: #f6d9a8; color: #6a4a12; border-color: transparent; }
.tag-invite { background: #cfe3d3; color: #24522f; border-color: transparent; }

/* QR code shown on a phone at the campsite — needs to be big and high contrast. */
.qr-holder {
  display: inline-block; background: #fff; padding: 14px;
  border-radius: 12px; border: 1px solid var(--line); margin: 8px auto 0;
}
.qr-holder svg { width: min(260px, 60vw); height: auto; display: block; }
@media print {
  .site-header, .dialog-head, .dialog-foot, .hint, .token-box { display: none !important; }
  .qr-holder { border: 0; }
}

/* Dashboard invite card — the first thing you see, because it is the thing
   you need while standing next to the person you just met. */
.invite-card {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 22px;
}
.invite-copy { flex: 1; min-width: 260px; }
.invite-copy h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; }
.invite-copy p  { margin: 0 0 4px; color: var(--ink-soft); font-size: 14.5px; }
.qr-small { cursor: pointer; margin: 0; flex: none; }
.qr-small svg { width: 150px; }
@media (max-width: 620px) {
  .invite-card { justify-content: center; text-align: center; }
  .invite-copy { text-align: left; }
}

/* Full-screen QR for showing to someone. */
.qr-full {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  background: rgba(12,10,8,.93); padding: 20px;
}
.qr-full-inner { text-align: center; max-width: 92vw; }
.qr-full-title { color: #fff; font-family: var(--font-display); font-size: 22px; margin: 0 0 14px; }
.qr-full .qr-holder { padding: 20px; }
.qr-full .qr-holder svg { width: min(70vh, 82vw); height: auto; }
.qr-full-sub { color: #f0ece6; margin: 16px 0 4px; font-size: 16px; }
.qr-full-url {
  color: #b9b1a7; font-size: 12.5px; margin: 0 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere;
}
.qr-full .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }

/* ------------------------------------------------------------- mobile fit */

/* The tab bar overflows a phone (Settings and Invites fell off the edge).
   Let it scroll sideways instead of clipping. */
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  #tabs {
    order: 3; width: 100%; margin: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; scrollbar-width: none;
  }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs button { white-space: nowrap; flex: none; }
}

/* List rows are a horizontal flex, which squeezes the title into a sliver
   once the action buttons claim their space. Below this width, stack them. */
@media (max-width: 760px) {
  .row { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
  .row-main { flex: 1 1 100%; min-width: 0; }
  .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .row-actions { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; }
  .row-actions .btn { flex: 1 1 auto; min-width: 90px; }
  .row > select { flex: 1 1 100%; }
  /* Colour dot and status tag belong together, above the title. */
  .row > .dot { order: -2; }
  .row > .tag { order: -1; }
  .row-thumb { width: 44px; height: 44px; }
  .panel-head h1 { flex: 1 1 100%; }
}

/* The dashboard invite card stacks rather than squashing the QR. */
@media (max-width: 620px) {
  .invite-card { flex-direction: column; align-items: stretch; text-align: left; }
  .qr-small { align-self: center; }
  .invite-copy { min-width: 0; }
}

/* Demo-data warning. Deliberately loud — shipping the site with example
   content still on it would be embarrassing in front of family. */
.seed-banner {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, #d9a441 14%, var(--surface)) 0 14px,
    color-mix(in srgb, #d9a441 8%, var(--surface)) 14px 28px);
  border: 2px solid #d9a441; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
}
.seed-banner h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; }
.seed-banner p  { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* Illustration picker in the post editor. */
.scene-grid {
  display: grid; gap: 12px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.scene-pick {
  border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface); cursor: pointer; padding: 0; text-align: left;
  display: flex; flex-direction: column; transition: transform .14s ease, border-color .14s ease;
}
.scene-pick:hover { transform: translateY(-2px); border-color: var(--accent); }
.scene-pick img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.scene-pick span { padding: 8px 10px; font-size: 13px; color: var(--ink-soft); }
