/* Samyak HQ — phone first. Colours from the Samyak brand: maroon, gold, ivory. */
:root {
  --maroon: #90292b; --maroon-dark: #6e1e20; --maroon-soft: #f6e4e2;
  --gold: #9d6200; --gold-soft: #f7ecd6;
  --ivory: #fcf8ed; --card: #fff; --ink: #2b211c; --muted: #75665b; --line: #e7ddcc;
  --green: #2a7a4b; --green-soft: #e1f2e7; --blue: #2b5ea7; --blue-soft: #e3ecf8;
  --red: #b3261e; --red-soft: #fbe6e4; --grey-soft: #efebe4;
  --radius: 14px; --shadow: 0 1px 2px rgba(60, 30, 20, .06), 0 4px 14px rgba(60, 30, 20, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.08rem; margin: 0 0 .6rem; }
p { margin: 0 0 .7rem; }
small, .muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---- shell */
.top { background: linear-gradient(120deg, var(--maroon-dark), var(--maroon) 60%, #a8452a); color: #fff; padding: .7rem 1rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 30; }
.top .brand { font-weight: 700; letter-spacing: .02em; color: #fff; font-size: 1.05rem; }
.top .brand span { opacity: .75; font-weight: 500; }
.top .who { margin-left: auto; font-size: .85rem; opacity: .9; text-align: right; }
.top button { background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 999px; padding: .4rem .8rem; font-size: .82rem; cursor: pointer; }
.nav { display: flex; }
.nav a { color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; flex: 1; padding: .45rem 0 .5rem; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--maroon); }
.nav a:hover { text-decoration: none; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head .grow { flex: 1; min-width: 0; }

/* ---- pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--maroon); background: var(--maroon); color: #fff; border-radius: 10px; padding: .62rem 1rem; font-size: .95rem; font-weight: 600; cursor: pointer; min-height: 44px; text-decoration: none; font-family: inherit; }
.btn:hover { background: var(--maroon-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--maroon); }
.btn.ghost:hover { background: var(--maroon-soft); }
.btn.quiet { background: var(--grey-soft); border-color: var(--grey-soft); color: var(--ink); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn.sm { min-height: 36px; padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; border-radius: 999px; padding: .12rem .6rem; font-size: .76rem; font-weight: 700; background: var(--grey-soft); color: var(--muted); white-space: nowrap; }
.pill.yoga { background: var(--maroon-soft); color: var(--maroon); }
.pill.ayurveda { background: var(--green-soft); color: var(--green); }
.pill.kulam { background: var(--blue-soft); color: var(--blue); }
.pill.direct { background: var(--gold-soft); color: var(--gold); }
.pill.s-new { background: var(--gold-soft); color: var(--gold); }
.pill.s-confirmed { background: var(--green-soft); color: var(--green); }
.pill.s-arrived { background: var(--blue-soft); color: var(--blue); }
.pill.s-cancelled { background: var(--red-soft); color: var(--red); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.note { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .93rem; }
.note.ok { background: var(--green-soft); color: #14502d; }
.note.bad { background: var(--red-soft); color: #7d1a14; }
.note.info { background: var(--gold-soft); color: #5e3b00; }

/* ---- forms */
label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; border: 1px solid #d4c8b6; border-radius: 10px; padding: .6rem .7rem; font: inherit; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--maroon); outline-offset: 1px; border-color: var(--maroon); }
.field { margin-bottom: .85rem; }
.field .err { color: var(--red); font-size: .84rem; margin-top: .25rem; }
.grid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); font-size: .95rem; }
.check input { width: 20px; height: 20px; }

/* ---- stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; display: block; color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; border-color: var(--maroon); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; color: var(--maroon); }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat.alert b { color: var(--gold); }

/* ---- filters */
.chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: .6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .42rem .85rem; font-size: .88rem; font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--maroon); }
.chip.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.chip i { font-style: normal; opacity: .7; margin-left: .25rem; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--maroon); list-style: none; padding: .3rem 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "\a0\25be"; }
details.more[open] > summary::after { content: "\a0\25b4"; }

/* ---- the booking sheet: cards on a phone, a spreadsheet on a wide screen */
.sheet { width: 100%; border-collapse: collapse; }
.sheet thead { display: none; }
.sheet tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .7rem; padding: .75rem .9rem; position: relative; }
.sheet td { display: block; padding: .1rem 0; }
.sheet td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: .8rem; font-weight: 700; }
.sheet td.guest { font-size: 1.04rem; font-weight: 700; padding-right: 5.5rem; }
.sheet td.guest a { color: var(--ink); }
.sheet td.guest small { display: block; font-weight: 500; }
.sheet td.status { position: absolute; top: .7rem; right: .8rem; }
.sheet td.empty { display: none; }
.sheet tr.cancelled { opacity: .6; }

