/* ============================================================
   ESN Gent Events — styles (v2, structured)
   ESN palette used as accents on calm, neutral surfaces:
   Cyan #00AEEF · Magenta #EC008C · Green #7AC143 ·
   Orange #F47B20 · Dark Blue #2E3192
   ============================================================ */

:root {
  --esn-cyan: #00AEEF;
  --esn-magenta: #EC008C;
  --esn-green: #7AC143;
  --esn-orange: #F47B20;
  --esn-dark: #2E3192;
  --ink: #191a2e;
  --muted: #676a80;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e4e6ee;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(25, 26, 46, 0.08);
  --shadow-lg: 0 6px 20px rgba(25, 26, 46, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  /* Sticky footer: content area stretches, footer sits at the bottom */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#app {
  flex: 1 0 auto;
  width: 100%;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

a { color: var(--esn-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; }

/* ---------- Header ---------- */
.site-header {
  background: var(--esn-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--esn-cyan);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-star { width: 30px; height: 30px; }
.brand-logo {
  height: 38px;
  width: 38px;
  object-fit: contain;
}
.brand-text { font-size: 1.05rem; letter-spacing: .2px; }
.brand-text strong { color: var(--esn-cyan); }

.main-nav { display: flex; gap: 2px; flex: 1; height: 62px; align-items: stretch; }
.main-nav a {
  color: #d6d8f0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .6px;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.main-nav a:hover { color: #fff; text-decoration: none; }
.main-nav a.active { color: #fff; border-bottom-color: var(--esn-cyan); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--esn-cyan); display: block; }
.user-link { display: flex; align-items: center; gap: 8px; color: #fff; }
.user-link:hover { text-decoration: none; opacity: .85; }

.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* Mobile-only / desktop-only helpers */
.m-only { display: none; }
.mobile-title { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: filter .12s ease, box-shadow .12s ease;
  text-align: center;
}
.btn:hover { filter: brightness(.94); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-cyan { background: var(--esn-cyan); color: #fff; }
.btn-magenta { background: var(--esn-magenta); color: #fff; }
.btn-green { background: var(--esn-green); color: #fff; }
.btn-orange { background: var(--esn-orange); color: #fff; }
.btn-dark { background: var(--esn-dark); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid var(--border); }
.btn-ghost:hover { background: #fff; filter: none; border-color: #c9ccdc; }
.btn-sm { padding: 5px 12px; font-size: .78rem; border-radius: 7px; }
.btn-block { display: block; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  margin: 28px 0 8px;
  border-radius: var(--radius);
  padding: 40px 40px 36px;
  color: #fff;
  background: var(--esn-dark);
  border-bottom: 4px solid var(--esn-cyan);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 1.75rem; font-weight: 900; margin-bottom: 8px; max-width: 640px; }
.hero p { max-width: 560px; color: #d9dbf2; margin-bottom: 20px; font-size: .95rem; }

/* ---------- Section headings ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 16px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .2px;
}
.section-title::before {
  content: "";
  width: 5px;
  height: 1.15em;
  border-radius: 3px;
  background: var(--esn-cyan);
  flex: none;
}

/* ---------- Search & filter bar ---------- */
.filter-bar { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; }
.filter-bar input[type="search"] {
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: .92rem;
  background: #fff;
  box-shadow: var(--shadow);
  outline: none;
  max-width: 440px;
}
.filter-bar input[type="search"]:focus { border-color: var(--esn-cyan); }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  color: var(--muted);
}
.chip:hover { border-color: #c9ccdc; color: var(--ink); }
.chip.active { background: var(--esn-dark); border-color: var(--esn-dark); color: #fff; }

/* ---------- Event cards ---------- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-bottom: 44px;
}
.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--accent, var(--esn-cyan));
  transition: box-shadow .15s ease;
}
.event-card:hover { box-shadow: var(--shadow-lg); }
.card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.event-card .card-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.event-card h3 { font-size: 1.08rem; font-weight: 900; }
.event-card h3 a { color: var(--ink); }
.event-meta {
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.event-desc { font-size: .88rem; color: var(--ink); flex: 1; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.date-badge {
  align-self: flex-start;
  background: var(--accent, var(--esn-cyan));
  color: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  text-align: center;
  font-weight: 900;
  line-height: 1.15;
  margin: 16px 0 0 20px;
}
.date-badge .d { font-size: 1.25rem; display: block; }
.date-badge .m { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.5px; }

.price-tag { font-weight: 900; color: var(--esn-dark); font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-tag.free { color: var(--esn-green); }
.price-strike { text-decoration: line-through; opacity: .5; font-size: .85em; font-weight: 700; }
.member-note { font-size: .78rem; color: var(--esn-dark); font-weight: 700; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #fff;
}
.badge-soldout { background: #9a9cb5; }
.badge-paid { background: var(--esn-green); }
.badge-pending { background: var(--esn-orange); }
.badge-free { background: var(--esn-cyan); }
.badge-draft { background: #9a9cb5; }
.badge-published { background: var(--esn-green); }
.badge-esn { background: var(--esn-dark); }
.badge-verified { background: var(--esn-green); }
.badge-requested { background: var(--esn-orange); }

/* ---------- Calendar ---------- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 14px;
}
.calendar-header h2 { font-size: 1.35rem; font-weight: 900; }
.cal-nav-buttons { display: flex; gap: 8px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 44px;
}
.cal-dow {
  text-align: center;
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  padding: 8px 0 4px;
}
.cal-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 104px;
  padding: 7px;
  font-size: .78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.other-month { background: transparent; border-style: dashed; opacity: .45; }
.cal-cell.today { border: 2px solid var(--esn-cyan); }
.cal-daynum { font-weight: 700; color: var(--muted); font-size: .75rem; }
.cal-cell.today .cal-daynum { color: var(--esn-cyan); }
.cal-event {
  display: block;
  background: var(--accent, var(--esn-cyan));
  color: #fff;
  border-radius: 5px;
  padding: 3px 7px;
  font-weight: 700;
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event:hover { text-decoration: none; opacity: .88; }

/* ---------- Event detail ---------- */
.event-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 28px 0 44px;
  overflow: hidden;
}
.event-detail-banner {
  padding: 38px 36px;
  color: #fff;
  background: var(--esn-dark);
  border-bottom: 4px solid var(--accent, var(--esn-cyan));
}
.event-detail-banner.has-img { background-size: cover; background-position: center; }
.event-detail-banner h1 { font-size: 1.7rem; font-weight: 900; }
.event-detail-body {
  padding: 30px 36px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 36px;
}
.event-info-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.event-info-list li { display: flex; gap: 14px; align-items: baseline; }
.event-info-list .ico { width: 22px; text-align: center; }
.info-label {
  flex: none;
  width: 82px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.buy-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: fit-content;
}
.buy-box .price-tag { font-size: 1.45rem; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row input {
  width: 72px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  text-align: center;
  background: #fff;
}
.cal-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Map embed ---------- */
.map-wrap {
  margin-top: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-embed { width: 100%; height: 260px; border: 0; display: block; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 760px; margin-bottom: 44px; }
.faq-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--muted);
  flex: none;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:hover { background: #f8fafd; }
.faq-a {
  padding: 0 18px 16px;
  font-size: .89rem;
  color: var(--ink);
}
.faq-a code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .82em;
}

/* ---------- Rich text ---------- */
.rich { font-size: .93rem; }
.rich p { margin: 0 0 12px; }
.rich ul { margin: 0 0 12px 20px; }
.rich li { margin-bottom: 4px; }
.rich h3 { margin: 18px 0 8px; font-size: 1.05rem; font-weight: 900; color: var(--esn-dark); }
.rich a { font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); }
th {
  background: #f2f3f8;
  color: var(--muted);
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafd; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 30px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}
.form-field input, .form-field textarea, .form-field select,
.buy-box select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .92rem;
  background: #fff;
  color: var(--ink);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--esn-cyan);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, .15);
}
.form-field input:disabled { background: var(--bg); color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.form-hint { font-size: .78rem; color: var(--muted); }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--esn-dark); }
.checkbox-row label { text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--ink); }

.inline-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: .82rem;
  width: 150px;
}

/* ---------- Ticket type rows (admin form) ---------- */
.option-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 70px 40px;
  gap: 8px;
  margin-bottom: 8px;
}
.option-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .88rem;
}

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: 10px; }

.loading { text-align: center; padding: 90px 0; color: var(--muted); }
.spinner {
  width: 38px; height: 38px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--esn-cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--esn-dark);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: .88rem;
  z-index: 100;
  max-width: 90vw;
}
.toast.error { background: var(--esn-magenta); }
.toast.success { background: var(--esn-green); }

.success-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 50px 30px;
  text-align: center;
  margin: 44px auto;
  max-width: 540px;
}
.success-panel .big { font-size: 2.8rem; }
.success-panel h1 { margin: 10px 0; font-size: 1.5rem; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 0; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.admin-tabs button {
  border: none;
  background: none;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.admin-tabs button:hover { color: var(--ink); }
.admin-tabs button.active { color: var(--esn-dark); border-bottom-color: var(--esn-dark); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-left: 4px solid var(--accent, var(--esn-cyan));
}
.stat-card .num { font-size: 1.5rem; font-weight: 900; color: var(--ink); line-height: 1.2; }
.stat-card .lbl {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  margin-top: 2px;
}

/* ---------- Profile & ESNcard ---------- */
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-bottom: 44px; }

/* Replica of the official ESNcard layout */
.esncard {
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  font-size: 10px;                  /* card scales off this */
}
.esncard-grey { filter: grayscale(.8) brightness(.96); }

.esncard-left {
  flex: 0 0 37%;
  background: linear-gradient(160deg, #2aa7e6 0%, #1d63c8 55%, var(--esn-dark) 100%);
  color: #fff;
  padding: 10% 6% 6% 7%;
  display: flex;
  flex-direction: column;
}
.esncard-brand { font-size: 1.5em; font-weight: 900; letter-spacing: .3px; }
.esncard-sub { font-size: .95em; line-height: 1.3; opacity: .9; margin-top: 2px; }
.esncard-photo {
  margin-top: 10%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.esncard-photo img { width: 100%; height: 100%; object-fit: cover; }
.esncard-photo span { font-weight: 900; letter-spacing: 2px; font-size: 1.2em; opacity: .8; }
.esncard-notvalid {
  font-size: .72em;
  text-align: center;
  margin-top: auto;
  padding-top: 6%;
  opacity: .85;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.esncard-right {
  flex: 1;
  padding: 6% 6% 5% 6%;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  min-width: 0;
}
.esncard-logo {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3%;
}
.esncard-logo img { width: 2.2em; height: 2.2em; }
.esncard-logo span { font-weight: 900; font-size: 1.6em; letter-spacing: .5px; }
.esncard-field { margin-bottom: 3.5%; min-width: 0; }
.esncard-frow { display: flex; gap: 6%; }
.esncard-frow .esncard-field { flex: 1; }
.esncard-label { font-size: .95em; font-weight: 700; color: #45536b; margin-bottom: 2px; }
.esncard-value {
  background: #bfe3f8;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 1.05em;
  font-weight: 700;
  min-height: 1.7em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.esncard-value.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; }
.esncard-bottom { display: flex; align-items: flex-end; gap: 6%; }
.esncard-bottom .esncard-field { flex: 1; margin-bottom: 0; }
.esncard-barcode {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 3.2em;
}
.esncard-barcode-empty { flex: 1; }

.esncard-status { font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* ---------- Account screen (avatar tap) ---------- */
.account-wrap {
  max-width: 460px;
  margin: 26px auto 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-wrap .esncard { max-width: none; }
.account-wrap .esncard-status { margin-top: -4px; }
.account-menu {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.account-menu a, .account-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.account-menu a:hover, .account-menu button:hover { background: #f8fafd; text-decoration: none; }
.account-menu > :last-child { border-bottom: none; }
.account-menu button { color: var(--esn-magenta); }
.account-menu .chev { color: var(--muted); font-size: 1.1rem; }

/* Desktop: two-column account layout (card left, menu right) */
@media (min-width: 821px) {
  .account-wrap {
    max-width: 940px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 16px 32px;
    align-items: start;
  }
  .account-wrap > .esncard,
  .account-wrap > .esncard-status,
  .account-wrap > .form-card { grid-column: 1; }
  .account-wrap > .esncard { font-size: 11.5px; }   /* card scales up a notch */
  .account-menu {
    grid-column: 2;
    grid-row: 1 / span 4;
    position: sticky;
    top: 86px;
  }
}

/* ---------- Ticket / QR ---------- */
.ticket-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  margin: 36px auto;
  overflow: hidden;
  text-align: center;
}
.ticket-head {
  background: var(--esn-dark);
  border-bottom: 4px solid var(--esn-cyan);
  color: #fff;
  padding: 22px;
}
.ticket-head h1 { font-size: 1.25rem; font-weight: 900; }
.ticket-head p { font-size: .85rem; color: #d9dbf2; margin-top: 4px; }
.ticket-body { padding: 26px 22px 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-box {
  background: #fff;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: inline-block;
}
.qr-box img, .qr-box canvas, .qr-box table { display: block; }
.ticket-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .75rem; color: var(--muted); word-break: break-all; }
.ticket-divider { width: 100%; border: none; border-top: 2px dashed var(--border); margin: 6px 0; }

.checkin-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  margin: 36px auto;
  padding: 30px;
  text-align: center;
}
.checkin-status { font-size: 2.6rem; margin-bottom: 6px; }
.checkin-panel h1 { font-size: 1.4rem; }
.checkin-details {
  text-align: left;
  margin: 18px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: .9rem;
}
.checkin-details p { margin: 4px 0; }

/* ---------- QR scanner ---------- */
.scan-panel { max-width: 520px; margin: 0 auto 44px; }
.scan-video-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}
.scan-video-wrap video { width: 100%; display: block; }
.scan-frame {
  position: absolute;
  inset: 14%;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28);
}

/* ---------- Image upload ---------- */
.img-preview {
  max-width: 260px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}
.img-upload-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- Mobile home: greeting + swipe rail ---------- */
.m-greet { padding: 20px 0 2px; }
.m-greet h1 { font-size: 1.4rem; font-weight: 900; }
.m-greet p { color: var(--muted); font-size: .85rem; }

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 24px 14px;
  margin: 0 -24px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.mini-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--esn-cyan));
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.mini-card:hover { text-decoration: none; }
.mini-date { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.mini-title {
  font-weight: 800;
  font-size: .92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.mini-price { font-size: .85rem; font-weight: 900; color: var(--esn-dark); }
.mini-price.free { color: var(--esn-green); }

/* ---------- Mobile bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--esn-dark);
  z-index: 60;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .3);
}
.bottom-nav a {
  color: #cfd2f2;
  font-size: .66rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  border-radius: 10px;
  text-decoration: none;
}
.bottom-nav a span { font-size: 1.25rem; line-height: 1; }
.bottom-nav a.active { color: #fff; background: rgba(0, 174, 239, .3); }
.bottom-nav a:hover { text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--esn-dark); color: #c9ccec; margin-top: 40px; font-size: .86rem; border-top: 3px solid var(--esn-cyan); }
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
  padding: 36px 24px;
}
.footer-star { width: 38px; height: 38px; margin-bottom: 8px; }
.footer-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  margin-bottom: 8px;
}
.site-footer a { color: var(--esn-cyan); }
.footer-bottom {
  text-align: center;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .76rem;
}

/* ---------- Responsive: app-style mobile ---------- */
@media (max-width: 820px) {
  .event-detail-body { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }

  /* Helpers */
  .m-only { display: block; }
  .d-only { display: none !important; }

  /* Slim native-style app bar: page title + avatar, no logo, no footer */
  .site-header {
    padding-top: env(safe-area-inset-top);
    border-bottom-width: 2px;
  }
  .header-inner { min-height: 50px; gap: 12px; }
  .brand { display: none; }
  .mobile-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: .2px;
  }
  .main-nav, .nav-toggle { display: none !important; }
  #btn-signout { display: none; }        /* sign-out lives on the Profile screen */
  .header-actions { margin-left: auto; }
  #user-name { display: none; }
  .site-footer { display: none; }

  .bottom-nav { display: flex; }
  body { padding-bottom: 76px; }

  /* Tap feedback feels native */
  .btn:active, .chip:active, .mini-card:active, .bottom-nav a:active { transform: scale(.97); }

  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-event { font-size: .6rem; padding: 2px 4px; }
  .section-title { font-size: 1.05rem; margin: 22px 0 12px; }

  /* Compact event cards */
  .events-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 30px; }
  .card-img { height: 130px; }
  .event-card .card-body { padding: 14px 16px 12px; gap: 6px; }
  .event-card h3 { font-size: 1rem; }
  .event-desc { font-size: .84rem; }
  .date-badge { margin: 12px 0 0 16px; padding: 4px 10px; }
  .date-badge .d { font-size: 1.1rem; }

  .filter-bar input[type="search"] { max-width: none; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding: 2px 24px 6px; margin: 0 -24px; scrollbar-width: none; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  th, td { padding: 9px 10px; font-size: .8rem; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 12px 14px; }
  .stat-card .num { font-size: 1.25rem; }
  .event-detail { margin-top: 16px; }
  .event-detail-banner { padding: 24px 20px; }
  .event-detail-banner h1 { font-size: 1.3rem; }
  .form-card { padding: 18px; }
  .form-actions .btn { flex: 1; }
  .success-panel { padding: 34px 20px; }
  .map-embed { height: 200px; }
  .option-row { grid-template-columns: 1fr 70px 70px 55px 36px; }
  .info-label { width: 70px; }
}
