:root {
  --bg: #09080d;          /* deep warm black — lounge */
  --panel: #16131d;
  --panel-2: #211d2b;
  --border: #2e2939;
  --text: #f4f1ea;        /* warm white */
  --muted: #a49caf;
  --accent: #cba25a;      /* champagne gold */
  --accent-2: #e8cf8c;
  --green: #35c07a;
  --red: #ff5566;
  --amber: #ffb020;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* soft golden ambience from the top for a premium venue feel */
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(203,162,90,.10), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent-2); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg, #17131f, #0f0c15);
  border-bottom: 1px solid var(--border);
}
/* Active-event check-in banner (injected by brand.js under the topbar). */
.active-event-bar {
  position: sticky; top: 0; z-index: 19;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 600; color: #08210f;
  background: linear-gradient(90deg, var(--green), #2aa869);
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.active-event-bar b { font-weight: 800; }
.active-event-bar .end-checkin {
  margin-left: auto; color: #08210f; font-weight: 700; text-decoration: none;
  border: 1px solid rgba(0,0,0,.28); border-radius: 999px; padding: 3px 12px; font-size: 12.5px;
}
.active-event-bar .end-checkin:hover { background: rgba(0,0,0,.12); }
.active-event-bar .pulse {
  width: 9px; height: 9px; border-radius: 50%; background: #08210f;
  box-shadow: 0 0 0 0 rgba(8,33,15,.5); animation: aeb-pulse 1.8s infinite;
}
@keyframes aeb-pulse { 0% { box-shadow: 0 0 0 0 rgba(8,33,15,.5); } 70% { box-shadow: 0 0 0 7px rgba(8,33,15,0); } 100% { box-shadow: 0 0 0 0 rgba(8,33,15,0); } }
@media (max-width: 600px) { .active-event-bar { padding: 8px 12px; font-size: 13px; } }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand .brand-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.brand small { color: var(--accent-2); font-weight: 600; }
.nav { display: flex; gap: 8px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent;
}
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); border-color: var(--border); }

/* First-run welcome card (admin.html after signup). */
.welcome-card {
  position: relative; background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--accent); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
}
.welcome-card h2 { margin: 0 0 6px; font-size: 20px; }
.welcome-card > p { margin: 0 0 12px; color: var(--muted); }
.welcome-steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.welcome-steps li { line-height: 1.5; }
.welcome-steps a { color: var(--accent-2); font-weight: 600; }
.welcome-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-cta .btn { width: auto; }
.welcome-x { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.welcome-x:hover { color: var(--text); }
.linkbtn { background: none; border: none; color: var(--accent-2); font-weight: 600; font-size: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

/* Account dropdown (injected by brand.js) — Account settings + Log out. */
.acct-menu { position: relative; }
.acct-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-weight: 600; padding: 8px 12px; cursor: pointer;
}
.acct-trigger:hover { border-color: var(--accent); }
.acct-ico { font-size: 13px; }
.acct-caret { font-size: 11px; color: var(--muted); }
.acct-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; display: none; z-index: 40; box-shadow: 0 14px 34px rgba(0,0,0,.5);
}
.acct-menu.open .acct-dropdown { display: block; }
.acct-dropdown a {
  display: block; padding: 11px 12px; border-radius: 8px; color: var(--text);
  text-decoration: none; font-size: 14px; font-weight: 600; border: 1px solid transparent;
}
.acct-dropdown a:hover, .acct-dropdown a.active { background: var(--panel-2); border-color: var(--border); }
.acct-dropdown .acct-logout { color: var(--red); }

/* Hamburger toggle (injected by brand.js) — hidden on desktop. */
.nav-toggle {
  display: none; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 20px; line-height: 1; padding: 7px 13px; cursor: pointer;
}

/* Mobile topbar: brand + hamburger on one row; nav drops down when open. */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; row-gap: 10px; }
  .brand { font-size: 15px; gap: 8px; min-width: 0; }
  .brand-name { white-space: nowrap; }
  .brand-sub { display: none; }
  .brand .brand-logo { width: 30px; height: 30px; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav { display: none; width: 100%; flex-direction: column; gap: 6px; }
  .nav.open { display: flex; }
  .nav a { text-align: left; padding: 13px 14px; font-size: 15px; background: var(--panel); border-color: var(--border); }
  /* Account menu fills the column; its dropdown pulls down as a floating
     overlay (doesn't push the page/nav content down). */
  .acct-menu { width: 100%; }
  .acct-trigger { width: 100%; justify-content: space-between; padding: 13px 14px; font-size: 15px; }
  .acct-caret { margin-left: auto; }
  .acct-dropdown { left: 0; right: 0; min-width: 0; }
}

