:root {
  /* === Site design tokens (matches home.html / the rest of the site) === */
  --navy-900: #0e1c46;
  --navy-800: #16255c;
  --navy-700: #1d2f6e;
  --royal: #2a4499;
  --gold: #b8912f;
  --gold-2: #caa445;
  --gold-soft: #e7d9b0;
  --ink: #20262f;
  --muted: #5c6472;
  --line: #dde3ef;
  --line-2: #e9edf5;
  --paper: #f4f6fa;
  --tint: #eceff6;
  --card: #fff;
  --serif: 'Bai Jamjuree', 'Sarabun', serif;
  --sans: 'Sarabun', system-ui, sans-serif;
  /* aliases so the existing rules retheme automatically */
  --primary: #1d2f6e;
  --on-primary: #fff;
  --accent: #b8912f;
  --bg: #f4f6fa;
  --ring: rgba(29, 47, 110, .12);
  --ok: #1c7a43;
  --warn: #b26a08;
  --danger: #b42318;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--paper);
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy-900);
}

/* ===== Site nav — identical to home: utility bar + sticky white header + gold underline ===== */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px }

.ubar { background: var(--navy-900); color: rgba(255, 255, 255, .82); font-size: 13px }
.ubar a { color: inherit; text-decoration: none }
.ubar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; gap: 16px }
.ubar .u-r { display: flex; gap: 20px; align-items: center }
.ubar a:hover { color: #fff }
@media (max-width:720px) { .ubar .est { display: none } .ubar .wrap { justify-content: center } }

.nav {
  position: sticky; top: 0; z-index: 200; margin: 0; max-width: none; padding: 0;
  background: #fff; border-bottom: 1px solid var(--line)
}
.nav::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2) 60%, var(--gold))
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 76px }

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none }
.brand img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold-soft); flex-shrink: 0 }
.brand .bt { font-family: var(--serif); font-weight: 700; font-size: 17.5px; color: var(--navy-900); line-height: 1.15; white-space: nowrap }
.brand .bs { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase }

.links { display: flex; gap: 2px; margin-left: auto }
.links a { padding: 9px 10px; font-size: 15px; font-weight: 500; color: #3a4353; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap }
.links a:hover, .links a.active { color: var(--navy-700); border-bottom-color: var(--gold) }

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

.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; width: 42px; height: 40px; cursor: pointer; color: var(--navy-700) }
@media (max-width:1160px) {
  .links { display: none } .nav .actions { display: none }
  .burger { display: flex; align-items: center; justify-content: center }
}

.mmenu { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(8, 16, 44, .6) }
.mmenu.open { display: block }
.mmenu .panel { position: absolute; top: 0; right: 0; width: 280px; max-width: 85%; height: 100%; background: #fff; padding: 22px; display: flex; flex-direction: column; gap: 4px; box-shadow: -10px 0 40px rgba(6, 12, 40, .3) }
.mmenu .panel a { padding: 13px 10px; border-bottom: 1px solid var(--line-2); font-weight: 500; color: #2a3446; text-decoration: none }
.mmenu .panel .btn { margin-top: 14px; justify-content: center }

/* nav buttons + account dropdown (matches home) */
.btn.solid { background: var(--navy-700); color: #fff; border-color: var(--navy-700) }
.btn.solid:hover { background: var(--navy-900); border-color: var(--navy-900) }
.btn.outline { background: transparent; color: var(--navy-700); border-color: var(--navy-700) }
.btn.outline:hover { background: var(--navy-700); color: #fff }
.btn.sm { padding: 9px 16px; font-size: 14px }

.acct { position: relative }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; color: var(--navy-700); cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1; transition: .15s }
.acct-btn:hover { border-color: var(--gold) }
.acct-av { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-700); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none }
.acct-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 214px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 14px 34px rgba(16, 32, 80, .17); padding: 6px; display: none; z-index: 120 }
.acct-menu.open { display: block }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: none; background: none; text-align: left; cursor: pointer; font-family: var(--sans); font-size: 14px; color: #2a3446; text-decoration: none; transition: .12s }
.acct-menu a:hover, .acct-menu button:hover { background: var(--tint) }
.acct-menu a.active { color: var(--navy-700); font-weight: 700 }
.acct-menu .ai { width: 18px; text-align: center; flex: none }
.acct-menu #acctLogout { color: var(--danger); border-top: 1px solid var(--line-2); margin-top: 4px }
.mm-acct { font-weight: 700; color: var(--navy-900); padding: 9px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px }

/* Content */
.container {
  max-width: 1180px;
  margin: 26px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(16, 32, 80, .05)
}

.greet {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  color: var(--navy-900)
}

.sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 20px;
  font-family: var(--serif);
  color: var(--navy-900)
}

