/* Control panels and forms: practical, readable layout in the brand palette. */

.page-admin { font-family: var(--sans); font-size: 15px; line-height: 1.5; }

.ad-head { background: var(--navy-deep, var(--paper)); border-bottom: 1px solid var(--on-bg-line, var(--line)); }
.ad-head-inner {
  max-width: 1100px; margin: 0 auto; padding: 28px 20px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.ad-kicker { margin: 0; font-family: var(--script); font-size: 1.35rem; font-weight: 600; color: var(--accent); }
.ad-head h1 { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; line-height: 1.15; margin: 2px 0 0; }
.ad-sub { margin: 4px 0 0; color: var(--on-bg-2, var(--ink-2)); }
.ad-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--on-bg-tint, var(--tint)); color: var(--on-bg, var(--ink)); font-size: 0.86rem; font-weight: 500; transition: background 0.2s;
}
.ad-link:hover { background: var(--on-bg-line, var(--tint-2)); }
.ad-link .icon { width: 14px; height: 14px; }

.ad-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.ad-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px;
  border-radius: 14px; background: #fdf6e6; border: 1px solid #efe0b8; color: #6b5520; font-size: 0.88rem;
}
.ad-note.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-deep); }
.ad-note.ok { background: var(--ok-soft); border-color: #d5d3b5; color: var(--ok); }
.ad-note .icon { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.ad-note .link { color: inherit; text-decoration: underline; }

.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ad-stat { background: var(--paper); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.ad-stat b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; line-height: 1.2; }
.ad-stat span { color: var(--muted); font-size: 0.82rem; }

.ad-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 860px) {
  .ad-grid { grid-template-columns: 1fr 1fr; }
  .ad-card.wide { grid-column: 1 / -1; }
}
.ad-card { background: var(--paper); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.ad-card h2 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 2px 0 16px; }

.ad-form { display: grid; gap: 14px; }
.ad-form label { display: grid; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.ad-form input, .ad-form textarea, .ad-select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
  font: inherit; font-size: 0.95rem; font-weight: 400; color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s;
}
.ad-form textarea { resize: vertical; }
.ad-form input:focus, .ad-form textarea:focus, .ad-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ad-form input:disabled { background: var(--tint); color: var(--muted); }
.ad-select { width: auto; padding: 8px 12px; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; white-space: nowrap; transition: background 0.2s, opacity 0.2s;
}
.ad-btn.primary { background: var(--btn); color: var(--btn-ink); }
.ad-btn.primary:hover { background: var(--btn-deep); }
.ad-btn.ghost { background: var(--tint); color: var(--ink); }
.ad-btn.ghost:hover { background: var(--tint-2); }
.ad-btn.danger { background: #fbeceb; color: var(--danger); }
.ad-btn.danger:hover { background: #f6dcda; }
.ad-btn.sm { height: 36px; padding: 0 14px; font-size: 0.82rem; }
.ad-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Cover photo, shown in the wedding's frame shape */
.cover-row { display: flex; align-items: center; gap: 26px; }
.cover-preview { flex: none; width: 130px; }
.cover-preview .frame { --edge: 4px; }
.cp-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 18%; text-align: center; font-size: 0.75rem; color: var(--muted); }
.cover-actions { display: grid; gap: 10px; }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.hint + .switch-row { border-top: 0; padding-top: 0; }
.switch-row b { display: block; font-size: 0.92rem; font-weight: 600; }
.switch-row small { color: var(--muted); font-size: 0.8rem; }
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 22%, var(--paper)); transition: background 0.2s; }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.5; }

.qr-preview { display: grid; place-items: center; min-height: 200px; margin: 16px 0; padding: 18px; border-radius: 16px; background: var(--tint); }
.qr-preview img { width: auto; max-height: 340px; border-radius: 6px; box-shadow: var(--shadow-sm); }
.qr-preview .hint { margin: 0; text-align: center; }

.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; }
.media-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sel-count { margin-right: auto; color: var(--muted); font-size: 0.85rem; }