.wrap { max-width: 720px; margin: 0 auto; padding: 18px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer;
}
.tabs button.active { background: var(--accent); color: #1a1408; border-color: var(--accent-2); }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}

#reader { border-radius: 12px; overflow: hidden; background: #000; }
#reader video { border-radius: 12px; }

.search-row { display: flex; gap: 8px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 16px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--accent); color: #1a1408; border-color: var(--accent-2); }
.btn.green { background: var(--green); color: #06210f; border-color: #34d17f; }
.btn.red { background: var(--red); color: #2a0509; border-color: #ff6b7a; }
.btn.ghost { background: transparent; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }

.result-list { display: flex; flex-direction: column; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
}
.person:hover { border-color: var(--accent); }
.avatar {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--panel-2); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 800; font-size: 20px;
}
.person .meta { flex: 1; min-width: 0; }
.person .meta .name { font-weight: 700; font-size: 16px; }
.person .meta .sub { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
}
.badge.none { background: #2a2a3a; color: var(--muted); }
.badge.admitted { background: rgba(47,191,113,.16); color: var(--green); border: 1px solid rgba(47,191,113,.4); }
.badge.cutoff { background: rgba(255,176,32,.16); color: var(--amber); border: 1px solid rgba(255,176,32,.4); }
.badge.banned { background: rgba(255,77,94,.16); color: var(--red); border: 1px solid rgba(255,77,94,.4); }
.tier { background: rgba(184,151,62,.16); color: var(--accent-2); border: 1px solid rgba(184,151,62,.4); }

/* member detail modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-back.open { display: flex; }
.modal {
  width: 100%; max-width: 560px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: 20px;
  max-height: 92vh; overflow-y: auto;
}
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 20px; } }

.profile-head { display: flex; gap: 16px; align-items: center; }
.big-avatar {
  width: 96px; height: 96px; border-radius: 16px; object-fit: cover;
  background: var(--panel-2); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 34px; color: var(--muted); flex-shrink: 0;
}
img.big-avatar { display: block; }
.profile-head h2 { margin: 0 0 6px; font-size: 22px; }
/* tap-to-enlarge profile photo (ID verification) */
.big-avatar-wrap { position: relative; padding: 0; border: none; background: transparent; cursor: pointer; flex-shrink: 0; line-height: 0; border-radius: 16px; }
.big-avatar-wrap .big-avatar { display: block; }
.zoom-badge {
  position: absolute; bottom: 5px; right: 5px; background: rgba(0,0,0,.7); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 7px; font-size: 13px; line-height: 1; padding: 3px 6px;
}
/* member ID photo preview (complete/uncropped, portrait) in the editor */
.id-photo-btn {
  position: relative; padding: 0; border: 1px solid var(--border); background: #000;
  border-radius: 14px; cursor: pointer; display: inline-block; line-height: 0; overflow: hidden;
}
.id-photo {
  display: block; width: auto; max-width: min(78vw, 260px);
  height: 240px; object-fit: contain; background: #000;
}
.id-photo-btn .zoom-badge {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.72); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; white-space: nowrap;
}

.photo-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.93); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox img { max-width: 100%; max-height: 92vh; object-fit: contain; border-radius: 10px; }
.photo-lightbox .lb-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; border: none; font-size: 20px; cursor: pointer;
}

