:root {
  --primary: #b7004f;
  --primary-soft: #fff0f5;
  --ink: #1f2328;
  --muted: #667085;
  --line: #e6e8ec;
  --panel: #ffffff;
  --page: #f6f7f9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 8%, rgba(183, 0, 79, 0.12), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(156, 83, 205, 0.1), transparent 30%),
    var(--page);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:active,
a:active {
  transform: scale(0.98);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(183, 0, 79, 0.45);
  box-shadow: 0 0 0 4px rgba(183, 0, 79, 0.08);
  outline: none;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.material-symbols-outlined.filled {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.ambient-light {
  width: 280px;
  height: 280px;
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.38;
  pointer-events: none;
}

.light-one {
  top: 40px;
  right: 8%;
  background: rgba(183, 0, 79, 0.22);
}

.light-two {
  bottom: 10%;
  left: 24%;
  background: rgba(156, 83, 205, 0.16);
}

.admin-shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%),
    #101114;
  color: white;
  box-shadow: 18px 0 40px rgba(16, 17, 20, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 22px;
}

.brand > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  font-weight: 800;
}

.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  text-align: left;
}

.admin-nav button.active,
.admin-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-topbar p,
.section-title p {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-topbar h1,
.section-title h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions a,
.topbar-actions button,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.connection-banner,
.auth-panel {
  border: 1px solid #f0dce5;
  border-radius: 12px;
  background: #fff8fb;
}

.connection-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  color: #5a4045;
}

.connection-banner.is-connected {
  border-color: #d7f2df;
  background: #f0fbf4;
}

.connection-banner > span {
  color: var(--primary);
}

.connection-banner strong,
.connection-banner p {
  margin: 0;
}

.connection-banner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.connection-banner code {
  color: var(--primary);
  font-weight: 800;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
}

.manager-access-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) minmax(160px, 0.6fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e6ff;
  border-radius: 12px;
  background: #f7faff;
}

.manager-access-panel strong,
.manager-access-panel small {
  display: block;
}

.manager-access-panel strong {
  font-size: 15px;
  font-weight: 800;
}

.manager-access-panel small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.manager-access-panel label {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.manager-access-panel input {
  width: 100%;
  margin-top: 6px;
}

body.manager-mode [data-owner-only] {
  display: none !important;
}

.primary-action {
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.secondary-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: grid;
  gap: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.event-context-bar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.04);
}

.event-context-bar label,
.event-context-bar strong,
.event-context-bar small {
  display: block;
}

.event-context-bar label {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.event-context-bar select {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.event-context-bar strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.event-context-bar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stats-grid,
.media-grid,
.send-grid,
.template-grid,
.rsvp-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stats-grid article,
.panel,
.upload-card,
.send-card,
.template-grid article,
.rsvp-summary article {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
}

.stats-grid article::after,
.panel::after,
.upload-card::after,
.send-card::after,
.template-grid article::after,
.rsvp-summary article::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.65), transparent 62% 100%);
  opacity: 0;
  transform: translateX(-80%);
  pointer-events: none;
}

.stats-grid article:hover,
.panel:hover,
.upload-card:hover,
.send-card:hover,
.template-grid article:hover,
.rsvp-summary article:hover {
  border-color: rgba(183, 0, 79, 0.18);
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.08);
}

.stats-grid article:hover::after,
.panel:hover::after,
.upload-card:hover::after,
.send-card:hover::after,
.template-grid article:hover::after,
.rsvp-summary article:hover::after {
  animation: card-sheen 900ms ease;
}

.stats-grid article,
.upload-card,
.send-card,
.template-grid article,
.rsvp-summary article {
  padding: 18px;
}

.stats-grid span {
  color: var(--primary);
}

.stats-grid strong,
.rsvp-summary strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  font-weight: 800;
}

.stats-grid small,
.rsvp-summary span,
.template-grid span,
.upload-card small,
.send-card small {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
}

.panel-header button {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

.guest-sheet-panel {
  padding: 0;
}

.guest-metrics {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fcfcfd);
}

.guest-metrics article:nth-of-type(n + 4) {
  min-height: 68px;
}

