/* StayHub — shared styles. Brand colours arrive as CSS variables from the property's settings. */
:root {
  --brand: #1f4e79;
  --accent: #f2a541;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6877;
  --line: #e2e6eb;
  --ok: #1f8a4c;
  --warn: #b26a00;
  --bad: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --brand-dark: color-mix(in srgb, var(--brand) 80%, black);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- header ---------- */
.topbar { background: var(--brand); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.brand img { height: 40px; width: auto; border-radius: 6px; background: #fff; padding: 3px; }
.topbar .nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.topbar .nav a, .topbar .nav button { color: #fff; text-decoration: none; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.topbar .nav a:hover, .topbar .nav button:hover { background: rgba(255,255,255,.12); }

/* ---------- hero + search ---------- */
.hero { background: var(--brand); color: #fff; padding: 28px 0 56px; position: relative; overflow: hidden; }
.hero.has-img { padding: 64px 0 80px; }
.hero .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero .wrap { position: relative; }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 38px); line-height: 1.15; }
.hero p { margin: 0; opacity: .92; font-size: 17px; }
.search { margin-top: -32px; position: relative; z-index: 2; }
.search form { background: var(--accent); padding: 4px; border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr .7fr .7fr auto; gap: 4px; box-shadow: var(--shadow); }
.search label { background: #fff; border-radius: 8px; padding: 6px 12px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.search input, .search select { border: 0; outline: 0; font-size: 15px; color: var(--text); background: transparent; padding: 2px 0; width: 100%; }
.search button { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 0 22px; font-size: 16px; font-weight: 600; cursor: pointer; min-height: 52px; }
.search button:hover { background: var(--brand-dark); }
@media (max-width: 760px) { .search form { grid-template-columns: 1fr 1fr; } .search button { grid-column: 1 / -1; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.section { margin-top: 24px; margin-bottom: 24px; }
.section h2 { font-size: 20px; margin: 0 0 12px; }

.room { display: grid; grid-template-columns: 260px 1fr 220px; gap: 0; overflow: hidden; margin-bottom: 14px; }
.room .photo { position: relative; background: var(--brand-soft); min-height: 200px; }
.room .photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.room .photo .count { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.room .photo .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); font-weight: 600; opacity: .6; }
.room .info { padding: 16px; border-right: 1px solid var(--line); }
.room h3 { margin: 0 0 4px; font-size: 19px; color: var(--brand); }
.room .facts { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.room .desc { font-size: 14px; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 99px; padding: 3px 9px; }
.chip.ok { background: #e7f6ed; color: var(--ok); }
.room .price { padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; text-align: right; gap: 4px; }
.price .total { font-size: 24px; font-weight: 700; }
.price .per { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; }
.badge.ok { background: #e7f6ed; color: var(--ok); }
.badge.warn { background: #fff3e0; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.neutral { background: #eef1f4; color: var(--muted); }
@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; }
  .room .photo { min-height: 200px; }
  .room .info { border-right: 0; border-bottom: 1px solid var(--line); }
  .room .price { align-items: stretch; text-align: left; }
}

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px; }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid #c9d0d8; border-radius: 8px; padding: 9px 11px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.field .err { color: var(--bad); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 8px 0; }
.check input { margin-top: 3px; }
.pay-opts { display: grid; gap: 8px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt b { display: block; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.alert.err { background: #fdecea; color: var(--bad); }
.alert.ok { background: #e7f6ed; color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }

.checkout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; }
.summary .tot { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }

.footer { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--line); padding: 12px 8px; }
.sidenav a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.sidenav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.sidenav a:hover { background: var(--bg); }
.admin-main { padding: 20px; min-width: 0; }
.admin-main h1 { font-size: 22px; margin: 0 0 16px; }
@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidenav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .sidenav a { white-space: nowrap; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 13px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #fafbfc; }
.tbl-wrap { overflow-x: auto; }
.cal { overflow-x: auto; }
.cal table { border-collapse: collapse; font-size: 12px; }
.cal th, .cal td { border: 1px solid var(--line); padding: 4px; text-align: center; min-width: 46px; }
.cal th.rn { text-align: left; min-width: 160px; position: sticky; left: 0; background: #fff; z-index: 1; }
.cal td.free { background: #e7f6ed; }
.cal td.part { background: #fff3e0; }
.cal td.full { background: #fdecea; }
.cal .pr { color: var(--muted); font-size: 11px; }
.swatch { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0; }
.amen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs figure { margin: 0; position: relative; }
.thumbs img { width: 90px; height: 68px; object-fit: cover; border-radius: 6px; }
.thumbs button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 4px; cursor: pointer; font-size: 11px; }
.login-box { max-width: 380px; margin: 60px auto; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 50; }
dialog { border: 0; border-radius: 12px; padding: 0; max-width: 640px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(16,24,40,.5); }
dialog .dlg-h { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; }
dialog .dlg-b { padding: 18px; max-height: 70vh; overflow: auto; }
dialog .dlg-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.mt { margin-top: 14px; }
.sum-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }
.muted-w { opacity: .75; font-weight: 400; }
.field-in, #bf select { border: 1px solid #c9d0d8; border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 240px; }
.tiny { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.logo-prev { height: 56px; width: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.mt-s { margin-top: 8px; }
.full { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.grow { flex: 1; min-width: 200px; border: 1px solid #c9d0d8; border-radius: 8px; padding: 7px 10px; }
#ff select, .row > select { border: 1px solid #c9d0d8; border-radius: 8px; padding: 7px 10px; background: #fff; }
.field input[type=checkbox], .field input[type=radio] { width: auto; padding: 0; }
.field input[type=color] { padding: 2px; width: 52px; height: 38px; }
.amen-grid label, .row > label.small { display: flex; gap: 6px; align-items: center; }
.card h2:first-child { margin-top: 0; }

/* photo gallery */
.room .photo[data-gallery], .sum-img[role=button] { cursor: zoom-in; }
.gallery-dlg { max-width: 1000px; width: calc(100% - 24px); background: #111; color: #fff; }
.gallery-dlg .dlg-h { border-color: #333; }
.gallery-dlg .btn.ghost { color: #fff; border-color: #444; }
.gallery-dlg[open] { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.g-stage { position: relative; background: #000; display: flex; align-items: center; justify-content: center; height: min(62vh, 600px); overflow: hidden; flex: none; }
.g-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 0; width: 44px; height: 60px; font-size: 32px; cursor: pointer; border-radius: 8px; }
.g-nav:hover, .g-nav:focus-visible { background: rgba(255,255,255,.3); }
#g-prev { left: 8px; } #g-next { right: 8px; }
.g-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
.g-thumbs img { width: 84px; height: 60px; object-fit: cover; border-radius: 4px; opacity: .55; cursor: pointer; flex: none; }
.g-thumbs img.on { opacity: 1; outline: 2px solid var(--accent); }
