/* Amber Beauty: gray primary, gold accent (from the logo), white. */
:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #2f3033;
  --body: #45464b;
  --muted: #66676b;
  --faint: #a9aaae;
  --line: #e4e4e1;
  --line-soft: #efefec;
  --surface2: #f0f0ed;
  --primary: #4a4b50;
  --primary-dark: #36373b;
  --primary-soft: #ececea;
  --gold: #b08d3e;
  --gold-dark: #7d5f1f;
  --gold-btn: #866726;
  --gold-soft: #f5eedd;
  --green: #4d7a3a;
  --green-soft: #e6efdd;
  --orange: #9a5b14;
  --orange-soft: #f8ead2;
  --red: #a33f2b;
  --red-soft: #f7e1dc;
  --blue: #3f5f86;
  --blue-soft: #e3eaf3;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --shadow: 0 1px 2px rgba(40, 40, 45, .05), 0 6px 20px rgba(40, 40, 45, .07);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--body);
}
main { max-width: 760px; margin: 0 auto; padding: 10px 18px 24px; }
h1, h2, h3 { color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 14px; font-weight: 700; }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 6px; }
.mt0 { margin-top: 0; }
a { color: var(--gold-dark); text-decoration: none; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; margin: 8px 0 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.ic { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.card .ic, h2 .ic { color: var(--gold); margin-right: 4px; }

.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.card.warn { background: var(--orange-soft); color: var(--orange); box-shadow: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.kv:first-child { border-top: 0; }
.kv > span:last-child { text-align: right; }

button, .btn {
  font: inherit; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 9px 16px; min-height: 42px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: transform .06s ease, background .15s ease;
}
button:active, .btn:active { transform: scale(.98); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(54, 55, 59, .2); }
button.primary:hover, .btn.primary:hover { background: var(--primary-dark); }
.btn.gold, button.gold { background: var(--gold-btn); border-color: var(--gold-btn); color: #fff; font-weight: 600; }
button.danger { color: var(--red); border-color: #efc9c0; }
button.small, .btn.small { min-height: 34px; padding: 5px 12px; font-size: 13.5px; }
button.block, .btn.block { width: 100%; }
button.big { min-height: 52px; font-size: 16px; }
button.link { background: none; border: 0; color: var(--gold-dark); padding: 0; min-height: 0; font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
button .ic, .btn .ic { color: inherit; }

label { display: block; font-size: 13.5px; color: var(--muted); margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 8px 0; }
label.check input { width: auto; }
input, textarea, select {
  font: inherit; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text);
}
textarea { min-height: 64px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--gold-soft); border-color: var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.grid3.actions { gap: 8px; margin: 12px 0; }
.grid3.actions button { white-space: normal; line-height: 1.2; font-size: 13.5px; padding: 8px; }
.seg2 { display: flex; gap: 16px; }
.upload { cursor: pointer; margin: 0; color: var(--text); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: var(--surface2); color: var(--muted); }
.badge.gold { background: var(--gold); color: #fff; }
.owe { color: var(--red); font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }

/* Page structure */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; }
.eyebrow { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; min-height: 36px; color: var(--gold-dark); }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 10px; }
.sec h2 { margin: 0; }
.sec a { font-size: 13.5px; font-weight: 600; }

/* Summary card */
.brief { display: block; background: linear-gradient(135deg, #4a4b50, #2f3033); color: #f3f3f1; border-radius: 22px; padding: 18px; box-shadow: 0 10px 24px rgba(40, 40, 45, .22); }
.brief .brief-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #d9c79c; }
.brief .brief-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.brief .n { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; color: #fff; font-variant-numeric: tabular-nums; }
.brief .n small { font-size: 16px; }
.brief .l { display: block; font-size: 12px; color: #c9c9c6; }

/* Lists */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 62px; color: var(--body); border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; width: 100%; text-align: left; background: none; font-weight: inherit; white-space: normal; justify-content: flex-start; }
.li:first-child { border-top: 0; }
a.li:active, button.li:active { background: var(--surface2); transform: none; }
.li .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: inherit; }
.li .t b { font-size: 15px; font-weight: 600; color: var(--text); }
.li .t span { font-size: 12.5px; color: var(--muted); }
.li .chev { color: var(--faint); display: flex; }
.li .time { width: 48px; display: flex; flex-direction: column; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.li .time span { font-size: 12px; color: var(--muted); font-weight: 500; }
.ibox { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.ibox .ic { color: inherit !important; margin: 0 !important; }
.ibox.gold { background: var(--gold-soft); color: var(--gold-dark); }
.ibox.blue { background: var(--blue-soft); color: var(--blue); }
.ibox.amber { background: var(--orange-soft); color: var(--orange); }
.ibox.gray { background: var(--surface2); color: var(--faint); }
.count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--gold); color: #fff; }
.count.soft { background: var(--gold-soft); color: var(--gold-dark); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: #e6e6e3; border-radius: 14px; margin: 4px 0 16px; }
.seg a { min-height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg a[aria-current="page"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(40, 40, 45, .12); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 19px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Bookings */
.booking-card { border-left: 4px solid var(--line); }
.booking-card.pending { border-left-color: var(--gold); }
.booking-card.confirmed { border-left-color: var(--primary); }
.booking-card.done { border-left-color: var(--green); }
.booking-card > div { margin-top: 2px; }

/* Courses */
.pkg .bar { height: 8px; background: var(--gold-soft); border-radius: 99px; margin: 8px 0 6px; overflow: hidden; }
.pkg .bar span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.photos figure { margin: 0; cursor: pointer; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--surface2); }
.photos figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 2px; }
.photo-full { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; }
.qr { width: 220px; max-width: 100%; height: auto; display: block; margin: 8px auto; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-top: 8px; }

.hour-row { display: grid; grid-template-columns: 1fr 96px 12px 96px; gap: 6px; align-items: center; }
.hour-row label.check { margin: 6px 0; }
.share-link { display: flex; gap: 6px; }
.share-link input { font-size: 13.5px; }
.notice-text { min-height: 200px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.compact td { padding: 6px 10px; }
th { background: #fafaf8; font-weight: 600; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 28px; background: var(--gold); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-val { font-size: 10px; font-weight: 700; white-space: nowrap; }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Date strip */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 12px; scroll-snap-type: x mandatory; }
.date-chip { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); scroll-snap-align: start; min-height: 0; color: var(--text); }
.date-strip.compact .date-chip { flex-basis: 52px; padding: 6px 2px; }
.date-chip .dc-dow { font-size: 12px; color: var(--muted); }
.date-chip .dc-day { font-size: 20px; font-weight: 700; }
.date-chip .dc-mon { font-size: 11px; color: var(--muted); }
.date-chip:disabled { opacity: .35; box-shadow: none; background: transparent; }
.date-chip.on, .date-chip[aria-pressed="true"] { border-color: var(--gold); }

/* App bar + navigation (owner app) */
body.app { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.appbar {
  position: sticky; top: 0; z-index: 11; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(246, 246, 244, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.appbar img { height: 34px; width: auto; }
.appbar .who { margin-left: auto; font-size: 12.5px; color: var(--muted); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(var(--tabs, 5), 1fr);
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 8px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.nav a span { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 999px; }
.nav a.active { color: var(--text); font-weight: 600; }
.nav a.active span { background: var(--gold-soft); color: var(--gold-dark); }

dialog { border: 0; border-radius: 20px; padding: 18px; width: min(560px, calc(100vw - 20px)); max-height: calc(100vh - 30px); }
dialog::backdrop { background: rgba(30, 30, 33, .5); }
dialog h2 { margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2f3033; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 50;
  max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.toast.error { background: var(--red); }

.auth { max-width: 400px; margin: 8vh auto 0; border-radius: 24px; padding: 28px 22px; }
.auth-logo { display: block; margin: 0 auto 8px; width: 220px; max-width: 80%; }

@media (min-width: 900px) {
  body.app { padding-bottom: 0; padding-top: 0; }
  .nav { position: sticky; top: 51px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); grid-template-columns: repeat(var(--tabs, 5), 130px); justify-content: center; }
  .nav a { flex-direction: row; gap: 6px; font-size: 14px; padding: 8px 0; }
  .toast { bottom: 24px; }
}

/* ---------- Public booking page ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 760px; margin: 0 auto; padding: 10px 18px; }
.topbar img { height: 44px; width: auto; display: block; }
.steps { list-style: none; padding: 12px; margin: 0 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); text-align: center; }
.steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); font-weight: 700; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active span { background: var(--gold-btn); color: #fff; box-shadow: 0 0 0 4px var(--gold-soft); }
.steps li.done span { background: var(--primary); color: #fff; }
.pick-summary { background: var(--gold-soft); color: var(--text); border-radius: 14px; padding: 10px 12px; font-size: 14px; margin-bottom: 4px; }
.pick-list { display: grid; gap: 10px; }
.pick { display: grid; gap: 3px; text-align: left; justify-items: start; justify-content: stretch; width: 100%; padding: 14px 16px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); border-radius: 18px; min-height: 0; white-space: normal; }
.pick:hover { border-color: var(--gold-soft); }
.pick-name { font-weight: 700; font-size: 16px; color: var(--text); }
.pick-meta { color: var(--gold-dark); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pick-desc { color: var(--muted); font-size: 13px; }
.group-title { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.slot-group { margin: 14px 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; font-weight: 600; border-radius: 14px; }
.slot:hover { border-color: var(--gold); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done-card { padding: 28px 18px; margin-top: 10px; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--gold); box-shadow: 0 0 0 8px var(--gold-soft); }
.center-row { justify-content: center; }
.book-footer { padding: 18px 0 8px; font-size: 12.5px; }
.back-row { margin-top: 16px; }
.topbar .btn.small { min-height: 44px; }
table.compact td { white-space: nowrap; }