.guest-total-control,
.guest-metrics article {
  min-height: 76px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.guest-total-control {
  align-content: center;
}

.guest-total-control input {
  height: 36px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
}

.guest-metrics article {
  display: flex;
  align-items: center;
  gap: 11px;
}

.guest-metrics article > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.guest-metrics strong,
.guest-metrics small {
  display: block;
}

.guest-metrics strong {
  font-size: 24px;
  font-weight: 800;
}

.guest-metrics small {
  color: var(--muted);
  font-size: 12px;
}

.guest-metrics .is-over {
  color: #b42318;
}

.guest-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.guest-sheet-toolbar strong,
.guest-sheet-toolbar small {
  display: block;
}

.guest-sheet-toolbar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-wrap {
  max-height: 520px;
  overflow: auto;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, rgba(183, 0, 79, 0.12), rgba(31, 35, 40, 0.05)) border-box;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.guest-sheet {
  min-width: 1180px;
  table-layout: fixed;
}

.guest-sheet th,
.guest-sheet td {
  height: 44px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  vertical-align: middle;
}

.guest-sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475467;
  box-shadow: inset 0 -1px 0 var(--line);
}

.guest-sheet tbody tr:nth-child(even) {
  background: #fcfcfd;
}

.guest-sheet tbody tr:hover {
  background: #fff8fb;
}

.guest-sheet td[contenteditable="true"] {
  outline: 0;
}

.guest-sheet td[contenteditable="true"]:focus {
  position: relative;
  background: white;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.guest-sheet select {
  height: 32px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
}

.guest-sheet .row-number {
  width: 48px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.guest-sheet th.row-number {
  z-index: 3;
}

.guest-sheet .sheet-actions {
  width: 120px;
  text-align: center;
}

.pass-cell,
.cover-cell {
  width: 150px;
}

.pass-button,
.cover-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
}

.pass-button:hover {
  background: var(--primary);
  color: white;
}

.guest-sheet tr[data-guest-status="confirmed"] .pass-button {
  background: #e9f8ef;
  color: #137a3a;
}

.guest-sheet tr[data-guest-status="pending"] .pass-button {
  background: #fff4db;
  color: #966000;
}

.guest-sheet tr[data-guest-status="declined"] .pass-button {
  background: #fee4e2;
  color: #b42318;
}

.guest-sheet tr[data-guest-status="confirmed"] select {
  border-color: #abefc6;
  background: #f0fbf4;
  color: #137a3a;
}

.guest-sheet tr[data-guest-status="pending"] select {
  border-color: #fedf89;
  background: #fffbeb;
  color: #966000;
}

.guest-sheet tr[data-guest-status="declined"] select {
  border-color: #fecdca;
  background: #fff5f4;
  color: #b42318;
}

.cover-button {
  background: #eef2ff;
  color: #3447a8;
}

.cover-button:hover {
  background: #3447a8;
  color: white;
}

.pass-button span,
.cover-button span {
  font-size: 18px;
}

.invitation-flow-button,
.guest-sheet .sheet-actions button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #98a2b3;
}

.invitation-flow-button {
  background: #f3f0ff;
  color: #6941c6;
  text-decoration: none;
}

.invitation-flow-button:hover {
  background: #6941c6;
  color: white;
}

.guest-sheet .sheet-actions button {
  background: transparent;
}

.guest-sheet .sheet-actions button:hover {
  background: #fff0f5;
  color: var(--primary);
}

.invitation-flow-button span,
.guest-sheet .sheet-actions span {
  font-size: 20px;
}

.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status.live {
  background: #e9f8ef;
  color: #137a3a;
}

.status.draft {
  background: #fff4db;
  color: #966000;
}

.status.paused {
  background: #eef2ff;
  color: #3447a8;
}

.status.archived {
  background: #f1f3f5;
  color: #667085;
}

.invitations-table {
  min-width: 860px;
}

.event-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.event-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.event-actions a,
.event-actions button {
  width: 31px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f4f7;
  color: #667085;
  text-decoration: none;
}

.event-actions a:hover,
.event-actions button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.event-actions button[data-event-action="delete"]:hover {
  background: #fee4e2;
  color: #b42318;
}

.event-actions span {
  font-size: 19px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.create-event-card {
  display: grid;
  gap: 18px;
}

.invitation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.new-invitation-card,
.invitation-card {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
}

.new-invitation-card {
  place-items: center;
  align-content: center;
  border-style: dashed;
  color: var(--primary);
  text-align: center;
}

.new-invitation-card > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 30px;
}

.new-invitation-card strong,
.new-invitation-card small,
.invitation-card strong,
.invitation-card small {
  display: block;
}

.new-invitation-card small,
.invitation-card small,
.invitation-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.invitation-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.invitation-card-top > .material-symbols-outlined {
  color: var(--primary);
  font-size: 30px;
}