.ad-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ad-item {
  position: relative; overflow: hidden; border-radius: 14px; background: var(--tint); cursor: pointer;
  outline: 2.5px solid transparent; outline-offset: -2.5px; transition: outline-color 0.15s;
}
.ad-item:hover { outline-color: var(--line); }
.ad-item.selected { outline-color: var(--accent); }
.ad-item .ph { aspect-ratio: 1; background: var(--tint-2); }
.ad-item .ph img, .ad-item .ph video { width: 100%; height: 100%; object-fit: cover; }
.ad-item input { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); pointer-events: none; }
.ad-item .kind {
  position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.72rem;
}
.ad-item .kind .icon { width: 11px; height: 11px; }
.ad-item .meta { padding: 8px 10px 10px; font-size: 0.76rem; line-height: 1.35; }
.ad-item .meta b { display: block; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-item .meta span { color: var(--muted); }
.ad-item .note {
  margin-top: 3px; color: var(--ink-2); font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ad-empty { grid-column: 1 / -1; margin: 0; padding: 30px; text-align: center; color: var(--muted); }

.danger-card h2 { color: var(--danger); }

/* ---------- Look & feel editor ---------- */
.look-grid { display: grid; gap: 26px; margin-top: 6px; }
@media (min-width: 900px) { .look-grid { grid-template-columns: 1fr 280px; } }
.mini-h { margin: 20px 0 10px; font-family: var(--sans); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mini-h:first-child { margin-top: 0; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.shape-opt {
  display: grid; justify-items: center; align-content: center; gap: 7px; min-height: 86px; padding: 12px 6px 10px;
  border-radius: 14px; background: var(--tint); border: 2px solid transparent; font-size: 0.78rem; color: var(--ink-2); transition: border-color 0.15s, background 0.15s;
}
.shape-opt svg { height: 38px; width: auto; max-width: 52px; fill: var(--accent); }
.shape-opt:hover { background: var(--tint-2); }
.shape-opt.on { border-color: var(--btn); background: var(--paper); color: var(--ink); font-weight: 600; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.preset {
  display: grid; gap: 8px; padding: 11px 12px; border-radius: 14px; background: var(--tint); border: 2px solid transparent;
  text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--ink); transition: border-color 0.15s, background 0.15s;
}
.preset:hover { background: var(--tint-2); }
.preset .dots { display: flex; }
.preset .dots i { width: 20px; height: 20px; border-radius: 50%; margin-right: -5px; box-shadow: 0 0 0 2px var(--paper), inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.preset.on { border-color: var(--btn); background: var(--paper); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.color-field { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.color-field:focus-within { border-color: var(--accent); }
.color-field input[type='color'] { flex: none; width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
.color-field input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type='color']::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 50%; }
.color-field input[type='color']::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 50%; }
.cf-text { display: grid; min-width: 0; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.cf-text input { width: 100%; padding: 0; border: 0; background: transparent; font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; color: var(--ink); text-transform: uppercase; }
.cf-text input:focus { outline: none; }
.contrast-note { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #fdf6e6; color: #6b5520; font-size: 0.82rem; }
.look-status { font-size: 0.82rem; font-weight: 600; color: var(--btn); }

/* Live preview phone */
.look-preview { display: grid; justify-items: center; align-content: start; gap: 8px; }
.pv-phone { width: 250px; padding: 10px; border-radius: 36px; background: #1b1b1f; box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.6); }
.pv-screen {
  display: grid; justify-items: center; padding: 26px 16px 18px; border-radius: 27px; overflow: hidden; text-align: center;
  background: var(--bg); color: var(--ink); font-family: var(--script);
}
.pv-date { margin: 0; font-style: italic; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.pv-names { margin: 4px 0 14px; font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.pv-frame-wrap { width: 62%; }
.pv-frame { --edge: 4px; }
.pv-frame .monogram b { font-size: 1.9rem; }
.pv-frame .monogram::before, .pv-frame .monogram::after { width: 26px; }
.pv-text { margin: 14px 0 6px; font-size: 0.82rem; line-height: 1.35; color: var(--ink-2); }
.pv-btn { width: 100%; margin-top: 7px; padding: 8px; border-radius: 999px; font-weight: 600; font-size: 0.98rem; }
.pv-btn.main { background: var(--btn); color: var(--btn-ink); }
.pv-btn.light { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

@media (max-width: 520px) {
  .two { grid-template-columns: 1fr; }
  .cover-row { flex-direction: column; align-items: flex-start; }
}

/* Printing the QR card: hide everything except the card image. */
#printArea { display: none; }
@media print {
  @page { margin: 0.4in; }
  body.printing > * { display: none !important; }
  body.printing #printArea { display: flex !important; justify-content: center; align-items: center; height: 95vh; }
  #printArea img { max-width: 100%; max-height: 100%; }
}
