:root {
  --bg: #f6f4ef; --card: #fff; --ink: #1f2a24; --muted: #6b746e; --line: #e3dfd6;
  --brand: #2f5d46; --brand-ink: #fff; --accent: #c8553d;
  --ok: #2f7a4b; --ok-bg: #e5f3ea; --warn: #8a5a00; --warn-bg: #fdf1d8; --err: #a02d22; --err-bg: #fbe6e3;
  --airbnb: #ffd3cf; --stayz: #cfe1ff; --direct: #d3f0dc; --family: #e7dbff; --block: #dcdcdc;
  --r: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .4em 0 .5em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1rem; margin: 1.2em 0 .4em; }
.card h2:first-of-type, .card h3:first-child { margin-top: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 60px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.signout { color: #d9e8df; font-size: .9rem; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #d9e8df; text-decoration: none; padding: 9px 12px; white-space: nowrap; border-radius: 8px 8px 0 0; font-size: .95rem; }
.tabs a.on { background: var(--bg); color: var(--ink); font-weight: 600; }

/* bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row h1, .head-row h2 { margin-bottom: .4em; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 14px 0; background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash ul { margin: 0; padding-left: 18px; }
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 16px;
  border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: var(--err); }
.btn.small { padding: 6px 11px; font-size: .88rem; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; padding: 4px 0; }
form.inline, details.inline { display: inline-block; vertical-align: middle; margin: 0; }
details.inline summary { list-style: none; }
details.inline summary::-webkit-details-marker { display: none; }
details.inline[open] > .form, details.inline .pop { margin-top: 8px; }
details.right { position: relative; }
.pop { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 230px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.danger-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.top-gap { margin-top: 14px; }
.count { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: .85rem; vertical-align: middle; }

/* forms */
.form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .95rem; }
.form label .muted { font-weight: 400; }
.form input:not([type=checkbox]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.form label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.form label.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.form label.line { justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; font-weight: 400; }
.form label.line span { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.narrow { max-width: 520px; }
.login { margin: 40px auto; }
.total-row { display: flex; justify-content: space-between; font-size: 1.15rem; padding: 14px 0; }
.upload { border: 2px dashed var(--line); border-radius: var(--r); padding: 14px; text-align: center; }
.upload img { max-width: 100%; max-height: 260px; margin-top: 10px; border-radius: 8px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.alert { border-color: var(--accent); }
.stat.alert b { color: var(--accent); }
.stat.warn b { color: var(--warn); }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eee; color: var(--ink); white-space: nowrap; }
.badge.src-airbnb { background: var(--airbnb); } .badge.src-stayz { background: var(--stayz); }
.badge.src-direct { background: var(--direct); } .badge.src-family { background: var(--family); }
.badge.src-block { background: var(--block); }
.badge.st-new { background: var(--accent); color: #fff; }
.badge.st-changed { background: var(--warn-bg); color: var(--warn); }
.badge.st-seen { background: #e8efe9; color: var(--brand); }
.badge.st-done { background: var(--ok-bg); color: var(--ok); }
.badge.st-cancel { background: var(--err-bg); color: var(--err); }
.badge.st-none { background: transparent; color: var(--muted); }

/* tables */
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.list th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.act { text-align: right; white-space: nowrap; }
table.list td.num { text-align: right; }
table.list.plain { border: 0; }
tr.cancelled td { opacity: .5; text-decoration: line-through; }
tr.cancelled td.act { text-decoration: none; }

/* calendar */
.cals { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.cal { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.cal td { height: 40px; border-radius: 6px; background: #f3f1ec; font-size: .78rem; vertical-align: top; padding: 3px 4px; position: relative; }
.cal td.past { opacity: .45; }
.cal td.today { outline: 2px solid var(--ink); }
.cal td.in { box-shadow: inset 3px 0 0 rgba(0,0,0,.35); }
.cal td.src-airbnb { background: var(--airbnb); } .cal td.src-stayz { background: var(--stayz); }
.cal td.src-direct { background: var(--direct); } .cal td.src-family { background: var(--family); }
.cal td.src-block { background: var(--block); }
.cal .mop { position: absolute; right: 2px; bottom: 1px; font-style: normal; font-size: .85rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin: 4px 0 10px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw.src-airbnb { background: var(--airbnb); } .sw.src-stayz { background: var(--stayz); } .sw.src-direct { background: var(--direct); }
.sw.src-family { background: var(--family); } .sw.src-block { background: var(--block); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-size: .88rem; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* settings */
.ical { margin-bottom: 10px; }
.ical > span { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.copy { display: flex; gap: 6px; }
.copy input { flex: 1; min-width: 0; padding: 8px 10px; font: .8rem ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-radius: 8px; background: #faf9f6; }

/* receipts */
.receipt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.receipt { display: flex; gap: 14px; }
.receipt p { margin: 6px 0 10px; }
.thumb { flex: none; width: 96px; height: 120px; border-radius: 8px; overflow: hidden; background: #f3f1ec; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* cleaner jobs */
.jobs { display: grid; gap: 12px; }
.job { display: flex; gap: 14px; margin: 0; }
.job.st-unseen { border: 2px solid var(--accent); }
.job.st-changed { border: 2px solid #e2b04a; }
.job.st-cancelled { border: 2px solid var(--err); background: #fff8f7; }
.job-date { flex: none; width: 58px; text-align: center; background: var(--bg); border-radius: 10px; padding: 6px 0; align-self: flex-start; }
.job-date span { display: block; line-height: 1.1; }
.dow, .mon { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.dnum { font-size: 1.6rem; font-weight: 700; }
.job-body { flex: 1; min-width: 0; }
.job-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 1.05rem; }
.job-body p { margin: 6px 0; }
.job .tight b { color: var(--accent); }
.note { background: var(--warn-bg); padding: 8px 10px; border-radius: 8px; }
.job-actions { display: flex; gap: 8px; margin-top: 10px; }
.nudge { background: var(--warn-bg); border-color: #efd9a7; }
.nudge b { display: block; margin-bottom: 8px; }
.nudge .btn { margin: 0 6px 6px 0; }
.hist { display: grid; gap: 8px; }
.hrow { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 14px; }
.hrow .right { text-align: right; }
.statement .big { font-size: 2rem; font-weight: 700; }

/* phones */
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .row2:not(.keep) { grid-template-columns: 1fr; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.list td { border: 0; padding: 4px 14px; }
  table.list td[data-l]::before { content: attr(data-l); display: inline-block; width: 70px; color: var(--muted); font-size: .8rem; }
  table.list td.act { text-align: left; }
  table.list.plain tr { padding: 6px 0; }
  .cal td { height: 34px; }
}

@media print {
  .top, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

/* notifications panel */
.pushbox { border-color: #cfe0d6; background: #f3f8f5; }
.pushbox p { margin: 6px 0 10px; }
.pushbox ol { margin: 8px 0; padding-left: 20px; }
.pushbox ol li { margin-bottom: 4px; }
.push-on { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .92rem; }

/* booking times + guests */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.pair { display: flex; gap: 6px; }
.pair input[type=date] { flex: 1.6; min-width: 0; }
.pair input[type=time] { flex: none; width: 8.6em; }
.row3.times { align-items: end; }
.row3.times .lbl { font-weight: 600; font-size: .95rem; padding-bottom: 22px; }
.badge.st-bonus { background: #fff0c2; color: #7a5300; }
@media (max-width: 640px) {
  .row3.times { grid-template-columns: 1fr 1fr; }
  .row3.times .lbl { grid-column: 1 / -1; padding: 0 0 4px; }
}
