@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --bg: #ece7db;
  --card: #ffffff;
  --ink: #433d39;
  --brand: #7f9485;
  --brand-dark: #6f8578;
  --line: #d7d0c3;
  --muted: #6f6964;
  --soft: #f0e6d6;
  --green: #2e7d41;
  --green-light: #e8f8e8;
  --green-border: #8fd39a;
  --red: #cb3131;
  --red-dark: #a91d1d;
  --orange: #e2872f;
}

/* ── Base ──────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  background: var(--bg) url('/theme/theme-bg.png') no-repeat top center fixed;
  background-size: cover;
  color: var(--ink);
}

/* ── Typography hierarchy ──────────────────────────────── */
h1 { font-size: 26px; font-weight: 700; line-height: 1.25; margin: 0 0 14px; }
h2 { font-size: 21px; font-weight: 700; line-height: 1.3;  margin: 0 0 10px; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.3;  margin: 0 0 8px;  }
p  { margin: 0 0 10px; line-height: 1.55; }
a  { color: var(--brand-dark); font-weight: 700; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand); }

/* ── Header / nav ──────────────────────────────────────── */
header {
  position: relative;
  z-index: 1100;
  background: rgba(248,244,236,.92);
  color: var(--ink);
  padding: 14px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header .header-logo {
  height: 30px;
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 4px;
}
header a.site-name {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-wrap { position: relative; z-index: 1200; }
.header-nav-cluster {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.user-initials-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.menu-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.menu-btn:hover { background: rgba(0,0,0,.04); }
.menu-panel {
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 170px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  display: none;
  z-index: 1300;
}
.menu-panel.open { display: block; }
.menu-panel a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a:hover { background: rgba(0,0,0,.03); }

/* ── Layout ────────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 16px auto;
  padding: 0 12px;
}

/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: box-shadow .2s ease;
}

/* ── Text utilities ────────────────────────────────────── */
.title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.meta  { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }

/* ── Form elements ─────────────────────────────────────── */
label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }

/* ── Buttons ───────────────────────────────────────────── */
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  touch-action: manipulation;
  transition: background .15s ease, box-shadow .15s ease;
}
button:hover { background: var(--brand-dark); }
button:disabled,
button[disabled] {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}
button:disabled:hover,
button[disabled]:hover {
  background: var(--line);
}
button.brand,
.btn-brand {
  background: var(--brand);
  color: #fff;
}
button.brand:hover,
.btn-brand:hover {
  background: var(--brand-dark);
}
button.book {
  background: var(--green);
  color: #fff;
  border: 1px solid #1a5a27;
}
button.book:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
button.booked {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid var(--green-border);
  cursor: default;
}
button.full {
  background: var(--red);
  color: #fff;
  cursor: pointer;
  white-space: pre-line;
  line-height: 1.2;
}
button.waitlisted {
  background: var(--orange);
  color: #fff;
  cursor: default;
  white-space: pre-line;
  line-height: 1.2;
}
button.closed {
  background: #aaa;
  color: #fff;
  cursor: default;
}
.btn-secondary { background: #8a7f76; color: #fff; }
.btn-secondary:hover { background: #7a706a; }
.tiny-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 7px;
  margin-left: 6px;
  background: var(--brand);
  color: #fff;
  border: 0;
  cursor: pointer;
}

/* ── Badges & pills ────────────────────────────────────── */
.badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge.available {
  color: var(--green);
  background: var(--green-light);
  border-color: var(--green-border);
  font-weight: 700;
}
.badge.full {
  color: #fff;
  background: var(--red);
  border-color: var(--red-dark);
  font-weight: 700;
}
.badge.default { color: #415748; background: #dfe8df; }

.price-pill {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  margin-right: 6px;
  border: 1px solid transparent;
  vertical-align: middle;
}
.price-pill.free {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green-border);
  font-weight: 700;
}

/* ── Status notices ────────────────────────────────────── */
.ok {
  color: var(--green);
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}
.warn { color: #8a5a00; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }

/* ── Event rows (home, bookings) ───────────────────────── */
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: box-shadow .2s ease;
}
.row:hover { box-shadow: 0 3px 14px rgba(0,0,0,.11); }
.row.full    { background: #e8e1d5; }
.row.private { background: #e0d7c7; }
.row.with-qr {
  grid-template-columns: 1fr 120px;
  align-items: stretch;
}

/* ── QR code box ───────────────────────────────────────── */
.qr-box {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }

/* ── Homepage hero ─────────────────────────────────────── */
.hero-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hero-logo {
  width: min(360px, 90%);
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.22));
}
.hero-text {
  max-width: 760px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: 12px 14px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Schedule day headers ──────────────────────────────── */
.day-header {
  margin: 14px 2px 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  display: inline-block;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.day-group { margin-bottom: 14px; }

/* ── Profile/help icons ────────────────────────────────── */
.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  user-select: none;
}
.help:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Profile entry blocks ──────────────────────────────── */
.entry {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  background: var(--card);
}

/* ── Empty state ───────────────────────────────────────── */
.empty { color: var(--muted); font-size: 14px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 0 8px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .row.with-qr { grid-template-columns: 1fr; }
  .qr-box { max-width: 140px; margin: 0 auto; }
  button { min-height: 44px; }
}

/* ── Ops hub touch menus (/ops/menu/*) ─────────────────── */
main.ops-hub-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.ops-hub-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--ink);
}
.ops-hub-subnav {
  text-align: center;
  margin: 24px 0 0;
}
.ops-hub-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.ops-hub-actions--solo {
  max-width: 520px;
}
.ops-hub-dash {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}
.ops-hub-section {
  padding: 14px 14px 16px;
}
.ops-hub-section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px;
  text-align: center;
  color: var(--ink);
}
.ops-hub-section .ops-hub-actions {
  max-width: none;
  margin: 0;
}
a.ops-hub-btn,
button.ops-hub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  padding: 14px 18px;
  margin: 0;
  border-radius: 14px;
  box-sizing: border-box;
  border: 2px solid var(--brand-dark);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
