/* Caravan bookings — mobile-first, no framework. Channel fills must match ChannelInfo.Fill(). */
:root {
  --ink: #1f2a37;
  --muted: #6b7280;
  --line: #dde3ea;
  --bg: #f5f7fa;
  --card: #ffffff;
  --brand: #1f4e79;
  --brand-ink: #ffffff;
  --accent: #2563eb;
  --danger: #b42318;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 10px;

  --ch-available: #ffffff;
  --ch-haven: #cfe0ff;
  --ch-havenextra: #fff0bf;
  --ch-family: #e5dbff;
  --ch-bookingcom: #c8ebf5;
  --ch-airbnb: #ffd5db;
  --ch-othersite: #ffdfc0;
  --ch-direct: #cdeedb;
  --ch-blocked: #d8dce2;

  --se-superpeak: #6fbf68;
  --se-peak: #86c9ee;
  --se-offpeak: #dfe5ec;
  --se-ownersonly: #b9a7f5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); }
h1 { font-size: 1.45rem; margin: 0 0 .2rem; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Top bar ---- */
.topbar { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: .55rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.nav { display: flex; gap: .25rem; order: 3; width: 100%; overflow-x: auto; }
.nav a { color: #dbe7f5; text-decoration: none; padding: .35rem .7rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.user { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .85rem; min-width: 0; }
.user-email { color: #c7d7ea; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.signout-form { margin: 0; display: inline; }
.signout { color: #fff; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
@media (min-width: 760px) {
  .nav { order: 0; width: auto; }
}

.container { max-width: 1280px; margin: 0 auto; padding: 1rem 16px 3rem; }
.flash { background: #ecfdf3; border: 1px solid #abefc6; color: #05603a; padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }

/* ---- Buttons & forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: 40px; padding: .45rem .9rem; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b8c2cf; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #173d60; }
.btn-quiet { background: transparent; }
.btn-danger { color: var(--danger); border-color: #f3c3be; background: #fff; }
.btn-group { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.check.big { font-size: 1rem; margin: .3rem 0 .8rem; }

select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input:not([type]), textarea {
  width: 100%; min-height: 40px; padding: .45rem .6rem; font: inherit; color: var(--ink);
  border: 1px solid #c9d2dd; border-radius: 8px; background: #fff;
}
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.jump select { width: auto; min-width: 9.5rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 560px; margin: 2rem auto; }
fieldset.card { min-width: 0; }
fieldset.card legend { font-weight: 700; padding: 0 .3rem; }
.field { margin-bottom: .8rem; display: flex; flex-direction: column; gap: .25rem; }
.field label { font-weight: 600; font-size: .9rem; }
.hint { color: var(--muted); font-size: .82rem; margin: .1rem 0 .6rem; }
.err, .errors { color: var(--danger); font-size: .85rem; }
.errors ul { margin: 0 0 .8rem; padding-left: 1.1rem; }
.money { display: flex; align-items: stretch; }
.money > span { display: flex; align-items: center; padding: 0 .55rem; background: #eef2f7; border: 1px solid #c9d2dd; border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); }
.money > input { border-radius: 0 8px 8px 0; }
.money.suffix > span { border-left: 0; border-right: 1px solid #c9d2dd; border-radius: 0 8px 8px 0; }
.money.suffix > input { border-radius: 8px 0 0 8px; }
.reg { text-transform: uppercase; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .06em; }
.row-2, .row-3 { display: grid; gap: 0 .8rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0 .6rem; }
.form-actions .spacer { flex: 1; }
.danger-zone { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1rem; }
.page-head { margin-bottom: 1rem; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-head p { margin: .2rem 0 0; }
.back { display: inline-block; margin-bottom: .4rem; text-decoration: none; font-weight: 600; }

/* ---- Calendar toolbar & KPIs ---- */
.cal-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .8rem 1rem; margin-bottom: 1rem; }
.cal-title p { margin: 0; }
.cal-actions { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.pdf-form { display: flex; gap: .6rem; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .8rem; display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: .78rem; color: var(--muted); }
.kpi-value { font-size: 1.25rem; font-weight: 700; }
.kpi-value small { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); }

/* ---- Legend ---- */
.legend { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin-bottom: 1rem; }
.legend summary { font-weight: 700; cursor: pointer; }
.legend-items { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .5rem; font-size: .85rem; }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.legend-sep { flex-basis: 100%; height: 0; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid #c3ccd7; }
.strip { display: inline-block; width: 18px; height: 6px; border-radius: 3px; vertical-align: middle; background: var(--se-offpeak); }

/* channel fills */
.ch-available { background: var(--ch-available); }
.ch-haven { background: var(--ch-haven); }
.ch-havenextra { background: var(--ch-havenextra); }
.ch-family { background: var(--ch-family); }
.ch-bookingcom { background: var(--ch-bookingcom); }
.ch-airbnb { background: var(--ch-airbnb); }
.ch-othersite { background: var(--ch-othersite); }
.ch-direct { background: var(--ch-direct); }
.ch-blocked { background: repeating-linear-gradient(135deg, var(--ch-blocked) 0 6px, #e7eaee 6px 12px); }
/* season strips */
.strip.se-superpeak { background: var(--se-superpeak); }
.strip.se-peak { background: var(--se-peak); }
.strip.se-offpeak { background: var(--se-offpeak); box-shadow: inset 0 0 0 1px #c9d2dd; }
.strip.se-ownersonly { background: var(--se-ownersonly); }

/* ---- Month grids ---- */
.months { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .months { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; min-width: 0; }
.month h2 { text-align: center; margin-bottom: .4rem; }
.reopens { text-align: center; font-size: .75rem; font-weight: 600; color: var(--brand); background: #e8f0f9; border-radius: 999px; margin: -.2rem auto .5rem; padding: .1rem .6rem; width: fit-content; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.weekdays span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: .2rem; }

.day {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  min-height: 52px; padding: 8px 4px 3px 5px; border-radius: 6px;
  border: 1px solid #e3e8ee; color: var(--ink); text-decoration: none; overflow: hidden;
}
.day.pad { border: 0; background: transparent; }
.day.closed { background: #f1f3f6; color: #9aa3ae; border-style: dashed; }
.day::before { /* season strip */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: transparent;
}
.day.se-superpeak::before { background: var(--se-superpeak); }
.day.se-peak::before { background: var(--se-peak); }
.day.se-offpeak::before { background: var(--se-offpeak); }
.day.se-ownersonly::before { background: var(--se-ownersonly); }
.day.start { border-left: 3px solid var(--ink); padding-left: 3px; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day.unpaid .num::after { content: "•"; color: var(--warn); margin-left: 2px; }
.day:hover { filter: brightness(.96); }
.num { font-size: .82rem; font-weight: 700; line-height: 1.1; }
.lbl {
  font-size: .64rem; line-height: 1.15; margin-top: 2px; font-weight: 600; color: #374151;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
@media (max-width: 420px) {
  .day { min-height: 42px; }
  .lbl { display: none; }
}

/* ---- Agenda list ---- */
.agenda { margin-top: 1.4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.agenda > summary { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; cursor: pointer; list-style: none; }
.agenda > summary::-webkit-details-marker { display: none; }
.agenda > summary::before { content: "›"; display: inline-block; font-weight: 700; font-size: 1.2rem; line-height: 1; transition: transform .15s; }
.agenda[open] > summary::before { transform: rotate(90deg); }
.agenda > summary h2 { margin: 0; font-size: 1.1rem; }
.agenda .count { background: #e8f0f9; color: var(--brand); font-weight: 700; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; }
.agenda-body { padding: 0 .9rem .9rem; border-top: 1px solid var(--line); }
.agenda-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .7rem 0 .6rem; }
.agenda-head p { margin: 0; }
.agenda-list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.agenda-list li + li { border-top: 1px solid var(--line); }
.agenda-row {
  display: grid; gap: .25rem .8rem; padding: .65rem .8rem; color: inherit; text-decoration: none;
  grid-template-columns: 1fr auto; grid-template-areas: "dates money" "who season";
}
.agenda-row:hover { background: #f8fafc; }
.a-dates { grid-area: dates; display: flex; flex-direction: column; }
.a-dates small { color: var(--muted); }
.a-season { grid-area: season; font-size: .85rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; justify-content: flex-end; }
.a-who { grid-area: who; display: flex; align-items: center; gap: .45rem; font-size: .9rem; min-width: 0; }
.a-money { grid-area: money; text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-size: .9rem; }
.a-money .rates { color: var(--muted); }
.a-money small { font-size: .72rem; }
@media (min-width: 760px) {
  .agenda-row { grid-template-columns: 220px 160px 1fr 200px; grid-template-areas: "dates season who money"; align-items: center; }
  .a-season { justify-content: flex-start; }
}
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid rgba(0,0,0,.08); white-space: nowrap; }
.paid { color: var(--ok); font-weight: 700; font-size: .8rem; }
.due { color: var(--warn); font-weight: 700; font-size: .8rem; }

/* ---- Tables, summary ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.two-col { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .two-col { grid-template-columns: 1fr 1fr; } }
.pricing-layout { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .pricing-layout { grid-template-columns: 1.1fr 1fr; } }
.pricing-layout h2 { margin-top: .6rem; }
.bar { height: 10px; background: #e7ecf2; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); }

/* ---- Financials ---- */
.kpi-value.neg, .num.neg { color: var(--danger); }
.chart-wrap { width: 100%; overflow-x: auto; }
.chart { width: 100%; height: auto; min-width: 560px; display: block; font-family: inherit; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-line { stroke: #b8c2cf; stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .axis.small { font-size: 9px; }
.chart .value { font-size: 10px; font-weight: 700; fill: var(--ink); }
.chart .seg { stroke: rgba(0,0,0,.15); stroke-width: .5; }
.chart .seg.tentative { stroke: #b48a00; stroke-dasharray: 3 2; }
.chart .seg.spend { fill: #f04438; opacity: .85; }
.chart .ch-haven { fill: var(--ch-haven); }
.chart .ch-havenextra { fill: var(--ch-havenextra); }
.chart .ch-family { fill: var(--ch-family); }
.chart .ch-bookingcom { fill: var(--ch-bookingcom); }
.chart .ch-airbnb { fill: var(--ch-airbnb); }
.chart .ch-othersite { fill: var(--ch-othersite); }
.chart .ch-direct { fill: var(--ch-direct); }
.swatch.spend { background: #f04438; border-color: #d92d20; }
.card .legend-items { margin-top: .6rem; }
.category-totals { margin-bottom: .8rem; }
.table tfoot th { border-top: 2px solid var(--line); border-bottom: 0; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.table tr.subtle td { color: var(--muted); }
.table td.nowrap { white-space: nowrap; }
.table small.block { display: block; }
.narrow-form { max-width: 720px; }

/* ---- Roles, requests ---- */
.badge { display: inline-block; min-width: 1.3em; padding: 0 .4em; margin-left: .35rem; border-radius: 999px; background: #f04438; color: #fff; font-size: .72rem; line-height: 1.5; text-align: center; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; background: #fff7e6; border: 1px solid #f5d58a; color: #7a4b00; padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }
.notice .btn { margin-left: auto; }
.day.requested { outline: 2px dashed #b45309; outline-offset: -3px; }
.swatch.requested { border: 2px dashed #b45309; background: #fff; }
span.day { cursor: default; }
.btn-small { padding: .25rem .6rem; font-size: .82rem; }
.chip.rq-pending { background: #fff7e6; color: #7a4b00; border-color: #f5d58a; }
.chip.rq-approved { background: #ecfdf3; color: #05603a; border-color: #abefc6; }
.chip.rq-declined { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.chip.rq-withdrawn { background: #f2f4f7; color: #475467; }
.request-list { list-style: none; padding: 0; margin: 0; }
.request { display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; padding: .8rem 0; border-top: 1px solid var(--line); }
.request:first-child { border-top: 0; }
.request-main { flex: 1 1 320px; min-width: 0; }
.request-message { margin: .3rem 0; color: #374151; font-style: italic; }
.request-actions { display: flex; align-items: flex-start; }
.request-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.request-form input[type=text] { min-width: 200px; }
.small { font-size: .85rem; }
h2 .count { background: #e8f0f9; color: var(--brand); font-weight: 700; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; vertical-align: middle; margin-left: .3rem; }
