:root {
  --teal: #0f6e6e; --teal-2: #0b5555; --teal-soft: #e3f1ef;
  --gold: #c9a227; --gold-soft: #f8efd2;
  --coral: #e2725b; --coral-soft: #fbe6e0;
  --blue: #3c6fd1; --purple: #8a5cc7;
  --bg: #f6f4ef; --card: #ffffff; --ink: #1d2b2b; --muted: #687676; --line: #e4e1d8;
  --ok: #2f8a4c; --warn: #b7791f; --bad: #c0392b;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ── Header + nav ── */
header.top { background: var(--teal); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-family: Georgia, serif; font-weight: 700; letter-spacing: .08em; font-size: 15px; }
.brand small { display: block; font-family: Inter, sans-serif; font-weight: 500; letter-spacing: .02em; color: #e8c56a; font-size: 12px; }
.month { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.month button { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.month button:hover { background: rgba(255,255,255,.22); }
.month input { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 8px; padding: 4px 8px; height: 30px; color-scheme: dark; }
.who { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 8px; }
.who button { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
nav.tabs { background: var(--teal-2); display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
nav.tabs button { background: none; border: 0; color: rgba(255,255,255,.75); padding: 10px 12px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 500; }
nav.tabs button.on { color: #fff; border-bottom-color: var(--gold); }
.demo { background: var(--gold-soft); color: #6b5410; padding: 8px 20px; font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo button { margin-left: auto; }

main { padding: 20px; max-width: 1280px; margin: 0 auto; }
h2 { margin: 0 0 4px; font-size: 20px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bar .grow { flex: 1; }

/* ── Buttons ── */
.btn { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--teal-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.ghost:hover { background: #f1efe9; }
.btn.danger { background: var(--card); color: var(--bad); border: 1px solid #f0c9c3; font-weight: 500; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
input.search { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--card); min-width: 200px; }

/* ── Cards / KPIs ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.teal { border-top: 3px solid var(--teal); } .kpi.gold { border-top: 3px solid var(--gold); } .kpi.coral { border-top: 3px solid var(--coral); }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.card h3 { margin: 0 0 10px; font-size: 15px; }

/* ── Tables ── */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #faf9f5; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f7fbfa; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
tfoot td { font-weight: 700; background: #faf9f5; border-bottom: 0; }
td.wrap { white-space: normal; min-width: 180px; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: #eee; }
.pill.Airbnb { background: var(--coral-soft); color: #a3422d; }
.pill.Direct { background: var(--teal-soft); color: var(--teal); }
.pill.Booking\.com { background: #e2eafa; color: var(--blue); }
.pill.Agoda { background: #efe6f8; color: var(--purple); }
.pill.cancelled { background: #f3e0dd; color: var(--bad); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.meter { height: 6px; background: #eeeae0; border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter > i { display: block; height: 100%; background: var(--teal); }

/* ── Calendar ── */
.cal td, .cal th { padding: 0; border: 1px solid var(--line); text-align: center; }
.cal th { padding: 4px 0; min-width: 30px; font-size: 11px; }
.cal th.we { background: #f3efe4; }
.cal td.unit { padding: 4px 10px; text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--card); z-index: 1; }
.cal td.day { height: 30px; cursor: pointer; font-size: 10px; font-weight: 600; color: #fff; overflow: hidden; max-width: 30px; }
.cal td.day:hover { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal td.day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.ch-Airbnb { background: var(--coral); } .ch-Direct { background: var(--teal); } .ch-Booking\.com { background: var(--blue); }
.ch-Agoda { background: var(--purple); } .ch-other { background: var(--gold); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ── Modal form ── */
.overlay { position: fixed; inset: 0; background: rgba(20,30,30,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 720px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal header h3 { margin: 0; font-size: 17px; }
.modal header button { margin-left: auto; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal form { padding: 16px 20px 20px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.field .check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); font-weight: 400; padding: 8px 0; }
.field .check input { width: auto; }
.aside { margin-top: 14px; padding: 12px; background: #faf9f5; border-radius: 10px; display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.aside b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.aside .warn { color: var(--warn); flex-basis: 100%; font-weight: 600; }
.err { color: var(--bad); margin-top: 10px; font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions .grow { flex: 1; }
@media (max-width: 600px) { .fields { grid-template-columns: 1fr; } main { padding: 14px; } header.top { padding: 10px 14px; } }

/* ── Misc ── */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.login { max-width: 380px; margin: 12vh auto; text-align: center; }
.login .brand { color: var(--teal); font-size: 22px; }
.login .brand small { color: var(--gold); font-size: 14px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.taxrow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); gap: 12px; }
.taxrow.total { font-weight: 700; border-bottom: 0; }
.taxrow span:last-child { font-variant-numeric: tabular-nums; }
.form-tag { font-size: 11px; color: var(--muted); background: #f1efe9; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
ul.tight { margin: 6px 0; padding-left: 18px; }

/* ── Deals, paid-by, allocation, permissions ── */
.who { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.who.R { background: var(--teal); color: #fff; }
.who.O { background: var(--gold-soft); color: #6b5410; }
header.top .who { font-size: 12px; font-weight: 400; padding: 0; background: none; color: inherit; }
.pill.deal { background: var(--teal-soft); color: var(--teal); }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.field small { font-size: 11px; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.multi .chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--ink); font-weight: 400; }
.multi .chip.on { background: var(--teal-soft); border-color: var(--teal); }
.multi .chip input { width: auto; margin: 0; }
.cal td.day { position: relative; }
.booked-dot { position: absolute; right: 2px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px #fff; }
.booked-dot.static { position: static; display: inline-block; vertical-align: -1px; margin-right: 4px; box-shadow: none; }
table.perms th, table.perms td { text-align: center; }
table.perms th:first-child, table.perms td:first-child { text-align: left; }
button.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-size: 11px; text-decoration: underline; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d7d3c8; border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::before { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); }

/* ── Dashboard periods, deltas, trend ── */
.delta { font-size: 12px; font-weight: 600; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.kpi .value .delta { font-size: 12px; }
.trend { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; padding: 4px 0; }
.tcol { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; cursor: pointer; border-radius: 6px; padding: 2px 0; }
.tcol:hover, .tcol.on { background: var(--teal-soft); }
.tcol .bars { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.tcol .bars i { display: block; width: 38%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 1px; }
.tcol .bars i.g { background: var(--teal); } .tcol .bars i.r { background: var(--gold); }
.tcol span { font-size: 11px; color: var(--muted); }
tr.sel td { background: var(--teal-soft); font-weight: 600; }
