/* Chatbaht hotels dashboard â€” additions on top of clinic-dashboard.css.
   Load this file AFTER clinic-dashboard.css (the salon file is not needed).
   Same rules: every class starts with "cbd-" and component rules are written
   ".cbd .cbd-x" where they style a button or a link, so they outrank the resets. */

.cbd {
  /* room types (fixed order, never re-assigned) */
  --cat-std: #2a78d6;
  --cat-dlx: #1baf7a;
  --cat-fam: #eb6834;
  --cat-suite: #4a3aa7;
  /* housekeeping: always shown with a word next to it in the Housekeeping section */
  --hk-clean: var(--line);
  --hk-dirty: #eda100;
  --hk-cleaning: var(--blue);
  --hk-ooo: #c93636;
}
.cbd-s-inhouse { background: var(--blue-soft); color: var(--blue-deep); }
.cbd-s-out { background: var(--st-completed-bg); color: var(--st-completed-ink); }
.cbd-drawer { overflow-y: auto; }
.cbd .cbd-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.cbd .cbd-btn-danger { background: var(--paper); border: 1px solid var(--stroke); color: var(--st-cancelled-ink); }
.cbd .cbd-btn-danger:hover { border-color: var(--st-cancelled-ink); }
.cbd-drawer-actions .cbd-btn:last-child:nth-child(odd), .cbd-drawer-actions .cbd-btn:nth-child(2):last-child { grid-column: 1 / -1; }
.cbd-attn .cbd-card-head h2, .cbd-h-ico { display: flex; align-items: center; gap: 8px; }
.cbd-h-ico svg { color: var(--gold); }
.cbd-sub { padding: 0 18px 14px; margin-top: -6px; font-size: 12.5px; color: var(--muted); max-width: 72ch; }
.cbd-list li[data-id] { cursor: pointer; }
.cbd-who span.cbd-wrap { white-space: normal; }
.cbd-toast { width: max-content; max-width: min(560px, calc(100% - 32px)); border-radius: 18px; }
.cbd-toast.is-bad svg { color: var(--hk-dirty); }
.cbd-meter { display: block; height: 6px; border-radius: 4px; background: var(--blue-soft); overflow: hidden; }
.cbd-meter::after { content: ""; display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0; background: var(--blue); }