a.ops-hub-btn:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  color: var(--ink);
}
button.ops-hub-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  border: 2px solid var(--line);
}
@media (max-width: 640px) {
  a.ops-hub-btn,
  button.ops-hub-btn {
    min-height: 48px;
    font-size: 15px;
  }
}

/* Site footer — optional tail nav, socials, copyright; single white card; last in main */
.site-footer {
  margin-top: 24px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.site-footer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.site-footer-tail-nav {
  margin: 0 0 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.site-footer-card .ops-hub-subnav.meta {
  margin: 0;
}
.site-footer-socials {
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35em;
  text-align: center;
}
.site-footer-socials a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}
.site-footer-socials a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.site-footer-socials-text {
  color: var(--muted);
}
.site-footer-copy {
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.25;
  text-align: center;
}

.cookie-consent-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.cookie-consent-banner[hidden] { display: none; }
.cookie-consent-banner p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}
.cookie-consent-banner a { color: var(--brand-dark); }
.cookie-consent-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.cookie-consent-banner button {
  flex: 0 0 auto;
  min-width: 108px;
}
@media (max-width: 640px) {
  .cookie-consent-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-consent-actions {
    flex-direction: column;
  }
  .cookie-consent-banner button { width: 100%; }
}

/* Generic browser error pages (non-/api/) */
main.error-page-main {
  max-width: none;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  margin: 0 auto;
  box-sizing: border-box;
}
.error-page-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 24px 26px;
  text-align: center;
}
.error-page-message {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.35;
}
.error-page-detail {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.error-page-actions {
  margin: 0;
}
a.error-page-home {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
a.error-page-home:hover {
  background: var(--brand-dark);
  color: #fff;
}
