/* CFS Connect - Centre for Surgery brand: navy #0D2C4D, ink #20272D, light #EEF2F4 */
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url(/static/fonts/jost-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url(/static/fonts/jost-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 600; font-display: swap; src: url(/static/fonts/jost-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Crimson Text"; font-weight: 600; font-display: swap; src: url(/static/fonts/crimson-text-latin-600-normal.woff2) format("woff2"); }

:root {
  --navy: #0D2C4D; --ink: #20272D; --light: #EEF2F4; --grey: #C1CDDB; --grey2: #DAE2EA; --muted: #5E6670;
  --green: #1E8A5A; --green-bg: #E6F4EC; --red: #C0392B; --red-ink: #A8321A; --red-bg: #FDECE7; --amber: #B7791F;
  --amber-bg: #FFF4DE; --white: #FFFFFF; --radius: 16px; --shadow: 0 1px 2px rgba(13,44,77,.06), 0 4px 16px rgba(13,44,77,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Jost", system-ui, sans-serif; color: var(--ink); background: var(--light); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 2px; }
.brand-serif { font-family: "Crimson Text", Georgia, serif; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.boot { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--navy); }
.boot .brand-serif { font-size: 30px; }
.boot-sub { letter-spacing: 3px; text-transform: uppercase; font-size: 12px; color: var(--muted); }

/* sign in */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--navy); }
.signin-card { background: var(--white); border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 420px; text-align: center; box-shadow: var(--shadow); }
.signin-card h1 { margin: 0; font-size: 30px; color: var(--navy); }
.signin-card p { color: var(--muted); }
.signin-card .gbtn { display: flex; justify-content: center; margin: 24px 0 8px; min-height: 44px; }
.signin-error { color: var(--red-ink); background: var(--red-bg); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.nav { width: 240px; flex: 0 0 240px; background: var(--navy); color: var(--white); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.nav-brand { padding: 0 10px; display: flex; flex-direction: column; }
.nav-brand .brand-serif { font-size: 23px; }
.nav-brand span:last-child { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--grey); }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--grey2); text-decoration: none; font-size: 15px; border: 0; background: none; text-align: left; width: 100%; }
.nav-link:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nav-link[aria-current="page"] { background: rgba(255,255,255,.13); color: var(--white); font-weight: 500; }
.nav-link svg { flex: 0 0 20px; }
.badge { margin-left: auto; background: #E4572E; color: var(--white); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.badge.soft { background: rgba(255,255,255,.18); }
.nav-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grey); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: 0 0 36px; }
.nav-me .who { display: flex; flex-direction: column; min-width: 0; }
.nav-me .who span:first-child { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-me button { margin-left: auto; background: none; border: 0; color: var(--grey); font-size: 12px; white-space: nowrap; padding: 4px; }

.main { flex: 1 1 auto; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 600; color: var(--navy); }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-select { height: 42px; border-radius: 999px; border: 1px solid var(--grey); background: var(--white); padding: 0 14px 0 34px; font-weight: 500; appearance: none; background-repeat: no-repeat; background-position: 14px center; background-size: 10px 10px; }
.status-select.available { background-image: radial-gradient(circle, var(--green) 60%, transparent 62%); }
.status-select.busy { background-image: radial-gradient(circle, var(--amber) 60%, transparent 62%); }
.status-select.away { background-image: radial-gradient(circle, var(--muted) 60%, transparent 62%); }
.phone-state { font-size: 13px; color: var(--muted); }
.phone-state.bad { color: var(--red-ink); }

.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.grow { flex: 999 1 520px; min-width: 0; }
.side { flex: 1 1 320px; max-width: 380px; position: sticky; top: 24px; }

.tabs { display: flex; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--light); flex-wrap: wrap; }
.tab { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--light); font-weight: 500; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--navy); color: var(--white); }
.tab.alert { background: var(--red-bg); color: var(--red-ink); }
.tab.alert[aria-selected="true"] { background: var(--red-ink); color: var(--white); }

.row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--light); }
.row:last-child { border-bottom: 0; }
.row.missed { background: #FFF6F3; }
.row .ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; background: var(--light); color: var(--navy); }
.row .ico.in-ok, .row .ico.out-ok { background: var(--green-bg); color: var(--green); }
.row .ico.missed { background: var(--red-bg); color: var(--red-ink); }
.row .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .title .num { font-weight: 400; color: var(--muted); }
.row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta.red { color: var(--red-ink); }
.row .when { font-size: 13px; color: var(--muted); min-width: 48px; text-align: right; }
.row.link { cursor: pointer; }
.row.link:hover { background: #F7F9FA; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--light); color: var(--navy); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: #17694A; }
.chip.red { background: var(--red-bg); color: var(--red-ink); }
.chip.amber { background: var(--amber-bg); color: #8A5A10; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

.btn { height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--grey); background: var(--white); color: var(--navy); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn.green { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 600; }
.btn.red { background: var(--red); border-color: var(--red); color: var(--white); font-weight: 600; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }

label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.1px; }
.tpl-pick { display: flex; gap: 8px; } .tpl-pick select { flex: 1 1 0; min-width: 0; text-transform: none; letter-spacing: 0; }
.input, select.input, textarea.input { height: 46px; border-radius: 12px; border: 1px solid var(--grey); padding: 0 14px; background: var(--white); font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); width: 100%; }
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }

