/* Stay Wild booking prototype — shared styles */
:root {
  --ground: #F6F4EE;
  --surface: #FFFFFF;
  --ink: #1D2621;
  --muted: #5B665F;
  --line: #DCD8CC;
  --line2: #ECE9E1;
  --forest: #2E5A45;
  --forest-d: #1F3A2D;
  --forest-50: #E6EFE9;
  --ok-bg: #DCEBE2; --ok-tx: #1E4D36; --ok-bd: #9CC3AD;
  --wait-bg: #FBEEDB; --wait-tx: #7A4709; --wait-bd: #E7C18A;
  --lock-bg: #E5F0F9; --lock-tx: #1F4E78; --lock-bd: #3B7AB0;
  --bad-bg: #FBE9E7; --bad-tx: #8F2A25; --bad-bd: #E8B4AF;
  --off-bg: #EEEDE8; --off-tx: #4F4E48;
  --sans: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  --serif: 'Noto Serif Thai', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--forest); }
a:hover { color: #1F4231; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
.serif { font-family: var(--serif); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* demo strip */
.demo { background: #3B2A0A; color: #FCEBC8; font-size: 12.5px; padding: 6px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.demo a { color: #FFE1A3; font-weight: 600; }
.demo .reset { background: none; border: 1px solid #8C6A2C; color: #FCEBC8; border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }

/* guest shell */
.shell { max-width: 480px; margin: 0 auto; background: var(--ground); min-height: 100vh; position: relative; }
@media (min-width: 520px) { .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--forest-d); color: #fff; }
.topbar .logo { height: 48px; width: auto; }
.topbar .t { flex: 1; min-width: 0; }
.topbar .t b { display: block; font-size: 15px; }
.topbar .t span { font-size: 12.5px; color: #CFE0D5; }
.iconbtn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 20px; cursor: pointer; }
.iconbtn.light { border-color: var(--line); color: var(--forest); background: #fff; }
.pad { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #CFCABD; background: #fff; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 12px; border: 0; background: var(--forest); color: #fff; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; padding: 0 18px; }
.btn:hover { background: #24493A; color: #fff; }
.btn.inline { width: auto; min-height: 44px; font-size: 15px; }
.btn2 { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--forest); background: #fff; color: var(--forest); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; padding: 0 14px; }
.btn2.gray { border-color: #CFCABD; color: var(--ink); }
.btn2.inline { width: auto; min-height: 40px; }
.later { display: inline-block; font-size: 11.5px; line-height: 20px; padding: 0 8px; border-radius: 999px; background: #EAE7DD; color: #4F4E48; font-weight: 500; vertical-align: middle; white-space: nowrap; }
.note { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note.green { background: var(--forest-50); color: var(--ok-tx); }
.note.amber { background: var(--wait-bg); color: var(--wait-tx); }
.note.blue { background: var(--lock-bg); color: var(--lock-tx); }
.note.red { background: var(--bad-bg); color: var(--bad-tx); }
.err { color: var(--bad-tx); font-size: 13px; margin-top: 4px; }
.pic { background: #C9D6C9; color: #2F4A3A; display: flex; align-items: center; justify-content: center; font-size: 13px; text-align: center; padding: 8px; }
.strike { text-decoration: line-through; color: #8C887E; font-size: 13px; }
.tag { display: inline-block; font-size: 12px; line-height: 22px; padding: 0 8px; border-radius: 6px; background: #EEF2EC; color: #2F4A3A; margin: 0 4px 4px 0; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid #CFCABD; background: #fff; font-size: 20px; color: var(--forest); cursor: pointer; }
.stepper b { min-width: 18px; text-align: center; }
.steps { display: flex; gap: 6px; font-size: 12px; }
.steps span { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; background: #ECE9E1; color: var(--muted); }
.steps span.on { background: var(--forest); color: #fff; }
.steps span.done { background: var(--ok-bg); color: var(--ok-tx); }
.sticky { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; z-index: 5; }
.li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.li:last-child { border-bottom: 0; }
.li .ico { flex: 0 0 22px; color: var(--forest); margin-top: 2px; }

/* hero */
.hero { position: relative; height: 230px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 40%; }
.hero-card { margin: -34px 16px 0; position: relative; }

/* calendar */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font-size: 12px; color: var(--muted); }
.d { height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; color: var(--ink); padding: 0; cursor: pointer; }
.d:hover { background: var(--forest-50); }
.d.blank { visibility: hidden; }
.d.past { color: #B5B1A6; cursor: default; background: transparent; }
.d.hol { background: var(--wait-bg); color: #8A510C; font-weight: 500; }
.d.full { background: #EFEDE7; color: #8C887E; text-decoration: line-through; cursor: not-allowed; }
.d.low { box-shadow: inset 0 0 0 1.5px #B8741F; }
.d.inrange { background: var(--ok-bg); color: var(--ok-tx); border-radius: 6px; }
.d.sel { background: var(--forest); color: #fff; font-weight: 600; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 6px; }

/* forms */
.f { display: flex; flex-direction: column; gap: 4px; }
.f label { font-size: 14px; font-weight: 500; }
.f input, .f select, .f textarea { min-height: 46px; border: 1px solid #CFCABD; border-radius: 10px; padding: 0 12px; font-size: 15px; background: #fff; width: 100%; }
.f textarea { padding: 10px 12px; min-height: 70px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 2px solid var(--forest); outline-offset: 1px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.chk input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--forest); flex: 0 0 22px; }

/* house cards */
.hcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hcard.picked { border: 2px solid var(--forest); }
.hcard .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); gap: 3px; margin: 0 auto; background: #fff; }
.qr i { background: var(--ink); border-radius: 2px; }

/* ticket */
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ticket .top { background: var(--forest-d); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.ticket .top img { height: 54px; width: auto; }
.ticket .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; }

/* admin */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; font-size: 14px; }
.side { flex: 1 1 210px; max-width: 240px; background: var(--forest-d); color: #DCE7DF; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
.side .brand img { height: 56px; width: auto; }
.side .brand span { font-size: 12px; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #DCE7DF; text-decoration: none; }
.side a:hover { background: #2A4A3A; color: #fff; }
.side a.on { background: var(--forest); color: #fff; font-weight: 600; }
.side .later { background: #3A5547; color: #DCE7DF; }
.side .who { margin-top: auto; padding: 16px 12px 0; font-size: 13px; border-top: 1px solid #36574A; }
.badge { min-width: 22px; height: 22px; border-radius: 999px; background: #E9A23B; color: #2A1A04; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.main { flex: 999 1 560px; min-width: 0; padding: 22px 26px 40px; display: flex; flex-direction: column; gap: 16px; }
.main .card { padding: 18px; min-width: 0; }
.pill { display: inline-block; font-size: 12px; line-height: 24px; padding: 0 10px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.ok { background: var(--ok-bg); color: var(--ok-tx); }
.wait { background: var(--wait-bg); color: var(--wait-tx); }
.lock { background: var(--lock-bg); color: var(--lock-tx); }
.bad { background: var(--bad-bg); color: var(--bad-tx); }
.off { background: var(--off-bg); color: var(--off-tx); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.3; }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
td.n, th.n { text-align: right; }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.todo:last-child { border-bottom: 0; }
.bar { height: 10px; border-radius: 5px; background: var(--forest); }
.kv { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.kv:last-child { border-bottom: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cols > * { min-width: 0; }
.newbk { border: 2px solid var(--forest); }
.bnav { display: none; }
.mhead { display: none; }

/* timeline calendar */
.tl { display: grid; grid-template-columns: 112px repeat(14, minmax(58px, 1fr)); grid-template-rows: 54px repeat(11, 48px); min-width: 940px; position: relative; }
.tl .dh { grid-row: 1; text-align: center; font-size: 12px; color: var(--muted); padding-top: 6px; border-bottom: 1px solid var(--line); }
.tl .dh b { display: block; font-size: 15px; color: var(--ink); }
.tl .hn { grid-column: 1; padding: 4px 10px; font-size: 13px; line-height: 1.3; display: flex; flex-direction: column; justify-content: center; }
.tl .ln { grid-column: 1 / -1; border-bottom: 1px solid var(--line2); }
.tl .cell { cursor: pointer; }
.tl .cell:hover { background: rgba(46,90,69,.07); }
.bk { position: relative; z-index: 2; margin: 6px 3px; border-radius: 8px; padding: 0 8px; font-size: 12px; line-height: 1.3; display: flex; align-items: center; overflow: hidden; white-space: nowrap; border: 1px solid; cursor: pointer; text-decoration: none; }
.bk.ok { border-color: var(--ok-bd); }
.bk.wait { border-color: var(--wait-bd); }
.bk.lock { background: #fff; border: 1.5px dashed var(--lock-bd); }
.bk.off { border-color: #D3D1C7; }
.bk.mine { box-shadow: 0 0 0 2px var(--forest); }

@media (max-width: 760px) {
  .side { display: none; }
  .main { padding: 14px 14px 90px; }
  .mhead { display: flex; align-items: center; gap: 10px; background: var(--forest-d); color: #fff; padding: 10px 14px; width: 100%; }
  .mhead img { height: 44px; width: auto; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 20; }
  .bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; font-size: 12px; color: var(--muted); text-decoration: none; }
  .bnav a.on { color: var(--forest); font-weight: 600; }
}
