/* ------------------------------------------------------------------
   Express Accounts (SaaS) — application styles
   ------------------------------------------------------------------ */

:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff4ff;
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --text: #1c2333;
  --text-muted: #5b6478;
  --border: #e4e7ee;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --bottom-nav-h: 62px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-float: 0 8px 24px rgba(16, 24, 40, .12);
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  font-size: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .8rem; }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: 1rem; }
.btn.danger { color: var(--red); }
.link-btn {
  background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font-size: .85rem;
}
.link-btn.danger { color: var(--red); }
.inline-form { display: inline; }

/* ---------------- Top bar & layout ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 36px; height: 36px; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.hamburger span { display: block; width: 16px; height: 2px; margin: 0 auto; background: var(--text); border-radius: 2px; }

.brand { display: flex; align-items: center; gap: 9px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff;
  font-weight: 700; font-size: .74rem; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.brand-tagline { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.biz-switcher select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: .82rem;
}
.topbar-icon-link { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.topbar-icon-link:hover { color: var(--accent); }
.user-chip { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }

.layout { display: flex; align-items: flex-start; max-width: 1400px; margin: 0 auto; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(15, 20, 32, .45); z-index: 40; }
.overlay.visible { display: block; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--card-bg);
}
.sidebar-inner { padding: 14px 10px 60px; }
.nav-section-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); font-weight: 700; padding: 16px 10px 6px;
}
.nav-section-label:first-child { padding-top: 6px; }
.sidebar a {
  display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: .87rem;
}
.sidebar a:hover { background: var(--accent-light); color: var(--accent-dark); text-decoration: none; }
.sidebar a.active { background: var(--accent); color: #fff; font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 26px 32px 70px; }

/* ---------------- Flash messages ---------------- */

.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: .88rem; }
.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }

/* ---------------- Page structure ---------------- */

.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-sub { color: var(--text-muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.card h2 { margin-top: 0; font-size: 1.05rem; }
.form-card { max-width: 900px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.empty-hint { color: var(--text-muted); }
.hint-text { color: var(--text-muted); font-size: .82rem; }

/* ---------------- Forms ---------------- */

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;
}
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--text); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid input[type=text], .form-grid input[type=email], .form-grid input[type=password],
.form-grid input[type=number], .form-grid input[type=date], .form-grid input[type=search],
.form-grid select, .form-grid textarea {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem;
  font-family: inherit; font-weight: 400; color: var(--text); background: #fff; min-height: 44px;
}
.form-grid textarea { min-height: unset; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 2px solid var(--accent-light); border-color: var(--accent); }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}

/* ---------------- Tables ---------------- */

.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table thead th { color: var(--text-muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; }
.totals-row td { font-weight: 700; }
.row-actions { display: flex; gap: 10px; white-space: nowrap; }

/* Line-item editor tables */
.line-item-table { margin-bottom: 16px; }
.line-item-table select, .line-item-table input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem;
}
.line-item-table .num input { text-align: right; }
.line-item-table .remove-line { font-size: 1.1rem; }

.totals-summary { max-width: 320px; margin-left: auto; margin-bottom: 20px; }
.totals-summary div { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.totals-summary .totals-grand { border-top: 2px solid var(--border); margin-top: 4px; padding-top: 10px; font-weight: 700; font-size: 1.05rem; }

/* ---------------- Badges / tags ---------------- */

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--bg); color: var(--text-muted); }
.badge-paid { background: var(--green-bg); color: var(--green); }
.badge-partial { background: var(--amber-bg); color: var(--amber); }
.badge-unpaid { background: var(--red-bg); color: var(--red); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .68rem; background: var(--accent-light); color: var(--accent-dark); margin-left: 6px; }

.balance-hint { font-weight: 600; padding: 8px 0; }
.balance-hint.ok { color: var(--green); }
.balance-hint.warn { color: var(--red); }

.badge-booked { background: var(--accent-light); color: var(--accent-dark); }
.badge-confirmed { background: var(--green-bg); color: var(--green); }
.badge-arrived { background: var(--amber-bg); color: var(--amber); }
.badge-completed { background: var(--green-bg); color: var(--green); }
.badge-cancelled { background: var(--red-bg); color: var(--red); }
.badge-no_show { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--accent-light); color: var(--accent-dark); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-critical { background: var(--red-bg); color: var(--red); }

/* ---------------- Calendar ---------------- */