.panel-icon {
  color: var(--gold);
  display: grid;
  place-items: center
}

.panel-icon svg {
  width: 24px;
  height: 24px
}

/* Action cards */
.container .actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px
}

@media (max-width:640px) {
  .container .actions {
    grid-template-columns: 1fr
  }
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  width: 100%;
  font-family: var(--sans);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}

.action-card:hover {
  box-shadow: 0 8px 24px rgba(16, 32, 80, .1);
  transform: translateY(-2px);
  border-color: var(--gold);
}

.action-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--navy-700);
}

.action-icon svg {
  width: 22px;
  height: 22px
}

.action-icon.primary {
  background: var(--navy-700);
  color: #fff
}

.action-icon.shop {
  background: var(--gold-soft);
  color: var(--navy-900)
}

.action-icon.lock {
  background: #f3e9d1;
  color: #8a6d1e
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0
}

.action-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-900)
}

.action-desc {
  font-size: 12.5px;
  color: var(--muted)
}

/* Info list */
.list {
  display: grid;
  gap: 2px;
  margin-top: 10px
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line)
}

.row:last-child {
  border-bottom: none
}

.row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--navy-700);
}

.row-icon svg {
  width: 18px;
  height: 18px
}

.k {
  color: var(--muted);
  font-size: 14px;
  flex: 1
}

.v {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy-900);
  text-align: right
}

/* Announce (only shows when populated) */
.announce {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--tint);
  color: var(--ink);
  font-size: 13px;
}

.announce:empty {
  display: none
}

.announce b {
  color: var(--navy-700)
}

/* Data-protected card */
.protect {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2fb, #f7f9fd);
  border: 1px solid var(--line);
}

.protect-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--navy-700);
  color: #fff;
}

.protect-icon svg {
  width: 22px;
  height: 22px
}

.protect-title {
  font-weight: 700;
  color: var(--navy-700);
  font-size: 14.5px
}

.protect-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px
}

/* Left column wrapper (profile card + bookings card stacked) */
.col-main {
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

/* My event bookings */
.bookings-list {
  display: grid;
  gap: 10px;
  margin-top: 12px
}

.bookings-empty {
  color: var(--muted);
  font-size: 13.5px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--tint);
  text-align: center
}

.bookings-empty a {
  color: var(--navy-700);
  font-weight: 700
}

.bookings-empty.err {
  color: var(--danger)
}

.bk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s
}

.bk-item:hover {
  border-color: var(--gold)
}

.bk-main {
  flex: 1;
  min-width: 0
}

.bk-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.bk-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px
}

.bk-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0
}

.bk-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap
}

.bk-badge.ok {
  background: #eaf5ee;
  border-color: #bfe3cc;
  color: var(--ok)
}

.bk-badge.wait {
  background: #f7f0dd;
  border-color: #e7d3a0;
  color: var(--warn)
}

.bk-badge.past {
  background: #f1f3f8;
  border-color: var(--line);
  color: var(--muted)
}

.bk-cancel {
  border: 1.5px solid #e7c9c6;
  background: #fff;
  color: var(--danger);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans)
}

.bk-cancel:hover {
  background: #fbf1f0
}

.bk-cancel:disabled {
  opacity: .6;
  cursor: default
}

/* Buttons (used inside modals) */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: var(--navy-700);
  font-weight: 700;
  font-family: var(--sans);
}

.btn.primary {
  background: var(--navy-700);
  color: #fff;
  border-color: var(--navy-700)
}

.btn.primary:hover {
  background: var(--navy-900);
  border-color: var(--navy-900);
  box-shadow: none
}

.btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--ring)
}

