/* Nucleus Studio — shared styles for the website, staff app, member app, kiosk and join page. */
:root {
  --night: #07131c; --navy: #0c1f2c; --navy2: #123044; --steel: #1d3b52;
  --accent: #f59e0b; --accent-ink: #b45309; --accent-soft: #fffbeb;
  --teal: #0e7490; --cyan: #22d3ee; --red: #e11d2e; --green: #10b981; --green-ink: #047857;
  --bg: #f6f4ef; --card: #ffffff; --ink: #0f172a; --ink2: #334155; --muted: #5b6777; --line: #dde3ea; --line2: #eef2f6; --field: #fbfcfd;
  --good-bg: #ecfdf5; --good-ink: #065f46; --warn-bg: #fffbeb; --warn-ink: #92400e; --stop-bg: #fef2f2; --stop-ink: #991b1b;
  --r: 14px; --shadow: 0 14px 40px rgba(7, 19, 28, .12);
  --display: 'Archivo', 'Inter', system-ui, sans-serif; --body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1620; --card: #102230; --ink: #e8f0f5; --ink2: #c3d3de; --muted: #8fa6b4; --line: #22394a; --line2: #18303f; --field: #0d1d29;
    --good-bg: #0b2f25; --good-ink: #6ee7b7; --warn-bg: #33250a; --warn-ink: #fcd34d; --stop-bg: #3a1216; --stop-ink: #fca5a5; --accent-soft: #33250a;
    --shadow: 0 14px 40px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1620; --card: #102230; --ink: #e8f0f5; --ink2: #c3d3de; --muted: #8fa6b4; --line: #22394a; --line2: #18303f; --field: #0d1d29;
  --good-bg: #0b2f25; --good-ink: #6ee7b7; --warn-bg: #33250a; --warn-ink: #fcd34d; --stop-bg: #3a1216; --stop-ink: #fca5a5; --accent-soft: #33250a;
  --shadow: 0 14px 40px rgba(0, 0, 0, .35); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.12; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .tiny { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font: 800 15px var(--display); letter-spacing: .01em; border-radius: 11px; padding: 11px 18px; min-height: 46px; background: var(--ink); color: var(--card); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.main { background: var(--red); color: #fff; }
.btn.accent { background: var(--accent); color: #1f1306; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.line { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.line:hover { border-color: var(--teal); }
.btn.ghost { background: transparent; color: var(--ink2); border: 1.5px solid var(--line); }
.btn.danger { background: var(--stop-bg); color: var(--stop-ink); border: 1.5px solid var(--stop-ink); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-weight: 600; text-decoration: underline; }

/* cards + fields */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label, .lbl { font: 700 13px var(--display); color: var(--ink2); }
.field label i, .lbl i { font-style: normal; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  background: var(--field); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 116, 144, .15); }
.bad { border-color: #dc2626 !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 600 13.5px var(--body); border: 1.5px solid var(--line); background: var(--card); color: var(--ink2); border-radius: 999px; padding: 7px 12px; cursor: pointer; min-height: 36px; }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 800 11px var(--body); letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good-ink); } .pill.warn { background: var(--warn-bg); color: var(--warn-ink); } .pill.stop { background: var(--stop-bg); color: var(--stop-ink); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.note { border-radius: 12px; padding: 11px 14px; font-weight: 600; font-size: 14.5px; }
.note.good { background: var(--good-bg); color: var(--good-ink); } .note.warn { background: var(--warn-bg); color: var(--warn-ink); } .note.stop { background: var(--stop-bg); color: var(--stop-ink); }
.note.info { background: var(--line2); color: var(--ink2); }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 14.5px; }
.kv:last-child { border-bottom: 0; } .kv span { color: var(--muted); } .kv b { text-align: right; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font: 800 11.5px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--line2); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* toast + modal */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); }
.toast { background: var(--ink); color: var(--card); border-radius: 12px; padding: 12px 16px; font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: #991b1b; color: #fff; } .toast.good { background: #065f46; color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgba(7, 19, 28, .55); z-index: 900; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); color: var(--ink); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal header h3 { font-size: 18px; flex: 1; }
.modal .body { padding: 16px 18px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
.x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: 10px; }
.x:hover { background: var(--line2); }

/* signature pad */
.sigpad { border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 150px; display: block; }
.waiver-text { white-space: pre-wrap; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-height: 240px; overflow: auto; font-size: 14px; color: var(--ink2); }

/* brand bar */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand b { font: 900 17px/1 var(--display); display: block; }
.brand small { display: block; font: 800 10px/1.2 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }

/* invoices + receipts (staff app, member app, pay page) */
.doc { background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; display: grid; gap: 14px; font-size: 14.5px; }
.doc .muted { color: #64748b; }
.doc-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.doc-gym { display: flex; gap: 12px; align-items: center; } .doc-gym b { font: 900 17px var(--display); }
.doc-logo { max-height: 56px; max-width: 180px; object-fit: contain; } .doc-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.doc-meta { text-align: right; } .doc-kind { font: 900 22px var(--display); letter-spacing: .02em; text-transform: uppercase; color: #0e7490; }
.doc-to { align-items: flex-end; }
.doc-lines { width: 100%; border-collapse: collapse; } .doc-lines th { text-align: left; font: 800 11px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #64748b; padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
.doc-lines td { padding: 8px 0; border-bottom: 1px solid #f1f5f9; } .doc-lines th:not(:first-child), .doc-lines td:not(:first-child) { text-align: right; padding-left: 10px; }
.doc-lines tfoot td { font-weight: 900; font-size: 16px; border-bottom: 0; padding-top: 10px; }
.doc .waiver-text { background: #f8fafc; color: #0f172a; border-color: #e2e8f0; }
.sig-img { max-width: 280px; max-height: 110px; background: #fff; border-bottom: 1.5px solid #0f172a; }
.powered { font-size: 12px; color: #94a3b8; text-align: center; } .powered b { color: #64748b; }
.print-host { display: none; }
@media print {
  body.printing > *:not(.print-host) { display: none !important; }
  body.printing .print-host { display: block; } body.printing { background: #fff; }
  .print-host .doc { border: 0; padding: 0; }
}

/* gym floor map (staff editor + member "find equipment") */
.gmap { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: var(--field); border: 1px solid var(--line); }
.gmap-in { position: absolute; inset: 0; touch-action: none; }
.gmap-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: .9; user-select: none; -webkit-user-drag: none; }
.gmap-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line2) 1px, transparent 1px), linear-gradient(90deg, var(--line2) 1px, transparent 1px); background-size: 5% 8%; }
.gzone { position: absolute; border: 2px solid var(--z); background: color-mix(in srgb, var(--z) 14%, transparent); border-radius: 10px; }
.gzone span { position: absolute; left: 6px; top: 4px; font: 800 11px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--z); background: color-mix(in srgb, var(--card) 80%, transparent); padding: 1px 5px; border-radius: 5px; }
.gmap.edit .gzone { cursor: move; } .gzone .grip { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--z) 50%); border-radius: 0 0 8px 0; }
.gpin { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px 3px 4px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--ink2); font: 700 11.5px var(--body); color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); z-index: 2; }
.gmap.edit .gpin { cursor: grab; touch-action: none; }
.gpin .gi { font-size: 14px; } .gpin.out { border-color: var(--stop-ink); color: var(--stop-ink); text-decoration: line-through; }
.gpin.hot { background: var(--accent); border-color: var(--accent-ink); color: #1f1306; z-index: 4; transform: translate(-50%, -50%) scale(1.25); animation: gpulse 1.2s ease-in-out infinite; }
@keyframes gpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); } 50% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); } }
@media (prefers-reduced-motion: reduce) { .gpin.hot { animation: none; } }
.dragging { opacity: .75; }