.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.calendar-toolbar .spacer { flex: 1; }
.calendar-nav { display: flex; gap: 6px; align-items: center; }
.calendar-scroll { overflow-x: auto; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.calendar-header-row, .calendar-body {
  display: grid;
}
.calendar-header-row {
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; background: var(--card-bg); z-index: 2;
}
.calendar-header-cell {
  padding: 10px 8px; font-weight: 700; font-size: .84rem; border-left: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.calendar-header-cell:first-child { border-left: none; }
.calendar-time-col { border-left: none; }
.calendar-time-label {
  font-size: .68rem; color: var(--text-muted); text-align: right; padding: 0 8px; position: relative; top: -6px;
}
.calendar-col {
  border-left: 1px solid var(--border);
  position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 72px);
}
.calendar-appt {
  position: relative;
  margin: 1px 3px;
  padding: 3px 6px;
  border-radius: 6px;
  overflow: hidden;
  font-size: .72rem;
  line-height: 1.3;
  color: #fff;
  text-decoration: none;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.calendar-appt:hover { outline: 2px solid rgba(0,0,0,.2); }
.calendar-appt.status-cancelled, .calendar-appt.status-no_show { opacity: .55; text-decoration: line-through; }
.calendar-appt .appt-time { font-weight: 700; display: block; }
.calendar-appt .appt-client.privacy-blur { filter: blur(5px); }
.calendar-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.appt-confirmed-tick {
  position: absolute; top: 2px; right: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.calendar-legend { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .82rem; margin-bottom: 12px; }
body.privacy-on .privacy-blur { filter: blur(6px); }
.calendar-unavailable {
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.05), rgba(0,0,0,.05) 6px, rgba(0,0,0,.09) 6px, rgba(0,0,0,.09) 12px);
  pointer-events: none;
  z-index: 0;
}
.calendar-off-label {
  display: block; font-weight: 400; font-size: .68rem; color: var(--text-muted);
}

/* ---------------- Dashboard ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: .76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-hint { font-size: .78rem; color: var(--text-muted); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

/* ---------------- Printable documents ---------------- */

.doc-sheet {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px; max-width: 820px;
}
.doc-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.doc-header h2 { margin: 0 0 6px; }
.doc-meta { text-align: right; }
.doc-meta h1 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: .05em; color: var(--text-muted); }
.doc-bill-to { margin-bottom: 20px; }
.doc-bill-to h3 { font-size: .78rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.doc-items { margin-bottom: 16px; }
.doc-totals { max-width: 320px; margin-left: auto; }
.doc-totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.doc-totals .totals-grand { border-top: 2px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.doc-notes { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .88rem; }

.doc-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.5;
}
.doc-footer strong { color: var(--text); }

/* A4 printing: physical page size + margins for header/footer to sit
   within, so invoices/receipts print cleanly on an A4 printer. */
@page {
  size: A4;
  margin: 14mm 12mm;
}

@media print {
  .topbar, .sidebar, .overlay, .no-print, .sitefooter { display: none !important; }
  .layout, .content { display: block; padding: 0; margin: 0; }
  .doc-sheet { box-shadow: none; border: none; max-width: 100%; padding: 0; }
  .doc-items tr, .doc-totals, .doc-footer { break-inside: avoid; }
  body { background: #fff; }
}

/* ---------------- Control panel (NCH-style flowchart home screen) ---------------- */

.control-panel {
  background: linear-gradient(180deg, #123a44, #0d2b33);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 24px;
}

.panel-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 0.85fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.panel-col { display: flex; flex-direction: column; gap: 10px; }
.panel-col-narrow { gap: 14px; }

.panel-subrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.panel-arrow {
  text-align: center;
  color: rgba(255, 255, 255, .35);
  font-size: .8rem;
  line-height: 1;
  margin: -2px 0;
}

.panel-tile {
  display: flex;
  align-items: center;
  min-height: 92px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.panel-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .24); }
.panel-tile:active { transform: translateY(0) scale(.98); }
.panel-tile.dim { min-height: 68px; font-size: .84rem; opacity: .92; }

.panel-tile.green  { background: linear-gradient(145deg, #2e9e4f, #1f7a3b); }
.panel-tile.orange { background: linear-gradient(145deg, #e0623f, #c8492a); }
.panel-tile.blue   { background: linear-gradient(145deg, #3a7fd5, #2a5fb0); }
.panel-tile.gold   { background: linear-gradient(145deg, #d99a2b, #b97e1c); }
.panel-tile.navy   { background: linear-gradient(145deg, #1c4a56, #133640); border: 1px dashed rgba(255,255,255,.25); }
.panel-tile.teal   { background: linear-gradient(145deg, #0d9488, #0f766e); }

.panel-summary {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 24px;
}
.panel-summary div { display: flex; justify-content: space-between; gap: 10px; color: rgba(255, 255, 255, .8); font-size: .84rem; }
.panel-summary strong { color: #fff; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .panel-flow { grid-template-columns: 1fr 1fr; }
  .panel-col-narrow { grid-column: span 2; flex-direction: row; }
  .panel-col-narrow .panel-tile { flex: 1; min-height: 64px; }
}

@media (max-width: 600px) {
  .control-panel { padding: 18px; border-radius: var(--radius-sm); }
  .panel-flow { grid-template-columns: 1fr; }
  .panel-col-narrow { grid-column: span 1; flex-direction: column; }
  .panel-tile { min-height: 64px; font-size: .86rem; }
  .panel-tile.dim { min-height: 52px; }
  .panel-summary { grid-template-columns: 1fr 1fr; }
}

/* ---------------- POS register / cash up ---------------- */

.pos-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pos-payment-col { display: flex; flex-direction: column; gap: 12px; }
.pos-total-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 4px;
}
.pos-total-box div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .95rem; }
.pos-total-box strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: var(--red-bg); }

@media (max-width: 700px) {
  .pos-payment-grid { grid-template-columns: 1fr; }
}

/* ---------------- Reconcile ---------------- */

.reconcile-summary { max-width: 360px; margin: 16px 0; }
.reconcile-summary p { display: flex; justify-content: space-between; margin: 4px 0; }

/* ---------------- Guest / marketing pages ---------------- */

.guest-body { background: var(--bg); }
.guest-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--card-bg); border-bottom: 1px solid var(--border);
}
.guest-nav { display: flex; align-items: center; gap: 16px; }
.guest-nav a:not(.btn) { color: var(--text-muted); font-weight: 600; font-size: .9rem; }
.guest-main { max-width: 1100px; margin: 0 auto; padding: 50px 24px 80px; }
.guest-footer { text-align: center; padding: 30px; color: var(--text-muted); font-size: .82rem; }

.hero { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.hero h1 { font-size: 2.3rem; margin: 0 0 16px; }
.hero-sub { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.auth-card {
  max-width: 420px; margin: 20px auto; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.auth-card h1 { margin-top: 0; font-size: 1.4rem; text-align: center; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 600; }
.auth-card input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .92rem; font-family: inherit;
}
.auth-switch { text-align: center; margin-top: 16px; font-size: .86rem; color: var(--text-muted); }

/* ---------------- Setup notice ---------------- */

.setup-notice { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.setup-card { max-width: 520px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.setup-card h1 { margin-top: 0; font-size: 1.4rem; }
.setup-card code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: .85em; }
.setup-error { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); word-break: break-word; }

/* ---------------- Bottom app-style tab bar (mobile) ---------------- */

.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(16, 24, 40, .08);
}
.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border: none; background: none; cursor: pointer;
  color: var(--text-muted);
  font-family: inherit; font-size: .66rem; font-weight: 600;
  border-radius: 12px;
}
.bottom-nav-item svg { flex-shrink: 0; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:active { background: var(--accent-light); }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .hamburger { display: none; }
  .bottom-nav { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
    width: 84vw; max-width: 320px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.15); }
  .content { padding: 18px 16px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 24px); }
  .sitefooter { display: none; }
  .brand-tagline { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .doc-header { flex-direction: column; }
  .doc-meta { text-align: left; }
  .biz-switcher select { max-width: 110px; }
  .page-head { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--bg); padding-top: 10px; margin-bottom: 14px; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.7rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 1.25rem; }
  .user-chip { display: none; }
  .topbar-icon-link { font-size: 0; }
  .topbar-icon-link::first-letter { font-size: 1.1rem; }
  .topbar-right { gap: 8px; }
}

/* Guest/marketing pages don't have a bottom nav, give their content room instead */
.guest-body .bottom-nav { display: none !important; }

/* ---------------- Public online booking (book.php) ---------------- */

.public-booking-body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
}
.public-booking {
  width: 100%;
  max-width: 520px;
  padding: 16px;
  margin: 0 auto;
}
.pb-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 28px;
}
.pb-header h1 { margin: 0 0 18px; font-size: 1.3rem; text-align: center; }
.pb-footer { text-align: center; color: var(--text-muted); font-size: .78rem; margin-top: 14px; }

.pb-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.pb-step {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 3px solid var(--border);
}
.pb-step.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

.pb-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pb-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  min-height: 56px;
  transition: border-color .12s ease, background .12s ease;
}
.pb-option:hover { border-color: var(--accent); background: var(--accent-light); text-decoration: none; }
.pb-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.pb-option-body { display: flex; flex-direction: column; gap: 2px; }
.pb-option-sub { font-size: .78rem; color: var(--text-muted); font-weight: 400; }

.pb-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: .95rem;
}
.pb-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pb-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: .88rem;
}
.pb-slot:hover { background: var(--accent-light); border-color: var(--accent); text-decoration: none; }

.pb-form { display: flex; flex-direction: column; gap: 14px; }
.pb-form label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 600; }
.pb-form input, .pb-form textarea {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; min-height: 46px;
}
.pb-form textarea { min-height: unset; }

.pb-back { display: inline-block; margin-top: 4px; color: var(--text-muted); text-decoration: none; font-size: .88rem; }
.pb-back:hover { color: var(--accent-dark); }

.pb-confirmed { text-align: center; padding: 10px 0; }
.pb-check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 14px;
}
.pb-confirmed h2 { margin: 0 0 8px; }
.pb-confirmed .btn { margin-top: 14px; }

.pb-link-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pb-link-row input {
  flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .88rem; background: var(--bg); color: var(--text);
}

@media (max-width: 480px) {
  .public-booking { padding: 10px; }
  .pb-card { padding: 18px 14px 22px; }
  .pb-slot-grid { grid-template-columns: repeat(2, 1fr); }
  .pb-step { font-size: .62rem; }
}