/* Scan QR Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 30;
  background: rgba(14, 28, 70, .5)
}

.modal.show {
  display: grid
}

.sheet {
  width: min(880px, 96vw);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(14, 28, 70, .3);
  overflow: hidden
}

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

.sheet header b {
  font-family: var(--serif);
  color: var(--navy-900);
  font-size: 16px;
}

.sheet .body {
  padding: 16px
}

.scan-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px
}

@media (max-width:880px) {
  .scan-wrap {
    grid-template-columns: 1fr
  }
}

.cam {
  position: relative;
  min-height: 240px;
  background: #000;
  border-radius: 12px;
  overflow: hidden
}

.cam video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.hint.small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px
}

.input {
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px var(--ring);
}

.status {
  font-size: 14px;
  color: var(--muted)
}

.ok {
  color: var(--ok)
}

.err {
  color: var(--danger)
}

.small {
  font-size: 12px
}

.muted {
  color: var(--muted)
}


footer {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center
}

/* ===== Digital membership card (site navy + gold) ===== */
.mcard { position:relative; border-radius:16px; overflow:hidden; color:#fff; padding:22px 24px;
  background:linear-gradient(135deg,var(--navy-900),var(--navy-800) 55%,var(--navy-700));
  box-shadow:0 14px 34px rgba(14,28,70,.30); border:1px solid rgba(255,255,255,.08); }
.mcard::before { content:""; position:absolute; left:0; right:0; top:0; height:4px;
  background:linear-gradient(90deg,var(--gold),var(--gold-2) 55%,var(--gold)); }
.mcard::after { content:""; position:absolute; right:-70px; top:-70px; width:210px; height:210px; border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.10),transparent 70%); pointer-events:none; }
.mcard-top { display:flex; align-items:center; gap:10px; position:relative; z-index:1; }
.mcard-logo { width:40px; height:40px; border-radius:50%; border:2px solid rgba(230,197,110,.6); object-fit:cover; background:#fff; flex-shrink:0; }
.mcard-club-name { font-family:var(--serif); font-weight:700; font-size:13.5px; line-height:1.25; }
.mcard-club-sub { font-size:10px; letter-spacing:1.4px; color:var(--gold-2); text-transform:uppercase; margin-top:1px; }
.mcard-chip { margin-left:auto; width:36px; height:28px; border-radius:6px; flex-shrink:0;
  background:linear-gradient(135deg,var(--gold-2),var(--gold)); box-shadow:inset 0 0 0 1px rgba(255,255,255,.35); }
.mcard-mid { display:flex; align-items:center; gap:16px; margin:18px 0 2px; position:relative; z-index:1; }
.mcard-photo { width:70px; height:70px; border-radius:12px; object-fit:cover; border:2px solid rgba(255,255,255,.25); background:#fff; flex-shrink:0; }
.mcard-id { flex:1; min-width:0; }
.mcard-label { font-size:10px; letter-spacing:1px; color:rgba(255,255,255,.6); text-transform:uppercase; }
.mcard-name { font-family:var(--serif); font-size:21px; font-weight:700; line-height:1.2; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mcard-code { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:14px; letter-spacing:1.5px; color:var(--gold-2); margin-top:3px; }
.mcard-qr { width:84px; height:84px; border-radius:10px; background:#fff; padding:6px; flex-shrink:0; }
.mcard-qr img { width:100%; height:100%; display:block; }
.mcard-foot { display:flex; align-items:flex-end; gap:22px; margin-top:16px; padding-top:14px;
  border-top:1px solid rgba(255,255,255,.14); position:relative; z-index:1; }
.mcard-flabel { font-size:9.5px; letter-spacing:.6px; color:rgba(255,255,255,.55); text-transform:uppercase; }
.mcard-fval { font-size:13px; font-weight:700; margin-top:2px; }
.mcard-fval.gold { color:var(--gold-2); }
.mcard-btn { margin-left:auto; display:inline-flex; align-items:center; gap:7px; border:1px solid rgba(230,197,110,.55); background:rgba(255,255,255,.10);
  color:var(--gold-2); padding:8px 14px; border-radius:9px; font-size:12.5px; font-weight:700; cursor:pointer; font-family:var(--sans); }
.mcard-btn svg { width:15px; height:15px; }
.mcard-btn:hover { background:rgba(230,197,110,.18); }
/* enlarged card in modal */
.mcard.big { padding:26px 28px; }
.mcard.big .mcard-name { font-size:24px; }
.mcard.big .mcard-photo { width:82px; height:82px; }
.mcard.big .mcard-qr { width:96px; height:96px; }
.mcard.big .mcard-code { font-size:15px; }
.card-sheet { width:min(460px,96vw); }
.card-sheet .body { padding:18px; background:var(--tint); }