/* dialler */
.dialler { display: flex; flex-direction: column; gap: 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.key { height: 54px; border-radius: 14px; border: 0; background: var(--light); color: var(--navy); font-size: 22px; font-weight: 500; }
.key:active { background: var(--grey2); }
.results { display: flex; flex-direction: column; border: 1px solid var(--light); border-radius: 12px; overflow: hidden; }
.results button { border: 0; background: var(--white); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--light); display: flex; flex-direction: column; }
.results button:last-child { border-bottom: 0; }
.results button:hover { background: #F7F9FA; }

/* call panel */
.callpanel { display: flex; flex-direction: column; gap: 14px; }
.call-who { text-align: center; padding: 6px 0; }
.call-who .name { font-size: 22px; font-weight: 600; color: var(--navy); }
.call-who .deal { font-size: 14px; color: var(--muted); }
.call-who .timer { font-size: 15px; color: var(--green); font-variant-numeric: tabular-nums; margin-top: 4px; }
.call-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.call-actions .btn { height: 56px; border-radius: 14px; flex-direction: column; gap: 2px; font-size: 12px; }
.payment-banner { background: var(--amber-bg); color: #6B4510; border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.payment-banner strong { display: block; }
.say-hint { background: #E8F0F8; color: #0D2C4D; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.say-hint strong { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
/* mini phone (always-on-top window) */
.mini-body { margin: 0; background: var(--navy); color: var(--white); font-family: Jost, system-ui, sans-serif; }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; min-height: 100vh; box-sizing: border-box; }
.mini .label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--grey); }
.mini .name { font-size: 20px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .deal { font-size: 13px; color: var(--grey); }
.mini .btns { display: flex; gap: 8px; margin-top: auto; }
.mini .btns .btn { flex: 1; }
.mini.ringing { animation: mini-pulse 1.2s ease-in-out infinite; }
@keyframes mini-pulse { 0%, 100% { background: var(--navy); } 50% { background: #16477A; } }

/* AI call summary */
.meta.headline { font-style: italic; color: #0D2C4D; }
.insight { background: #F4F7FA; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.insight .steps { margin: 0 0 4px 18px; padding: 0; }
.insight details summary { cursor: pointer; color: #0D2C4D; font-weight: 500; margin-top: 4px; }
.insight .transcript { max-height: 320px; overflow: auto; font-size: 14px; line-height: 1.45; margin-top: 6px; }
.insight .transcript p { margin: 0 0 6px; }

/* reply by WhatsApp or text */
.channel-pick { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; }
.channel-pick .btn[aria-pressed="true"] { background: #0D2C4D; color: #fff; border-color: #0D2C4D; }

/* caller context on the ringing card */
.incoming .ctx { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--grey); }
.incoming .ctx .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.incoming .ctx .chip { background: rgba(255,255,255,.14); color: var(--white); border: 0; }
.incoming .ctx .hl { font-style: italic; color: var(--white); }

/* AI help in the wrap-up box */
.ai-wrap { background: #F4F7FA; border-radius: 10px; padding: 8px 12px; }
.ai-wrap:empty { display: none; }
.ai-steps { display: flex; flex-direction: column; gap: 6px; }
.ai-steps .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }

/* quick replies */
.dialog.qr { max-width: 640px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto; }
.qr-list { display: flex; flex-direction: column; gap: 8px; }
.qr-item { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #DCE3EA; border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.qr-item:hover, .qr-item:focus-visible { border-color: #0D2C4D; }
.qr-cat { margin: 12px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qr-cat:first-child { margin-top: 0; }
.qr-edit { display: flex; flex-direction: column; gap: 12px; }
.qr-row { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid #E8EDF2; }
.qr-row .btn { justify-self: start; }

/* my day */
.stack { display: flex; flex-direction: column; gap: 20px; }
.myday { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(135deg, #FFFFFF 0%, #F3F7FB 100%); }
.myday-head { display: flex; align-items: flex-start; gap: 12px; }
.myday-hello { font-family: "Crimson Text", Georgia, serif; font-weight: 600; font-size: 24px; color: var(--navy); line-height: 1.1; }
.myday-line { font-size: 14px; margin-top: 4px; }
.myday-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.myday-tile { background: var(--white); border: 1px solid var(--light); border-radius: 14px; padding: 12px 14px; }
.myday-tile .n { font-size: 24px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.15; }
.myday-tile .l { font-size: 13px; color: var(--ink); font-weight: 500; }
.myday-tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.myday-tile.good { background: var(--green-bg); border-color: transparent; }
.myday-tile.good .n { color: var(--green); }
.myday-tile.lead { background: var(--navy); border-color: var(--navy); }
.myday-tile.lead .n, .myday-tile.lead .l { color: var(--white); }
.myday-tile.lead .s { color: var(--grey); }
.linkish { margin-left: auto; background: none; border: 0; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; padding: 4px; white-space: nowrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* welcome tour */
.dialog.tour { max-width: 460px; }
.tour-body { display: flex; flex-direction: column; gap: 10px; }
.tour-body p { margin: 0; line-height: 1.5; }
.tour-kicker { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.tour-dots { display: flex; gap: 6px; margin: 6px 0 2px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--grey2); }
.tour-dots span.on { background: var(--navy); width: 22px; border-radius: 999px; }

/* photos, settings, snow */
img.avatar { object-fit: cover; padding: 0; }
.avatar.sm { width: 24px; height: 24px; flex: 0 0 24px; font-size: 10px; }
.avatar.lg { width: 64px; height: 64px; flex: 0 0 64px; font-size: 20px; }
.me-btn { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; color: inherit; padding: 0; text-align: left; margin-left: 0 !important; }
.me-btn:hover .who span:first-child { text-decoration: underline; }
.me-card { display: flex; align-items: center; gap: 14px; }
.who-row { display: flex; align-items: center; gap: 8px; }
.person .avatar.sm { margin-right: 2px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* phones: bottom bar with More, keypad sheet, compact My day */
.nav-more, .fab, .sheet-bar, .lbl .short { display: none; }
.sheet-wrap { align-items: flex-end; padding: 0; }
.sheet { background: var(--white); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; max-height: 85vh; overflow: auto; animation: rise .18s ease-out; }
.sheet-me { display: flex; gap: 12px; align-items: center; padding: 8px 8px 14px; border-bottom: 1px solid var(--light); margin-bottom: 6px; }
.sheet-item { display: flex; align-items: center; gap: 14px; border: 0; background: none; padding: 14px 10px; border-radius: 12px; font-size: 16px; color: var(--navy); text-align: left; }
.sheet-item:active { background: var(--light); }
.sheet-item.danger { color: var(--red-ink); justify-content: center; margin-top: 6px; border-top: 1px solid var(--light); border-radius: 0; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) {
  .nav-link.secondary { display: none; }
  table.grid { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-more { display: flex; }
  .nav-link { flex: 1 1 0; min-width: 0; }
  .lbl .long { display: none; } .lbl .short { display: inline; }
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 22px; }
  .topdate, .mini-btn, .myday-head .linkish.small { display: none; }
  .phone-state { font-size: 12px; }
  .status-select { height: 38px; }
  .myday { padding: 14px; gap: 10px; }
  .myday-hello { font-size: 20px; }
  .myday-line { font-size: 13px; }
  .myday-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .myday-tile { padding: 9px 10px; border-radius: 12px; }
  .myday-tile .n { font-size: 20px; }
  .myday-tile .l { font-size: 12px; line-height: 1.2; }
  .myday-tile .s { display: none; }
  #phone-panel[data-mode="dialler"] { display: none; }
  body.dial-open #phone-panel[data-mode="dialler"] { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-width: none; border-radius: 20px 20px 0 0;
    max-height: 88vh; overflow: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(13,44,77,.25); animation: rise .18s ease-out; }
  body.dial-open::after { content: ""; position: fixed; inset: 0; background: rgba(13,44,77,.35); z-index: 44; }
  .sheet-bar { display: flex; align-items: center; justify-content: space-between; color: var(--navy); }
  #phone-panel[data-mode="call"] { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 35; max-width: none;
    max-height: 70vh; overflow: auto; box-shadow: 0 10px 40px rgba(13,44,77,.3); }
  .fab { display: flex; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; width: 58px; height: 58px; border-radius: 50%;
    border: 0; background: var(--green); color: var(--white); align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(30,138,90,.4); }
  .wa:not(.thread-open) .wa-thread { display: none; }
  .wa:not(.thread-open) { min-height: 0; }
  .wa:not(.thread-open) .wa-list { max-height: none; border-bottom: 0; }
  .wa-head { padding: 12px; }
  .wa-head .wa-who { flex: 1 1 calc(100% - 70px) !important; }
  .wa-head select { flex: 1 1 auto; width: auto; min-width: 0; }
  .wa-compose { flex-wrap: wrap; }
  .wa-compose textarea { flex: 1 1 100%; }
  .wa-compose .btn { flex: 1 1 0; }
  body.dial-open .nav, body.dial-open .fab { display: none; }
  .wa.thread-open { min-height: calc(100vh - 190px); }
}

/* ---- Patients (CRM) */
.card-h { margin: 0; padding: 18px 20px 10px; font-size: 17px; font-weight: 600; color: var(--navy); }
.card.pad .card-h { padding: 0 0 10px; }
.seg { display: inline-flex; gap: 4px; background: var(--white); border: 1px solid var(--grey2); border-radius: 999px; padding: 4px; }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--navy); font-weight: 500; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.seg.wide { flex-wrap: wrap; border: 0; padding: 0; background: none; }
.seg.wide button { background: var(--light); height: 32px; font-size: 13px; }
.seg.wide button[aria-pressed="true"] { background: var(--navy); }
.crm-main { flex: 999 1 520px; min-width: 0; }
.crm-main-wrap { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.crm-main-wrap > .card { margin: 0; }
.crm-main-wrap > .crm-main { flex: none; }
.upcoming-h { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: .3px; margin: 14px 0 4px; }
.upcoming-group:first-of-type .upcoming-h { margin-top: 4px; }
.row.crm-task .when { white-space: nowrap; }
.crm-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.row.crm-task .when { text-align: left; font-weight: 600; color: var(--navy); min-width: 64px; }
.row.crm-task .when.late { color: var(--red-ink); }
.row.crm-task a.title { color: var(--ink); text-decoration: none; }
.row.crm-task a.title:hover { text-decoration: underline; }
.crm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.crm-col { background: #E3E9EE; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 210px); overflow-y: auto; }
.crm-col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.crm-col-h h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy); margin-right: auto; }
.crm-col-h .count { font-size: 12px; font-weight: 600; background: var(--white); color: var(--navy); border-radius: 999px; padding: 2px 9px; }
.crm-col-v { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -6px; }
.crm-card { background: var(--white); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(13,44,77,.08); display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.crm-card:hover { box-shadow: 0 2px 10px rgba(13,44,77,.14); }
.crm-card .top { display: flex; align-items: flex-start; gap: 8px; }
.crm-card .name { font-weight: 600; margin-right: auto; }
.crm-card .proc { font-size: 13px; color: var(--muted); }
.crm-card .mid { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.crm-card .val { font-size: 13px; font-weight: 600; color: var(--navy); }
.crm-card .next { font-size: 12px; color: var(--muted); border-top: 1px solid var(--light); padding-top: 7px; }
.crm-card .next.late { color: var(--red-ink); }
.crm-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; margin-bottom: 12px; }
.crm-head { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.crm-head .who { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.crm-head .who > .id { margin-right: auto; display: flex; flex-direction: column; gap: 6px; }
.crm-head h2 { margin: 0; font-size: 30px; color: var(--navy); }
.crm-head .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-head .avatar.lg { background: var(--navy); color: var(--white); }
.crm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-actions .btn { text-decoration: none; }
.crm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.crm-steps li { display: flex; flex-direction: column; gap: 6px; }
.crm-steps .bar { height: 6px; border-radius: 999px; background: var(--grey2); }
.crm-steps .lbl { font-size: 12px; color: var(--muted); }
.crm-steps li.done .bar { background: var(--navy); }
.crm-steps li.done .lbl { color: var(--navy); }
.crm-steps li.now .bar { background: var(--green); }
.crm-steps li.now .lbl { color: #17694A; font-weight: 600; }
.crm-next { background: var(--light); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.crm-next span { font-size: 13px; color: var(--muted); }
.crm-next.late { background: var(--red-bg); }
.crm-next.late strong, .crm-next.late span { color: var(--red-ink); }
.crm-dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; font-size: 14px; }
.crm-dl dt { color: var(--muted); }
.crm-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.crm-tl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-right: 16px; border-bottom: 1px solid var(--light); }
.crm-tl-h .card-h { padding-bottom: 18px; margin-right: auto; }
.crm-tl { list-style: none; margin: 0; padding: 6px 0; }
.crm-tl li { display: flex; gap: 14px; padding: 14px 20px; }
.crm-tl .ico { width: 34px; height: 34px; border-radius: 50%; background: var(--light); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.crm-tl .k-whatsapp .ico, .crm-tl .k-sms .ico { background: var(--green-bg); color: #17694A; }
.crm-tl .k-note .ico { background: var(--amber-bg); color: #8A5A10; }
.crm-tl .b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.crm-tl .hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.crm-tl .hd .muted { margin-left: auto; }
.crm-tl .tx { font-size: 14px; line-height: 1.5; white-space: pre-line; background: #F7F9FA; border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; }
.crm-tl .k-whatsapp.in .tx, .crm-tl .k-sms.in .tx { background: var(--green-bg); }
@media (max-width: 700px) {
  .crm-steps { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .crm-steps .lbl { display: none; }
  .crm-head { padding: 18px; }
  .crm-head h2 { font-size: 24px; }
  .crm-board { grid-auto-columns: 85%; }
}
.crm-row-btns { display: flex; align-items: center; gap: 8px; }
.icon-call { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--green); color: var(--white); display: flex; align-items: center; justify-content: center; }

/* ---- Price list and rota */
.banner { background: var(--light); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; color: var(--navy); }
.banner.amber { background: var(--amber-bg); color: #8A5A10; }
.banner summary { cursor: pointer; font-weight: 600; }
.banner ul { margin: 8px 0 0; padding-left: 18px; }
.pl-search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--grey2); border-radius: 999px; padding: 0 14px; height: 40px; min-width: min(340px, 100%); color: var(--muted); }
.pl-search input { border: 0; outline: 0; background: none; flex: 1; font-size: 14px; height: 38px; padding: 0; }
.pl-body { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.pl-card { padding-bottom: 8px; }
.pl-scroll { overflow-x: auto; }
.pl-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 20px; border-bottom: 1px solid var(--light); }
.pl-t td { padding: 9px 20px; border-bottom: 1px solid var(--light); vertical-align: top; }
.pl-t td.t { font-weight: 600; color: var(--navy); min-width: 150px; }
.pl-t td.p { font-weight: 600; white-space: nowrap; }
.pl-t td.n { color: var(--muted); }
.pl-t tr.who td { color: var(--muted); font-size: 13px; padding-top: 4px; }
.pl-t tr.flag td { background: var(--amber-bg); }
.pl-t .was { display: block; font-size: 12px; font-weight: 500; color: #8A5A10; }
.pl-t.pl-opts { margin-top: 6px; max-width: 560px; }
.pl-t.pl-opts td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--light); }
.pl-t.pl-opts td.p { text-align: right; padding-right: 0; }
.pl-proc { padding: 12px 20px; border-top: 1px solid var(--light); display: flex; flex-direction: column; gap: 4px; }
.pl-proc .top { display: flex; justify-content: space-between; gap: 12px; color: var(--navy); }
.pl-proc .price { font-weight: 600; white-space: nowrap; }
.pl-proc .meta { font-size: 13px; color: var(--muted); }
.pl-proc .pc-note { font-size: 13px; background: var(--amber-bg); color: #8A5A10; border-radius: 10px; padding: 6px 10px; }
.pl-proc .links { display: flex; gap: 14px; font-size: 13px; margin-top: 2px; }
.rota-t { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.rota-t th, .rota-t td { padding: 10px 8px; border-bottom: 1px solid var(--light); text-align: center; }
.rota-t thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.rota-t thead th.now { color: var(--navy); }
.rota-t tbody th { text-align: left; padding-left: 20px; color: var(--navy); white-space: nowrap; }
.rota-t .chip { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; padding: 4px 10px; }
.rota-t .chip small { font-size: 11px; font-weight: 500; }
.team-t td, .team-t th { white-space: nowrap; }
.rules { margin: 4px 0 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.steps-list { margin: 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.steps-list li { background: var(--light); border-radius: 12px; padding: 8px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.card.pad .crm-bar { margin-bottom: 4px; }
.pl-menus { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.pl-menu { display: flex; gap: 12px; align-items: baseline; }
.pl-menu-h { flex: 0 0 132px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pl-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-right: 20px; }
@media (max-width: 700px) { .pl-menu { flex-direction: column; gap: 6px; } .pl-menu-h { flex: none; } }

/* ---- clearer navigation and board */
.nav-link { font-weight: 500; }
.nav-link[aria-current="page"] { background: var(--white); color: var(--navy); font-weight: 700; box-shadow: inset 4px 0 0 var(--green); }
.nav-link[aria-current="page"] svg { color: var(--navy); }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); padding: 14px 12px 4px; }
.main a:not(.btn):not(.crm-card):not(.row):not(.nav-link):not(.tile):not(.wa-row) { text-decoration: underline; text-underline-offset: 2px; }
.crm-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.crm-search { flex: 1 1 340px; height: 44px; border: 2px solid var(--navy); color: var(--navy); }
.crm-search input { font-size: 15px; }
.crm-select { height: 40px; border-radius: 999px; border: 2px solid var(--navy); padding: 0 14px; font-weight: 600; color: var(--navy); background: var(--white); }
.crm-tools .seg.wide button { border: 2px solid var(--navy); background: var(--white); font-weight: 600; }
.crm-tools .seg.wide button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.crm-col { background: #DCE3EA; }
.crm-col-h { background: var(--navy); border-radius: 10px; padding: 8px 10px; }
.crm-col-h h2 { color: var(--white); font-weight: 700; }
.crm-col-h .count { background: var(--white); color: var(--navy); font-weight: 700; }
.crm-col-v { font-weight: 600; color: var(--navy); margin-top: 0; }
.rot-count { color: var(--red-ink); font-weight: 700; }
.crm-card .name { font-weight: 700; color: var(--navy); font-size: 15px; }
.crm-card .proc { color: var(--ink); }
.crm-card .next { color: var(--ink); }
.crm-card .next.late { color: var(--red-ink); font-weight: 600; }
.crm-card.rot { background: #FDECEC; box-shadow: inset 4px 0 0 var(--red-ink); }
.rot-badge { background: var(--red-ink); color: var(--white); font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.crm-results:empty { display: none; }
.crm-found { margin-bottom: 14px; }
.crm-found ul { list-style: none; margin: 0; padding: 0 0 8px; }
.crm-found li { display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-top: 1px solid var(--light); }
.crm-found li a { flex: 1; color: var(--navy); }
.pl-menus .seg.wide button { border: 2px solid var(--navy); background: var(--white); font-weight: 600; }
.pl-menus .seg.wide button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.card-h { font-weight: 700; }
@media (max-width: 900px) { .nav-group { display: none; } .nav-link[aria-current="page"] { box-shadow: none; } }

/* ---- Add deal, Won / Lost (written to Pipedrive) */
.crm-add { margin-left: auto; height: 44px; font-weight: 700; }
.crm-close { display: inline-flex; gap: 8px; margin-left: 8px; padding-left: 10px; border-left: 2px solid var(--light); }
.crm-dialog { max-width: 560px; }
.crm-form { display: flex; flex-direction: column; gap: 12px; }
.crm-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.crm-form textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.crm-msg:empty { display: none; }
.crm-msg { display: flex; flex-direction: column; gap: 8px; }
.crm-dups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crm-dups li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--light); border-radius: 10px; }
.crm-dups .who { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.crm-dups .go { display: flex; gap: 10px; align-items: center; }
@media (max-width: 560px) { .crm-form .row2 { grid-template-columns: 1fr; } .crm-add { margin-left: 0; } }
.banner.red { background: #FDECEC; color: var(--red-ink); margin-bottom: 0; }
.crm-msg .banner { margin-bottom: 0; }

/* ---- Email (coordinators' mailboxes, read only) */
.mail-tools .banner { margin-bottom: 10px; }
.mail-row { align-items: flex-start; }
/* the open email stands out clearly (Shahaab, 8 Nov 2026) */
.mail-row.on, .mail-row.on:hover { background: var(--navy); box-shadow: inset 6px 0 0 var(--green); }
.mail-row.on .title, .mail-row.on .subj, .mail-row.on .meta, .mail-row.on .muted { color: #fff !important; }
.mail-row.on .meta { opacity: .85; }
.mail-row.on .avatar { background: #fff; color: var(--navy); }
.mail-row.on .chip { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.mail-row.on.unread .title::before { background: #fff; }
.mail-row .body { min-width: 0; }
.mail-row .subj { display: block; font-weight: 600; color: var(--navy); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row .meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.mail-msgs { flex: 1 1 auto; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #F7F9FA; }
.mail-msg { background: var(--white); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 1px rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 6px; }
.mail-msg.out { border-left: 4px solid #6FA8DC; }
.mail-msg .hd { display: flex; justify-content: space-between; gap: 10px; }
.mail-msg .tx, .mail-tx { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.mail-earlier { white-space: pre-wrap; word-wrap: break-word; font-size: 13px; color: var(--muted, #4A5560); border-left: 3px solid var(--line, #D5DDE6); padding-left: 10px; margin-top: 6px; }
.mail-tx.clip { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
button.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; }
.mail-back { display: none; }
@media (max-width: 900px) { .mail-back { display: inline-flex; } }
.mail-connect { max-width: 640px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.mail-invite { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
/* Folders, unread and the formatted email (8 Nov 2026) */
.mail-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mail-bar > .btn { margin-left: auto; }
.mail-bar-r { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.ooo-on { background: var(--amber-bg); border-color: var(--amber); color: #7A4E0E; font-weight: 600; }
.mail-tidy { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.mail-hint { margin: 8px 10px; }
.mail-folders { flex-wrap: wrap; }
.mail-row.unread .title, .mail-row.unread .subj { font-weight: 800; color: var(--navy); }
.mail-row.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: middle; }
.mail-frame iframe { width: 100%; border: 0; display: block; min-height: 40px; background: #fff; }
.mail-frame-tools { display: flex; gap: 16px; flex-wrap: wrap; }
.mail-frame-tools:empty { display: none; }
.mail-hd-r { display: flex; align-items: center; gap: 12px; }
.mail-from { min-width: 0; overflow-wrap: anywhere; }
.mail-later { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.mail-later[hidden] { display: none; }
.mail-link-results { display: flex; flex-direction: column; max-height: 320px; overflow: auto; }
.mail-link-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--light); padding: 10px 6px; cursor: pointer; color: inherit; font: inherit; }
.mail-link-row:hover { background: var(--light); }
.mail-link-row .chip { margin-left: auto; }

/* ---- Home */
a.nav-brand { text-decoration: none; color: inherit; border-radius: 10px; }
a.nav-brand img { display: block; width: 150px; height: auto; filter: brightness(0) invert(1); }   /* the website logo, shown white on navy */
a.nav-brand:hover img { opacity: .85; }
a.nav-brand { align-items: center; }
a.nav-brand .rule { display: block; width: 28px; height: 2px; background: var(--green); margin: 10px 0 8px; border-radius: 2px; }
a.nav-brand .cap { padding-left: 2.4px; text-align: center; }   /* letter-spacing adds space after the last letter: pad the first side to match */
.signin-card h1 img { display: block; width: 220px; height: auto; margin: 0 auto 6px; }
.copy-card { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
a.nav-brand:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.home-head h2 { margin: 0; color: var(--navy); font-size: 28px; }
.home-actions { display: flex; gap: 10px; align-items: center; flex: 1 1 520px; justify-content: flex-end; }
.home-actions .crm-search { flex: 1 1 360px; }
.home-actions .crm-add { margin-left: 0; }
a.tile.link { text-decoration: none; display: block; box-shadow: var(--shadow), inset 0 -3px 0 var(--navy); }
a.tile.link:hover { background: var(--light); }
a.tile.link .l { text-decoration: underline; text-underline-offset: 2px; color: var(--navy); font-weight: 600; }

/* ---- Working a deal from the patient page */
.crm-steps.can-move li button.step { all: unset; display: flex; flex-direction: column; gap: 6px; cursor: pointer; border-radius: 6px; }
.crm-steps.can-move li button.step:hover .bar { background: var(--green-bg); outline: 1px solid var(--green); }
.crm-steps.can-move li button.step:hover .lbl { color: var(--navy); }
.crm-steps.can-move li button.step:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.crm-next { gap: 8px; }
.crm-next .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-next .b { display: flex; gap: 6px; }
.crm-next.none { flex-direction: column; align-items: flex-start; background: var(--red-bg); }
.crm-next.none strong, .crm-next.none span { color: var(--red-ink); }
.link-btn { background: none; border: 0; padding: 0 0 0 8px; color: var(--green); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.quick-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.crm-form label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.note-box { padding: 16px 20px 4px; border-bottom: 1px solid var(--line, #E5E9EF); }
.note-in { position: relative; }
.note-box textarea.input { width: 100%; height: auto; padding: 10px 14px; resize: vertical; min-height: 64px; }
.note-act { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0 12px; }
.mention-sugg { position: absolute; left: 10px; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--grey2); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 35, 64, .14); padding: 6px; display: flex; flex-direction: column; min-width: 220px; }
.mention-sugg[hidden] { display: none; }
.mention-sugg button { all: unset; display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.mention-sugg button:hover, .mention-sugg button:focus-visible { background: var(--light); }
.mention { background: var(--green-bg); color: #17694A; border-radius: 6px; padding: 0 4px; font-weight: 600; }
.crm-tl .b > .btn.small { align-self: flex-start; margin-top: 6px; }
.for-you { margin-bottom: 20px; }
.for-you .card-h { display: flex; align-items: center; gap: 6px; }
.semble-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.semble-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--light); border-radius: 12px; font-size: 14px; }
.semble-list li.past { background: transparent; border: 1px solid var(--grey2); }
.semble-past summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 10px 0 8px; }
.dialog.wide, .crm-dialog.wide { width: min(720px, calc(100vw - 32px)); max-width: 720px; }
.dialog.wide textarea.input { min-height: 200px; font-family: inherit; line-height: 1.5; }
.mail-quote summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.mail-quote .tx { white-space: pre-wrap; font-size: 13px; color: var(--muted); border-left: 3px solid var(--grey2); padding-left: 10px; max-height: 180px; overflow: auto; }
.qr-top { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 8px; }
.quote-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 90px 110px minmax(0, 240px); align-items: center; gap: 12px; }
.quote-row .val { font-weight: 600; text-align: right; }
.quote-row .next { font-size: 13px; color: var(--muted); }
.quote-row .next.late, .quote-row.chase .next { color: var(--red-ink); }
.quote-row.chase { box-shadow: inset 4px 0 0 var(--red); }
@media (max-width: 760px) {
  .quote-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .quote-row .val { display: none; }
  .quote-row .next { grid-column: 2 / -1; }
  .quote-row .chip { grid-column: 3; grid-row: 1; justify-self: end; }
  .qr-top { grid-template-columns: 1fr; }
}
a.quote-row, .for-you a.row { text-decoration: none; color: inherit; }
a.quote-row:hover .title, .for-you a.row:hover .title { text-decoration: underline; text-underline-offset: 2px; }

/* ---- the menu scrolls on its own when the window is shorter than it */
@media (min-width: 901px) {
  .nav { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
  .nav > * { flex-shrink: 0; }
}
@media (min-width: 901px) and (max-height: 900px) {
  .nav { gap: 16px; padding-top: 18px; }
  .nav-link { padding: 8px 12px; }
  a.nav-brand img { width: 128px; }
  a.nav-brand .rule { margin: 8px 0 6px; }
}

/* ---- menu groups: Today's work, Look up, Manage (folds away) */
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-toggle:hover { color: var(--white); }
.nav-toggle .chev { font-size: 12px; letter-spacing: 0; }
.nav-link.folded { display: none; }
[data-badge="calls-missed"] { display: none; }
@media (min-width: 901px) {
  .nav-link.desk-hide { display: none; }
  [data-badge="calls-missed"]:not(.hidden) { display: inline-flex; }
}
@media (max-width: 900px) { .nav-toggle { display: none; } .nav-link.folded.secondary { display: none; } .nav-link.folded:not(.secondary) { display: flex; } }
@media (max-width: 640px) {
  .home-actions { flex-wrap: wrap; flex-basis: 100%; }
  .home-actions .crm-search { flex: 1 1 100%; min-width: 0; }
  .home-actions .crm-search input { min-width: 0; width: 100%; }
}
.incoming { position: fixed; z-index: 50; top: 20px; right: 20px; width: min(380px, calc(100vw - 32px)); background: var(--navy); color: var(--white); border-radius: 20px; padding: 22px; box-shadow: 0 12px 40px rgba(13,44,77,.35); display: flex; flex-direction: column; gap: 14px; animation: pop .18s ease-out; }
.incoming .label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--grey); }
.incoming .name { font-size: 24px; font-weight: 600; }
.incoming .deal { color: var(--grey2); font-size: 14px; }
.incoming .btns { display: flex; gap: 10px; }
.incoming .btns .btn { flex: 1; height: 50px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* wrap-up and dialogs */
.overlay { position: fixed; inset: 0; background: rgba(13,44,77,.4); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--white); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; color: var(--navy); font-size: 21px; }
.tagset { display: flex; flex-wrap: wrap; gap: 8px; }
.tagset button { border: 1px solid var(--grey); background: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.tagset button[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* WhatsApp */
.wa { display: flex; min-height: 70vh; overflow: hidden; }
.wa-list { width: 340px; flex: 0 0 340px; border-right: 1px solid var(--light); overflow: auto; max-height: 78vh; }
.wa-thread { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; max-height: 78vh; }
.wa-head { padding: 14px 18px; border-bottom: 1px solid var(--light); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wa-msgs { flex: 1 1 auto; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: #F7F9FA; }
.bubble { max-width: 72%; padding: 9px 12px; border-radius: 14px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { background: var(--white); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.bubble.out { background: #DCEBFA; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .stamp { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.bubble img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; }
.wa-compose { border-top: 1px solid var(--light); padding: 12px; display: flex; gap: 10px; align-items: flex-end; }
.wa-compose textarea { min-height: 46px; max-height: 160px; }
.window-note { font-size: 13px; padding: 8px 18px; background: var(--amber-bg); color: #6B4510; }

/* live board */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile .n { font-size: 30px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile.warn .n { color: var(--red-ink); }
.teamgrid { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.person { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--light); font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.available { background: var(--green); } .dot.busy { background: var(--amber); } .dot.on_call { background: var(--red); }

/* reports */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--light); }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 500; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 16px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--muted); }
.bars .bar span.v { width: 100%; background: var(--navy); border-radius: 6px 6px 0 0; min-height: 2px; }

.section-title { margin: 0; padding: 16px 18px 0; font-size: 16px; color: var(--navy); }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--white); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.bad { background: var(--red-ink); }

/* phone and tablet */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .nav { width: 100%; height: auto; position: sticky; top: auto; bottom: 0; order: 2; flex: 0 0 auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 0; z-index: 30; position: fixed; left: 0; right: 0; }
  .nav-brand, .nav-me { display: none; }
  .nav-links { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-link { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; width: auto; align-items: center; }
  .nav-link .badge { position: absolute; margin: -4px 0 0 16px; font-size: 10px; padding: 0 5px; }
  .main { padding: 16px 16px 92px; }
  .side { max-width: none; position: static; flex-basis: 100%; }
  .wa { flex-direction: column; }
  .wa-list { width: 100%; flex: 0 0 auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--light); }
  .wa.thread-open .wa-list { display: none; }
  .incoming { top: auto; bottom: 90px; right: 16px; }
}
@media (max-width: 600px) {
  .row .chip { display: none; }
  .topbar .right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Messages: clearer states, who-said-what and channel colours */
:root { --wa: #1E8A5A; --wa-bg: #E3F4EA; --sms: #2563A8; --sms-bg: #E4EEF9; --thread-bg: #E7ECF1; }
.wa-list { background: var(--white); }
.wa-row, .wa-row * { text-decoration: none; }
.wa-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 14px 14px; border-bottom: 1px solid var(--grey2); border-left: 4px solid transparent; text-decoration: none; color: var(--ink); }
.wa-row:hover { background: #F5F8FA; }
.wa-row.s-waiting { border-left-color: var(--red); background: #FFF7F5; }
.wa-row.s-held { border-left-color: var(--amber); }
.wa-row.s-done { opacity: .62; }
.wa-row[aria-current="true"] { border-left-color: var(--navy); background: #EAF0F6; opacity: 1; }
.wa-av { position: relative; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--grey2); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.wa-av .ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--white); display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 9px; font-weight: 700; }
.wa-av .ch.is-wa { background: var(--wa); } .wa-av .ch.is-sms { background: var(--sms); }
.wa-av .ch svg { width: 10px; height: 10px; stroke: var(--white); }
.wa-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wa-top { display: flex; align-items: baseline; gap: 8px; }
.wa-top .nm { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-top .wait { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--red-ink); }
.wa-last { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-waiting .wa-last { color: var(--ink); font-weight: 500; }
.wa-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-tags:empty { display: none; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 2px 8px; border-radius: 999px; background: var(--light); color: var(--navy); }
.tag.red { background: var(--red-bg); color: var(--red-ink); } .tag.amber { background: var(--amber-bg); color: #7A4E0E; } .tag.grey { background: var(--grey2); color: var(--muted); }
.wa-group { padding: 10px 16px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); background: var(--light); border-bottom: 1px solid var(--grey2); }
.wa-head { background: var(--white); border-bottom: 1px solid var(--grey2); }
.wa-head .nm { font-size: 17px; font-weight: 600; color: var(--navy); text-decoration: none; }
.wa-head a.nm:hover { text-decoration: underline; }
.wa-head .win { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.wa-head .win.open { background: var(--wa-bg); color: var(--wa); } .wa-head .win.closed { background: var(--amber-bg); color: #7A4E0E; }
.wa-msgs { background: var(--thread-bg); gap: 10px; }
.wa-day { align-self: center; margin: 6px 0; }
.wa-day span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--white); border-radius: 999px; padding: 3px 12px; box-shadow: 0 1px 1px rgba(13,44,77,.08); }
.bubble { max-width: 70%; padding: 10px 14px; border-radius: 16px; }
.bubble.cont { margin-top: -6px; }
.bubble.in { background: var(--white); border: 1px solid #CED8E2; box-shadow: 0 1px 2px rgba(13,44,77,.08); }
.bubble.out { background: var(--navy); color: var(--white); }
.bubble.out .stamp { color: #C1CDDB; }
.bubble.out.auto { background: var(--white); color: var(--ink); border: 1.5px dashed #9AA8B6; }
.bubble.out.auto .stamp { color: var(--muted); }
.bubble .auto-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.bubble .tpl-body { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.bubble .tpl-body .fill { font-size: 13px; opacity: .8; }
.bubble .stamp { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.chtag { font-size: 10px; font-weight: 700; letter-spacing: .4px; padding: 1px 6px; border-radius: 4px; }
.chtag.is-wa { background: var(--wa-bg); color: var(--wa); } .chtag.is-sms { background: var(--sms-bg); color: var(--sms); }
.bubble.in .stamp { justify-content: flex-start; }
.channel-pick { background: var(--white); }
.ch-btn { gap: 6px; }
.ch-btn.is-wa[aria-pressed="true"] { background: var(--wa); border-color: var(--wa); color: var(--white); }
.ch-btn.is-sms[aria-pressed="true"] { background: var(--sms); border-color: var(--sms); color: var(--white); }
.ch-btn[aria-pressed="true"] svg { stroke: var(--white); }
.wa-compose { background: var(--white); border-top: 3px solid var(--grey2); }
.wa-compose.ch-whatsapp { border-top-color: var(--wa); } .wa-compose.ch-sms { border-top-color: var(--sms); }
.wa-compose.ch-whatsapp .send { background: var(--wa); border-color: var(--wa); }
.wa-compose.ch-sms .send { background: var(--sms); border-color: var(--sms); }
.btn.wa-btn { color: var(--wa); border-color: #A9D8BF; } .btn.wa-btn svg { stroke: var(--wa); }

/* ---- patient page: read-only until launch, booking a consultation */
.prelaunch { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--light); color: var(--muted); font-size: 14px; }
.prelaunch strong { color: var(--navy); }
.book-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.book-step { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--grey2); }
.book-step:first-child { border-top: 0; padding-top: 4px; }
.book-step .lbl { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.book-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.book-docs .doc { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--grey2); border-radius: 12px; background: var(--white); cursor: pointer; font-family: inherit; color: var(--ink); }
.book-docs .doc[aria-checked="true"] { border-color: var(--navy); background: #EAF0F6; }
.book-docs .doc .small { color: var(--green); }
.book-slots { display: flex; flex-direction: column; gap: 12px; }
.book-day .dh { display: flex; gap: 10px; align-items: baseline; }
.book-day .times { display: flex; flex-wrap: wrap; gap: 5px; }
.book-day { padding: 10px 12px; border-radius: 12px; background: var(--light); }
.book-day .part { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.book-day .pl { flex: 0 0 74px; font-size: 12px; color: var(--muted); padding-top: 6px; }
.slot { min-width: 54px; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--grey2); background: var(--white); font: inherit; font-size: 13px; cursor: pointer; color: var(--navy); }
.slot:hover { border-color: var(--navy); }
.slot[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.book-who { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; }
.book-who.ok { flex-direction: row; align-items: center; background: var(--green-bg); color: var(--green); }
.book-who.ok svg { stroke: var(--green); }
.book-who.new { background: var(--amber-bg); }
@media (max-width: 640px) { .book-docs { grid-template-columns: 1fr; } .bubble { max-width: 86%; } .book-day .part { flex-direction: column; gap: 2px; } .book-day .pl { padding-top: 0; } }

/* ---- Messages: the reply area as one panel, owners you can see at a glance */
.wa-thread { position: relative; }
.wa-reply { background: var(--white); border-top: 3px solid var(--grey2); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.wa-reply.ch-whatsapp { border-top-color: var(--wa); } .wa-reply.ch-sms { border-top-color: var(--sms); }
.wa-reply .channel-pick { padding: 0; background: none; }
.wa-reply .wa-compose { border-top: 0; padding: 0; background: none; align-items: flex-end; }
.wa-reply .wa-compose textarea { min-height: 46px; }
.wa-reply.ch-whatsapp .send { background: var(--wa); border-color: var(--wa); }
.wa-reply.ch-sms .send { background: var(--sms); border-color: var(--sms); }
.btn.attach { flex: 0 0 auto; width: 46px; height: 46px; padding: 0; justify-content: center; }
.btn.attach svg { stroke: var(--navy); }
.wa-row.s-done { opacity: 1; }
.wa-row.s-done .wa-av { background: var(--light); color: var(--muted); }
.wa-row.s-done .wa-last { color: var(--muted); }
.wa-top .when { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.wa-top .wait { color: var(--white); background: var(--red); border-radius: 999px; padding: 1px 8px; }
.s-held .wa-top .wait { background: var(--amber); color: #3D2706; }
.wa-foot { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.owner { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy); }
.owner .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .3px; }
.owner.none { color: #7A4E0E; } .owner.none .dot { background: var(--amber-bg); color: #7A4E0E; border: 1.5px dashed #C98A2B; }
.owner.quiet { color: var(--muted); font-weight: 500; } .owner.quiet .dot { background: #9AA8B6; }
.owner.none.quiet { color: var(--muted); } .owner.none.quiet .dot { background: var(--light); color: var(--muted); border-color: #B7C2CD; }
.owner-pick { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.owner-pick select { font-weight: 600; color: var(--navy); }

/* ---- files: dropped, pasted or chosen */
.file-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.file-tray[hidden] { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--light); border: 1px solid var(--grey2); font-size: 13px; color: var(--navy); }
.file-chip svg { stroke: var(--navy); flex: 0 0 auto; }
.file-chip .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; font-weight: 600; }
.file-chip .fs { color: var(--muted); font-size: 12px; }
.file-chip .x { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; color: var(--muted); border-radius: 6px; }
.file-chip .x:hover { background: var(--grey2); color: var(--ink); }
.drop-cover { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(234,240,246,.92); border: 3px dashed var(--navy); border-radius: inherit; pointer-events: none; }
.drop-cover[hidden] { display: none; }
.drop-cover > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--navy); padding: 16px; }
.drop-cover strong { font-size: 18px; } .drop-cover span { font-size: 13px; color: var(--muted); }
.drop-cover svg { stroke: var(--navy); }
.dialog.wide { position: relative; }

/* ---- drag to move: board cards, Up next tasks, saved replies */
.drag-row { cursor: grab; -webkit-touch-callout: none; }
.drag-row:active { cursor: grabbing; }
.drag-src { opacity: .35; outline: 2px dashed var(--navy); outline-offset: -2px; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; box-shadow: 0 12px 28px rgba(13,44,77,.28); border-radius: 14px; background: var(--white); opacity: .96; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.crm-col.drop-on { box-shadow: inset 0 0 0 2px var(--navy); }
.crm-card.saving { opacity: .6; }
.drag-hint { margin-left: auto; }
.card-h .hint { font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 10px; }
.crm-main.drop-on { box-shadow: 0 0 0 2px var(--light); }
.qr-grip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: grab; touch-action: none; color: var(--muted); }
.qr-grip svg { stroke: var(--muted); stroke-width: 3; }
.qr-grip:hover, .qr-grip:focus-visible { background: var(--light); }
.qr-edit.drop-on { outline: 2px dashed var(--grey2); outline-offset: 4px; border-radius: 12px; }
@media (max-width: 640px) { .drag-hint { display: none; } .file-chip .fn { max-width: 160px; } .card-h .hint { display: none; } }
.qr-top { grid-template-columns: auto minmax(0, 1fr) 190px; align-items: center; }
@media (max-width: 640px) { .qr-top { grid-template-columns: auto minmax(0, 1fr); } .qr-top .qr-ch { grid-column: 1 / -1; } }
@media (max-width: 640px) { .wa-reply { padding: 10px 12px 12px; } .wa-reply .wa-compose textarea { flex: 1 1 calc(100% - 60px); min-width: 0; } }

/* ---- patient data stays here: a faint name watermark, no printing, parked stages */
#wm { position: fixed; inset: 0; z-index: 900; pointer-events: none; background-repeat: repeat; }
@media print {
  body.guarded > * { display: none !important; }
  body.guarded::after { content: "Printing is switched off in CFS Connect to keep patient details safe."; display: block; padding: 40px; font: 16px sans-serif; }
}
.crm-col.parked { background: #EEF1F4; }
.crm-col.parked .crm-col-h { background: #7C8B99; }
.crm-col.parked .crm-card { opacity: .85; }
.data-guard.alert { box-shadow: inset 4px 0 0 var(--red); }

/* ---- team goal, leaderboard, my ring, wins */
.fun-strip { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; gap: 16px; margin-bottom: 20px; }
.fun-strip:empty { display: none; }
.fun-card { display: flex; flex-direction: column; gap: 10px; }
.fun-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.fun-h .seg button { font-size: 12px; padding: 4px 10px; letter-spacing: 0; text-transform: none; }
.goal-n { font-size: 15px; color: var(--ink); } .goal-n strong { font-size: 30px; color: var(--navy); margin-right: 2px; }
.goal-bar { height: 14px; border-radius: 999px; background: var(--light); overflow: hidden; }
.goal-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy), var(--wa)); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.goal.hit .goal-bar span { background: linear-gradient(90deg, var(--wa), #B7791F); }
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--light); }
.lb li.me { background: #EAF0F6; box-shadow: inset 3px 0 0 var(--navy); }
.lb .m { font-size: 18px; } .lb .nm { flex: 1; font-weight: 600; color: var(--navy); } .lb strong { font-size: 18px; color: var(--navy); }
.lb-me { color: var(--muted); }
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { transform: rotate(-90deg); flex: 0 0 auto; }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--light); }
.ring .fill { stroke: var(--wa); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring.full .fill { stroke: #B7791F; }
.ring-n { font-size: 15px; } .ring-n strong { font-size: 28px; color: var(--navy); }
.streak { font-weight: 600; color: #B4521B; font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #FFF4DE; color: #7A4E0E; border: 1px solid #F1D9A6; }
.wrapup { grid-column: 1 / -1; background: linear-gradient(120deg, #FFFFFF 60%, #FFF6E5); }
.wrap-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.mvp { font-size: 18px; color: var(--navy); }
.side-stack { display: flex; flex-direction: column; gap: 16px; }
.side-stack > .card { margin: 0; }
.fun-feed { display: flex; flex-direction: column; }
.win-row { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--light); font-size: 14px; }
.win-row .t { flex: 1; min-width: 0; }
.clap { border: 1px solid var(--grey2); background: var(--white); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 13px; transition: transform .15s; }
.clap:hover:not(:disabled) { transform: scale(1.08); }
.clap.on, .clap:disabled { background: #FFF4DE; border-color: #F1D9A6; cursor: default; }
.toast.win { display: flex; align-items: center; gap: 10px; background: var(--navy); color: var(--white); }
.toast.win .clap { background: rgba(255,255,255,.15); border-color: transparent; color: var(--white); }
.goals-row { display: flex; gap: 16px; flex-wrap: wrap; }
.day-card { text-align: center; align-items: center; }
.day-card h2 { margin: 0; }
.day-stats { display: flex; gap: 28px; justify-content: center; margin: 6px 0; }
.day-stats div { display: flex; flex-direction: column; } .day-stats strong { font-size: 30px; color: var(--navy); } .day-stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .fun-strip { grid-template-columns: 1fr 1fr; } .fun-card.mine { grid-column: 1 / -1; } }
@media (max-width: 640px) { .fun-strip { grid-template-columns: 1fr; } .fun-card.mine { grid-column: auto; } }

/* ---- a little life: things settle into place, December snow on the logo */
@keyframes cfs-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cfs-pop { 0% { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
#view > * { animation: cfs-rise .32s ease both; }
#view > *:nth-child(2) { animation-delay: .04s; } #view > *:nth-child(3) { animation-delay: .08s; } #view > *:nth-child(4) { animation-delay: .12s; }
.toast { animation: cfs-pop .28s ease both; }
.dialog { animation: cfs-pop .22s ease both; }
.crm-card, .btn, .tile, .wa-row { transition: box-shadow .18s, transform .18s, background-color .18s; }
.crm-card:hover { transform: translateY(-1px); }
.tile.link:hover { transform: translateY(-2px); }
body.festive a.nav-brand { position: relative; }
body.festive a.nav-brand::before { content: "\2744  \2745  \2746"; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 11px; letter-spacing: 6px; color: rgba(255,255,255,.75); animation: cfs-drift 4s ease-in-out infinite alternate; pointer-events: none; }
@keyframes cfs-drift { from { transform: translate(-50%, 0); } to { transform: translate(-46%, 4px); } }
@media (prefers-reduced-motion: reduce) {
  #view > *, .toast, .dialog, body.festive a.nav-brand::before { animation: none !important; }
  .goal-bar span, .ring .fill, .crm-card, .tile { transition: none !important; }
}

/* ---- payment links on the patient page */
.pay-card .card-h { display: flex; align-items: center; gap: 8px; }
.pay-test { font-size: 11px; padding: 2px 8px; }
.pay-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--light); }
.pay-row .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-row .t strong { color: var(--navy); font-size: 16px; }
.pay-row .b { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.chip.green { background: #E3F4EA; color: #1E7A46; }
.chip.red { background: #FDECEA; color: #B42318; }
.pay-send { flex-wrap: wrap; }

/* ---- "CFS Connect has been updated" bar */
.update-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  background: var(--navy); color: var(--white); padding: 10px 14px 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(14,42,71,.25); font-size: 14px; }
.update-bar .link-btn { color: rgba(255,255,255,.8); }

.tpl-words { white-space: pre-wrap; margin-top: 4px; font-size: 13px; line-height: 1.45; }

/* the call box on screens without a phone panel (Nikesh, 7 Nov 2026) */
.call-dock { position: fixed; right: 20px; bottom: 20px; z-index: 55; width: 360px; max-width: calc(100vw - 24px); max-height: 80vh;
  overflow: auto; box-shadow: 0 12px 40px rgba(13,44,77,.3); border: 1px solid var(--grey2); }
.crm-park { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.call-sum { margin-top: 6px; background: var(--light); border-radius: 10px; padding: 8px 12px; }
.call-sum > summary { cursor: pointer; color: var(--navy); }
.call-sum .tx { margin-top: 6px; }
.call-sum .call-more { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.implant-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.implant-steps li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.implant-steps li.done label { color: var(--muted); text-decoration: line-through; }
button.late-who { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; display: flex;
  align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--grey2); }
button.late-who .title { text-decoration: none; font-weight: 600; color: var(--navy); }
.note-edit { display: flex; gap: 14px; margin-top: 6px; }
.note-edit button.link { font-size: 13px; color: var(--muted, #6b7280); }
.note-edit button.link:hover { color: var(--navy); }
.tpl-preview { display: flex; flex-direction: column; gap: 6px; }
.chip.doc-chip { background: #fff; color: var(--navy); border: 1px solid var(--navy); border-radius: 6px; font-weight: 700; letter-spacing: .04em; }
/* Team overview for Darren (Shahaab, 8 Nov 2026) */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; align-items: start; }
.ov-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ov-name h3 { margin: 0; font-size: 17px; color: var(--navy); }
.ov-warm { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ov-warm b { margin-right: 6px; color: var(--navy); }
.ov-list { margin-top: 14px; }
.ov-list h4 { margin: 0 0 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; color: var(--navy); }
.ov-list h4 .count { background: var(--light); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.ov-list h4 .count.on { background: var(--red-bg); color: var(--red-ink); }
.ov-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: inherit; }
a.ov-row:hover { background: var(--light); }
.ov-row .ov-side { grid-column: 2; grid-row: 1; align-self: center; }
.ov-row .ov-what { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Lead warmth (Shahaab, 8 Nov 2026) */
.chip.warmth { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; cursor: help; }
.chip.warmth .wdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.w-warm { background: #E3F4EA; color: #17694A; }
.chip.w-cool { background: #E8EEF6; color: #3A5A80; }
.chip.w-at_risk { background: #FDECEA; color: #B42318; }
.crm-card .chip.warmth { font-size: 11px; padding: 2px 8px; }
.warmth-why { margin-top: 6px; font-size: 13px; color: var(--muted, #5b6b7d); padding-left: 10px; border-left: 3px solid #C9D3DF; }
.warmth-why.w-warm { border-left-color: #1E8A5A; }
.warmth-why.w-at_risk { border-left-color: #C0392B; }
/* Owner badge and colour-coded details (Shahaab, 7 Nov 2026) */
.owner-badge { --oc: #0D2C4D; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px;
  border: 2px solid var(--oc); background: color-mix(in srgb, var(--oc) 8%, #fff); }
.owner-badge .avatar { background: var(--oc); color: #fff; width: 40px; height: 40px; flex: 0 0 40px; font-size: 14px; }
.owner-badge .ob-t { display: flex; flex-direction: column; line-height: 1.2; }
.owner-badge .ob-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.owner-badge strong { font-size: 17px; color: var(--oc); }
.owner-badge.none { --oc: #B42318; }
.owner-badge.none strong { color: #B42318; }
.dgroups { display: flex; flex-direction: column; gap: 12px; }
.dgroup { border-left: 4px solid var(--gc, #CBD5E1); padding: 8px 0 8px 12px; border-radius: 2px; background: color-mix(in srgb, var(--gc, #CBD5E1) 6%, #fff); }
.dgroup .dg-h, .dgroup > summary { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gc, #64748B); margin-bottom: 6px; }
.dgroup > summary { cursor: pointer; margin-bottom: 0; }
.dgroup > summary .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dgroup[open] > summary { margin-bottom: 8px; }
.g-contact { --gc: #64748B; }
.g-clinical { --gc: #2563EB; }
.g-money { --gc: #17694A; }
.g-source { --gc: #94A3B8; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.green { background: #E3F4EA; color: #17694A; }
.pill.red { background: #FDE8E7; color: #B42318; }
.pill.amber { background: #FEF3C7; color: #92400E; }
.pill.grey { background: #EEF2F4; color: #475569; }
.pill.blue { background: #E0ECFF; color: #1D4ED8; }
a.short-link { color: var(--navy); }

.banner.mail-off { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* every drop-down: our own chevron, set in from the rounded edge (7 Nov 2026 - the browser's arrow sat on the border) */
select:not(.status-select):not([multiple]) {
  -webkit-appearance: none; appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230D2C4D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 12px 8px;
}
select.input:not([multiple]) { background-position: right 14px center; padding-right: 36px; }
select::-ms-expand { display: none; }

/* ---- dashboard (7 Nov 2026) ---- */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dash-tabs { flex-wrap: wrap; padding: 0; border: 0; }
.dash-tabs .tab:not([aria-selected="true"]) { background: var(--white); color: var(--navy); }
.dash-tools { display: flex; align-items: center; gap: 10px; }
.dash-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.dash-custom[hidden] { display: none; }
.dash-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.dash-tile { border-top: 4px solid var(--grey); }
.dash-tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-tile.t-lead { border-top-color: #2F6FB3; } .dash-tile.t-consult { border-top-color: #7A4FB5; }
.dash-tile.t-quote { border-top-color: #C07A12; } .dash-tile.t-money { border-top-color: #1F8A5B; }
.dash-tile.t-lost { border-top-color: #B23A3A; } .dash-tile.t-call { border-top-color: var(--navy); }
.dash-tile.warn .sub { color: var(--red-ink); font-weight: 600; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.dash-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dash-grid td, .dash-grid th { white-space: nowrap; }
.dash-grid tr.total td { font-weight: 700; border-top: 2px solid var(--navy); }
.dash-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.funnel, .barlist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.f-row, .b-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 48px; align-items: center; gap: 10px; font-size: 14px; }
.f-bar, .b-bar { height: 12px; background: var(--light); border-radius: 999px; overflow: hidden; }
.f-bar > span { display: block; height: 100%; background: #7A4FB5; border-radius: 999px; }
.b-bar > span { display: block; height: 100%; background: #2F6FB3; border-radius: 999px; }
.f-n, .b-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.b-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend { display: flex; align-items: flex-end; height: 160px; margin-top: 12px; border-bottom: 1px solid var(--grey); }
.trend .day { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend .bar { display: block; width: 70%; max-width: 22px; min-height: 1px; background: #2F6FB3; border-radius: 4px 4px 0 0; }
.trend .dot { position: absolute; left: 50%; width: 9px; height: 9px; margin: 0 0 -4px -4.5px; border-radius: 50%; background: #7A4FB5; border: 2px solid var(--white); }
.trend-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.dash-legend { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dash-legend .k { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.dash-legend .k.lead { background: #2F6FB3; margin-left: 0; } .dash-legend .k.consult { background: #7A4FB5; border-radius: 50%; }
@media (max-width: 640px) { .f-row, .b-row { grid-template-columns: 1fr 1fr 40px; } .trend { height: 120px; } }
/* ---- dashboard v2 (7 Nov 2026): leads first, sources and cost, quotes to chase, calls ---- */
.dash-section { font-size: 18px; color: var(--navy); margin: 10px 0 -4px; }
.dash-sub { font-size: 14px; color: var(--navy); margin: 16px 0 8px; }
.dash-calls { display: flex; flex-direction: column; gap: 18px; }
.lh { border-top: 4px solid #2F6FB3; }
.lh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 12px 0 6px; }
.lh-stat { background: var(--light); border-radius: 12px; padding: 12px 14px; }
.lh-n { font-size: 34px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.lh-l { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.vs { display: block; font-size: 12px; font-weight: 600; }
.vs.up { color: #1F8A5B; } .vs.down { color: #B23A3A; } .vs.same { color: var(--muted); }
.lh-chart { position: relative; margin-top: 12px; }
.lh-bars { position: relative; display: flex; align-items: flex-end; height: 220px; border-bottom: 1px solid var(--grey); }
.lh-day { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.lh-stack { width: 72%; max-width: 26px; min-height: 1px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.lh-stack > span { display: block; min-height: 1px; }
.lh-avg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lh-avg polyline { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dash-legend .k.line { height: 3px; border-radius: 2px; background: var(--navy); width: 16px; }
.k-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dash-tile.t-speed { border-top-color: #0EA5B7; }
.q-age .b-row { grid-template-columns: 1fr 50px 90px; }
.b-row.total { border-top: 1px solid var(--grey); padding-top: 8px; font-weight: 700; }
.targets { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.t-row { display: grid; grid-template-columns: 160px repeat(2, minmax(0, 1fr)); gap: 16px; align-items: center; }
.t-bar { display: flex; flex-direction: column; gap: 4px; }
.dash-grid td.red { color: #B23A3A; font-weight: 700; }
.dash-grid tr.link { cursor: pointer; }
.dash-grid tr.link:hover td { background: var(--light); }
@media (max-width: 640px) { .lh-bars { height: 160px; } .t-row { grid-template-columns: 1fr; } .lh-n { font-size: 28px; } }
.pw-row { display: flex; gap: 8px; align-items: center; } .pw-row .input { flex: 1; }
.tpl-bubble { background: #E7F7EE; border: 1px solid #BFE5CF; border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
@media (max-width: 900px) {
  .call-dock { left: 8px; right: 8px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); max-height: 70vh; }
}
