/* The live CRM: the demo's look (../demo/demo.css), plus sign-in, settings
   and the few things only the product has. */

body.booting > aside.side, body.booting > main, body.gated > aside.side, body.gated > main { visibility: hidden; }
body.booting, body.gated { overflow: hidden; }
.brand b { display: block; font-family: var(--script); font-size: 26px; line-height: 40px; color: var(--brand-text); font-weight: 400; }
.me .av { width: 34px; height: 34px; }
.ws-pick { height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: #fff; font-size: 12.5px; }
.logout { text-align: left; }

/* sign in: the agency's brand on the left (remembered from the last visit),
   one email and password form on the right. No sign-up: accounts are made
   for people. */
.gate { --g-deep: #0E2235; --g-primary: #1A6FB0; --g-accent: #F5B83D; --g-display: 'Oleo Script Swash Caps', Georgia, serif;
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); background: #fff; }
.gate[hidden] { display: none; }
/* Solid brand colour, no glow; the headline and the live cards sit in the
   middle of the panel, the mark at the top. */
.gate-art { position: relative; overflow: hidden; background: var(--g-deep); color: #fff; padding: 44px clamp(32px, 5vw, 72px); display: flex; flex-direction: column; }
.gate-mark { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; }
.gate-mark b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.gate-mark span { font-size: 14px; font-weight: 600; color: var(--g-accent); }
.gate-mark img { height: 44px; max-width: 220px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px 10px; }
.gate-mark .script { font-family: var(--g-display); font-size: 34px; font-weight: 400; color: #fff; }
.gate-hero { position: relative; z-index: 1; margin-top: auto; max-width: 560px; font-size: clamp(34px, 3.6vw, 54px); line-height: 1.06; font-weight: 700; letter-spacing: -.025em; }
.gate-hero em { font-style: normal; font-family: var(--g-display); font-weight: 400; color: var(--g-accent); }
.gate-cards { position: relative; z-index: 1; margin: 40px 0 auto; display: grid; gap: 12px; max-width: 440px; }
.gc { display: flex; gap: 12px; align-items: center; background: #fff; color: #111318; border-radius: 14px; padding: 13px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.24); animation: gc-in .6s cubic-bezier(.2,.7,.2,1) backwards; }
.gc:nth-child(2) { margin-left: 40px; animation-delay: .18s; }
.gc:nth-child(3) { margin-left: 16px; animation-delay: .36s; }
.gc > div { flex: 1; min-width: 0; }
.gc b { display: block; font-size: 14px; }
.gc span { display: block; font-size: 13px; color: #111318; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc time { flex: none; align-self: flex-start; font-size: 12px; font-weight: 600; color: #111318; }
.gc i { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 14px; }
.gc .gc-wa { background: #DCF8C6; color: #128C4A; }
.gc .gc-pay { background: color-mix(in srgb, var(--g-accent) 28%, #fff); color: #6A4A00; }
.gc .gc-ask { background: color-mix(in srgb, var(--g-primary) 16%, #fff); color: var(--g-primary); }
.gc .gc-wa svg, .gc .gc-ask svg { width: 16px; height: 16px; }
@keyframes gc-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .gc { animation: none; } }

.gate-side { display: flex; flex-direction: column; align-items: center; padding: 44px clamp(24px, 5vw, 72px) 32px; overflow-y: auto; }
.gate-form { width: 100%; max-width: 400px; margin-block: auto; display: flex; flex-direction: column; gap: 16px; }
.gate-form h2 { font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
#gate-fields { display: flex; flex-direction: column; gap: 16px; }
.gate-form .lead { font-size: 15px; color: #111318; margin-top: -10px; }
.gf { display: flex; flex-direction: column; gap: 7px; }
.gf > span { font-size: 13px; font-weight: 700; color: #111318; }
.gf input { height: 48px; border: 1.5px solid rgba(17,19,24,.16); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 15.5px; background: #fff; width: 100%; }
.gf input:focus { outline: none; border-color: var(--g-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-primary) 16%, transparent); }
.gf-pass { position: relative; display: block; }
.gf-pass input { padding-right: 70px; }
.gf-show { position: absolute; right: 8px; top: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: #F2F4F7; font-weight: 600; font-size: 13px; cursor: pointer; }
.gate-go { height: 50px; border: 0; border-radius: 12px; background: var(--g-deep); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 4px; transition: transform .12s ease, background .12s ease; }
.gate-go:hover { background: color-mix(in srgb, var(--g-deep) 85%, var(--g-primary)); }
.gate-go:active { transform: scale(.99); }
.gate-go:disabled { opacity: .6; cursor: default; }
.gate-forgot { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--g-primary); cursor: pointer; }
.gate-help { font-size: 14px; line-height: 1.5; color: #111318; background: #F5F7FA; border-radius: 12px; padding: 12px 14px; }
.gate-help[hidden] { display: none; }
.gate-err { color: #B42318; background: #FDE8E6; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.gate-err.ok { color: #12754A; background: #E2F4EA; }
.gate-err[hidden] { display: none; }
.gate-by { width: 100%; max-width: 400px; margin-top: 32px; font-size: 13px; font-weight: 600; color: #111318; }
.gate-out { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--g-primary); cursor: pointer; }

@media (max-width: 860px) {
  .gate { display: block; overflow-y: auto; }
  .gate-art { padding: 24px 20px 28px; min-height: 0; }
  .gate-hero { margin-top: 28px; font-size: 30px; }
  .gate-cards { display: none; }
  .gate-side { padding: 28px 20px 32px; overflow: visible; }
  .gate-form { margin-block: 0; }
}

/* sample data flag: a slim bar along the bottom of the work area, with room
   left for it under every page, so it never sits on a button or the reply box */
.sample-flag { position: fixed; left: 248px; right: 0; bottom: 0; z-index: 4; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--accent-tint); border-top: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; }
.sample-flag[hidden] { display: none; }
.sample-flag .linkish { font-weight: 700; text-decoration: underline; }
body:has(#sample-flag:not([hidden])) #view { padding-bottom: 104px; }
body:has(#sample-flag:not([hidden])) .inbox { height: calc(100vh - 190px); }
body:has(#sample-flag:not([hidden])) .set-save { bottom: 52px; }

/* ---------- layout fixes across the CRM (10-17) */
body { grid-template-columns: 248px minmax(0, 1fr); }

/* Sidebar: labels on one line, scrolls on short laptop screens so Log out is
   never cut off, and Log out sits next to your name. */
.side { overflow-y: auto; padding: 18px 14px 14px; gap: 4px; scrollbar-width: thin; }
.nav a { white-space: nowrap; padding: 7px 10px; }
.nav-h { padding: 12px 10px 4px; }
.side-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 8px; padding: 12px 4px 0; }
.side-foot .me { grid-column: 1; grid-row: 1; min-width: 0; }
.side-foot .me > div { min-width: 0; }
.side-foot .me b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .logout { grid-column: 2; grid-row: 1; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink); text-align: center; cursor: pointer; }
.side-foot .logout:hover { background: var(--tile); }
.side-foot .ws-pick, .side-foot div.by { grid-column: 1 / -1; }
.side-foot div.by { white-space: nowrap; color: var(--ink-2); }

/* Empty screens: the icon was an unsized SVG and filled the whole card. */
.empty-state > svg { width: 48px; height: 48px; padding: 12px; border-radius: 14px; background: var(--brand-tint); color: var(--brand-text); flex: none; }
.empty-state p { max-width: 540px; color: var(--ink); }
.empty-state .stack { flex-wrap: wrap; }

/* Pipeline: all five stages fit on a 1280 laptop. */
.board { grid-template-columns: repeat(5, minmax(176px, 1fr)); gap: 12px; }
.deal .d1 { align-items: flex-start; }
.col > header { gap: 8px; }
.col > header span { white-space: nowrap; }

/* Inbox: names stay on one line, the reply box never shows a scrollbar. */
.inbox { grid-template-rows: minmax(0, 1fr); }
.inbox .convo { min-height: 0; }
.thread .t1 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads .seg { flex-wrap: nowrap; }
.threads .seg > * { white-space: nowrap; }
@media (min-width: 1181px) and (max-width: 1440px) { .inbox { grid-template-columns: 284px minmax(0, 1fr) 236px; } }
@media (min-width: 761px) and (max-width: 1180px) { .inbox { grid-template-columns: 260px minmax(0, 1fr); } }
.composer textarea { scrollbar-width: none; }
.composer textarea::-webkit-scrollbar { display: none; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tables: the avatar and the name stay on one line; wide tables scroll
   inside their card, never the page. */
td:first-child { white-space: nowrap; }
.card.flush { overflow-x: auto; }

/* Trips: one column grid for every group, so Travelling, Confirmed and
   Planning line up. */
#view[data-r=trips] .card.flush > table { table-layout: fixed; min-width: 880px; }
#view[data-r=trips] td { padding-top: 10px; padding-bottom: 10px; line-height: 1.35; }
#view[data-r=trips] td:first-child { white-space: normal; }
#view[data-r=trips] td:first-child .av { float: left; margin: -4px 10px 0 0; }
#view[data-r=trips] td:first-child b { white-space: normal; display: block; overflow: hidden; }
#view[data-r=trips] th:nth-child(1) { width: 22%; }
#view[data-r=trips] th:nth-child(2) { width: 12%; }
#view[data-r=trips] th:nth-child(3) { width: 12%; }
#view[data-r=trips] th:nth-child(4) { width: 10%; }
#view[data-r=trips] th:nth-child(5) { width: 18%; }
#view[data-r=trips] th:nth-child(6) { width: 11%; }
#view[data-r=trips] .paybar { width: 56px; }

/* Travellers: the ranked table gets the full width below 1480. */
@media (max-width: 1480px) { #view[data-r=customers] .g-5-7 { grid-template-columns: minmax(0, 1fr); } }

/* settings */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.set-grid .card { display: flex; flex-direction: column; gap: 14px; }
.set-grid .card > header { margin-bottom: 0; }
.set-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-row.three { grid-template-columns: 1fr 1fr 1fr; }
.set-grid input, .set-grid select, .set-grid textarea { height: 38px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: #fff; font: inherit; width: 100%; }
.set-grid textarea { height: auto; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.set-grid input[type=color] { padding: 2px; height: 38px; }
.set-grid input:focus, .set-grid textarea:focus, .set-grid select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.set-logo { display: flex; align-items: center; gap: 12px; }
.set-logo img { height: 40px; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.members .row { align-items: center; flex-wrap: wrap; row-gap: 8px; }
.members .row .grow { flex: 1 1 180px; min-width: 0; }
.members .row .grow b, .members .row .grow div { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* small additions to the demo screens */
.ch-note { background: var(--tile); color: var(--ink-2); }
.bubble.note { align-self: center; background: var(--accent-tint); max-width: 80%; }
.sent-via { font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-2); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty-state b { color: var(--ink); font-size: 16px; }
.empty-state .stack { flex-direction: row; justify-content: center; }
.live-link { display: flex; gap: 8px; align-items: center; background: var(--tile); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.live-link code { font-family: var(--mono); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syncing { opacity: .6; pointer-events: none; }

@media (max-width: 900px) {
  .set-grid, .set-row, .set-row.three { grid-template-columns: 1fr; }
  .page-head .head-actions { flex-wrap: wrap; }
  .card.flush > table { min-width: 560px; }
}

/* Top bar on laptops and tablets: everything on one line, New enquiry
   always visible. */
.crumbs { white-space: nowrap; min-width: 0; }
@media (max-width: 1320px) { .search { width: 240px; } .top { padding: 0 24px; } }
@media (max-width: 1180px) {
  .search { width: 180px; }
  .search kbd { display: none; }
  .crumbs { font-size: 0; gap: 0; }
  .crumbs span { display: none; }
  .crumbs b { font-size: 15px; }
}

/* Phones */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .sample-flag { left: 0; font-size: 12.5px; padding: 8px 12px; }
  /* Only the page name in the top bar; the agency name is in the menu. */
  .crumbs { font-size: 0; gap: 0; }
  .crumbs span { display: none; }
  .crumbs b { font-size: 16px; }
  /* The conversation list was hidden on phones, so there was no way to
     switch chats: it becomes a short scrolling list above the conversation. */
  .inbox, body:has(#sample-flag:not([hidden])) .inbox { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .inbox .threads { display: flex; max-height: 248px; border-right: 0; border-bottom: 1px solid var(--line); }
  .inbox .bubbles { max-height: 60vh; }
}
