/* Bay Sauna — beach wellness / coastal spa: warm sand, deep-sea teal, driftwood and a sunset-coral accent.
   Every text/background pairing below clears WCAG AA in both themes. */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --fs-xs: .8125rem; --fs-sm: .9375rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.625rem; --fs-2xl: 2.25rem; --fs-hero: clamp(2.5rem, 6vw, 4rem);
  --radius: 16px; --radius-sm: 10px;
  --bg: #f7f1e8; --surface: #fffcf7; --surface-2: #efe5d6; --text: #10282b; --muted: #485a5b; --border: #d9cbb6;
  --primary: #0d5a5f; --primary-text: #ffffff; --primary-hover: #0a4549;
  --accent: #a3401c; --accent-soft: #fbe9de;
  --ok: #1d6431; --ok-soft: #e5f4e8; --warn: #85480a; --warn-soft: #fdf0dc; --bad: #9f1d1d; --bad-soft: #fce6e4;
  --link: #0b5c6e; --focus: #0e7c86;
  --shadow: 0 1px 2px rgba(16,40,43,.06), 0 8px 24px rgba(16,40,43,.07);
  --deep: #062a2e; --deep-2: #0d3b40; --on-deep: #e7f2ef; --on-deep-muted: #b9d1cc;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #071b1d; --surface: #0d2629; --surface-2: #133338; --text: #e8f2ef; --muted: #a9c2bd; --border: #27494d;
  --primary: #7fd1cb; --primary-text: #062022; --primary-hover: #a3e1dc;
  --accent: #f4a582; --accent-soft: #2e1d16;
  --ok: #86d9a0; --ok-soft: #10291b; --warn: #f2c27c; --warn-soft: #2b2112; --bad: #ff9f97; --bad-soft: #331715;
  --link: #8fd8d2; --focus: #8fd8d2;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --deep: #041416; --deep-2: #0b2a2e; --on-deep: #e7f2ef; --on-deep-muted: #b9d1cc;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: var(--fs-md); line-height: 1.55; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-3); letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num, .money, td.num { font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--space-4); }

/* Buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn-sm { min-height: 44px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--space-1); }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: var(--space-4); }
.field-error { color: var(--bad); font-size: var(--fs-sm); margin-top: var(--space-1); min-height: 0; }
.error-summary { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-4); }
.row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-4); }

/* Cards, badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: var(--space-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.badge-ok { color: var(--ok); background: var(--ok-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.badge-bad { color: var(--bad); background: var(--bad-soft); }
.badge-info { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: var(--fs-sm); }

/* Header / nav (customer) */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--text); font-weight: 800; font-size: var(--fs-lg); }
.brand img { height: 36px; width: auto; }
.nav { display: flex; gap: var(--space-1); margin-left: auto; align-items: center; flex-wrap: nowrap; }
.nav a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: var(--fs-sm); min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); }
.nav a.btn-primary, .nav a.btn-primary:hover { background: var(--primary); color: var(--primary-text); }
.nav a.btn-primary:hover { background: var(--primary-hover); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.menu-btn { display: none; }
@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); flex-direction: column; align-items: stretch; padding: var(--space-3); border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
}

/* Hero */
.hero { position: relative; color: #fff; background: #062a2e url('/assets/stock-1.webp') center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(4,30,33,.93) 0%, rgba(6,42,46,.8) 48%, rgba(13,90,95,.45) 100%); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 28px; background: var(--bg); clip-path: path('M0 18 C 160 0, 320 30, 480 16 S 800 2, 960 16 S 1280 30, 1440 12 L 1440 28 L 0 28 Z'); }
.hero .container { position: relative; padding-top: var(--space-8); padding-bottom: var(--space-8); }
.hero h1 { font-size: var(--fs-hero); line-height: 1.05; max-width: 15ch; color: #fff; }
.hero p.lead { font-size: var(--fs-lg); max-width: 46ch; color: #e6ebf3; }
.hero .eyebrow { display: inline-block; color: #ffd9bf; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-xs); margin-bottom: var(--space-3); }
.hero .btn-primary { background: #ffffff; color: #0d5a5f; }
.hero .btn-primary:hover { background: #fbe9de; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-facts { display: flex; gap: var(--space-5); flex-wrap: wrap; margin-top: var(--space-6); color: #e6ebf3; font-size: var(--fs-sm); }
.hero-facts strong { color: #fff; display: block; font-size: var(--fs-lg); }

/* Sections */
section.block { padding: var(--space-8) 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: var(--space-6); max-width: 680px; }
.section-head .eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-xs); }
.step { display: flex; gap: var(--space-3); align-items: flex-start; }
.step .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.photo-strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 700px) { .photo-strip { grid-template-columns: repeat(2, 1fr); } }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); align-items: stretch; }
.plan { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-2); }
.plan .price { font-size: var(--fs-xl); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

/* Slots */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.slot { text-align: left; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 72px; }
.slot:hover:not([disabled]) { border-color: var(--primary); }
.slot[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--surface-2); }
.slot[disabled] { cursor: not-allowed; opacity: .7; }
.slot .t { font-weight: 800; font-variant-numeric: tabular-nums; }
.day-tabs { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); }
.day-tabs button { flex: none; min-width: 72px; }
.seats { display: flex; gap: 3px; margin-top: 6px; }
.seats i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); display: block; }
.seats i.on { background: var(--muted); }