/* ---------- Front desk: arriving, leaving, waiting ---------- */
.cbd-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* ---------- Room chart: one row per room, one column per night ---------- */
.cbd-daypick { display: none; }
.cbd-chart-scroll { overflow-x: auto; border-top: 1px solid var(--stroke-soft); border-radius: 0 0 var(--r) var(--r); }
.cbd-chart { --lab: 84px; min-width: 900px; }
.cbd-chart-head { display: grid; grid-template-columns: var(--lab) repeat(var(--n), minmax(0, 1fr)); }
.cbd-chart .cbd-cal-day { padding: 8px 2px; }
.cbd-chart .cbd-cal-day b { font-size: 15px; }
.cbd-chart .cbd-cal-day.is-we { background: #fbfaf7; }
.cbd-cal-day small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--st-confirmed-ink); }
.cbd-cal-day.is-full small { color: var(--st-cancelled-ink); }
.cbd-chart-group { display: flex; align-items: center; gap: 10px; padding: 7px 18px; border-top: 1px solid var(--stroke-soft); background: #fbfaf7; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.cbd-chart-group span { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.cbd-chart-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); border-top: 1px solid var(--stroke-soft); }
.cbd .cbd-chart-lab {
  position: sticky; left: 0; z-index: 4;
  display: flex; align-items: center; gap: 8px; padding: 0 10px 0 18px;
  background: var(--paper); border-right: 1px solid var(--stroke-soft);
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: left;
}
.cbd .cbd-chart-lab:hover { color: var(--blue-deep); }
.cbd-hk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }
.cbd-chart-track {
  position: relative; height: 42px;
  background-image: linear-gradient(90deg, var(--stroke-soft) 1px, transparent 1px);
  background-size: calc(100% / var(--n)) 100%;
}
.cbd-chart-today { position: absolute; top: 0; bottom: 0; left: calc(var(--t) / var(--n) * 100%); width: calc(100% / var(--n)); background: rgba(232, 85, 43, 0.07); pointer-events: none; }
/* A stay runs from the afternoon of arrival to noon on the leaving day. */
.cbd .cbd-stay {
  position: absolute; top: 5px; bottom: 5px; z-index: 2;
  left: calc(var(--a) / var(--n) * 100% + 2px); width: calc(var(--w) / var(--n) * 100% - 4px);
  padding: 0 6px 0 10px; border-radius: 9px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: inset 3px 0 0 var(--c);
  font-size: 12px; font-weight: 800; text-align: left; white-space: nowrap; text-overflow: ellipsis;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s;
}
.cbd .cbd-stay:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--c), 0 8px 18px -10px rgba(11, 18, 32, 0.45); z-index: 3; }
.cbd .cbd-stay.is-inhouse { background: color-mix(in srgb, var(--c) 30%, #fff); }
.cbd .cbd-stay.is-out { opacity: 0.6; }
.cbd .cbd-stay.is-pending { outline: 1.5px dashed color-mix(in srgb, var(--c) 70%, #fff); outline-offset: -1.5px; box-shadow: none; }
.cbd .cbd-stay.is-cut { border-radius: 0 9px 9px 0; }
.cbd .cbd-free {
  position: absolute; top: 0; bottom: 0; left: calc(var(--a) / var(--n) * 100%); width: calc(100% / var(--n));
  display: grid; place-items: center; font-size: 16px; font-weight: 700; color: transparent;
  transition: background 0.15s, color 0.15s;
}
.cbd .cbd-free:hover, .cbd .cbd-free:focus-visible { background: var(--blue-soft); color: var(--blue-deep); }
.cbd-off {
  position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none;
  left: calc(var(--a) / var(--n) * 100%); width: calc(var(--w) / var(--n) * 100%);
  display: grid; place-items: center; overflow: hidden; white-space: nowrap;
  background: repeating-linear-gradient(135deg, rgba(11, 18, 32, 0.06) 0 6px, transparent 6px 12px), var(--ivory);
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.cbd-legend { padding-top: 2px; }
.cbd-legend i.is-dash { background: none; border: 1.5px dashed var(--muted); }
.cbd-legend i.is-dark { background: color-mix(in srgb, var(--cat-std) 55%, #fff); }
.cbd-legend i.cbd-hk-dot { border-radius: 50%; }
.cbd-legend-gap { flex-basis: 100%; height: 0; }

/* ---------- Housekeeping ---------- */
.cbd-two { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cbd-two.is-even { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.cbd-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.cbd .cbd-rm {
  display: grid; gap: 5px; align-content: start; justify-items: start; padding: 12px;
  border-radius: 14px; border: 1px solid var(--stroke); background: var(--paper); text-align: left;
  transition: border-color 0.2s;
}
.cbd .cbd-rm:hover { border-color: rgba(11, 18, 32, 0.3); }
.cbd .cbd-rm.is-flag { border-color: color-mix(in srgb, var(--gold) 70%, transparent); background: #fffaf0; }
.cbd-rm b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cbd-rm small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cbd-rm > span:not(.cbd-pill) { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.3; min-height: 2.6em; }

/* ---------- Rooms left to sell ---------- */
.cbd-tbl-wrap { overflow-x: auto; border-top: 1px solid var(--stroke-soft); }
.cbd-tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.cbd-tbl th { padding: 10px 18px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: #fbfaf7; white-space: nowrap; }
.cbd-tbl td { padding: 12px 18px; border-top: 1px solid var(--stroke-soft); font-size: 13px; vertical-align: middle; }
.cbd-tbl .cbd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbd-tbl tfoot td { font-weight: 800; background: #fbfaf7; }
.cbd-tbl td small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.cbd-fill { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.cbd-fill .cbd-meter { width: 64px; }
.cbd-av { min-width: 430px; }
.cbd-av th:not(:first-child), .cbd-av td:not(:first-child) { padding: 8px 3px; text-align: center; }
.cbd-av th:last-child, .cbd-av td:last-child { padding-right: 12px; }
.cbd-av th b { display: block; font-size: 13px; color: var(--text); letter-spacing: 0; }
.cbd-av th.is-today, .cbd-av th.is-today b { color: var(--blue); }
.cbd .cbd-av-n { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--st-confirmed-bg); color: var(--st-confirmed-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.cbd .cbd-av-n.is-low { background: var(--st-pending-bg); color: var(--st-pending-ink); }
.cbd .cbd-av-n:hover { box-shadow: 0 0 0 2px currentColor; }
.cbd-av-full { font-size: 11px; font-weight: 700; color: var(--st-cancelled-ink); }
.cbd-av tfoot td { font-variant-numeric: tabular-nums; }

/* ---------- Week numbers and booking sources ---------- */
.cbd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--stroke-soft); }
.cbd-stats div { padding: 14px 18px; border-left: 1px solid var(--stroke-soft); }
.cbd-stats div:first-child { border-left: 0; }
.cbd-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cbd-stats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.cbd-note { padding: 12px 14px; border-radius: var(--r); background: var(--ivory); font-size: 13px; color: var(--text-2); }
.cbd-note b { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cbd-card > .cbd-note { margin: 0 18px 18px; }

/* ---------- Key numbers: metric cards over one trend chart ---------- */
/* Like a shop dashboard: tap a card to draw or hide its line (up to 4). */
#numbers .cbd-card-head { flex-wrap: wrap; }
.cbd-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 18px 14px; }
.cbd .cbd-metric {
  display: grid; gap: 2px; align-content: start; padding: 11px 13px 12px; text-align: left;
  border: 1px solid var(--stroke); border-top: 3px solid var(--stroke); border-radius: var(--r-sm); background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cbd .cbd-metric:hover { box-shadow: var(--shadow-sm); }
.cbd .cbd-metric[aria-pressed="true"] { border-top-color: var(--c); }
.cbd-metric span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.cbd-metric b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cbd-metric small { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cbd-metric.is-off { background: var(--ivory); border-color: var(--stroke-soft); }
.cbd-metric.is-off b { color: var(--muted); }
.cbd-delta { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.cbd-delta.is-good { color: #006300; }
.cbd-delta.is-bad { color: #b42318; }
.cbd-lc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 4px 18px 0; }
.cbd-lc-head > b { font-size: 13px; font-weight: 800; }
.cbd-lc-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.cbd-lc-key span { display: inline-flex; align-items: center; gap: 6px; }
.cbd-lc-key i, .cbd-lc-tip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.cbd-lc-count { color: var(--muted); }
.cbd-lc { position: relative; margin: 4px 18px 16px; outline: 0; touch-action: pan-y; }
.cbd-lc:focus-visible { box-shadow: 0 0 0 2px var(--blue-soft); border-radius: var(--r-sm); }
.cbd .cbd-lc-svg { display: block; width: auto; height: auto; stroke: none; overflow: visible; }
.cbd-lc-grid { stroke: #e6e2d8; stroke-width: 1; stroke-dasharray: 3 4; }
.cbd-lc-grid.is-base { stroke: #c9c3b5; stroke-dasharray: none; }
.cbd-lc-x { font: 600 11px var(--font); fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.cbd-lc-x.is-today { font-weight: 800; fill: var(--text); }
.cbd-lc-x.is-first { text-anchor: start; }
.cbd-lc-cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.cbd-lc-tip {
  position: absolute; top: 6px; z-index: 3; display: grid; gap: 4px; min-width: 200px; padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--paper); box-shadow: var(--shadow-sm), 0 0 0 1px var(--stroke);
  font-size: 12px; pointer-events: none;
}
.cbd-lc-tip b { font-size: 12.5px; font-weight: 800; }
.cbd-lc-tip small { margin-top: -3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.cbd-lc-tip span { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 600; }
.cbd-lc-tip em { margin-left: auto; padding-left: 14px; font-style: normal; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cbd-lc-tip .cbd-lc-rooms { color: var(--muted); font-size: 11.5px; }
.cbd-lc-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.cbd-trend-tbl { max-height: 420px; overflow-y: auto; }
#numbers.is-big .cbd-trend-tbl { max-height: 760px; }
.cbd-lc[hidden], .cbd-trend-tbl[hidden], .cbd-lc-tip[hidden] { display: none; }

/* ---------- Bookings table extras ---------- */
.cbd-tools-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cbd-select { height: 38px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--stroke); background: var(--paper); font: 600 13px/1 var(--font); color: var(--text); }
.cbd-hb td small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* ---------- What the AI knows ---------- */
.cbd-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--stroke-soft); }
.cbd-rules div { padding: 14px 18px; border-bottom: 1px solid var(--stroke-soft); }
.cbd-rules div:nth-child(odd) { border-right: 1px solid var(--stroke-soft); }
.cbd-rules dt { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cbd-rules dd { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; }

/* ---------- Booking form (inside the side panel) ---------- */
.cbd-form { display: grid; gap: 12px; }
.cbd-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cbd-field { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.cbd-field input, .cbd-field select {
  width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--stroke); background: var(--paper);
  font: 600 16px/1.2 var(--font); color: var(--text);
}
.cbd-field input:focus, .cbd-field select:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cbd-field select:disabled { background: var(--ivory); color: var(--muted); }
.cbd-sum { display: grid; gap: 3px; padding: 12px 14px; border-radius: var(--r); background: var(--ivory); font-size: 13px; font-weight: 700; }
.cbd-sum small { font-size: 12px; font-weight: 600; color: var(--muted); }
.cbd-sum.is-bad { background: var(--st-cancelled-bg); color: var(--st-cancelled-ink); }
.cbd-form .cbd-drawer-actions { margin-top: 4px; }

/* ---------- Guest profiles and auto-tags ---------- */
.cbd .cbd-gtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; white-space: normal; overflow: visible; }
.cbd .cbd-gtag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--tg-bg); color: var(--tg-ink);
}
.cbd-gtag.is-gold { --tg-bg: #f6ecd9; --tg-ink: #7a5a1f; }
.cbd-gtag.is-blue { --tg-bg: var(--blue-soft); --tg-ink: var(--blue-deep); }
.cbd-gtag.is-green { --tg-bg: var(--st-confirmed-bg); --tg-ink: var(--st-confirmed-ink); }
.cbd-gtag.is-orange { --tg-bg: var(--st-noshow-bg); --tg-ink: var(--st-noshow-ink); }
.cbd-gtag.is-pink { --tg-bg: #fbe6ef; --tg-ink: #9b2c5c; }
.cbd-gtag.is-red { --tg-bg: var(--st-cancelled-bg); --tg-ink: var(--st-cancelled-ink); }
.cbd-gtag.is-grey { --tg-bg: var(--st-completed-bg); --tg-ink: var(--st-completed-ink); }
.cbd .cbd-who .cbd-remember { margin-top: 4px; font-weight: 700; color: var(--st-cancelled-ink); }
.cbd .cbd-tabs button small { margin-left: 2px; font-size: 11px; font-weight: 700; opacity: 0.6; }

.cbd .cbd-glist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; max-height: 640px; overflow-y: auto; padding: 0 12px 8px; }
.cbd .cbd-glist li { align-items: flex-start; cursor: pointer; border-top: 1px solid var(--stroke-soft); border-radius: 0; }
.cbd .cbd-glist li:nth-child(-n + 2) { border-top: 0; }
.cbd .cbd-glist li:hover { background: #fbfaf7; }
.cbd .cbd-glist li.cbd-empty { grid-column: 1 / -1; cursor: default; }
.cbd-glist .cbd-avatar { width: 34px; height: 34px; font-size: 12px; }
.cbd-gspend { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.cbd-gspend b { display: block; font-size: 14px; font-weight: 800; }
.cbd-gspend small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cbd-grules { margin: 4px 18px 18px; border-top: 1px solid var(--stroke-soft); padding-top: 12px; }
.cbd-grules summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--blue-deep); }
.cbd-grules dl { display: grid; gap: 8px; margin: 12px 0 8px; }
.cbd-grules dl div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 13px; }
.cbd-grules dd { margin: 0; color: var(--text-2); }
.cbd-grules p { margin: 0; font-size: 12.5px; color: var(--muted); }

.cbd-gbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cbd-gbox .cbd-gtags { margin: 0; }
.cbd .cbd-gbox .cbd-btn svg { width: 14px; height: 14px; }
.cbd-gwarn { background: var(--st-cancelled-bg); color: var(--st-cancelled-ink); font-weight: 700; }
.cbd-gwarn b { color: inherit; }
.cbd-gstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--stroke-soft); border-radius: var(--r); }
.cbd-gstats div { padding: 10px 14px; }
.cbd-gstats div:nth-child(even) { border-left: 1px solid var(--stroke-soft); }
.cbd-gstats div:nth-child(n + 3) { border-top: 1px solid var(--stroke-soft); }
.cbd-gstats b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cbd-gstats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.cbd-gmem p { margin: 6px 0 0; }
.cbd-gmem i { display: block; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cbd-ghist h3 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cbd-ghist .cbd-list { padding: 0; border: 1px solid var(--stroke-soft); border-radius: var(--r); }
.cbd-dm { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 6px; }

/* ---------- Win back booking-site guests ---------- */
.cbd-stats div.is-hero b { color: var(--st-confirmed-ink); }
.cbd-wb { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; padding: 14px 18px 18px; border-top: 1px solid var(--stroke-soft); }
.cbd .cbd-wb .cbd-tools { padding: 0 0 10px; }
.cbd .cbd-wb-list .cbd-list { padding: 0; border: 1px solid var(--stroke-soft); border-radius: var(--r); max-height: 520px; overflow-y: auto; }
.cbd .cbd-wb-list li { align-items: center; cursor: pointer; border-top: 1px solid var(--stroke-soft); border-radius: 0; }
.cbd .cbd-wb-list li:first-child { border-top: 0; }
.cbd .cbd-wb-list li:hover { background: #fbfaf7; }
.cbd .cbd-wb-list li.cbd-empty { cursor: default; }
.cbd-wb-list .cbd-avatar { width: 34px; height: 34px; font-size: 12px; }
.cbd-wb-list .cbd-gspend b { color: var(--st-confirmed-ink); }
.cbd-wb-side { display: grid; gap: 12px; align-content: start; }
.cbd-wb-auto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--stroke-soft); border-radius: var(--r); }
.cbd-wb-auto b { display: block; font-size: 13.5px; }
.cbd-wb-auto span { font-size: 12px; font-weight: 600; color: var(--muted); }
.cbd .cbd-switch { flex: none; position: relative; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: rgba(11, 18, 32, 0.18); cursor: pointer; transition: background 0.2s var(--ease-out); }
.cbd .cbd-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 18, 32, 0.3); transition: transform 0.2s var(--ease-out); }
.cbd .cbd-switch[aria-pressed="true"] { background: var(--line); }
.cbd .cbd-switch[aria-pressed="true"] i { transform: translateX(18px); }
.cbd .cbd-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cbd-wb-msg { padding: 12px 14px 14px; border-radius: var(--r); background: #dfe7f1; }
.cbd-wb-msg small { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cbd-wb-msg p { margin: 0; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: #fff; font-size: 13px; line-height: 1.5; color: var(--text); }
.cbd-code { padding: 1px 5px; border-radius: 4px; background: var(--st-confirmed-bg); color: var(--st-confirmed-ink); font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; }

/* ---------- Messages through the stay ---------- */
/* Seven message cards in stay order, each with its own on/off switch; queue on the left, guest replies on the right. */
.cbd-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 14px 18px; list-style: none; border-top: 1px solid var(--stroke-soft); }
.cbd-step { position: relative; display: flex; flex-direction: column; border: 1px solid var(--stroke-soft); border-radius: var(--r); background: #fff; }
.cbd-step::after { content: ""; position: absolute; top: 22px; right: -9px; width: 9px; border-top: 1px dashed var(--stroke); }
.cbd-step:last-child::after { display: none; }
.cbd .cbd-step-main { flex: 1; display: grid; align-content: start; gap: 2px; padding: 10px 10px 8px; border: 0; border-radius: var(--r) var(--r) 0 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cbd .cbd-step-main:hover { background: #fbfaf7; }
.cbd-step-main i { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 4px; border-radius: 50%; background: var(--line); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 800; }
.cbd-step-main b { font-size: 13px; line-height: 1.3; }
.cbd-step-main small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.cbd-step-main em { margin-top: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--st-confirmed-ink); }
.cbd .cbd-step > .cbd-switch { margin: 0 10px 10px; transform: scale(0.85); transform-origin: left center; }
.cbd-step.is-off { background: #f7f5f1; }
.cbd-step.is-off .cbd-step-main i { background: rgba(11, 18, 32, 0.25); }
.cbd-step.is-off .cbd-step-main b, .cbd-step.is-off .cbd-step-main em { color: var(--muted); }
.cbd-mh { margin: 6px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cbd .cbd-mreplies { padding: 0; border: 1px solid var(--stroke-soft); border-radius: var(--r); max-height: 520px; overflow-y: auto; }
.cbd .cbd-mreplies li { align-items: flex-start; cursor: pointer; border-top: 1px solid var(--stroke-soft); border-radius: 0; }
.cbd .cbd-mreplies li:first-child { border-top: 0; }
.cbd .cbd-mreplies li:hover { background: #fbfaf7; }
.cbd .cbd-mreplies .cbd-who small { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.cbd .cbd-mreplies .cbd-gspend b { color: var(--st-confirmed-ink); }
.cbd .cbd-who .cbd-mquote { margin: 4px 0 2px; padding: 6px 10px; border-radius: 4px 12px 12px 12px; background: #dfe7f1; color: var(--text); font-weight: 500; }

/* ---------- Extras and offers, quiet nights ---------- */
.cbd-xrules { display: grid; gap: 8px; }
.cbd-xrules .cbd-wb-auto { padding: 10px 12px; }
.cbd-xrules .cbd-wb-auto b { font-size: 13px; }
.cbd-xrules .cbd-wb-auto.is-off b { color: var(--muted); }
.cbd-qn { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; padding: 14px 18px; border-top: 1px solid var(--stroke-soft); }
.cbd .cbd-qn-n { display: grid; gap: 3px; padding: 10px 10px 9px; border: 1px solid var(--stroke-soft); border-radius: var(--r); background: #fff; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.cbd .cbd-qn-n:hover { background: #fbfaf7; }
.cbd .cbd-qn-n[aria-pressed="true"] { border-color: var(--line); box-shadow: inset 0 0 0 1px var(--line); }
.cbd-qn-n span { font-size: 12px; font-weight: 700; color: var(--muted); }
.cbd-qn-n.is-we span { color: var(--text); }
.cbd-qn-n b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cbd-qn-n i { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--line) var(--w), rgba(11, 18, 32, 0.08) var(--w)); }
.cbd-qn-n small { font-size: 11px; font-weight: 600; color: var(--muted); }
.cbd .cbd-qn-n.is-quiet { background: #fdf6e7; border-color: #f0dcae; }
.cbd-qn-n.is-quiet i { background: linear-gradient(90deg, var(--hk-dirty) var(--w), rgba(11, 18, 32, 0.08) var(--w)); }
.cbd-qn-n.is-quiet small { color: #8a5d00; }
.cbd .cbd-wb-list #qn-who { max-height: 430px; }
.cbd-wb-list .cbd-mh { margin: 0 0 10px; }
.cbd-qn-head b { display: block; font-size: 16px; }
.cbd-qn-head span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cbd-qn-auto { font-size: 12px; font-weight: 600; color: var(--muted); }
#qn-side .cbd-field select { width: 100%; }

/* ---------- Stay stamps, groups and weddings ---------- */
.cbd .cbd-stamps { display: flex; flex-wrap: wrap; gap: 3px; margin: 5px 0 3px; }
.cbd-stamps i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(11, 18, 32, 0.18); box-sizing: border-box; }
.cbd-stamps i.is-on { border-color: var(--line); background: var(--line); }
.cbd-stamps i.is-coming { border: 1.5px dashed var(--line); }
.cbd .cbd-stamps.is-big { flex-wrap: nowrap; gap: 5px; margin: 8px 0; }
.cbd-stamps.is-big i { flex: none; width: 19px; height: 19px; border-width: 2px; }
.cbd-stcard { margin-bottom: 8px; padding: 12px 14px; border-radius: 14px; background: #fff; }
.cbd-stcard b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.cbd-stcard span { font-size: 12px; font-weight: 700; color: var(--st-confirmed-ink); }
.cbd-pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px 18px; border-top: 1px solid var(--stroke-soft); }
.cbd .cbd-pipe-s { position: relative; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--stroke-soft); border-top: 3px solid var(--pc); border-radius: var(--r); background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.cbd .cbd-pipe-s:hover { background: #fbfaf7; }
.cbd .cbd-pipe-s[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--pc); border-color: var(--pc); }
.cbd-pipe-s:not(:nth-child(n + 4))::after { content: ""; position: absolute; top: 50%; right: -9px; width: 9px; border-top: 1px dashed var(--stroke); }
.cbd-pipe-s span { font-size: 12px; font-weight: 700; color: var(--muted); }
.cbd-pipe-s b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cbd-pipe-s small { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.cbd-pipe-s.is-new { --pc: #e0a21b; }
.cbd-pipe-s.is-quote { --pc: var(--blue); }
.cbd-pipe-s.is-won { --pc: var(--line); }
.cbd-pipe-s.is-done { --pc: #8a93a3; }
.cbd-pipe-s.is-lost { --pc: #d85a5a; }
.cbd .cbd-wb-list #gp-list li { align-items: flex-start; }
.cbd-gsteps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: gs; border: 1px solid var(--stroke-soft); border-radius: var(--r); }
.cbd-gsteps li { position: relative; padding: 10px 14px 10px 46px; counter-increment: gs; border-top: 1px solid var(--stroke-soft); }
.cbd-gsteps li:first-child { border-top: 0; }
.cbd-gsteps li::before { content: counter(gs); position: absolute; left: 14px; top: 11px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: #fff; font-size: 11.5px; font-weight: 800; }
.cbd-gsteps b { display: block; font-size: 13px; }
.cbd-gsteps span { font-size: 12px; font-weight: 600; color: var(--muted); }
.cbd-gquote td { font-size: 13px; }
.cbd-gquote tfoot td { font-weight: 800; border-top: 1px solid var(--stroke); }

/* ---------- Tax and invoices ---------- */
.cbd-tax-tbl td small { display: block; font-size: 11.5px; color: var(--muted); }
.cbd .cbd-tax-tbl .is-neg { color: var(--st-cancelled-ink); }
.cbd-tax-tbl tfoot td { font-weight: 800; border-top: 1px solid var(--stroke); }
.cbd-tax-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cbd-tax-foot p { margin: 0; flex: 1 1 260px; }
.cbd-hotel-id p { margin: 4px 0 0; font-size: 12.5px; }
.cbd-tax-check p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; }
#tx-body .cbd-when { width: 84px; }
#tx-body .cbd-when small { white-space: nowrap; }
.cbd-wb-list .cbd-gspend b.is-neg { color: var(--st-cancelled-ink); }
.cbd .cbd-tax-tbl tbody tr { cursor: pointer; }

/* ---------- Hotel documents for TM30 ---------- */
.cbd-odocs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 18px 18px; }
.cbd-od { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1.5px dashed var(--stroke); border-radius: var(--r); }
.cbd-od.is-done { border: 1px solid var(--stroke-soft); }
.cbd-od.is-skip { background: var(--ivory); }
.cbd-od img, .cbd-od-ico { display: grid; place-items: center; width: 100%; height: 110px; border-radius: var(--r-sm); object-fit: cover; background: var(--ivory); color: var(--muted); }
.cbd .cbd-od-ico svg { width: 28px; height: 28px; }
.cbd-od.is-done .cbd-od-ico { background: var(--st-confirmed-bg); color: var(--st-confirmed-ink); }
.cbd-od.is-skip .cbd-od-ico { background: #fff; }
.cbd-od .cbd-who b { white-space: normal; }
.cbd-od-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cbd-od-acts:empty { display: none; }
.cbd-od-acts label { cursor: pointer; }
.cbd-od-big { display: block; width: 100%; border-radius: var(--r); border: 1px solid var(--stroke-soft); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1180px) {
  .cbd-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbd-three > .cbd-attn { grid-column: 1 / -1; order: -1; }
  .cbd-two, .cbd-two.is-even { grid-template-columns: minmax(0, 1fr); }
  .cbd-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cbd-wb { grid-template-columns: minmax(0, 1fr); }
  .cbd-steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 168px; overflow-x: auto; scrollbar-width: none; }
  .cbd-qn { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 104px; overflow-x: auto; scrollbar-width: none; }
  .cbd-pipe { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 128px; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 900px) {
  .cbd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbd-stats div:nth-child(odd) { border-left: 0; }
  .cbd-stats div:nth-child(n + 3) { border-top: 1px solid var(--stroke-soft); }
  .cbd-rules { grid-template-columns: minmax(0, 1fr); }
  .cbd-rules div:nth-child(odd) { border-right: 0; }
  .cbd .cbd-tabbar { grid-template-columns: repeat(6, 1fr); }
  .cbd .cbd-glist { grid-template-columns: minmax(0, 1fr); }
  .cbd .cbd-glist li:nth-child(2) { border-top: 1px solid var(--stroke-soft); }
  .cbd-grules dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cbd-odocs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .cbd-three { grid-template-columns: minmax(0, 1fr); }
  /* the chart becomes one night at a time: pick a night, see every room */
  .cbd-chart-scroll { display: none; }
  .cbd-daypick {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 50px;
    gap: 4px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none;
  }
  .cbd .cbd-daypick button { border: 1px solid var(--stroke-soft); }
  .cbd-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px 14px; gap: 8px; }
  .cbd-tools-right { flex: 1 1 100%; }
  .cbd-select { height: 44px; font-size: 16px; }
  .cbd .cbd-av-n { min-width: 40px; height: 40px; }
  .cbd-metrics { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; padding: 0 12px 12px; scrollbar-width: none; }
  .cbd-wb { padding: 12px; }
  .cbd-steps { padding: 12px; grid-auto-columns: 150px; }
  .cbd-qn { padding: 12px; grid-auto-columns: 92px; }
  .cbd-pipe { padding: 12px; grid-auto-columns: 116px; }
  .cbd-lc-head { padding: 4px 12px 0; }
  .cbd-lc { margin: 4px 8px 12px; }
  .cbd .cbd-hb td:nth-child(n) { grid-row: auto; }
  .cbd .cbd-hb td:nth-child(4), .cbd .cbd-hb td:nth-child(5) { display: none; }
  .cbd .cbd-hb td:nth-child(2), .cbd .cbd-hb td:nth-child(3) { grid-column: 1; color: var(--muted); font-size: 12.5px; }
  .cbd .cbd-hb td:nth-child(6) { grid-column: 2; grid-row: 1; justify-self: end; }
  .cbd .cbd-hb td:nth-child(7) { grid-column: 2; grid-row: 2 / 4; align-self: center; font-weight: 800; }
}
