/* Fonts are served from this server (no Google request, so staff and member IP addresses are not shared). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("../fonts/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("../fonts/oswald-latin-600-normal.woff2") format("woff2"); }

/* Wellness Empire Gym — staff app
   Palette taken from the website theme: black base, gold primary, red accent. */

:root {
  --base: #0b0b0c;
  --surface: #151517;
  --surface-2: #1e1e22;
  --surface-3: #2a2a30;
  --line: #303037;
  --text: #f5f5f6;
  --muted: #a3a3ab;
  --gold: #f2c230;
  --gold-deep: #c6900f;
  --red: #e5484d;
  --green: #30c27c;
  --amber: #f2a93b;
  --grey: #8b8b93;
  --radius: 10px;
  --display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font: 15px/1.55 var(--body);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; line-height: 1.15; margin: 0 0 .6rem; }
h1 { font-size: 1.75rem; text-transform: uppercase; }
h2 { font-size: 1.2rem; text-transform: uppercase; color: var(--text); }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) 239px, var(--line) 239px, var(--line) 240px, var(--base) 240px); }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: block; margin: 0 6px 18px; }
.brand img { width: 100%; max-width: 190px; height: auto; display: block; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--surface-3); color: var(--gold); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.nav .count { background: var(--gold); color: #141416; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.whoami { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.whoami form { display: inline; }
.whoami button { background: none; border: 0; color: var(--gold); padding: 0; font: inherit; cursor: pointer; }

.main { padding: 26px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

.topbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: var(--base); }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar img { height: 34px; }
  .main { padding: 18px 16px 50px; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child { margin-bottom: .9rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold-deep); border-radius: var(--radius); padding: 14px 16px; }
.tile b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.green { border-left-color: var(--green); }
.tile.amber { border-left-color: var(--amber); }
.tile.red { border-left-color: var(--red); }
a.tile:hover { text-decoration: none; background: var(--surface-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.empty { color: var(--muted); padding: 14px 0; }

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.green { background: rgba(48,194,124,.15); color: #5fe0a2; }
.pill.amber { background: rgba(242,169,59,.16); color: #ffc46b; }
.pill.red { background: rgba(229,72,77,.16); color: #ff8589; }
.pill.grey { background: rgba(139,139,147,.18); color: #c9c9cf; }
.pill.gold { background: rgba(242,194,48,.16); color: var(--gold); }

/* ---------- notices ---------- */
.flash { border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; border: 1px solid; }
.flash.success { background: rgba(48,194,124,.1); border-color: rgba(48,194,124,.4); }
.flash.error { background: rgba(229,72,77,.1); border-color: rgba(229,72,77,.45); }
.flash.info { background: rgba(242,194,48,.08); border-color: rgba(242,194,48,.35); }
.note { background: var(--surface-2); border-left: 3px solid var(--gold-deep); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.note.amber { border-left-color: var(--amber); }
.note.red { border-left-color: var(--red); }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field .err { color: #ff8589; font-size: 13px; margin-top: 4px; }
.field.has-err input, .field.has-err select { border-color: var(--red); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; background: var(--base); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 6px; margin: 0 0 18px; }
legend { font-family: var(--display); text-transform: uppercase; padding: 0 8px; color: var(--gold); }

.yesno { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.yesno:last-of-type { border-bottom: 0; }
.yesno p { margin: 0; flex: 1; }
.yesno .opts { display: flex; gap: 6px; flex: none; }
.yesno input { position: absolute; opacity: 0; pointer-events: none; }
.yesno .opts label { margin: 0; padding: 7px 16px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; min-width: 58px; text-align: center; }
.yesno input:focus-visible + label { outline: 2px solid var(--gold); }
.yesno input[value=no]:checked + label { background: var(--surface-3); border-color: var(--muted); }
.yesno input[value=yes]:checked + label { background: rgba(242,169,59,.2); border-color: var(--amber); color: #ffc46b; }
.has-err .yesno .opts label { border-color: rgba(229,72,77,.5); }

.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: var(--base); }
.choice label b { display: block; font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; }
.choice label span { color: var(--muted); font-size: 13px; }
.choice input:checked + label { border-color: var(--gold); background: rgba(242,194,48,.07); }
.choice input:focus-visible + label { outline: 2px solid var(--gold); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold); color: #141416; border: 0; border-radius: 8px;
  padding: 10px 18px; font: 600 14px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #ffd65a; text-decoration: none; }
.btn.secondary { background: var(--surface-3); color: var(--text); }
.btn.secondary:hover { background: #36363e; }
.btn.danger { background: transparent; color: #ff8589; border: 1px solid rgba(229,72,77,.5); }
.btn.danger:hover { background: rgba(229,72,77,.12); }
.btn.green { background: var(--green); color: #07130d; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.big { padding: 15px 26px; font-size: 17px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.tabs a.on { background: var(--gold); color: #141416; border-color: var(--gold); font-weight: 600; }
.tabs a:hover { text-decoration: none; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

details.inline summary { cursor: pointer; color: var(--gold); margin-bottom: 8px; }

/* ---------- login ---------- */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login .brand img { max-width: 260px; margin: 0 auto 22px; }

/* ---------- check-in screen ---------- */
.checkin { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "scan verdict" "recent verdict"; gap: 0 20px; align-items: start; }
.ci-scan { grid-area: scan; }
.ci-recent { grid-area: recent; }
.ci-verdict { grid-area: verdict; margin-bottom: 18px; }
@media (max-width: 1000px) { .checkin { grid-template-columns: 1fr; grid-template-areas: "scan" "verdict" "recent"; } .ci-verdict { min-height: 0; } }
.scan-box { display: flex; gap: 10px; }
.scan-box input { font-size: 18px; padding: 14px 16px; }
.results { margin-top: 10px; }
.result {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
  background: var(--base); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.result:hover, .result:focus { border-color: var(--gold); outline: none; }
.verdict { border-radius: 14px; padding: 22px; border: 2px solid var(--line); background: var(--surface); min-height: 260px; }
.verdict.green { border-color: var(--green); background: linear-gradient(180deg, rgba(48,194,124,.14), var(--surface) 55%); }
.verdict.amber { border-color: var(--amber); background: linear-gradient(180deg, rgba(242,169,59,.14), var(--surface) 55%); }
.verdict.red { border-color: var(--red); background: linear-gradient(180deg, rgba(229,72,77,.16), var(--surface) 55%); }
.verdict .big-word { font-family: var(--display); font-size: 2.6rem; text-transform: uppercase; line-height: 1; margin-bottom: 8px; }
.verdict.green .big-word { color: #5fe0a2; }
.verdict.amber .big-word { color: #ffc46b; }
.verdict.red .big-word { color: #ff8589; }
.verdict .who { font-size: 1.35rem; font-weight: 600; }
.verdict ul { padding-left: 18px; margin: 10px 0; }
.video-wrap { position: relative; margin-top: 12px; display: none; }
.video-wrap.on { display: block; }
.video-wrap video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; object-fit: cover; }
.is-checkin .main { padding-top: 20px; }

/* ---------- member card ---------- */
.member-card {
  width: 100%; max-width: 380px; margin: 0 auto; background: radial-gradient(120% 90% at 0% 0%, #2a2208 0%, #111113 55%);
  border: 1px solid #3a3320; border-radius: 18px; padding: 22px; text-align: center;
}
.member-card img.logo { width: 82%; margin: 0 auto 10px; display: block; }
.member-card .qr { background: #fff; border-radius: 12px; padding: 14px; width: 230px; height: 230px; margin: 12px auto; display: grid; place-items: center; }
.member-card .qr svg, .member-card .qr canvas { width: 100%; height: 100%; }
.member-card .name { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.member-card .no { color: var(--gold); letter-spacing: .12em; font-weight: 600; }

/* ---------- bars (attendance) ---------- */
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 56px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { background: var(--surface-2); border-radius: 4px; height: 14px; overflow: hidden; }
.bar .fill { background: var(--gold); height: 100%; border-radius: 4px; }
.bar .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- member-facing pages ---------- */
.public-head { padding: 18px 16px; text-align: center; border-bottom: 1px solid var(--line); background: #000; }
.public-head img { height: 64px; width: auto; }
.public-main { max-width: 860px; margin: 0 auto; padding: 26px 16px 40px; }
.public-foot { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; font-size: 13px; text-align: center; }

/* Sign-in page: note for members */
.member-note { margin-top: 18px; }
.member-note h2 { font-size: 1.05rem; margin: 0 0 6px; }
.member-note p { margin: 0; color: var(--muted, #a1a1aa); line-height: 1.55; }

/* Today's messages (WhatsApp prepared for staff) */
.note.green { border-left-color: var(--green, #30c27c); }
.wa-item { display: grid; grid-template-columns: minmax(180px, 1.2fr) 2fr auto; gap: 12px 18px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line, #2b2b31); }
.wa-item:first-of-type { border-top: 0; }
.wa-who { display: flex; flex-direction: column; gap: 2px; }
.wa-preview summary { cursor: pointer; color: var(--muted, #9d9da6); }
.wa-text { white-space: normal; background: rgba(48, 194, 124, .06); border: 1px solid rgba(48, 194, 124, .25); border-radius: 10px; padding: 12px 14px; margin-top: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.wa-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.wa-actions form { margin: 0; }
.wa-item.is-done { opacity: .5; }
.wa-item.is-done .wa-actions .btn, .wa-item.is-done .wa-actions form { display: none; }
.wa-done { color: var(--green, #30c27c); font-weight: 600; }
form.inline { display: inline; }
@media (max-width: 760px) { .wa-item { grid-template-columns: 1fr; } .wa-actions { justify-content: flex-start; } }
