[hidden] { display: none !important; }
:root {
  --bg: #f6f5f2; --surface: #fff; --surface-2: #fbfaf8; --border: #e6e3dd;
  --text: #1d1c1a; --text-2: #5b5852; --muted: #8c887f;
  --accent: #b5532f; --accent-ink: #fff; --accent-soft: #f7e6de;
  --ok: #1d7f4e; --ok-soft: #e1f3e8; --warn: #a76a00; --warn-soft: #fbefd5;
  --bad: #c0362c; --bad-soft: #fbe3e0; --info: #2a78d6; --info-soft: #e3eefb;
  --airbnb: #eb6834; --booking: #2a78d6; --direct: #1baf7a;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 8px rgba(0,0,0,.03);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --surface: #1c1c1a; --surface-2: #232321; --border: #33322f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d85;
    --accent: #e0774f; --accent-soft: #3a2a22; --ok-soft: #173326; --warn-soft: #3a2d10;
    --bad-soft: #3d1c19; --info-soft: #172a42; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }

/* layout */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 15px; padding: 4px 10px 16px; display: flex; gap: 8px; align-items: center; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .sep { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.whoami { margin-top: 18px; padding: 12px 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
main { padding: 24px 28px 60px; min-width: 0; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: 16px; }
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 14px 18px 0; }
.kpi .label { color: var(--text-2); font-size: 12.5px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.b-airbnb .dot { background: var(--airbnb); } .b-booking .dot { background: var(--booking); } .b-direct .dot, .b-other .dot { background: var(--direct); }
.b-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.b-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.b-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.b-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.b-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* forms */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.95); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { color: var(--bad); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { font-size: 12.5px; color: var(--text-2); font-weight: 550; display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; } .field .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--bad); font-size: 12px; }
.field.has-error input, .field.has-error select { border-color: var(--bad); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; min-width: 130px; }
.filters .f label { font-size: 11px; margin-bottom: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.checklist label { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); margin: 0; }
.checklist ul { list-style: none; padding: 0; margin: 0; display: contents; }

/* messages */
.msgs { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--info-soft); color: var(--text); border: 1px solid var(--border); }
.msg.success { background: var(--ok-soft); } .msg.warning { background: var(--warn-soft); } .msg.error { background: var(--bad-soft); }

/* link box */
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }
.linkbox input { border: 0; background: transparent; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 0; }

/* calendar */
.cal { position: relative; }
.cal-head, .cal-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--border); }
.cal-head .days { display: grid; }
.cal-head .days div { font-size: 10.5px; color: var(--muted); text-align: center; padding: 6px 0; border-left: 1px solid var(--border); }
.cal-head .days div.we { background: var(--surface-2); }
.cal-row .name { padding: 10px 12px; font-weight: 550; border-right: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row .name small { display: block; color: var(--muted); font-weight: 400; }
.cal-row .lane { position: relative; height: 54px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100%/var(--n) - 1px), var(--border) calc(100%/var(--n) - 1px), var(--border) calc(100%/var(--n))); }
.bar { position: absolute; top: 10px; height: 34px; border-radius: 6px; padding: 3px 7px; font-size: 11.5px; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 2px solid var(--surface); line-height: 1.25; }
.bar small { display: block; opacity: .85; font-size: 10.5px; }
.bar.airbnb { background: var(--airbnb); } .bar.booking { background: var(--booking); } .bar.direct, .bar.other { background: var(--direct); }
.bar.unqualified { background: repeating-linear-gradient(45deg, var(--booking), var(--booking) 6px, #5598e7 6px, #5598e7 12px); }
.bar.block, .bar.mirror { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); top: 16px; height: 22px; font-size: 10.5px; }
.bar.conflict { outline: 2px solid var(--bad); outline-offset: 1px; }
.bar:hover { text-decoration: none; filter: brightness(1.05); z-index: 3; }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .6; z-index: 2; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* charts */
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px; }
.pill-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.pill-tabs a { padding: 5px 11px; border-radius: 6px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.pill-tabs a.on { background: var(--accent-soft); color: var(--accent); }
.pill-tabs a:hover { text-decoration: none; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

@media print {
  .side, .no-print, .msgs { display: none !important; }
  .app { display: block; } main { padding: 0; } .card { box-shadow: none; border: 0; }
  .fiche { page-break-after: always; }
}
