:root {
  --navy: #0d1d35;
  --ink: #172032;
  --muted: #68717a;
  --pink: #ed0b8c;
  --pink-2: #d2077d;
  --deep: #8c155e;
  --blush: #fff3f9;
  --line: #f2d3e5;
  --ok: #1f8a5b;
  --bad: #c84235;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 16px/1.55 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, #fffafd 0%, #fff0f8 52%, #f3f7ff 100%);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; flex: none; }

.glow { position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; background: rgba(237, 11, 140, .12); filter: blur(40px); pointer-events: none; }
.glow.a { top: -240px; right: -160px; }
.glow.b { bottom: -260px; left: -200px; background: rgba(39, 59, 143, .08); }

.shell { width: min(560px, 100% - 32px); margin: 0 auto; padding: 28px 0 56px; }
.shell.wide { width: min(1120px, 100% - 32px); }

/* Event flyer header (invite page) */
.flyer-head { overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #fde6f2; }
.flyer-head img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.flyer-head .flyer-band { margin: 0; padding: 9px 12px; background: var(--pink); color: #fff; text-align: center; font: 700 10.5px Montserrat, sans-serif; letter-spacing: .14em; text-transform: uppercase; }

/* Event banner — mirrors the PDF ticket header */
.event-banner {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 24px 24px; background: linear-gradient(170deg, var(--pink) 0%, #b40f75 60%, var(--deep) 100%);
}
.event-banner::before, .event-banner::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.event-banner::before { width: 240px; height: 240px; right: -70px; top: -90px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); }
.event-banner::after { width: 160px; height: 160px; left: -60px; bottom: -80px; background: rgba(255,255,255,.06); }
.eb-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.eb-logo { background: #fff; border-radius: 99px; padding: 6px 12px; }
.eb-logo img { width: 92px; height: auto; }
.eb-tag { border: 1px solid rgba(255,255,255,.6); border-radius: 99px; padding: 5px 11px; font: 700 9.5px Montserrat, sans-serif; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.eb-edition { position: relative; margin: 0 0 6px; font: 700 10.5px Montserrat, sans-serif; letter-spacing: .22em; text-transform: uppercase; opacity: .82; }
.eb-title { position: relative; margin: 0; color: #fff; font: 800 clamp(34px, 9vw, 46px)/1 Montserrat, sans-serif; letter-spacing: -.03em; }
.eb-title em { display: block; color: #fff; margin-top: 4px; font: italic 500 clamp(29px, 8vw, 40px)/1.05 "Playfair Display", serif; letter-spacing: -.01em; }
.eb-kicker { position: relative; margin: 10px 0 20px; font: 500 13px Montserrat, sans-serif; opacity: .9; }
.eb-when { position: relative; display: flex; align-items: center; gap: 14px; }
.eb-day { width: 56px; height: 56px; flex: none; display: grid; place-content: center; text-align: center; background: #fff; color: var(--pink); border-radius: 14px; }
.eb-day strong { font: 800 22px/1 Montserrat, sans-serif; }
.eb-day span { color: var(--navy); font: 700 9px Montserrat, sans-serif; letter-spacing: .14em; }
.eb-when b { display: block; font: 700 14px Montserrat, sans-serif; }
.eb-when small { font-size: 13px; opacity: .92; }

.card { background: #fff; border-radius: var(--radius); box-shadow: 0 30px 70px rgba(99, 22, 72, .14); }
.card.joined { border-radius: 0 0 var(--radius) var(--radius); }
.card-body { padding: 26px 24px 28px; }
.label { margin: 0 0 6px; color: var(--pink); font: 700 10px Montserrat, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { font-family: Montserrat, sans-serif; letter-spacing: -.02em; color: var(--navy); }
.card h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.15; }
.lead { margin: 0 0 20px; color: var(--muted); }
.lead strong { color: var(--ink); }

/* Seat */
.seat { display: flex; gap: 14px; align-items: center; padding: 10px; background: var(--blush); border-radius: 16px; margin-bottom: 22px; }
.seat img { width: 116px; height: 82px; object-fit: cover; border-radius: 10px; flex: none; }
.seat-name { display: block; font: 800 16px/1.2 Montserrat, sans-serif; color: var(--navy); }
.swatch { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.swatch i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.swatch .p { background: var(--pink); } .swatch .w { background: #fff; } .swatch .k { background: #191919; }
.swatch span { margin-left: 4px; }

/* Pool */
.pool { margin: 0 0 22px; }
.pool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pool-head small { color: var(--muted); font-size: 12px; }
.pool ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pool li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; }
.avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--deep)); color: #fff; font: 700 12px Montserrat, sans-serif; }
.pool li div { min-width: 0; flex: 1; }
.pool li strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool li small { color: var(--muted); font-size: 12px; }
.badge { flex: none; padding: 3px 9px; border-radius: 99px; background: var(--blush); color: var(--deep); font: 700 10px Montserrat, sans-serif; letter-spacing: .04em; }
.pool li.empty { justify-content: center; border-style: dashed; color: var(--muted); font-size: 13px; }

/* Form */
.field { position: relative; margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--navy); font-size: 13px; font-weight: 600; }
.field input {
  width: 100%; min-height: 52px; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  outline: none; transition: border-color .2s, box-shadow .2s; font-size: 16px;
}
.field input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(237, 11, 140, .12); }
.phone { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.phone:focus-within { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(237, 11, 140, .12); }
.phone span { display: grid; place-items: center; padding: 0 12px; background: var(--blush); color: var(--deep); font-weight: 700; font-size: 14px; }
.phone input { border: 0; border-radius: 0; box-shadow: none !important; }
.field.invalid input, .field.invalid .phone { border-color: var(--bad); }

.btn {
  min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 20px;
  border: 0; border-radius: 12px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform .2s, background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 14px 32px rgba(237, 11, 140, .25); }
.btn-pink:hover { background: var(--pink-2); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: var(--blush); color: var(--deep); }
.btn-wa { background: #1fae5b; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.status { min-height: 22px; margin: 12px 0 0; font-size: 14px; color: var(--bad); text-align: center; }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* Confirmed banner */
.confirmed { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; background: #eaf7f0; color: #135c3b; border-radius: 14px; font-size: 14px; animation: fadeUp .5s ease both; }
.confirmed svg { color: var(--ok); margin-top: 2px; }

/* Web ticket */
.ticket { position: relative; animation: fadeUp .6s ease both; }
.ticket .card { border-radius: 0 0 var(--radius) var(--radius); }
.t-guest { font: 800 24px/1.15 Montserrat, sans-serif; color: var(--navy); margin: 0 0 16px; overflow-wrap: anywhere; }
.t-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 0; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.t-info small { display: block; color: var(--muted); font: 700 9.5px Montserrat, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.t-info strong { font: 700 14px Montserrat, sans-serif; }
.perf { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 6px 0; }
.perf::before, .perf::after { content: ""; position: absolute; top: -15px; width: 28px; height: 28px; border-radius: 50%; background: #fbeef6; }
.perf::before { left: -38px; } .perf::after { right: -38px; }
.stub { display: flex; gap: 20px; align-items: center; padding-top: 22px; }
.qr { width: 132px; height: 132px; flex: none; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr img { width: 100%; height: 100%; }
.code { display: block; font: 800 19px Montserrat, sans-serif; color: var(--navy); letter-spacing: .02em; }
.stub p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stub .by { color: var(--deep); font-weight: 600; }

.actions { display: grid; gap: 10px; margin-top: 20px; }
.section { margin-top: 18px; }
.share-box { padding: 20px; border-radius: 18px; background: linear-gradient(135deg, var(--navy), #1d2f58); color: #fff; }
.share-box h3 { color: #fff; margin: 0 0 4px; font-size: 18px; }
.share-box p { margin: 0 0 14px; color: rgba(255,255,255,.75); font-size: 14px; }
.share-box p strong { color: #ff7cc6; }
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 13px; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.state { padding: 40px 24px; text-align: center; }
.state svg { width: 44px; height: 44px; color: var(--pink); margin-bottom: 10px; }
.state h2 { margin: 0 0 8px; }
.state p { margin: 0 auto; max-width: 360px; color: var(--muted); }
.spinner { width: 34px; height: 34px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
.foot { margin-top: 26px; text-align: center; color: var(--muted); font-size: 12px; }
.foot a { color: var(--deep); font-weight: 600; text-decoration: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 420px) {
  .card-body { padding: 22px 18px 24px; }
  .event-banner { padding: 18px 18px 22px; }
  .perf::before { left: -32px; } .perf::after { right: -32px; }
  .stub { gap: 14px; }
  .qr { width: 112px; height: 112px; }
  .code { font-size: 16px; }
  .seat img { width: 96px; height: 72px; }
  .t-info strong { font-size: 13px; }
}

/* ---------- Admin ---------- */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.admin-bar .brand { display: flex; align-items: center; gap: 14px; }
.admin-bar .brand img { width: 120px; }
.admin-bar h1 { margin: 0; font-size: 20px; }
.admin-bar small { color: var(--muted); font-size: 13px; }
.login { max-width: 420px; margin: 10vh auto 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; background: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(99,22,72,.08); }
.stat strong { display: block; font: 800 26px/1.1 Montserrat, sans-serif; color: var(--navy); }
.stat span { color: var(--muted); font-size: 13px; }
.panel { margin-bottom: 22px; }
.panel h2 { margin: 0 0 4px; font-size: 20px; }
.panel .lead { margin-bottom: 18px; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font: 700 14px Montserrat, sans-serif; color: var(--navy); }
.step-title span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--pink); color: #fff; font-size: 12px; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.seat-opt { position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.seat-opt:hover { transform: translateY(-3px); border-color: rgba(237,11,140,.45); box-shadow: 0 16px 36px rgba(99,22,72,.12); }
.seat-opt.selected { border-color: var(--pink); box-shadow: 0 16px 36px rgba(237,11,140,.2); }
.seat-opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.seat-opt .body { padding: 10px 12px 12px; }
.seat-opt .body b { display: block; font: 700 13.5px/1.25 Montserrat, sans-serif; color: var(--navy); }
.seat-opt .check { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--pink); color: #fff; opacity: 0; transform: scale(.6); transition: .2s; }
.seat-opt.selected .check { opacity: 1; transform: none; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--blush); color: var(--deep); cursor: pointer; }
.stepper input { width: 64px; border: 0; text-align: center; font: 800 20px Montserrat, sans-serif; color: var(--navy); outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.hint strong { color: var(--deep); }
.create-row { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.result { margin-top: 18px; padding: 18px; border-radius: 16px; background: #eaf7f0; animation: fadeUp .4s ease both; }
.result p { margin: 0 0 10px; color: #135c3b; font-weight: 600; }
.result .copy-row input { background: #fff; color: var(--ink); border-color: #bfe3cf; }

.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { min-height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px; min-width: 240px; outline: none; }
.invite { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; margin-bottom: 12px; }
.invite.off { opacity: .6; }
.inv-head { display: flex; gap: 14px; align-items: center; }
.inv-head img { width: 84px; height: 62px; object-fit: cover; border-radius: 10px; flex: none; }
.inv-head .meta { flex: 1; min-width: 0; }
.inv-head b { display: block; font: 700 15px Montserrat, sans-serif; color: var(--navy); }
.inv-head small { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font: 700 10.5px Montserrat, sans-serif; }
.pill.on { background: #eaf7f0; color: var(--ok); } .pill.offp { background: #f1f1f4; color: var(--muted); }
.pill.full { background: var(--blush); color: var(--deep); }
.inv-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.inv-links label { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
.inv-links .copy-row { margin: 0; }
.inv-links .copy-row input { background: var(--blush); color: var(--ink); border: 0; }
.guests { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.guests th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.guests td { padding: 9px 6px; border-bottom: 1px solid #f7e6f0; vertical-align: middle; }
.guests a { color: var(--deep); font-weight: 600; text-decoration: none; }
.sms-ok { color: var(--ok); font-weight: 600; } .sms-bad { color: var(--bad); font-weight: 600; cursor: help; }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: flex-end; }
.btn-danger { background: #fdeeee; color: var(--bad); }
.icon-btn { width: 44px; min-height: 44px; padding: 0; }
.empty-list { padding: 30px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .create-row, .inv-links { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; } .stat strong { font-size: 20px; } .stat span { font-size: 11.5px; }
  .seat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .toolbar input { min-width: 0; width: 100%; }
  .guests thead { display: none; }
  .guests tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid #f7e6f0; }
  .guests td { padding: 0; border: 0; }
  .admin-bar .brand img { width: 90px; }
}

/* Admin — scanner team */
.stats { grid-template-columns: repeat(4, 1fr); }
.team-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.team-form .field { margin: 0; }
.team-form .btn { min-height: 52px; }
.guests.team tr.off { opacity: .6; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .team-form { grid-template-columns: 1fr; }
  .guests.team tr { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; margin-top: 6px; }
}

/* Dinner page */
.dinner-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.dinner-facts > div { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--blush); }
.dinner-facts .wide { grid-column: 1 / -1; }
.dinner-facts svg { color: var(--pink); }
.dinner-facts small { display: block; color: var(--muted); font: 700 9.5px Montserrat, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.dinner-facts strong { font: 700 14.5px Montserrat, sans-serif; color: var(--navy); }
.dinner-facts .price { background: linear-gradient(135deg, var(--pink), var(--deep)); }
.dinner-facts .price svg, .dinner-facts .price strong { color: #fff; }
.dinner-facts .price small { color: rgba(255,255,255,.8); }
.dinner-facts .price strong { font-size: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.state .dinner-facts svg { width: 18px; height: 18px; margin: 0; }
.pay-note { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border: 1.5px dashed var(--pink); border-radius: 14px; color: var(--deep); font-size: 14px; font-weight: 600; text-align: left; }
.pay-note a { color: var(--pink); font-weight: 800; white-space: nowrap; }
.state .pay-note { margin-top: 14px; }
.state .pay-note svg { width: 18px; height: 18px; margin: 0; flex: none; }
.seats-left { margin: -6px 0 18px; text-align: center; color: var(--bad); font: 700 14px Montserrat, sans-serif; }
.btn-paid { background: #eaf7f0; color: var(--ok); }
.btn-paid:hover { background: #d6f0e2; }
.guests tr.is-paid td:first-child strong { color: var(--ok); }
#dinner h2 .pill { vertical-align: middle; font-size: 11px; }

/* WhatsApp payment link (dinner) */
.pay-wa { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 13px 14px; border-radius: 14px; background: #e9f9ef; border: 1.5px solid #b9ebcb; color: #116b3a; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; transition: transform .2s, background .2s, box-shadow .2s; }
.pay-wa:hover { transform: translateY(-2px); background: #dcf6e6; box-shadow: 0 10px 24px rgba(31,174,91,.18); }
.pay-wa .wa-icon { width: 34px; height: 34px; flex: none; padding: 7px; border-radius: 50%; background: #25d366; color: #fff; }
.pay-wa span { flex: 1; }
.pay-wa b { white-space: nowrap; color: #0b5a2f; }
.pay-wa svg.lucide { color: #1fae5b; }
.state .pay-wa { margin-top: 14px; }
.state .pay-wa svg.lucide { width: 18px; height: 18px; margin: 0; }
.state .pay-wa .wa-icon { width: 34px; height: 34px; margin: 0; color: #fff; }