/* the assistant chat (website, gym pages, member app) */
.chat-fab { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 950; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; border: 0; background: var(--c); color: #fff; font: 800 15px var(--display); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); cursor: pointer; }
.chat-fab svg { width: 22px; height: 22px; }
body:has(.cart-bar:not([hidden])) .chat-fab { display: none; }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 960; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 560px) { .chat-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--night); color: #fff; flex-wrap: wrap; }
.chat-head b { font: 900 16px var(--display); flex: 1; } .chat-sub { font-size: 12px; color: #8fb3c4; order: 3; width: 100%; margin-top: -4px; }
.chat-x { background: none; border: 0; color: #fff; font-size: 26px; width: 40px; height: 40px; cursor: pointer; border-radius: 10px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-msg { max-width: 88%; padding: 10px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
.chat-msg.assistant { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--c); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-text p { margin: 0 0 6px; } .chat-text p:last-child { margin: 0; } .chat-text li { margin-left: 16px; }
.chat-act { margin-top: 8px; background: var(--c); color: #fff; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; } .chat-chips .chip { font-size: 13px; }
.chat-typing { display: flex; gap: 4px; } .chat-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; } .chat-typing i:nth-child(2) { animation-delay: .15s; } .chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.chat-form textarea { min-height: 44px; max-height: 120px; resize: none; } .chat-send { width: 46px; flex: none; border: 0; border-radius: 12px; background: var(--c); color: #fff; font: 900 20px var(--display); cursor: pointer; }
.chat-foot { font-size: 11px; color: var(--muted); text-align: center; padding: 0 0 8px; background: var(--card); }
.chat-handoff { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
