:root {
  --ink: #182a30;
  --muted: #5e6f74;
  --bg: #f2efe9;
  --surface: #ffffff;
  --line: #e4ded2;
  --primary: #1c6b6b;
  --primary-dark: #134f4f;
  --open: #b9791a;
  --open-bg: #fbeed3;
  --claimed: #2f6f9e;
  --claimed-bg: #e2eef7;
  --done: #38875c;
  --done-bg: #e2f1e8;
  --danger: #b23b2e;
  --cal-uncov: #d6422f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 42, 48, .06), 0 6px 18px rgba(24, 42, 48, .05);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--primary); }
.brand-mark { color: var(--primary); font-size: .8em; vertical-align: middle; }
.mainnav { display: flex; gap: .35rem; flex: 1; flex-wrap: wrap; }
.mainnav a {
  color: var(--muted); padding: .4rem .7rem; border-radius: 8px; font-weight: 500; font-size: .95rem;
}
.mainnav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.mainnav a.on { background: var(--primary); color: #fff; }
.userbox { display: flex; align-items: center; gap: .75rem; }
.who { font-size: .85rem; color: var(--muted); }
.who em { font-style: normal; display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.link { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; }

.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .btn { margin-left: auto; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-left: auto; }
.head-actions .btn { margin-left: 0; }
.quick { margin-left: auto; }
.readonly-badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 99px; }

/* flash / callouts */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.flash-ok { background: var(--done-bg); color: var(--done); }
.flash-error { background: #fae3e0; color: var(--danger); }
.callout { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.card.pad { padding: 1.1rem 1.25rem; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .85rem; }
.card-head a { font-size: .85rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.cols .wide { grid-column: 1 / -1; }

/* stats */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.stat-num { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: .78rem; color: var(--muted); }
.accent-open { color: var(--open); }
.pos { color: var(--done); }
.neg { color: var(--danger); }

/* lists / rows */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--line); position: relative; }
.row:last-child { border-bottom: none; }
.chip-bar { width: 4px; align-self: stretch; border-radius: 99px; background: var(--chip, var(--primary)); }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; }
.row-dates { font-size: .9rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .9rem; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 99px; background: var(--chip, var(--primary)); margin-right: .5rem; vertical-align: baseline; }

/* pills */
.pill { font-size: .72rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; white-space: nowrap; }
.pill-open { background: var(--open-bg); color: var(--open); }
.pill-claimed { background: var(--claimed-bg); color: var(--claimed); }
.pill-done { background: var(--done-bg); color: var(--done); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tfoot th { border-top: 2px solid var(--line); border-bottom: none; font-weight: 700; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table td .dot { margin-right: .4rem; }

/* forms */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
.form input, .form select { font: inherit; color: var(--ink); padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.form input[type="color"] { padding: .2rem; height: 42px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form input:focus, .form select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.hint { font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.row-incomplete { background: var(--open-bg); }
.inline-form { display: flex; gap: .4rem; margin-top: .5rem; }
.inline-form input { flex: 1; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* cleaning pay */
.time-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.time-2 label { display: flex; flex-direction: column; font-size: .82rem; color: var(--muted); gap: .2rem; }
.time-2 input { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; }
.pay-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.pay-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.pay-card.pay-due { border-color: var(--open); background: var(--open-bg); }
.pay-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pay-amount { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.pay-sub { font-size: .82rem; color: var(--muted); }

/* calendar (timeline) */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-month { font-family: var(--display); font-size: 1.15rem; min-width: 8.5rem; text-align: center; }
.cal-filter { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.cal-filter-item { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; cursor: pointer; user-select: none; }
.cal-filter-item .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--chip); display: inline-block; }

.cal-card { padding: 0; overflow: hidden; }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal { min-width: max-content; --cw: 28px; --label-w: 140px; }
.cal-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: none; }
.cal-rowlabel { flex: 0 0 var(--label-w); position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; background: var(--surface); font-weight: 600; font-size: .92rem; border-right: 1px solid var(--line); }
.cal-rowlabel .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--chip); flex: 0 0 auto; }
.cal-headrow { background: #fbfaf7; position: sticky; top: 0; z-index: 4; }
.cal-headrow .cal-rowlabel { background: #fbfaf7; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

.cal-track { display: grid; grid-auto-rows: 44px; position: relative; flex: 1 1 auto; }
.cal-headrow .cal-track { grid-auto-rows: 38px; }
.cal-day { grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; border-left: 1px solid var(--line); color: var(--muted); }
.cal-day-wd { font-size: .62rem; text-transform: uppercase; }
.cal-day-n { font-size: .82rem; font-weight: 600; color: var(--ink); }
.cal-day.we { background: #f6f3ec; }
.cal-day.today { background: var(--primary); }
.cal-day.today .cal-day-wd, .cal-day.today .cal-day-n { color: #fff; }

.cal-cell { grid-row: 1; border-left: 1px solid #f0ece3; z-index: 1; }
/* Free nights stand out (so you can tune portal prices); occupied stay plain. */
.cal-cell.free { background: rgba(56,135,92,.10); }
.cal-cell.free.we { background: rgba(56,135,92,.18); }
.cal-cell.busy { background: transparent; }
.cal-cell.busy.we { background: #faf8f3; }
.cal-cell.today { box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary); }
.cal-cell:hover { background: rgba(28,107,107,.16); }

.cal-bar { position: relative; grid-row: 1; z-index: 2; align-self: center; height: 30px; margin: 0 1px; display: flex; align-items: center; padding: 0 .5rem; border-radius: 7px; background: var(--c); color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.cal-bar:hover { text-decoration: none; filter: brightness(1.07); }
.cal-bar-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar.incomplete { border: 2px dashed rgba(255,255,255,.85); }
.cal-bar.b-fatta { color: #fff; opacity: .7; }
/* Bookings that spill into the previous/next month: flatten the edge + chevron. */
.cal-bar.cont-left { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: .95rem; }
.cal-bar.cont-right { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: .95rem; }
.cal-bar.cont-left::before, .cal-bar.cont-right::after { position: absolute; top: 50%; transform: translateY(-50%); font-size: .9rem; font-weight: 700; opacity: .9; }
.cal-bar.cont-left::before { content: '‹'; left: 3px; }
.cal-bar.cont-right::after { content: '›'; right: 3px; }

.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 1rem; font-size: .85rem; color: var(--muted); }
.cal-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.cal-legend .swatch { width: .85rem; height: .85rem; border-radius: 4px; display: inline-block; }
.cal-legend .swatch-fatta { background: var(--muted); opacity: .7; }
.cal-legend .swatch-incomplete { background: var(--primary); border: 2px dashed #fff; box-shadow: 0 0 0 1px var(--line); }
.cal-legend .swatch-free { background: rgba(56,135,92,.18); border: 1px solid rgba(56,135,92,.45); }
.cal-legend .swatch-cont { background: var(--muted); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; line-height: 1; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: .55rem .9rem; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: .35rem .6rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; }
.btn-ghost-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-ghost-danger:hover { background: #fae3e0; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
form { margin: 0; }
details.pwd summary { list-style: none; cursor: pointer; }
details.pwd summary::-webkit-details-marker { display: none; }

/* login */
.login { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 360px; }
.login-brand { font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.login-brand span { color: var(--primary); }
.login-sub { color: var(--muted); margin: .35rem 0 1.25rem; font-size: .92rem; }

/* cleaner task cards */
.block { margin-bottom: 1.75rem; }
.block-title { font-size: 1rem; color: var(--muted); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .04em; font-family: var(--body); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.task { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--chip, var(--primary)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.task-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.task-date { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); font-size: .9rem; }
.task-house { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.task-meta { color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.task-actions { margin-top: .9rem; display: flex; flex-direction: column; gap: .5rem; }

.empty { text-align: center; padding: 4rem 1rem; }
.empty h1 { margin-bottom: .5rem; }

/* responsive */
@media (max-width: 720px) {
  .wrap { padding: 1rem .75rem 2.5rem; }
  .cols { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }

  /* nav becomes a single swipeable row */
  .topbar { gap: .75rem; padding: .6rem .9rem; }
  .mainnav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: .25rem; padding-bottom: .15rem; }
  .mainnav a { flex: 0 0 auto; white-space: nowrap; }

  /* wide tables scroll inside their card instead of breaking the layout */
  .card:not(.cal-card) { overflow-x: auto; }
  .table { font-size: .85rem; }

  /* calendar: tighter columns + labels so more days fit on a phone */
  .cal { --cw: 22px; --label-w: 94px; }
  .cal-rowlabel { font-size: .82rem; padding: 0 .5rem; }
  .cal-headrow .cal-rowlabel { font-size: .68rem; }
  .cal-bar { font-size: .72rem; height: 28px; padding: 0 .35rem; }
  .cal-day-n { font-size: .76rem; }
  .cal-toolbar { gap: .6rem; }
  .head-actions .btn { padding: .45rem .6rem; font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