/* ---- room chart */
.chart-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 74vh; box-shadow: var(--shadow); }
.chart { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.chart th, .chart td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; height: 40px; min-width: 62px; text-align: center; }
.chart thead th { position: sticky; top: 0; background: #fbf5ea; z-index: 3; padding: .25rem .2rem; font-weight: 600; line-height: 1.15; }
.chart thead th.today { background: var(--maroon); color: #fff; }
.chart thead th.we { color: var(--gold); }
.chart .rm { position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; padding: .25rem .6rem; min-width: 92px; font-weight: 700; white-space: nowrap; }
.chart thead th.rm { z-index: 4; background: #fbf5ea; }
.chart .rm small { display: block; font-weight: 500; }
.chart tr.bld td { background: var(--maroon-soft); color: var(--maroon); font-weight: 800; text-align: left; padding: .3rem .6rem; height: auto; position: sticky; left: 0; }
.chart td a { display: flex; align-items: center; justify-content: center; height: 100%; width: 100%; padding: 0 .2rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; font-size: .74rem; }
.chart td a:hover { text-decoration: none; filter: brightness(.95); }
.chart td.free a { color: #c9bca8; font-weight: 500; }
.chart td.free a:hover { background: var(--green-soft); color: var(--green); }
.chart td.yoga a { background: var(--maroon-soft); color: var(--maroon); }
.chart td.ayurveda a { background: var(--green-soft); color: var(--green); }
.chart td.kulam a { background: var(--blue-soft); color: var(--blue); }
.chart td.direct a { background: var(--gold-soft); color: var(--gold); }
.chart td.new a { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .7) 0 5px, transparent 5px 10px); }
.legend { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }

/* ---- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: .7rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow > span { display: block; }
.list .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--grey-soft); flex: none; }
.msg { white-space: pre-wrap; background: #f7f1e4; border-radius: 10px; padding: .8rem; font-size: .92rem; margin-bottom: .8rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; font-size: .93rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin: 1rem 0; }

/* ---- sign-in and public pages */
.center { max-width: 430px; margin: 0 auto; padding: 2.2rem 1rem; }
.center .logo { text-align: center; margin-bottom: 1.2rem; }
.center .logo img { width: 84px; height: 84px; }
.center .logo h1 { color: var(--maroon); margin-top: .4rem; }
.public { max-width: 760px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.public header { text-align: center; margin-bottom: 1.2rem; }
.public header img { width: 72px; height: 72px; }
.public header h1 { color: var(--maroon); font-size: 1.5rem; margin-top: .3rem; }
.roomopt { display: flex; gap: .7rem; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .5rem; cursor: pointer; background: #fff; font-weight: 600; color: var(--ink); font-size: .96rem; }
.roomopt input { width: 20px; height: 20px; flex: none; }
.roomopt:has(input:checked) { border-color: var(--maroon); background: var(--maroon-soft); }
.roomopt small { display: block; font-weight: 500; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
}
@media (min-width: 980px) {
  .nav { position: static; border: 0; background: none; padding: 0; margin-left: 1.5rem; gap: .2rem; }
  .nav a { flex: none; flex-direction: row; color: rgba(255, 255, 255, .8); font-size: .92rem; padding: .45rem .8rem; border-radius: 999px; gap: .4rem; }
  .nav a svg { width: 17px; height: 17px; }
  .nav a.on { background: rgba(255, 255, 255, .18); color: #fff; }
  .wrap { padding-bottom: 2rem; }
  .stats { grid-template-columns: repeat(6, 1fr); }
  .grid.four { grid-template-columns: repeat(4, 1fr); }

  .sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; font-size: .9rem; }
  .sheet th:first-child { border-top-left-radius: var(--radius); }
  .sheet th:last-child { border-top-right-radius: var(--radius); }
  .sheet thead { display: table-header-group; }
  .sheet th { text-align: left; background: #fbf5ea; padding: .55rem .7rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); position: sticky; top: 48px; z-index: 5; }
  .sheet tr { display: table-row; border: 0; box-shadow: none; margin: 0; padding: 0; border-radius: 0; position: static; }
  .sheet tbody tr:hover { background: #fdf9f0; }
  .sheet td, .sheet td.status, .sheet td.empty { display: table-cell; position: static; padding: .55rem .7rem; border-bottom: 1px solid #f0e8da; vertical-align: top; }
  .sheet td[data-l]::before { content: none; }
  .sheet td.guest { font-size: .95rem; padding-right: .7rem; }
}
@media print {
  .top, .nav, .noprint { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
}
