/* EnPointe CRM — brand guide: Core Purple #513092, Rise Gold #F3C131, Pulse Gradient #F9E42C → #F3C131 → #513092 */
:root {
  --purple: #513092;
  --purple-700: #3F2474;
  --pulse: linear-gradient(90deg, #513092 0%, #F3C131 70%, #F9E42C 100%);
  --purple-50: #F3EFFA;
  --purple-100: #E6DEF5;
  --gold: #F3C131;
  --gold-50: #FEF6E2;
  --ink: #1F1B2D;
  --ink-2: #4A4560;
  --muted: #6E6887;
  --line: #E4E1EC;
  --bg: #F7F6FB;
  --card: #FFFFFF;
  --green: #1E7A4C;
  --green-50: #E5F4EC;
  --red: #B42318;
  --red-50: #FDECEA;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 27, 45, .06), 0 1px 8px rgba(31, 27, 45, .04);
  --sidebar: 232px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.5; }
a { color: var(--purple); }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.boot, .loading { padding: 48px; color: var(--muted); text-align: center; }

/* Brand */
.brand-mark { font-weight: 700; font-size: 22px; letter-spacing: -.02em; display: inline-flex; }
.brand-mark.big { font-size: 34px; }
.brand-mark.small { font-size: 18px; }
.brand-en { color: var(--gold); }
.brand-pointe { color: #fff; }
.auth-card .brand-pointe, .topbar .brand-pointe { color: var(--purple); }

/* Buttons & inputs */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
}
.btn:hover { border-color: var(--purple-100); background: var(--purple-50); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.primary:hover { background: var(--purple-700); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-50); border-color: #F5C2BD; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { appearance: none; border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; padding: 6px 10px; border-radius: 8px; color: inherit; }
.icon-btn:hover { background: var(--purple-50); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #CFCADB; border-radius: 8px;
  padding: 9px 11px; width: 100%; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); outline: 2px solid var(--purple-100); }
input.num { max-width: 120px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink-2); }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-actions.sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; }

/* Pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--purple-50); color: var(--purple); }
.pill.gold { background: var(--gold-50); color: #8A6100; }
.pill.green { background: var(--green-50); color: var(--green); }
.pill.grey { background: #EEEDF2; color: var(--muted); }
.pill.blue { background: #E6EEFB; color: #1F4E9C; }

/* Auth screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--purple) 0%, #2A1257 100%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-product { color: var(--muted); font-size: 13px; margin: 2px 0 22px; }
.auth-card h1 { font-size: 21px; margin-bottom: 14px; }
.auth-links { text-align: center; margin: 16px 0 0; font-size: 14px; }
.notice { background: var(--gold-50); border: 1px solid #F6DC95; color: #6B4B00; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: var(--purple); color: #fff; display: flex; flex-direction: column;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar > .brand-mark { padding: 0 10px 20px; }
.nav-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { width: 20px; text-align: center; opacity: .9; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--purple); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.me-name { font-weight: 600; font-size: 14px; }
.me-role { font-size: 12px; opacity: .75; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { padding: 28px 32px 48px; max-width: 1200px; width: 100%; }
.main:focus { outline: none; }

/* Page pieces */
.page-head { margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 40px 24px; }
.card.empty .pill { margin-bottom: 12px; }
.card.empty p { max-width: 520px; margin: 0 auto; color: var(--ink-2); }
.error-card { border-color: #F5C2BD; background: var(--red-50); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile-value { font-size: 26px; font-weight: 700; color: var(--purple); }
.tile-label { font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--purple); }
.tab.active { color: var(--purple); border-bottom-color: var(--gold); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #FAF9FD; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table select { width: auto; min-width: 110px; }
.table .actions { white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.row-muted td { color: var(--muted); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 12, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }

/* Toasts */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .5s; font-size: 14px; }
.toast-error { background: var(--red); }
.toast.fade { opacity: 0; }

/* Phone */
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,12,40,.35); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 21px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table td.right { text-align: left; padding-top: 8px; }
}

/* =====================================================================
   Phases 2–12 additions
   ===================================================================== */