.invitation-card > strong {
  font-size: 18px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 17, 20, 0.42);
  backdrop-filter: blur(8px);
}

.event-modal-panel {
  width: min(980px, 100%);
  max-height: min(88vh, 860px);
  position: relative;
  z-index: 1;
  overflow: auto;
}

.preview-modal-panel {
  width: min(560px, 100%);
  max-height: min(90vh, 920px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}

.manager-access-modal-panel {
  width: min(560px, 100%);
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.modal-close-button {
  width: 38px;
  height: 38px;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f2f4f7;
  color: #667085;
}

.preview-modal-header {
  padding-right: 48px;
}

.preview-modal-header strong,
.preview-modal-header small {
  display: block;
  margin: 0;
}

.preview-modal-header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.manager-access-modal-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding-right: 48px;
}

.manager-access-modal-header > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 28px;
}

.manager-access-modal-header p,
.manager-access-modal-header h3,
.manager-access-modal-header small {
  margin: 0;
}

.manager-access-modal-header p {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manager-access-modal-header h3 {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
}

.manager-access-modal-header small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.manager-code-display {
  padding: 18px;
  border: 1px dashed rgba(183, 0, 79, 0.32);
  border-radius: 12px;
  background: #fff8fb;
  color: var(--primary);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.manager-link-field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.manager-link-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
}

.manager-access-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-modal-panel iframe {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6f7f9;
}

.create-event-header,
.create-section-title,
.location-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-event-header {
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.create-event-header h3,
.create-event-header small,
.create-section-title strong,
.create-section-title small,
.location-card-title strong,
.location-card-title small {
  display: block;
  margin: 0;
}

.create-event-header h3 {
  font-size: 20px;
}

.create-event-header small,
.create-section-title small,
.location-card-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.create-event-header > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.create-section {
  display: grid;
  gap: 14px;
}

.create-section-title > span,
.location-card-title > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.location-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.location-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfd;
}

.compact-grid {
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 98px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.slug-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.slug-field span {
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
}

.slug-field input {
  border: 0;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

body.cover-studio-mode .editor-layout {
  grid-template-columns: minmax(260px, 0.64fr) minmax(360px, 0.82fr) minmax(360px, 0.9fr);
}

body.cover-studio-mode .editor-layout > .panel:first-child,
body.cover-studio-mode .editor-card,
.cover-studio-preview {
  max-height: calc(100vh - 132px);
  overflow: auto;
}

body.cover-studio-mode .editor-layout > .panel:first-child {
  position: sticky;
  top: 18px;
}

.editor-card {
  padding: 0;
}

.cover-studio-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  position: sticky;
  top: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    white;
}

.cover-studio-header,
.cover-studio-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cover-studio-header small,
.cover-studio-header strong {
  display: block;
}

.cover-studio-header small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cover-studio-header strong {
  margin-top: 2px;
  color: #101828;
  font-size: 16px;
}

.cover-studio-header button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f2f4f7;
  color: #667085;
}

.cover-device-frame {
  min-height: 640px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 22%, rgba(183, 0, 79, 0.08), transparent 30%),
    linear-gradient(180deg, #f7f8fb, #eef1f5);
}

.cover-device-frame iframe {
  width: min(100%, 390px);
  height: min(76vh, 700px);
  min-height: 610px;
  border: 0;
  border-radius: 28px;
  background: white;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

.cover-studio-actions button,
.cover-studio-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.cover-studio-actions button:first-child {
  background: var(--primary);
  color: white;
}

.editor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.editor-card-header h3,
.editor-card-header small {
  display: block;
  margin: 0;
}

.editor-card-header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.editor-event-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(183, 0, 79, 0.12);
  border-radius: 999px;
  background: rgba(183, 0, 79, 0.06);
  color: #6c2142;
  font-size: 12px;
}

.editor-event-chip strong,
.editor-event-chip span {
  margin: 0;
}

.editor-event-chip span {
  color: var(--muted);
  font-family: "Plus Jakarta Sans", sans-serif;
}

.editor-event-chip em {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(108, 33, 66, 0.1);
  color: #6c2142;
  font-style: normal;
  font-weight: 800;
  text-transform: capitalize;
}

.editor-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff4db;
  color: #966000;
  font-size: 11px;
  font-weight: 800;
}

.editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.editor-form label {
  min-width: 0;
}

.editor-form label > span {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.inline-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f8fafc;
}

.inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.editor-section-heading {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f8fafc;
}

.editor-section-heading strong {
  color: #101828;
  font-size: 13px;
}