.ph-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-name-row h2 { margin: 0; }
.cutoff-mini {
  background: transparent; color: var(--red); border: 1px solid rgba(255,77,94,.5);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.cutoff-mini:active { transform: translateY(1px); }
.cutoff-mini.active { background: var(--red); color: #2a0509; border-color: #ff6b7a; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.kv .k { color: var(--muted); }
.kv:last-child { border-bottom: none; }

.big-status {
  text-align: center; padding: 16px; border-radius: 14px; margin: 14px 0;
  font-weight: 800; font-size: 20px; letter-spacing: .5px;
}
.big-status.none { background: #22222f; color: var(--muted); }
.big-status.admitted { background: rgba(47,191,113,.16); color: var(--green); }
.big-status.cutoff { background: rgba(255,176,32,.16); color: var(--amber); }
.big-status.banned { background: rgba(255,77,94,.18); color: var(--red); }

/* member notes callout (special service) */
.note-callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(201,150,63,.12); border: 1px solid rgba(201,150,63,.45);
  border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 12px 14px; margin: 14px 0; font-size: 15px; line-height: 1.4; color: var(--text);
}
.note-callout span { font-weight: 600; }
.expired-callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,77,94,.12); border: 1px solid rgba(255,77,94,.5);
  border-left: 4px solid var(--red); border-radius: 12px;
  padding: 12px 14px; margin: 14px 0; font-size: 15px; line-height: 1.4; color: var(--red); font-weight: 700;
}
.note-line { color: var(--accent-2); font-size: 13px; margin-top: 3px; }

/* lifetime member stats (in profile) */
.mini-stats { display: flex; gap: 10px; margin: 14px 0; }
.mini-stat { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.mini-stat .mn { font-size: 24px; font-weight: 800; color: var(--accent-2); }
.mini-stat .ml { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* house drink tab */
.drink-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin: 14px 0; }
.drink-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drink-label { font-weight: 700; font-size: 15px; }
.drink-count { font-size: 30px; font-weight: 800; color: var(--accent-2); min-width: 40px; text-align: right; }
.drink-head .drink-count { margin-bottom: 0; }
.guest-box .drink-head { margin-bottom: 0; }
.guest-step { display: flex; align-items: center; gap: 12px; }
.guest-step .btn { width: 44px; padding: 8px 0; font-size: 20px; line-height: 1; }
.guest-step .drink-count { min-width: 32px; text-align: center; }
.drink-pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(201,150,63,.16);
  color: var(--accent-2); border: 1px solid rgba(201,150,63,.4); border-radius: 999px;
  padding: 2px 9px; font-size: 12px; font-weight: 800; }

/* install / get-app page */
.install-hero { padding: 26px 18px; }
.install-logo { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; border: 1px solid var(--border); }
.install-hero h1 { font-size: 22px; margin: 14px 0 8px; }
.install-hero .btn { width: auto; padding: 14px 28px; font-size: 16px; }
.steps { margin: 0; padding-left: 22px; line-height: 1.9; font-size: 15px; }
.steps li { margin-bottom: 4px; }
.steps .key { display: inline-block; min-width: 24px; text-align: center; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-weight: 700; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 18px; border-radius: 12px; z-index: 100; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.qr-box { text-align: center; }
.qr-box img { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 10px; }

/* dashboard */
.wrap.wide { max-width: 1080px; }
.dash-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dash-head h1 { margin: 0; font-size: 26px; }
.card-title { margin: 0 0 12px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 860px) { .dash-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.dash-side { display: flex; flex-direction: column; gap: 14px; }
.stat-row { flex-wrap: wrap; }
.stat-row .stat { min-width: 120px; }

.tier-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tier-name { width: 78px; font-size: 14px; font-weight: 600; }
.tier-bar { flex: 1; height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.tier-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.tier-n { width: 28px; text-align: right; font-weight: 700; }

/* nightly activity chart */
.chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chart-head .card-title { margin: 0; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.sw-members { background: var(--accent); }
.sw-drinks { background: #3d9aa8; }
.nightly-chart { display: flex; gap: 12px; align-items: flex-end; overflow-x: auto; padding: 22px 2px 0; }
.night-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 40px; }
.night-bars { display: flex; align-items: flex-end; justify-content: center; gap: 5px; width: 100%; }
.nb { width: 40%; max-width: 20px; border-radius: 5px 5px 0 0; position: relative; }
.nb.members { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.nb.drinks { background: linear-gradient(180deg, #57bccb, #3d9aa8); }
.nb .v { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text); }
.night-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

.roster-search { margin: 4px 0 12px; }
#roster { max-height: 460px; overflow-y: auto; }

.feed { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed-item:last-child { border-bottom: none; }
.dot-sm { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.feed-time { color: var(--muted); font-size: 12px; margin-top: 2px; }