/* Page shell */
main { min-height: 60vh; }
.page { padding: var(--space-6) 0 var(--space-8); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.stack > * + * { margin-top: var(--space-4); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.big-action { display: grid; place-items: center; text-align: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); }
.big-action .btn { min-height: 64px; font-size: var(--fs-lg); padding: 14px 28px; }
.timer { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.score { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.score button { min-width: 48px; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.score button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.bubble { max-width: 80%; padding: var(--space-3); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.bubble.owner { margin-left: auto; background: var(--accent-soft); }
.thread { display: flex; flex-direction: column; gap: var(--space-3); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; white-space: nowrap; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button:focus-visible { outline: 3px solid var(--focus); }
tr:last-child td { border-bottom: 0; }
.table-tools { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; margin-bottom: var(--space-3); flex-wrap: wrap; }
.table-tools input { max-width: 320px; }
.pager { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; margin-top: var(--space-3); }

/* States */
.skeleton { height: 16px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }
.empty, .error-state { text-align: center; padding: var(--space-6) var(--space-4); }
.error-state { color: var(--bad); }

/* Toast + dialog */
.toast-host { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 600; }
.toast.bad { background: var(--bad); color: #fff; }
[data-theme="dark"] .toast.bad { color: #1a0b0b; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: var(--space-5); width: min(92vw, 520px); }
dialog::backdrop { background: rgba(5,10,20,.6); }

/* Footer */
footer.site { background: var(--deep); color: var(--on-deep-muted); padding: var(--space-7) 0 var(--space-5); }
footer.site a { color: #a8e3dd; }
footer.site h4 { color: #fff; margin: 0 0 var(--space-2); font-size: var(--fs-md); }
footer.site .trust { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-4); }
footer.site .trust span { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-sm); }

/* Admin shell */
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--deep); color: var(--on-deep); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: #fff; margin-bottom: var(--space-4); }
.sidebar a { color: var(--on-deep); text-decoration: none; display: flex; gap: var(--space-2); align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); min-height: 44px; font-weight: 600; font-size: var(--fs-sm); }
.sidebar a:hover, .sidebar a[aria-current="page"] { background: #164a50; color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.role-chip { display: inline-block; font-size: var(--fs-xs); font-weight: 700; color: var(--on-deep); border: 1px solid var(--on-deep-muted); border-radius: 999px; padding: 2px 10px; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: var(--fs-xs); }
.heat th, .heat td { border: 0; padding: 6px 4px; text-align: center; position: static; background: transparent; }
.heat td { border-radius: 6px; min-width: 34px; font-variant-numeric: tabular-nums; }
.heat td.h0 { background: var(--surface-2); color: var(--muted); }
.heat td.h1 { background: #cfe9e6; color: #0b3b40; }
.heat td.h2 { background: #8fcfc8; color: #062a2e; }
.heat td.h3 { background: #0d5a5f; color: #ffffff; }
.heat td.h4 { background: #a3401c; color: #ffffff; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lang-switch button { min-height: 44px; min-width: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.door-screen { display: grid; place-items: center; text-align: center; gap: var(--space-4); padding: var(--space-6) var(--space-4); }
.door-screen .qr svg { width: min(70vw, 340px); height: auto; }
.points-pill { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; color: var(--accent); }
.admin-top { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; min-height: 64px; }
.admin-main { padding: var(--space-5); min-width: 0; }
.admin-menu { display: none; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 60; transform: translateX(-105%); transition: transform .2s; height: 100vh; }
  .sidebar.open { transform: none; }
  .admin-menu { display: inline-flex; }
  .admin-main { padding: var(--space-4); }
}
.chart { width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--primary); }
.chart .line { stroke: var(--accent); fill: none; stroke-width: 2.5; }
.qr svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }
@media print { .sidebar, .admin-top, .no-print { display: none !important; } }