.editor-section-heading small {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-content: start;
}

.range-field > strong {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  align-self: end;
}

.range-field input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--primary);
}

.editor-form input[type="text"],
.editor-form input[type="number"],
.editor-form input[type="url"],
.editor-form textarea {
  border-radius: 8px;
  background: #fcfcfd;
}

.editor-form textarea {
  min-height: 132px;
  line-height: 1.55;
}

.itinerary-editor-stack {
  display: grid;
  gap: 14px;
}

.itinerary-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.itinerary-editor-header strong,
.itinerary-editor-header small {
  display: block;
}

.itinerary-editor-header strong {
  color: #344054;
  font-size: 13px;
}

.itinerary-editor-header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

[data-itinerary-items] {
  display: grid;
  gap: 12px;
}

.itinerary-editor-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.itinerary-editor-item-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.itinerary-editor-item-top strong {
  color: #344054;
  font-size: 13px;
}

.itinerary-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #344054;
}

.mini-action .material-symbols-outlined {
  font-size: 18px;
}

.mini-action:hover {
  background: #f8fafc;
}

.itinerary-editor-item .wide {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .itinerary-editor-header,
  .itinerary-editor-item-top {
    align-items: stretch;
    flex-direction: column;
  }

  .itinerary-editor-actions {
    justify-content: flex-start;
  }

  .itinerary-editor-item {
    grid-template-columns: minmax(0, 1fr);
  }
}

.inline-media-card {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
}

.inline-media-card strong,
.inline-media-card small {
  display: block;
}

.inline-media-card .media-preview {
  min-height: 180px;
}

.color-field {
  align-content: start;
}

.color-control {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfd;
}

.color-control input {
  width: 42px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.color-control strong {
  color: #344054;
  font-size: 13px;
  letter-spacing: 0;
}

.toggle-list {
  display: grid;
  gap: 8px;
}

.toggle-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfd;
  color: #344054;
  font-weight: 700;
  text-align: left;
}

.toggle-list button:hover,
.toggle-list button.active {
  border-color: rgba(183, 0, 79, 0.22);
  background: #fff8fb;
}

.toggle-list span {
  min-width: 0;
}

.toggle-list input {
  width: 40px;
  height: 22px;
  position: relative;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #d0d5dd;
  cursor: pointer;
}

.toggle-list i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #667085;
  font-style: normal;
}

.toggle-list i:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.toggle-list input::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.22);
  transition: transform 180ms ease;
}

.toggle-list input:checked {
  background: var(--primary);
}

.toggle-list input:checked::after {
  transform: translateX(18px);
}

.upload-card,
.send-card {
  display: grid;
  gap: 8px;
}

.upload-card > span,
.send-card > span {
  color: var(--primary);
  font-size: 30px;
}

.send-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fcfcfd;
}

.send-meta b {
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

.send-meta span {
  color: var(--muted);
  font-size: 12px;
}

.send-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.send-guest-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
  animation: send-card-in 260ms ease both;
}

.send-guest-card.is-waiting {
  border-color: #fedf89;
  background: #fffbeb;
}

.send-guest-card.is-confirmed {
  border-color: #abefc6;
  background: #f0fbf4;
  opacity: 0.78;
}

.send-guest-card.is-moving {
  animation: send-card-move 520ms ease both;
}

.send-guest-card.is-empty {
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.send-guest-card.is-empty > span {
  color: var(--primary);
  font-size: 32px;
}

.send-guest-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.send-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.send-guest-main strong,
.send-guest-main small {
  display: block;
}

.send-guest-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-guest-main small,
.send-state {
  color: var(--muted);
  font-size: 12px;
}

.messages-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.messages-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.messages-summary article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.messages-summary article > span {
  color: var(--primary);
  font-size: 28px;
}

.messages-summary strong,
.messages-summary small {
  display: block;
}

.messages-summary strong {
  font-size: 28px;
  line-height: 1;
}

.messages-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.messages-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.message-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
}