:root { --red-ink: #B42318; --warn: #8A6100; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.good { color: var(--green); font-weight: 600; }
.bad { color: var(--red); font-weight: 600; }
.warn { color: var(--warn); }
.error-text { color: var(--red); }
.lead { font-size: 17px; color: var(--ink-2); }
.small { font-size: 13px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mobile-only { display: none; }
mark { background: var(--gold-50); color: inherit; padding: 0 2px; border-radius: 3px; }
pre.email-preview { white-space: pre-wrap; background: #FAF9FD; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 13px/1.5 inherit; font-family: inherit; max-height: 300px; overflow: auto; }

/* pills */
.pill.red { background: var(--red-50); color: var(--red); }
.pill + .pill { margin-left: 4px; }
.lvl-rookie { background: #E8F1FB; color: #1D4F91; }
.lvl-pro { background: var(--purple-50); color: var(--purple); }
.lvl-veteran { background: var(--gold-50); color: #7A5600; }
.lvl-legend { background: #1F1B2D; color: var(--gold); }
.level-sum .pill { margin-right: 4px; }
.tab-badge { background: var(--gold); color: var(--purple); border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 6px; }
.code-tag { font-size: 14px; background: var(--purple-50); color: var(--purple); border-radius: 6px; padding: 2px 8px; margin-left: 10px; vertical-align: middle; }
.title-sub { font-size: 16px; font-weight: 500; }

/* page heads */
.page-head.row, .card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head-row { margin-bottom: 10px; }
.card-head-row h2 { margin: 0; }
.card-head { margin-bottom: 8px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; font-size: 14px; }
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.head-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.head-actions, .row-actions, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { margin-bottom: 14px; }
.section-title { margin: 24px 0 10px; font-size: 18px; color: var(--purple); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 180px; }
.filters.inline { margin: 0; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.inline-field input, .inline-field select { width: auto; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.month-label { min-width: 140px; text-align: center; }

/* grids */
.grid-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-cols > .card { margin-bottom: 0; }
.grid-cols + .card, .grid-cols + .grid-cols { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.form-grid .full, .field.full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 15px; color: var(--purple); margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input.check { width: 18px; height: 18px; min-height: 0; accent-color: var(--purple); }
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip-check input { width: auto; min-height: 0; accent-color: var(--purple); }
.readonly { padding: 9px 0; }
.form-actions.wrap { flex-wrap: wrap; }
.btn.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
.small-select { width: auto; min-height: 32px; font-size: 13px; padding: 4px 8px; }
.modal.wide { max-width: 860px; }
textarea { resize: vertical; }

/* kv lists */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* tables */
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: #FAF9FD; }
.grid-table td, .grid-table th { white-space: nowrap; }
.flush-inner { margin: 0 -20px -20px; }
.empty-state { padding: 20px; text-align: center; color: var(--muted); }
.score-cell { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; padding: 4px 8px; border-radius: 8px; min-width: 64px; }
/* Month score grid: each score sits centered right under its "Review #" heading */
.score-grid th, .score-grid td, .score-grid th.num, .score-grid td.num { text-align: center; }
.exp-label { font-size: 10px; }
/* Client Experience colors from the original sheet: WOW purple, Positive green, Neutral strong yellow, Negative red, Couldn't satisfy gray */
.exp-wow { background: #513092; color: #fff; }
.exp-positive { background: #2E8B57; color: #fff; }
.exp-neutral { background: #E0A800; color: #2B2000; }
.exp-negative { background: #C62828; color: #fff; }
.exp-couldnt { background: #8A8A8A; color: #fff; }
.exp-na { background: #EEEDF2; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.legend-item, .exp-chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; display: inline-block; }

/* lists */
.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contact { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.entries { display: flex; flex-direction: column; gap: 12px; }
.entry { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.link-group h3 { font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.flow-edit { padding-left: 22px; }
.flow-edit li { margin-bottom: 8px; }
.flow-edit li > * { vertical-align: top; }
.flow-edit textarea { width: calc(100% - 110px); display: inline-block; }
.flow-btns { display: inline-flex; gap: 2px; }
.flow-view { padding-left: 22px; margin: 0; }
.flow-view li { padding: 3px 0; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--purple-50); color: var(--purple); display: inline-grid; place-items: center; flex-shrink: 0; font-size: 13px; margin-right: 6px; }
.feed-title a { font-weight: 600; text-decoration: none; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip { background: var(--gold-50); border: 1px solid #F6DC95; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tile.warn .tile-value { color: var(--red); }
.tile-levels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.small-val { font-size: 22px; }
.notice.ok { background: var(--green-50); border-color: #B7E1C8; color: var(--green); }
.notice.warn-notice { background: var(--red-50); border-color: #F2B8B5; color: var(--red); }
.notice { display: block; }

/* checklist */
.stage-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.stage-block.current { border-color: var(--purple-100); box-shadow: 0 0 0 2px var(--purple-50); }
.stage-block summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.check-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #CFCADB; display: inline-grid; place-items: center; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.checklist li.done .check-mark { background: var(--green); border-color: var(--green); color: #fff; }
.check-body { flex: 1; }
.progress { height: 8px; background: var(--purple-50); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); }

/* scorecard */
.scorecard-layout { display: grid; grid-template-columns: 1fr 230px; gap: 16px; align-items: start; }
.score-aside { position: sticky; top: 76px; }
.score-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; align-items: center; margin-bottom: 10px; }
.score-panel.inline { padding: 10px 16px; }
.score-big { font-size: 40px; font-weight: 700; color: var(--purple); line-height: 1; }
.score-big span { font-size: 18px; color: var(--muted); font-weight: 600; }
.rubric-section h3 { color: var(--purple); font-size: 15px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--gold-50); }
.rubric-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.rubric-item.unrated .item-label::before { content: "•"; color: var(--gold); margin-right: 6px; font-weight: 700; }
.item-label .pts { color: var(--muted); font-size: 12px; }
.item-note { grid-column: 1 / -1; min-height: 34px; padding: 6px 10px; font-size: 14px; }
.rating-group { display: flex; gap: 4px; flex-wrap: wrap; }
.rating-opt { position: relative; }
.rating-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rating-opt span { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }
.rating-opt input:focus-visible + span { outline: 3px solid var(--gold); }
.r-yes input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.r-good input:checked + span { background: var(--gold); color: var(--purple); border-color: var(--gold); }
.r-no input:checked + span { background: var(--red); color: #fff; border-color: var(--red); }
.r-na input:checked + span { background: #6E6887; color: #fff; border-color: #6E6887; }
.review-items { list-style: none; padding: 0; margin: 0; }
.review-items li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rating-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.rating-tag.r-yes { background: var(--green-50); color: var(--green); }
.rating-tag.r-good { background: var(--gold-50); color: var(--warn); }
.rating-tag.r-no { background: var(--red-50); color: var(--red); }
.rating-tag.r-na { background: #EEEDF2; color: var(--muted); }
.summary-box { border: 2px dashed var(--purple-100); border-radius: 10px; padding: 12px 14px; margin: 8px 0; background: #FCFBFE; }
.summary-box h3 { margin: 0; font-size: 15px; }
.summary-text { white-space: pre-line; }
details.card > summary { cursor: pointer; }

/* billing / reports */
.billing-list { display: flex; flex-direction: column; gap: 4px; }
.statement-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.report-table th { white-space: nowrap; }
.assess { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.assess summary { cursor: pointer; }
.builder { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.export-btns { display: inline-flex; gap: 6px; }

/* search, inbox, messages */
.search-form { display: flex; gap: 8px; margin-bottom: 16px; max-width: 640px; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.search-results a { text-decoration: none; }
.snippet { margin-top: 4px; color: var(--ink-2); }
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.thread-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thread-list li a { display: block; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.thread-list li.active a { background: var(--purple-50); }
.thread-list li.unread strong { color: var(--purple); }
.thread-pane { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 300px; display: flex; flex-direction: column; gap: 10px; }
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.messages { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 10px 12px; border-radius: 12px; background: #F3F1F8; }
.msg.mine { align-self: flex-end; background: var(--purple); color: #fff; }
.msg.mine .msg-meta { color: rgba(255,255,255,.75); }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.composer input[type=file] { width: auto; border: 0; min-height: 0; padding: 0; }

/* top bar + bell (desktop too) */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.menu-btn { display: none; }
.quick-search { flex: 1; max-width: 420px; }
.quick-search input { min-height: 36px; padding: 6px 12px; }
.topbar-title { flex: 1; font-weight: 600; color: var(--muted); }
.bell { position: relative; margin-left: auto; }
.bell-btn { position: relative; font-size: 20px; }
.bell-count { position: absolute; top: 0; right: 2px; background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 1px 5px; }
.bell-panel { position: absolute; right: 0; top: 44px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); z-index: 45; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.bell-head > div { display: flex; gap: 6px; }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.bell-panel li.unread a { background: #FBF9FF; }
.bell-panel li.unread .n-title { font-weight: 700; }
.pref-list { list-style: none; padding: 0; margin: 0; }
.pref-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
a.me { text-decoration: none; color: inherit; }

/* portal */
.sidebar.portal { background: linear-gradient(180deg, var(--purple) 0%, #2A1257 100%); }
.portal-client { padding: 0 10px 14px; font-size: 13px; color: rgba(255,255,255,.8); }
.csr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.csr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.csr-card:hover { border-color: var(--purple-100); }
.csr-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.mini-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 0; font-size: 13px; }
.mini-stats dt { color: var(--muted); }
.mini-stats dd { margin: 0; }
.pulse-banner { text-decoration: none; font-weight: 600; margin-bottom: 14px; }
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin: 12px 0 4px; }
.nps-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 0; font-weight: 700; cursor: pointer; font: inherit; }
.nps-btn[aria-pressed=true] { background: var(--purple); color: #fff; border-color: var(--purple); }
.nps-scale { display: flex; justify-content: space-between; margin-bottom: 12px; }
.audio { width: 100%; margin: 8px 0; }
.public-wrap { min-height: 100vh; background: var(--bg); }
.public-head { background: var(--purple); color: #fff; padding: 14px 24px; display: flex; gap: 12px; align-items: center; }
.public-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }

@media (max-width: 980px) {
  .scorecard-layout { grid-template-columns: 1fr; }
  .score-aside { position: static; order: -1; }
  .inbox { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar { padding: 10px 16px; }
  .menu-btn { display: inline-block; }
  .mobile-only { display: inline-flex; }
  .quick-search { display: none; }
  .rubric-item { grid-template-columns: 1fr; }
  .flow-edit textarea { width: 100%; }
  .nps { grid-template-columns: repeat(6, 1fr); }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .flush-inner { margin: 0; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
}
a.tile { text-decoration: none; color: inherit; }
@media (max-width: 820px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 22px; }
}

/* Logo images */
.auth-logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 6px; }
.auth-card .auth-product { text-align: center; }
.side-logo { display: block; width: 100%; max-width: 190px; height: auto; margin: 2px 10px 22px; }
.top-logo { height: 30px; width: auto; }
.public-logo { height: 36px; width: auto; }
.public-title { opacity: .85; font-weight: 600; }

/* ---------- Dashboard v2: per-client overview + to-do column ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash-main, .dash-side { min-width: 0; }
.dash-side .card { padding: 16px; }
.dash-side .card-head h2 { font-size: 15px; }
.side-title { margin-top: 0; }
.todo-group { margin: 18px 0 8px; font-size: 15px; color: var(--purple); }
.todo-sub { margin: 10px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.todo-list.compact li { padding: 6px 0; }
.coach-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.coach-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--purple); border-radius: var(--radius); padding: 10px 14px; }
.coach-card.is-me { border-left-color: var(--gold); }
.coach-name { font-weight: 600; margin-bottom: 4px; }
.coach-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.coach-nums strong { color: var(--ink); }
.wf + .wf { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.wf-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.progress { height: 6px; background: var(--purple-50); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.progress-bar { height: 100%; background: var(--gold); }
.wf-steps { list-style: none; padding: 0; margin: 0; }
.wf-steps li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wf-steps li:last-child { border-bottom: 0; }
.wf-check { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); align-items: center; justify-content: center; font-size: 13px; flex: none; }
.wf-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.wf-step-main { display: flex; gap: 10px; align-items: flex-start; }
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
.dash-main .table td, .dash-main .table th { padding-left: 8px; padding-right: 8px; }
.dash-main .tile-levels { flex-wrap: nowrap; }
.dash-main .tile-levels .pill { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.coach-group + .coach-group { margin-top: 18px; }
.coach-group-title { margin: 4px 0 8px; font-size: 15px; color: var(--purple); }
/* Dashboard: wider left side, one-line cells */
.dash-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.dash-main .table th, .dash-main .table td { white-space: nowrap; }
.dash-main .table { font-size: 14px; }
@media (max-width: 1250px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.main:has(.dash-grid) { max-width: 1600px; }
.dash-grid { grid-template-columns: minmax(0, 1fr) 280px; }
.dash-main .card { padding: 16px; }
.dash-main .table td, .dash-main .table th { padding-left: 6px; padding-right: 6px; }
.dash-main .table th { letter-spacing: .02em; }
@media (max-width: 1399px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.prewrap { white-space: pre-wrap; }
.kv.culture { grid-template-columns: 200px 1fr; }
/* Contacts: who-gets-what toggles */
.send-col { text-align: center; }
.send-toggle { min-width: 44px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer; }
.send-toggle.to { background: var(--purple); border-color: var(--purple); color: #fff; }
.send-toggle.cc { background: var(--gold-50); border-color: var(--gold); color: #6B4B00; }
.send-toggle:hover { border-color: var(--purple); }
.flush-inner .table td .nowrap, td .nowrap { white-space: nowrap; }
/* CSR retention strip */
.retention { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 4px 0 8px; }
.ret-stat { background: #FAF9FD; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: left; font: inherit; color: inherit; }
button.ret-stat { cursor: pointer; }
button.ret-stat:hover, .ret-stat.active { border-color: var(--purple); background: var(--purple-50); }
.ret-value { font-size: 22px; font-weight: 700; color: var(--purple); }
.ret-stat.in .ret-value { color: var(--green); }
.ret-stat.out .ret-value { color: var(--red); }
.ret-label { font-size: 12px; color: var(--muted); }
@media (max-width: 820px) { .retention { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Wider pages so wide tables aren't cut off */
.main { max-width: 1600px; }
.btn.icon-only { min-width: 32px; padding: 4px 8px; }
.flush-inner .table td.send-col, .flush-inner .table th.send-col { padding-left: 4px; padding-right: 4px; }
.flush-inner .table td, .flush-inner .table th { padding-left: 10px; padding-right: 10px; }
.flush-inner .table { font-size: 13.5px; }
.flush-inner .table th { white-space: nowrap; letter-spacing: .02em; }
.send-toggle { min-width: 34px; padding: 3px 6px; }
@media (max-width: 1399px) {
  .flush-inner .table td, .flush-inner .table th { padding-left: 6px; padding-right: 6px; }
  .flush-inner .table td.send-col, .flush-inner .table th.send-col { padding-left: 2px; padding-right: 2px; }
}
/* Client FMS */
.fms-kv dd.secret-dd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.mfa-qr { display: block; max-width: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; margin: 8px 0; }
.qr-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; min-height: 60px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qr-drop:focus { outline: 3px solid var(--gold); border-color: var(--purple); }
/* Call flow document */
.cf-section { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; background: #fff; }
.cf-section-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.cf-heading { font-weight: 700; color: var(--purple); font-size: 16px; }
.cf-body { width: 100%; font-size: 14px; line-height: 1.5; }
.cf-view h4 { color: var(--purple); margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--gold); display: inline-block; }
.cf-view > div:first-child h4 { margin-top: 0; }
.cf-view .prewrap { line-height: 1.55; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--purple); text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
label.btn { cursor: pointer; }
a.btn { text-decoration: none; }
.row-actions.nowrap { flex-wrap: nowrap; }
.row-actions.nowrap input { flex: 1; min-width: 0; }
/* Phase colors (from the original scorecard spreadsheet) */
.tint-peach { --phase: #F6B092; --phase-bg: #FCEADF; --phase-ink: #8A3E1C; }
.tint-blue  { --phase: #86A2D9; --phase-bg: #DEE6F6; --phase-ink: #263E80; }
.tint-green { --phase: #A3D084; --phase-bg: #E6F2DE; --phase-ink: #306024; }
.tint-pink  { --phase: #FDAAAA; --phase-bg: #FEEBEB; --phase-ink: #8C2828; }
.tint-gray  { --phase: #A5A5A5; --phase-bg: #F2F2F2; --phase-ink: #464646; }
.tint-none  { --phase: var(--line); --phase-bg: #FAF9FD; --phase-ink: var(--purple); }
/* Scorecard: color strip on the left of each section, like the spreadsheet */
.rubric-section[class*="tint-"] { border-left: 6px solid var(--phase); padding-left: 12px; }
.rubric-section[class*="tint-"] > h3 { color: var(--phase-ink); }
.card[class*="tint-"] { border-left: 6px solid var(--phase); }
.card[class*="tint-"] .card-head h2 { color: var(--phase-ink); }
/* Call flow: tinted boxes with the same strip */
.cf-section[class*="tint-"] { background: var(--phase-bg); border-left: 6px solid var(--phase); }
.cf-section[class*="tint-"] .cf-heading { color: var(--phase-ink); background: rgba(255,255,255,.7); }
.cf-section[class*="tint-"] .cf-body { background: #fff; }
.cf-box { background: var(--phase-bg); border-left: 6px solid var(--phase); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
.cf-box h4 { color: var(--phase-ink); border-bottom: 0; margin: 0 0 6px; padding: 0; }
.cf-color { max-width: 230px; }
.fit-badge { padding: 4px 10px; border-radius: 999px; font-weight: 600; background: #F2F1F6; color: var(--muted); }
.fit-badge.ok { background: var(--green-50); color: var(--green); }
.fit-badge.warn { background: var(--gold-50); color: #6B4B00; }
.fit-badge.bad { background: #FDECEC; color: var(--red); }
.cf-notes { width: 100%; background: #FFFDF6; border-style: dashed; line-height: 1.5; }
.cf-heading.locked { flex: 1; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,.7); }
.cf-doc-title { margin: 0 0 4px; color: var(--ink); }
/* Call flow kind tabs (Phase 1 / Time / Price) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.seg-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.seg-btn:hover { border-color: var(--purple-100); background: var(--purple-50); }
.seg-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.seg-status { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: rgba(0,0,0,.06); }
.seg-btn.active .seg-status { background: rgba(255,255,255,.2); }
.seg-status.approved { color: var(--green); } .seg-btn.active .seg-status.approved { color: #CFF3DD; }
.seg-status.sent { color: #8A6100; } .seg-btn.active .seg-status.sent { color: #FFE7A8; }
/* Linked (from Phase 1) sections in PRO call flows */
.link-pill { background: #fff; color: var(--ink-2); font-weight: 600; }
.cf-linked { background: rgba(255,255,255,.75); border: 1px dashed rgba(0,0,0,.12); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.cf-after-label { display: block; font-size: 12px; font-weight: 600; color: var(--phase-ink, var(--muted)); margin: 10px 0 4px; }
.cf-value { margin-top: 10px; background: #fff; border: 2px solid var(--phase, var(--gold)); border-radius: 8px; padding: 10px 12px; }
.cf-value-label { font-weight: 700; color: var(--phase-ink, var(--purple)); margin-bottom: 6px; }
/* Form extras: ⓘ notes, radios, repeat rows, notes */
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--purple); background: #fff; color: var(--purple); font: italic 700 11px Georgia, serif; cursor: pointer; vertical-align: 1px; padding: 0; margin-left: 4px; }
.info-btn[aria-expanded="true"] { background: var(--purple); color: #fff; }
.info-note { background: var(--purple-50); border-left: 3px solid var(--purple); border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--ink-2); margin: 2px 0 8px; line-height: 1.45; }
.radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check:has(input:checked) { border-color: var(--purple); background: var(--purple-50); color: var(--purple); font-weight: 600; }
.form-note { border-radius: 8px; padding: 10px 14px; font-size: 14px; line-height: 1.5; margin: 4px 0 8px; }
.form-note.soft { background: #F6F4FB; color: var(--ink-2); }
.form-note.callout { background: var(--gold-50); border: 1px solid #F6DC95; color: #5C4100; font-weight: 600; }
.repeat-list { display: grid; gap: 10px; margin-bottom: 8px; }
.repeat-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FCFBFE; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; color: var(--purple); }
.repeat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.repeat-grid .full { grid-column: 1 / -1; }
.repeat-grid .field { margin-bottom: 6px; }
/* Public onboarding: sticky progress + section jump links */
.ob-sticky { position: sticky; top: 0; z-index: 5; background: var(--bg, #F7F6FB); padding: 8px 0 10px; margin-bottom: 10px; }
.ob-progress { height: 8px; background: var(--purple-50); border-radius: 999px; overflow: hidden; }
.ob-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--gold)); transition: width .3s; }
.ob-progress-pct { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ob-nav { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.form-section { scroll-margin-top: 110px; }
/* CRM: ask on the call */
.ask-call { background: var(--gold-50); border: 1px solid #F6DC95; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.ask-call summary { cursor: pointer; }
.ask-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; margin-top: 8px; }
.ask-groups h4 { margin: 8px 0 2px; font-size: 13px; color: #5C4100; }
.ask-groups ul { margin: 0; padding-left: 18px; font-size: 13px; }
.file-list { list-style: none; padding: 0; margin: 0 0 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.repeat-checks { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 2px 0 4px; }
.repeat-checks .chip-check { white-space: nowrap; }
.repeat.compact .repeat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.repeat-checks { align-items: center; }
.repeat-checks .chip-check { font-size: 12.5px; padding: 3px 9px; }
.repeat-checks > span.muted { flex-basis: 100%; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: -2px; }
/* Monthly metrics grid */
.metrics-grid input { max-width: 150px; }
.metrics-grid td { vertical-align: middle; }
.company-only { margin-top: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
.company-only summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.baseline-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 820px) { .baseline-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report-table .base-date { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.modal .form-section { margin: 10px 0 2px; font-size: 14px; }
/* ---------- Redesigned Monthly Progress Report (preview) ---------- */
.rv { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); max-width: 1000px; }
.rv-head { background: linear-gradient(120deg, var(--purple) 0%, #5B2CA8 100%); color: #fff; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 4px solid var(--gold); }
.rv-logo { height: 40px; }
.rv-head-text { text-align: right; }
.rv-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--gold); font-weight: 700; }
.rv-head h1 { margin: 2px 0; font-size: 26px; color: #fff; }
.rv-sub { font-size: 14px; opacity: .9; }
.rv-body { padding: 22px 28px 10px; }
.rv-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.rv-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-top: 5px solid #D9D5E6; background: #FCFBFE; }
.rv-card.good { border-top-color: var(--green); }
.rv-card.bad { border-top-color: #E0884A; }
.rv-card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.rv-card-value { font-size: 30px; font-weight: 800; color: var(--purple); margin: 4px 0 2px; }
.rv-card.na .rv-card-value { color: #B4AFC4; }
.rv-card-goal { font-size: 13px; font-weight: 600; }
.rv-card.good .rv-card-goal { color: var(--green); }
.rv-card.bad .rv-card-goal { color: #B5541C; }
.rv-card-delta { font-size: 12px; margin-top: 6px; font-weight: 600; }
.rv-card-delta.good { color: var(--green); } .rv-card-delta.bad { color: #B5541C; } .rv-card-delta.flat { color: var(--muted); }
.rv-section { margin-bottom: 24px; }
.rv-section h2 { font-size: 17px; color: var(--purple); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); display: inline-block; }
.rv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.rv-table th, .rv-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.rv-table thead th { background: var(--purple); color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.rv-table thead th:first-child { border-top-left-radius: 8px; } .rv-table thead th:last-child { border-top-right-radius: 8px; }
.rv-table .num { text-align: right; white-space: nowrap; }
.rv-table tbody th { font-weight: 600; color: var(--ink); }
.rv-table td.base { background: #F6F4FB; }
.rv-asof { display: block; font-size: 11px; color: var(--muted); }
.rv-table .cell-good { background: #E8F5EE; color: #1A6B43; font-weight: 600; }
.rv-table .cell-bad { background: #FDF0E7; color: #A34A16; font-weight: 600; }
.rv-table .cell-na { color: #A9A4B8; }
.rv-group td { background: #F3F0FA; padding: 6px 12px; }
.rv-legend { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rv-legend .chip { font-size: 11px; padding: 2px 10px; border-radius: 999px; }
.rv-legend .good { background: #E8F5EE; color: #1A6B43; } .rv-legend .bad { background: #FDF0E7; color: #A34A16; } .rv-legend .na { background: #F2F1F6; color: var(--muted); }
.rv-note { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.rv-highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rv-hl { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FFFCF2; }
.rv-hl.badge { background: #F6F2FD; }
.rv-hl-icon { font-size: 20px; line-height: 1; }
.rv-quote { font-style: italic; color: var(--ink-2); margin-top: 4px; font-size: 13px; }
.rv-assess { display: grid; gap: 12px; }
.rv-acard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; break-inside: avoid; }
.rv-acard-head { margin-bottom: 8px; }
.rv-apart { border-left: 4px solid var(--line); padding: 4px 10px; margin: 6px 0; font-size: 14px; }
.rv-apart.t-good { border-color: var(--green); } .rv-apart.t-gold { border-color: var(--gold); } .rv-apart.t-bad { border-color: #D64545; } .rv-apart.t-purple { border-color: var(--purple); }
.rv-apart-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); }
.rv-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 16px; border-top: 1px solid var(--line); }
.preview-banner { background: var(--gold-50); border: 1px solid #F6DC95; color: #5C4100; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 820px) { .rv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rv-head { flex-direction: column; align-items: flex-start; } .rv-head-text { text-align: left; } }
@media print {
  body.printing-report .sidebar, body.printing-report .topbar, body.printing-report .page-head, body.printing-report .tabs, body.printing-report .filters, body.printing-report .toolbar, body.printing-report .preview-banner { display: none !important; }
  body.printing-report .main { padding: 0 !important; max-width: none !important; }
  body.printing-report .rv { border: 0; box-shadow: none; max-width: none; }
  .rv-head, .rv-table thead th, .rv-card, .rv-table td, .rv-group td, .rv-hl, .rv-legend .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rv-section, .rv-cards { break-inside: avoid; }
}
/* Current month stands out in the company metrics table */
.rv-table thead th.cur { background: var(--gold); color: #3B2600; }
.rv-cur-tag { display: block; font-size: 9px; letter-spacing: .08em; font-weight: 700; opacity: .85; }
.rv-table td.cur { font-size: 16px; font-weight: 800; border-left: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.rv-table tbody tr:last-child td.cur { border-bottom: 2px solid var(--gold); }
/* ---------- Official full-color logo on white, with the Pulse Gradient ---------- */
.side-logo-plate { background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0 2px 20px; box-shadow: 0 2px 10px rgba(0,0,0,.12); position: relative; overflow: hidden; }
.side-logo-plate::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--pulse); }
.side-logo-plate .side-logo { margin: 0 auto; max-width: 180px; }
.public-head { background: #fff !important; color: var(--purple) !important; border-bottom: 0; position: relative; box-shadow: 0 1px 3px rgba(31,27,45,.06); }
.public-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--pulse); }
.public-head .public-title { color: var(--purple); opacity: 1; }
.public-logo { height: 40px; }
.rv-head { background: #fff !important; color: var(--ink) !important; border-bottom: 0 !important; position: relative; padding-bottom: 26px !important; }
.rv-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--pulse); }
.rv-head h1 { color: var(--purple) !important; }
.rv-head .rv-kicker { color: #B88A0B; }
.rv-head .rv-sub { color: var(--ink-2); opacity: 1; }
.rv-logo { height: 52px; }
.cf-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 3px solid transparent; border-image: var(--pulse) 1; }
.cf-brand img { height: 36px; }
.cf-brand .cf-brand-title { text-align: right; color: var(--purple); font-weight: 700; }
.cf-brand .cf-brand-title span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
@media print { .side-logo-plate::after, .public-head::after, .rv-head::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- Data reports + archive ---------- */
.dr-controls, .dr-toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.dr-field { min-width: 150px; flex: 0 1 220px; margin: 0; }
.dr-field select, .dr-field input { width: 100%; }
.dr-desc { flex-basis: 100%; margin: 2px 0 0; }
.dr-cols { margin: 12px 0 4px; }
.dr-cols summary { cursor: pointer; font-weight: 600; color: var(--purple); }
.dr-col-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dr-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0; }
.dr-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.dr-table th.sortable:hover { color: var(--purple); }
.dr-table tfoot td { font-weight: 700; background: var(--gold-50); border-top: 2px solid var(--gold); }
.dr-table tr.clickable { cursor: pointer; }
.dr-saved-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dr-saved .chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--purple-100); background: var(--purple-50); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; }
.dr-saved .chip a { color: var(--purple); font-weight: 600; text-decoration: none; }
.chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.chip-x:hover { color: var(--red); }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-list > li { border-left: 3px solid var(--purple-100); padding: 6px 0 10px 12px; margin-bottom: 6px; }
.hist-list .hist-head { font-weight: 600; }
.hist-list table { font-size: 13px; margin-top: 4px; }
.hist-list td { padding: 2px 8px 2px 0; vertical-align: top; }
.hist-from { color: var(--red-ink); text-decoration: line-through; }
.hist-to { color: var(--green); }
@media (max-width: 640px) { .dr-field { flex: 1 1 100%; } }

/* ---------- Pricing plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.plan-table td:first-child { white-space: nowrap; font-weight: 600; }
.plan-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 10px; }
.plan-edit-col h4 { margin: 0 0 6px; font-size: 13px; color: var(--purple); }
.plan-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; margin-bottom: 8px; }
.plan-pick .field { margin: 0; min-width: 200px; }
.fallback-rates { padding: 12px 16px; }
.fallback-rates summary { cursor: pointer; font-weight: 600; color: var(--muted); }

/* ---------- Call reviews by month (CSR Scorecards tab) ---------- */
.score-months { display: flex; flex-direction: column; gap: 8px; }
.score-month { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.score-month[open] { border-color: var(--purple-100); }
.score-month > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; cursor: pointer; list-style: none; }
.score-month > summary::-webkit-details-marker { display: none; }
.score-month > summary::before { content: "▸"; color: var(--purple); transition: transform .15s; }
.score-month[open] > summary::before { transform: rotate(90deg); }
.score-month-name { font-weight: 700; min-width: 120px; }
.score-month-scores { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.score-chip { display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.score-month-avg { margin-left: auto; white-space: nowrap; }
.score-month > .table-wrap { margin: 0 14px 10px; }
.score-month > .table-wrap + .table-wrap { margin-top: 0; }
@media (max-width: 640px) { .score-month-avg { margin-left: 0; } }
.tile-current { outline: 2px solid var(--purple); background: var(--purple-50); }
.bday-now strong { color: var(--purple); }

/* ---------- Coaching tracker (CSR Overview) ---------- */
.trk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trk-head h2 { margin-right: 6px; }
.trk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.trk-col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.trk-list { list-style: none; margin: 0; padding: 0; }
.trk-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.trk-row:last-child { border-bottom: 0; }
.trk-row a { font-weight: 600; text-decoration: none; color: var(--ink); }
.trk-row a:hover { color: var(--purple); }
.trk-icon { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.trk-icon.ok { background: var(--green-50); color: var(--green); }
.trk-icon.bad { background: var(--red-50); color: var(--red-ink); }
.trk-icon.warn { background: var(--gold-50); color: var(--warn); }
.trk-icon.todo { border: 1.5px dashed var(--muted); color: var(--muted); }
.month-status { white-space: nowrap; font-size: 13px; }
.month-status .ok { color: var(--green); font-weight: 700; }
.trk-nav { min-width: 30px; padding: 2px 8px; font-size: 16px; line-height: 1; }
.publish-email { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-weight: 600; }
.publish-email input { width: auto; min-height: 0; margin: 0; accent-color: var(--purple); }
.warn-notice { background: var(--gold-50); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.hist-link { font-size: 12px; font-weight: 600; white-space: nowrap; margin-left: 4px; }
th.metric-focus, td.metric-focus, tr.metric-focus > * { background: var(--purple-50); }
th.metric-focus { color: var(--purple); }
.carry-over { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.check-mark.in-progress { color: var(--warn); }
.field[hidden], .field.full[hidden] { display: none !important; }

/* ---------- Open notes tray + drafts ---------- */
.note-tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: var(--card); border-top: 2px solid var(--purple); box-shadow: 0 -4px 14px rgba(31, 27, 45, .08); overflow-x: auto; }
.note-tray[hidden] { display: none; }
body.has-note-tray .main { padding-bottom: 72px; }
.note-tray-label { white-space: nowrap; color: var(--purple); font-size: 13px; }
.note-tray-items { display: flex; gap: 8px; }
.note-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--purple-100); background: var(--purple-50);
  border-radius: 10px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.note-chip:hover { border-color: var(--purple); }
.note-chip-meta { font-size: 11px; font-weight: 500; color: var(--muted); }
.note-chip.late { background: var(--gold-50); border-color: var(--gold); }
.note-chip.old { background: var(--red-50); border-color: var(--red); }
.draft-state { margin-right: auto; }
.draft-state.warn { color: var(--red-ink); }
.draft-help { background: var(--purple-50); border-radius: 8px; padding: 8px 12px; }
.modal-overlay { z-index: 60; }
@media (max-width: 640px) { .note-tray { padding: 6px 10px; } .note-tray-label { display: none; } }
@media (min-width: 821px) { .note-tray { left: var(--sidebar); } }

/* ---------- Coaching notes grouped by level ---------- */
.notes-by-level { display: flex; flex-direction: column; gap: 10px; }
.level-notes { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.level-notes > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none; }
.level-notes > summary::-webkit-details-marker { display: none; }
.level-notes > summary::before { content: "▸"; color: var(--purple); transition: transform .15s; }
.level-notes[open] > summary::before { transform: rotate(90deg); }
.level-notes > .entries { padding: 0 16px 14px; }
.level-notes.current { border-color: var(--purple-100); }

/* ---------- One-line coaching notes ---------- */
.note-lines td { vertical-align: middle; }
.note-lines .goal-cell { max-width: 320px; }
.goal-tip { position: relative; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; cursor: help; border-bottom: 1px dotted var(--muted); }
.goal-cell { overflow: visible; }
.level-notes > .table-wrap { padding: 0 16px 14px; }
/* Floating hover text (drawn on top of the page so table/box edges never clip it) */
.float-tip { position: fixed; z-index: 1000; max-width: 360px; white-space: normal; background: var(--ink); color: #fff; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; line-height: 1.45; box-shadow: 0 6px 18px rgba(0,0,0,.2); pointer-events: none; }
.group-goals:empty { display: none; }
.group-goals { border: 1px solid var(--purple-100); background: var(--purple-50); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 12px; }
.group-goals h3 { margin: 0 0 4px; font-size: 15px; }
.group-goal { margin-top: 10px; }
.group-goal textarea { width: 100%; margin-top: 4px; }
.form-grid > .group-goals { grid-column: 1 / -1; }

/* ---------- Training calls ---------- */
.new-call-btn { margin-top: 6px; }
.training-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.training-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.training-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.training-head h3 { margin: 0; font-size: 16px; }
.training-desc { margin: 0; color: var(--ink-2); font-size: 14px; }
.training-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { border: 1px solid var(--purple-100); background: var(--purple-50); color: var(--purple); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.training-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; }
.inline-audio { width: 100%; max-width: 320px; height: 36px; }
.play-wrap { display: inline-flex; }
.call-code-box { margin: 4px 0 12px; }
.call-code-box .call-code { font-size: 16px; color: var(--purple); }
.call-code-box .check-field { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.call-code-box .check-field input { width: auto; min-height: 0; }
.call-code-box .field-hint { flex-basis: 100%; margin-left: 22px; }
.csr-code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; color: var(--purple); background: var(--purple-50); border: 1px solid var(--purple-100); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.csr-code.big { font-size: 14px; padding: 2px 8px; }

/* ---------- Scorecard: compact call section ---------- */
.call-section { display: flex; flex-direction: column; gap: 10px; }
.call-row { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: start; }
.call-row-label { font-weight: 700; padding-top: 7px; font-size: 13px; }
.call-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.call-row.needs .call-row-label { color: var(--red-ink); }
.call-row.needs .call-row-label::after { content: " *"; }
.call-row.needs input[type=text] { border-color: var(--red); }
.call-row.needs .seg-btn { border-color: var(--red); }
.call-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.call-pick select { width: auto; min-width: 180px; }
.call-summary { font-size: 13px; color: var(--muted); }
.call-summary a.missing { color: var(--red-ink); font-weight: 600; }
.call-details-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.call-details-edit[hidden] { display: none; }
.call-details-edit input, .call-details-edit select { width: auto; }
.call-details-edit label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; min-width: 40px; }
.seg-btn:hover { border-color: var(--purple); }
.seg-btn.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.tier-desc { max-width: 380px; }
.call-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.goal-line textarea { width: 100%; margin-top: 4px; }
.review-details summary { cursor: pointer; color: var(--muted); }
.review-details .call-details-edit { margin-top: 6px; }
@media (max-width: 640px) { .call-row { grid-template-columns: 1fr; gap: 4px; } .call-row-label { padding-top: 0; } }
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.review-id-tag { display: flex; flex-direction: column; align-items: flex-end; background: var(--purple-50); border: 1px solid var(--purple-100); border-radius: 10px; padding: 6px 12px; }
.review-id-tag .review-id-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.review-id-tag strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; color: var(--purple); }
@media (max-width: 640px) { .head-right { align-items: flex-start; } .review-id-tag { align-items: flex-start; } }
.rubric-item.locked { opacity: .65; }
.rubric-item.locked .item-label { font-weight: 500; }

/* Scorecard side panel: call flow button + client scoring notes */
.client-notes { margin-top: 12px; padding: 12px 14px; }
.client-notes h3 { font-size: 14px; margin: 12px 0 6px; }
.client-notes .btn.block { width: 100%; justify-content: center; }
.client-notes-list { list-style: none; margin: 0; padding: 0; max-height: 42vh; overflow-y: auto; }
.client-notes-list li { padding: 7px 0; border-top: 1px solid var(--line); }
.client-notes-list li:first-child { border-top: 0; }
.client-notes-list .prewrap { margin-top: 3px; color: var(--ink-2, inherit); }

/* Portal: level-up banner */
.notice.levelup { border-color: var(--gold, #F3C131); background: #FFF8E1; }
.levelup-title { font-weight: 700; font-size: 16px; color: var(--purple); margin-bottom: 2px; }
.notice.levelup .btn { margin-top: 4px; }

/* Progression email: schedule table + call flow attachments */
.sched-table td, .sched-table th { padding: 4px 6px; }
.sched-table select { max-width: 100%; }
.sched-preview { background: var(--bg, #F7F6FA); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: 13px/1.5 inherit; white-space: pre-wrap; margin: 8px 0 0; }
.attach-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* "Ready to send" — designed email preview + steps */
.steps-list { margin: 8px 0 4px; padding-left: 20px; }
.steps-list li { margin: 3px 0; }
.email-design-preview summary { cursor: pointer; color: var(--purple); font-weight: 600; margin: 6px 0; }
.email-design-frame { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; max-height: 50vh; overflow: auto; }
.email-design-frame table { max-width: 100%; }

/* Settings → Email design */
.email-design-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .email-design-grid { grid-template-columns: 1fr; } }
.email-design-frame.big { max-height: none; background: #F4F4F6; padding: 14px; }
.email-logo-thumb { max-width: 160px; max-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.email-design-grid input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.email-design-grid .form-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.email-design-grid .form-grid .field.full { grid-column: 1 / -1; }
.email-design-frame.big img { max-width: 100%; }

/* Settings → Email design: quick guide */
.help-box { border: 1px solid var(--purple-100, #E4DDF4); background: #F8F5FD; border-radius: var(--radius, 10px); padding: 10px 14px; margin: 0 0 14px; }
.help-box summary { cursor: pointer; font-weight: 700; color: var(--purple); }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-top: 8px; }
@media (max-width: 900px) { .help-cols { grid-template-columns: 1fr; } }
.help-box h4 { margin: 10px 0 4px; font-size: 14px; }
.help-box ol { margin: 0 0 6px; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.help-box li { margin: 3px 0; }

/* CSR metric history: each number sits centred under its column title */
.metric-table th.num, .metric-table td.num, .metric-cols th.num, .metric-cols td.num { text-align: center; }

/* Client → By CSR grid: scrolls sideways once months pile up; CSR names stay pinned */
.csr-grid .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--card, #fff); white-space: nowrap; box-shadow: 1px 0 0 var(--line); }
.csr-grid th.num, .csr-grid td.num { min-width: 92px; }

/* Getting around: Back, Recent, breadcrumbs */
.nav-controls { display: flex; align-items: center; gap: 6px; }
.recent-wrap { position: relative; }
.recent-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 280px; max-width: 360px; background: var(--card, #fff);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(31, 27, 45, .14); padding: 6px; }
.recent-item { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "kind label" "kind sub"; column-gap: 8px; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: inherit; }
.recent-item:hover, .recent-item:focus { background: var(--purple-50, #F3EFFA); }
.recent-kind { grid-area: kind; align-self: center; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--purple); background: var(--purple-50, #F3EFFA); border-radius: 4px; padding: 2px 5px; }
.recent-label { grid-area: label; font-weight: 600; }
.recent-sub { grid-area: sub; font-size: 12px; color: var(--muted); }
.recent-empty { padding: 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin: 0 0 10px; color: var(--muted); }
.crumbs a { color: var(--purple); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); }
.crumb-current { color: var(--ink, #1F1B2D); font-weight: 600; }
@media (max-width: 640px) { .nav-controls .nav-back { display: none; } }

/* Client submissions: where each one went */
.outcome-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.outcome-tags a.pill { text-decoration: none; }
.sub-actions { flex-wrap: wrap; }

/* CSR timeline grouped by month */
.tl-month { border: 1px solid var(--line); border-radius: var(--radius, 10px); margin: 0 0 10px; background: var(--card, #fff); }
.tl-month > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 9px 14px; cursor: pointer; list-style: none; background: #F7F5FC; border-radius: var(--radius, 10px); }
.tl-month[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius, 10px) var(--radius, 10px) 0 0; }
.tl-month > summary::-webkit-details-marker { display: none; }
.tl-month > summary::before { content: "▸"; color: var(--purple); transition: transform .15s; }
.tl-month[open] > summary::before { transform: rotate(90deg); }
.tl-month-name { font-weight: 700; }
.tl-month .feed { margin: 0; padding: 6px 14px 10px; }

/* Client → CSRs grouped by coach */
.coach-group + .coach-group { margin-top: 6px; }
.coach-group-head { padding: 8px 14px; background: #F7F5FC; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Portal pulse: 3 quick questions */
.pulse-q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pulse-q:last-of-type { border-bottom: 0; }
.pulse-q-text { font-weight: 600; margin: 0 0 8px; }
.pulse-q-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 12px; margin-right: 8px; }
.nps-btn.wide { min-width: 96px; padding: 8px 14px; }
.nps.nps-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 360px; }
.pulse-q textarea { width: 100%; }
.pulse-list > li { padding: 6px 0; border-top: 1px solid var(--line); }
.pulse-list > li:first-child { border-top: 0; }
.pulse-answer.flagged { border-left: 3px solid var(--red); padding-left: 8px; }
.pulse-comment { margin-top: 3px; font-style: italic; }

/* Portal → Book & share */
.fb-row { display: flex; gap: 16px; align-items: flex-start; }
.fb-icon { font-size: 28px; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; background: #F3EFFA; border-radius: 12px; flex: none; }
.fb-body { flex: 1; min-width: 0; }
.fb-body h2 { margin: 0 0 4px; font-size: 18px; }
.fb-body textarea, .fb-body input[type=text] { width: 100%; }
.fb-stars { display: flex; gap: 4px; }
.fb-star { font-size: 26px; line-height: 1; background: none; border: 0; color: #D7D2E4; cursor: pointer; padding: 2px; }
.fb-star.on, .fb-star:hover { color: #F3C131; }
.fb-share { margin: 6px 0; }
.fb-sent li { padding: 8px 0; border-top: 1px solid var(--line); }
.fb-sent li:first-child { border-top: 0; }

/* Reports → Kudos & testimonials */
.kudos-quote { margin: 8px 0 6px; padding: 8px 12px; border-left: 3px solid var(--gold, #F3C131); background: #FFFBEF; border-radius: 6px; white-space: pre-wrap; }
.kudos-stars { color: #F3C131; letter-spacing: 1px; }

/* Admin "View portal as…" preview */
.preview-bar { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--purple, #513092); color: #fff; font-size: 13.5px; }
.preview-bar .btn { background: #fff; color: var(--purple, #513092); border-color: #fff; }
body.portal-preview .sidebar-foot .btn, body.portal-preview .topbar .bell-wrap, body.portal-preview .topbar .bell { display: none; }

/* Portal home: CSRs as rows */
.portal-csr-table td.num, .portal-csr-table th.num { text-align: center; }
.portal-csr-table td { vertical-align: middle; }
.portal-csr-table td:first-child strong { white-space: nowrap; }
.tile-sub { font-size: 12px; margin-top: 2px; }
.session-rows td { vertical-align: middle; }
.session-summary td { background: #FAF8FE; }
.portal-csr-table .goal-cell { max-width: 220px; }
.portal-csr-table td a { text-decoration: none; }
.tiles a.tile { text-decoration: none; color: inherit; }

/* Team progress (CRM client → Progression, portal → Team progress) */
.tp-pipeline { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.tp-col { background: #F7F5FC; border-radius: 10px; padding: 8px; min-width: 150px; }
.tp-col-head { padding: 2px 4px 8px; }
.tp-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; }
.tp-card.behind { border-left: 3px solid var(--red); }
.tp-card .pill { font-size: 10px; }
.tp-empty { padding: 4px; }
.tp-bar { height: 6px; background: #E6E1F2; border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.tp-bar-fill { height: 100%; background: var(--purple); border-radius: 3px; }
.tp-bar-fill.full { background: var(--green, #2E8B57); }
.tp-grid th.tp-item-head { font-size: 11px; max-width: 110px; white-space: normal; line-height: 1.25; vertical-align: bottom; text-align: center; }
.tp-cell { text-align: center; }
.tp-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 14px; line-height: 1; }
.tp-mark.done { background: #E4F4EA; color: #1F7A3D; }
.tp-mark.partial { background: #FDF1D2; color: #9A6000; }
.tp-mark.todo { background: #F1EFF5; color: #9A94AD; }
button.tp-toggle { border: 1px dashed var(--purple-100, #D6CCEE); cursor: pointer; }
button.tp-toggle:hover { border-color: var(--purple); }
.tp-grid .sticky-col { position: sticky; left: 0; background: var(--card, #fff); z-index: 1; white-space: nowrap; }
.tp-promos li { padding: 5px 0; border-top: 1px solid var(--line); }
.tp-promos li:first-child { border-top: 0; }

/* Portal: coaching session details */
.session-rows.clickable tbody tr { cursor: pointer; }
.session-rows.clickable tbody tr:hover { background: #FAF8FE; }
.link-ish { color: var(--purple); font-weight: 600; font-size: 13px; }
.sd-head { margin-bottom: 12px; }
.sd-row { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.sd-label { font-weight: 600; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .sd-row { grid-template-columns: 1fr; } }
/* Portal billing: autopay */
/* Services on hold (payment 30+ days late) */
.notice.hold-notice { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--red-50); border: 2px solid var(--red); color: var(--red); }
.notice.hold-notice div div { color: var(--text, #1f1a2e); margin-top: 2px; }
.notice.hold-notice .btn { white-space: nowrap; flex: none; }
.autopay-q { font-weight: 600; font-size: 14px; margin: 14px 0 8px; }
.autopay-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .autopay-choices { grid-template-columns: 1fr; } }
.autopay-choice { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border, #E3DFEA); border-radius: 10px;
  background: var(--card, #fff); cursor: pointer; font: inherit; color: inherit; }
.autopay-choice:hover { border-color: var(--purple, #513092); }
.autopay-choice.on { border-color: var(--purple, #513092); background: var(--purple-50, #F3EEFB); box-shadow: 0 0 0 1px var(--purple, #513092) inset; }
.autopay-choice-dot { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid #B9B2C8; background: #fff; }
.autopay-choice.on .autopay-choice-dot { border-color: var(--purple, #513092); box-shadow: inset 0 0 0 3px #fff; background: var(--purple, #513092); }
.autopay-choice-sub { display: block; margin-top: 2px; line-height: 1.4; }
.autopay-consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; background: var(--purple-50, #F3EEFB); border-radius: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.autopay-consent input.check { flex: none; margin-top: 2px; width: 16px; height: 16px; }
.autopay-choices + p { margin-top: 10px; }
/* EnCore — the team's internal name for the CRM (clients only ever see EnPointe) */
.side-logo-plate .app-name { text-align: center; font-weight: 800; letter-spacing: .03em; font-size: 14px; color: var(--purple, #513092); margin-top: 6px; }
.top-app-name { font-weight: 800; letter-spacing: .03em; font-size: 13px; color: var(--purple, #513092); align-self: center; }