.message-card.is-empty {
  min-height: 140px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.message-card.is-empty > span {
  color: var(--primary);
  font-size: 34px;
}

.message-card-header,
.message-card-meta,
.message-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-card-header {
  align-items: flex-start;
}

.message-guest {
  min-width: 0;
}

.message-guest strong,
.message-guest small {
  display: block;
}

.message-guest strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-guest small,
.message-card-meta,
.message-card-note {
  color: var(--muted);
  font-size: 12px;
}

.message-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.message-type-badge.is-video {
  background: #eef4ff;
  color: #3453d1;
}

.message-body {
  display: grid;
  gap: 12px;
}

.message-text {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #fcfcfd;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}

.message-video {
  width: 100%;
  border-radius: 12px;
  background: #0f172a;
}

.message-card-actions {
  justify-content: flex-end;
}

.message-card-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.send-guest-actions {
  display: flex;
  gap: 8px;
}

.send-guest-actions button {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.send-guest-actions button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.send-guest-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.send-state {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f2f4f7;
  font-weight: 800;
}

.is-waiting .send-state {
  background: #fff4db;
  color: #966000;
}

.is-confirmed .send-state {
  background: #e9f8ef;
  color: #137a3a;
}

.upload-card button,
.upload-button,
.send-card button {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.media-uploader {
  align-content: start;
}

.media-preview {
  min-height: 142px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 8px 0 2px;
  border: 1px dashed #d0d5dd;
  border-radius: 10px;
  background: #fcfcfd;
  color: #98a2b3;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  min-height: 142px;
  object-fit: cover;
}

.media-preview audio {
  width: calc(100% - 20px);
}

.media-preview > .material-symbols-outlined {
  font-size: 34px;
}

.gallery-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.gallery-preview img {
  min-height: 62px;
  aspect-ratio: 1;
  border-radius: 7px;
}

.media-upload-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 0;
}

.media-upload-meta small {
  color: var(--muted);
  font-size: 11px;
}

.media-upload-meta small[data-media-status] {
  color: var(--primary);
  font-weight: 700;
  text-align: right;
}

.media-upload-meta small[data-media-status][data-tone="success"] {
  color: #137a3a;
}

.media-upload-meta small[data-media-status][data-tone="error"] {
  color: #b42318;
}

.media-progress {
  height: 6px;
  overflow: hidden;
  margin: 8px 2px 0;
  border-radius: 999px;
  background: #f1e0e8;
}

.media-progress span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #d81b78, #f263a1);
  transition: width 180ms ease;
}

.audio-preview {
  gap: 8px;
  padding: 14px;
  text-align: center;
}

.audio-preview small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.media-actions button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 0;
  text-align: center;
}

.media-actions button {
  background: #f2f4f7;
  color: #667085;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease;
}

.click-spark {
  width: 10px;
  height: 10px;
  position: fixed;
  z-index: 999;
  border-radius: 50%;
  background: rgba(183, 0, 79, 0.55);
  box-shadow: 0 0 22px rgba(183, 0, 79, 0.55);
  pointer-events: none;
  animation: spark-pop 520ms ease forwards;
}

@keyframes card-sheen {
  0% {
    opacity: 0;
    transform: translateX(-80%);
  }

  35% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: translateX(80%);
  }
}

@keyframes spark-pop {
  from {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.4);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4);
  }
}

@keyframes send-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes send-card-move {
  0% {
    opacity: 0.4;
    transform: translateY(-10px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.send-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-grid article strong,
.upload-card strong,
.send-card strong {
  display: block;
  font-size: 16px;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid,
  .media-grid,
  .template-grid,
  .rsvp-summary,
  .messages-summary,
  .manager-access-panel,
  .event-context-bar,
  .editor-layout,
  body.cover-studio-mode .editor-layout,
  .location-card-grid,
  .guest-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-studio-preview {
    grid-column: 1 / -1;
    position: static;
  }

  .send-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-main {
    padding: 16px;
  }

  .admin-topbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-nav,
  .auth-panel,
  .manager-access-panel,
  .stats-grid,
  .media-grid,
  .template-grid,
  .rsvp-summary,
  .messages-summary,
  .event-context-bar,
  .form-grid,
  .editor-layout,
  body.cover-studio-mode .editor-layout,
  .location-card-grid,
  .guest-metrics {
    grid-template-columns: 1fr;
  }

  .messages-feed {
    grid-template-columns: 1fr;
  }

  body.cover-studio-mode .editor-layout > .panel:first-child,
  body.cover-studio-mode .editor-card,
  .cover-studio-preview {
    max-height: none;
    position: static;
  }

  .cover-device-frame {
    min-height: 560px;
    padding: 12px;
  }

  .cover-device-frame iframe {
    min-height: 540px;
    height: 70vh;
  }

  .admin-topbar h1,
  .section-title h2 {
    font-size: 24px;
  }

  .gallery-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-access-modal-actions {
    grid-template-columns: 1fr;
  }

  .manager-code-display {
    font-size: 26px;
  }
}
