/* ==========================================================================
   NOS CRM — design system (§3)
   ========================================================================== */
:root {
  --ink: #16151b;
  --paper: #f5f4f8;
  --violet-deep: #33066b;
  --violet: #5a2f9e;
  --blue-mid: #3d6ea0;
  --teal: #2aa7a4;
  --slate: #807d8c;
  --slate-light: #bcb9c6;
  --border: #e6e3ee;
  --good: #2aa768;
  --warn: #c8862b;
  --danger: #c94b4b;
  --white: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(22,21,27,.06), 0 1px 3px rgba(22,21,27,.04);
  --shadow: 0 4px 16px rgba(22,21,27,.07), 0 1px 3px rgba(22,21,27,.05);
  --shadow-lg: 0 18px 50px rgba(22,21,27,.20);

  --sidebar-w: 250px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* Click-to-call phone links (tel: → 8x8 Work as the default handler) */
.tel-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dotted var(--slate-light);
}
.tel-link:hover { color: var(--violet); border-bottom-color: var(--violet); }

/* Dashboard inline bulk-select bar (change account type) */
.dash-bulk {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 12px; padding: 8px 12px; border-radius: 10px;
  background: var(--violet-deep); color: #fff;
}
.dash-bulk select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); }

/* Column picker (§4) */
.cols-wrap { position: relative; margin-left: auto; }
.cols-menu { position: absolute; right: 0; top: 30px; z-index: 30; width: 216px; padding: 8px;
  background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.cols-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.cols-row:hover { background: var(--paper); }
.cols-check { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 13px; font-weight: 500; cursor: pointer; }
.cols-move { display: flex; gap: 3px; }
.cols-arrow { width: 22px; height: 22px; border: 1px solid var(--border); background: var(--white);
  border-radius: 6px; cursor: pointer; font-size: 11px; color: var(--slate); line-height: 1; }
.cols-arrow:hover:not(:disabled) { background: var(--paper); }
.cols-arrow:disabled { opacity: .35; cursor: default; }

/* Inline account-type editor in dashboard tables (click to change) */
.type-inline {
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--paper); color: var(--ink);
  cursor: pointer; max-width: 150px;
}
.type-inline:hover { border-color: var(--violet); }

/* Slimmer performance panels (profit / target / company / activity banners) */
.card[style*="border:none"] { padding: 13px 18px; }
.panel-chevron { font-size: 11px; opacity: .85; }
.card.panel-collapsed { padding-top: 10px; padding-bottom: 10px; }

/* Draggable / resizable dashboard widgets (§2, Gridstack) */
.grid-stack { margin: 16px -8px 0; }
.grid-stack-item-content { overflow: hidden; border-radius: var(--radius); display: flex; }
.grid-stack-item-content > .card { flex: 1; height: 100%; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.grid-stack-item-content > .card > .list-scroll { flex: 1; height: auto; min-height: 0; max-height: none; resize: none; }
.grid-stack-item-content .cal-resizable { flex: 1; height: auto; min-height: 0; max-height: none; resize: none; }
.grid-stack .gs-handle { cursor: move; }

/* Resizable table columns (drag the header border) */
.accounts.resizable-cols th { position: relative; }
.accounts.resizable-cols td { overflow: hidden; }
.accounts.resizable-cols td .acc-company .names { min-width: 0; }
.accounts.resizable-cols td .code,
.accounts.resizable-cols td .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounts.resizable-cols th.cb-col, .accounts.resizable-cols td.cb-col { width: 40px; padding-left: 12px; padding-right: 4px; overflow: visible; }
.accounts tbody tr.row-sel, .accounts tbody tr.row-sel:hover { background: #ece9f3; }
.accounts.resizable-cols th.chev-col, .accounts.resizable-cols td.chevron { width: 34px; overflow: visible; }
.col-resizer { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; user-select: none; touch-action: none; z-index: 3; }
.col-resizer:hover { background: rgba(90, 47, 158, .3); }

/* Reminder-card reschedule row */
.rc-reschedule { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rc-dt { font-size: 12px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }

/* NOS Phone dialer (floating) */
.dialer-fab {
  position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px;
  border-radius: 50%; background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  color: #fff; border: none; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 1000;
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.dialer-fab:hover { transform: scale(1.06); }
.dialer-fab.active { filter: brightness(1.1); }
.dialer-fab svg { width: 24px; height: 24px; }
.dialer-panel {
  position: fixed; right: 22px; bottom: 90px; width: 468px; z-index: 1000;
  background: var(--white); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.dialer-head {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet)); color: #fff;
}
.dialer-logo { width: 30px; height: 30px; border-radius: 7px; background: #fff; padding: 2px; object-fit: contain; }
.dialer-title { flex: 1; font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
.dialer-sub { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.75); margin-top: 1px; }
.dialer-x { background: rgba(255,255,255,.15); border: none; cursor: pointer; color: #fff; font-size: 13px; width: 24px; height: 24px; border-radius: 6px; }
.dialer-x:hover { background: rgba(255,255,255,.28); }
.dialer-body { display: flex; gap: 0; }
.dialer-main { width: 250px; padding: 14px; border-right: 1px solid var(--border); }
.dialer-side { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; min-width: 0; }
.dialer-row { display: flex; gap: 8px; align-items: stretch; }
.dialer-display {
  flex: 1; font-family: var(--font-mono); font-size: 19px; text-align: center;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-width: 0;
}
.dialer-display:focus { outline: none; border-color: var(--violet); }
.dialer-back { width: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); cursor: pointer; font-size: 16px; }
.dialer-hint { min-height: 15px; font-size: 12px; color: var(--slate); text-align: center; margin: 6px 0; }
.dialer-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.dialer-key {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 0 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--paper); cursor: pointer; transition: background .12s;
}
.dialer-key:hover { background: #ece9f3; }
.dk-digit { font-family: var(--font-mono); font-size: 19px; font-weight: 600; line-height: 1; }
.dk-letters { font-size: 8px; letter-spacing: .08em; color: var(--slate); height: 10px; }
.dialer-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.dialer-mini { flex: 1; padding: 7px 0; font-size: 11.5px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); cursor: pointer; color: var(--slate); }
.dialer-mini:hover { background: var(--paper); color: var(--ink); }
.dialer-call {
  width: 100%; background: var(--good); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dialer-call svg { width: 18px; height: 18px; }
.dialer-call:hover { filter: brightness(1.05); }
.dialer-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.dialer-tab {
  flex: 1; padding: 6px 0; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--slate);
}
.dialer-tab.active { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }
.dialer-list { flex: 1; overflow-y: auto; max-height: 236px; }
.dialer-list-empty { font-size: 12px; color: var(--slate); padding: 10px 4px; text-align: center; }
.dialer-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.dialer-item:hover { background: var(--paper); }
.dialer-item-main {
  flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0;
  text-align: left; border: none; background: none; cursor: pointer; padding: 7px 6px;
}
.dialer-item-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialer-item-sub { font-size: 11px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialer-dir { font-weight: 700; margin-right: 4px; }
.dialer-dir.out { color: var(--blue-mid); }
.dialer-dir.in { color: var(--good); }
.dialer-item-x { border: none; background: none; cursor: pointer; color: var(--slate-light); font-size: 13px; padding: 4px 7px; border-radius: 6px; }
.dialer-item-x:hover { color: var(--violet); background: #ece9f3; }

@media (max-width: 640px) {
  .dialer-panel { right: 12px; left: 12px; width: auto; }
  .dialer-body { flex-direction: column; }
  .dialer-main { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ---- Floating personal to-do widget ------------------------------------- */
.todo-widget {
  position: fixed; left: 0; top: 0; width: 300px; z-index: 1000;
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.todo-widget.dragging, .todo-widget.resizing { user-select: none; }
.todo-widget.dragging { box-shadow: 0 24px 48px -18px rgba(22, 10, 45, .5); }
.todo-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: linear-gradient(120deg, var(--violet-deep), var(--violet) 55%, var(--teal));
  color: #fff; cursor: grab; touch-action: none;
}
.todo-widget.dragging .todo-head { cursor: grabbing; }
.todo-title { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: .01em; }
.todo-collapse {
  background: rgba(255,255,255,.16); border: none; cursor: pointer; color: #fff;
  font-size: 17px; line-height: 1; width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.todo-collapse:hover { background: rgba(255,255,255,.3); }
.todo-widget.collapsed .todo-body { display: none; }
.todo-body { padding: 10px 12px 12px; }
.todo-list { max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
/* When the user has set an explicit height, the list flexes to fill it. */
.todo-widget.sized .todo-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.todo-widget.sized .todo-list { flex: 1; min-height: 0; max-height: none; }
.todo-resize {
  position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px;
  cursor: nwse-resize; color: var(--slate-light); touch-action: none;
  display: flex; align-items: flex-end; justify-content: flex-end;
}
.todo-resize svg { width: 11px; height: 11px; }
.todo-resize:hover { color: var(--violet); }
.todo-widget.collapsed .todo-resize { display: none; }
.todo-empty { font-size: 12.5px; color: var(--slate); text-align: center; padding: 14px 4px; }
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 4px;
  border-bottom: 1px solid #f1eff6;
  transition: opacity .24s ease, transform .24s ease;
}
.todo-item:last-child { border-bottom: none; }
.todo-item.done { opacity: 0; transform: translateX(10px); }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--slate-light); }
.todo-item.done .todo-check { background: var(--good); border-color: var(--good); color: #fff; }
.todo-check {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); background: var(--white); cursor: pointer;
  color: transparent; display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s, color .12s;
}
.todo-check:hover { border-color: var(--good); }
.todo-check svg { width: 13px; height: 13px; }
.todo-text { font-size: 13px; line-height: 1.4; color: var(--ink); word-break: break-word; }
.todo-add-row { display: flex; gap: 7px; }
.todo-input {
  flex: 1; min-width: 0; font-size: 13px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--paper);
}
.todo-input:focus { outline: none; border-color: var(--violet); background: var(--white); }
.todo-add {
  flex-shrink: 0; width: 38px; border: none; border-radius: 9px; cursor: pointer;
  font-size: 20px; line-height: 1; color: #fff;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
}
.todo-add:hover { filter: brightness(1.08); }

@media (max-width: 640px) {
  .todo-widget { width: calc(100vw - 24px); max-width: 320px; }
}

/* ---- Floating "not called this month" widget (reuses to-do mechanics) ---- */
.cc-widget {
  position: fixed; left: 0; top: 0; width: 300px; z-index: 1000;
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.cc-widget.dragging { user-select: none; box-shadow: 0 24px 48px -18px rgba(22, 10, 45, .5); }
.cc-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: linear-gradient(120deg, var(--violet-deep), var(--violet) 55%, var(--teal));
  color: #fff; cursor: grab; touch-action: none;
}
.cc-widget.dragging .cc-head { cursor: grabbing; }
.cc-title { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: .01em; }
.cc-collapse {
  background: rgba(255,255,255,.16); border: none; cursor: pointer; color: #fff;
  font-size: 17px; line-height: 1; width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.cc-collapse:hover { background: rgba(255,255,255,.3); }
.cc-widget.collapsed .cc-body { display: none; }
.cc-body { padding: 10px 12px 12px; }
.cc-sub { font-size: 11.5px; line-height: 1.45; color: var(--slate); margin-bottom: 8px; }
.cc-list { max-height: 280px; overflow-y: auto; }
.cc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px; border-bottom: 1px solid #f1eff6; text-decoration: none;
  transition: opacity .22s ease, transform .22s ease, background .12s;
}
.cc-row:last-child { border-bottom: none; }
.cc-row:hover { background: var(--paper); }
.cc-row.gone { opacity: 0; transform: translateX(10px); }
.cc-co { font-size: 13px; font-weight: 500; color: var(--ink); word-break: break-word; }
.cc-ph { font-size: 12px; color: var(--slate); font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 640px) { .cc-widget { width: calc(100vw - 24px); max-width: 320px; } }

/* ---- "Tidy up" writing button (floats by the focused text field) -------- */
.tidy-btn {
  position: fixed; z-index: 1200; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; line-height: 1.4;
  color: #fff; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  box-shadow: 0 4px 12px -3px rgba(51,6,107,.5);
}
.tidy-btn:hover { filter: brightness(1.08); }
.tidy-btn:disabled { opacity: .75; cursor: default; }
.tidy-btn.undo { background: var(--slate); box-shadow: 0 4px 12px -3px rgba(0,0,0,.3); }

/* ---- Marketing engagement report ---------------------------------------- */
.mk-report-btn { margin-top: 10px; background: none; border: 1px solid var(--border); color: var(--violet); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.mk-report-btn:hover { background: var(--paper); border-color: var(--violet); }
.mk-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.mk-report-note { font-size: 12px; color: var(--slate); margin: 2px 0 12px; }
.mk-report-table { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; }
.mk-eng-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mk-eng-table th { position: sticky; top: 0; background: var(--paper); text-align: left; padding: 9px 12px; font-weight: 600; color: var(--slate); border-bottom: 1px solid var(--border); white-space: nowrap; }
.mk-eng-table td { padding: 8px 12px; border-bottom: 1px solid #f1eff6; vertical-align: top; }
.mk-eng-table tr:last-child td { border-bottom: none; }
.mk-eng-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.mk-eng-badge.clicked { background: rgba(42,167,104,.15); color: #1f7a4d; }
.mk-eng-badge.opened { background: rgba(90,47,158,.12); color: var(--violet); }
.mk-eng-badge.delivered { background: var(--paper); color: var(--slate); }

/* ---- Reorder Radar ------------------------------------------------------ */
.rr { max-width: 980px; }
.rr-head { margin-bottom: 14px; }
.rr-title { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
.rr-sub { color: var(--slate); font-size: 13.5px; margin: 0; max-width: 720px; line-height: 1.5; }
.rr-lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); margin: 0 0 14px; }
.rr-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rr-chip { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--white); }
.rr-chip-n { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.rr-chip-l { font-size: 12.5px; color: var(--slate); }
.rr-chip.red .rr-chip-n { color: var(--danger); }
.rr-chip.amber .rr-chip-n { color: #c8862b; }
.rr-actions { margin-bottom: 10px; }
.rr-list { display: flex; flex-direction: column; gap: 8px; }
.rr-row { display: grid; grid-template-columns: 132px minmax(0,1fr) auto auto; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.rr-row.tone-red { border-left: 4px solid var(--danger); }
.rr-row.tone-amber { border-left: 4px solid #c8862b; }
.rr-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; text-align: center; white-space: nowrap; }
.rr-badge.red { background: rgba(201,75,75,.12); color: var(--danger); }
.rr-badge.amber { background: rgba(200,134,43,.15); color: #a5701f; }
.rr-co { text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rr-co-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.rr-co-note { font-size: 12.5px; color: var(--slate); }
.rr-meta { font-size: 12.5px; color: var(--ink); text-align: right; white-space: nowrap; }
.rr-meta .muted { color: var(--slate); font-size: 11.5px; }
.rr-call { background: var(--paper); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--violet); cursor: pointer; white-space: nowrap; }
.rr-call:hover { background: #fff; border-color: var(--violet); }
.rr-empty { color: var(--slate); font-size: 13.5px; padding: 20px 4px; }
@media (max-width: 720px) { .rr-row { grid-template-columns: 1fr; gap: 6px; } .rr-meta { text-align: left; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.2; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.muted { color: var(--slate); }
.small { font-size: 12px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: var(--white); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #faf9fc; border-color: var(--slate-light); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }
.btn-primary:hover { background: var(--violet); border-color: var(--violet); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b83f3f; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(90,47,158,.08); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---- forms -------------------------------------------------------------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--border); background: var(--white);
  border-radius: var(--radius-sm); padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(90,47,158,.14);
}
textarea { resize: vertical; min-height: 72px; }
/* checkboxes/radios must NOT inherit the full-width rule above (it squashed rows) */
input[type="checkbox"], input[type="radio"] {
  width: auto; margin: 0; padding: 0; box-shadow: none;
  flex: 0 0 auto; accent-color: var(--violet); cursor: pointer;
  width: 16px; height: 16px;
}
.inline-edit { border-color: transparent; background: transparent; padding: 6px 8px; margin: -6px -8px; border-radius: var(--radius-sm); }
.inline-edit:hover { background: #faf9fc; border-color: var(--border); }

/* ---- cards -------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; }

/* ---- chips / badges ----------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--paper); color: var(--slate); border: 1px solid var(--border);
}
.chip-rep { background: rgba(90,47,158,.10); color: var(--violet-deep); border-color: rgba(90,47,158,.20); }
.chip-tag { background: rgba(61,110,160,.10); color: var(--blue-mid); border-color: rgba(61,110,160,.2); }
.chip-industry { background: rgba(90,47,158,.10); color: var(--violet-deep); border-color: rgba(90,47,158,.20); }
.chip-type { background: rgba(37,150,120,.10); color: #1f7a5c; border-color: rgba(37,150,120,.22); }
.chip-count { background: rgba(255,255,255,.18); color: #fff; border: none; }
.type-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.type-task { background: rgba(61,110,160,.12); color: var(--blue-mid); }
.type-callback { background: rgba(42,167,164,.14); color: #1c7f7c; }

/* ---- priority dots ------------------------------------------------------ */
.pdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.pdot-followup { background: #e5484d; box-shadow: 0 0 0 2px rgba(229, 72, 77, .22); }
.pdot-order { background: var(--danger); }
.pdot-quote { background: var(--warn); }
.pdot-email { background: var(--good); }
.pdot-none  { background: var(--slate-light); }
.pchip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--ink);
  padding: 6px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
}
.pchip.active { border-color: currentColor; box-shadow: 0 0 0 2px rgba(90,47,158,.10); }
.pchip[data-p="order"].active  { color: var(--danger); }
.pchip[data-p="quote"].active  { color: var(--warn); }
.pchip[data-p="email"].active  { color: var(--good); }

/* ---- avatar / logo ------------------------------------------------------ */
.avatar {
  width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto;
  object-fit: cover; background: var(--paper); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; color: #fff;
  font-family: var(--font-display); font-size: 13px; overflow: hidden; border: 1px solid var(--border);
}
.avatar-lg { width: 56px; height: 56px; border-radius: 12px; font-size: 20px; }

/* ==========================================================================
   Layout — sidebar + main
   ========================================================================== */
#app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 auto; color: #fff; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #512a92 0%, #41217f 60%, #351b6e 100%);
  display: flex; flex-direction: column; padding: 20px 16px;
}
/* White brand strip so the NOS ring + black "NOS" text are clearly visible;
   the wordmark switches to deep purple to read on the white. */
.sidebar .brand { display: flex; align-items: center; gap: 11px; height: 64px; padding: 0 16px; margin: -20px -16px 16px; background: #fff; border: none; box-shadow: none; }
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .brand img.brand-logo { width: auto; height: 40px; max-width: 100%; object-fit: contain; }
.sidebar .brand b { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: .02em; color: var(--violet-deep); }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.78);
  padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; }
.nav-link svg { width: 18px; height: 18px; opacity: .9; flex: 0 0 auto; }
.sidebar .spacer { flex: 1; }
.sidebar .user-box { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; margin-top: 10px; }
.sidebar .user-box .name { font-weight: 600; font-size: 13px; }
.sidebar .user-box .role { font-size: 11px; color: rgba(255,255,255,.6); text-transform: capitalize; }

/* sync ring motif (§3) */
.sync-ring { width: 16px; height: 16px; }
.sync-ring.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.7);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px);
}
.topbar h1 { font-size: 20px; }
.content { padding: 24px 28px 60px; width: 100%; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-row-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--slate); }
.kpi .value { font-family: var(--font-mono); font-weight: 600; font-size: 30px; margin-top: 6px; }
.kpi .value.violet { color: var(--violet-deep); }
.kpi .value.teal { color: #1c7f7c; }
.kpi .value.chase { color: #c0392b; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.list-scroll { height: 340px; min-height: 160px; max-height: 85vh; overflow-y: auto; margin: -6px; padding: 6px; resize: vertical; }
/* Resizable dashboard calendar pane (drag the bottom-right corner) */
.cal-resizable { height: 380px; min-height: 240px; max-height: 85vh; overflow: auto; resize: vertical; }

.mini-row { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.mini-row:hover { background: #faf9fc; }
.mini-row .meta { min-width: 0; }
.mini-row .meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .meta .s { font-size: 12px; color: var(--slate); }
.mini-row .time { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--slate); }

/* ==========================================================================
   Accounts table
   ========================================================================== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 380px; }
.search { position: relative; }
.search input { width: 100%; padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--slate); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.acc-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.acc-filter { display: flex; align-items: center; gap: 6px; }
.acc-filter select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--white); }

/* Inline row editors (rep / type / tags) */
.cell-select { font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); color: var(--ink); cursor: pointer; max-width: 100%; }
.cell-select:hover { border-color: var(--violet); }
.tags-cell { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: pointer; min-height: 22px; }
.tag-pop { background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 8px; width: 224px; max-height: 280px; overflow: auto; }
.tag-pop-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.tag-pop-row:hover { background: var(--paper); }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--white); font-weight: 600; font-size: 13px; color: var(--slate); cursor: pointer;
}
.tab.active { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }
.tab .chip-count { background: rgba(0,0,0,.06); color: var(--slate); }
.tab.active .chip-count { background: rgba(255,255,255,.2); color: #fff; }

table.accounts { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.accounts th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); font-weight: 700; padding: 11px 14px; background: #faf9fc; border-bottom: 1px solid var(--border); }
table.accounts td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.accounts tr:last-child td { border-bottom: none; }
table.accounts tbody tr { cursor: pointer; }
table.accounts tbody tr:hover { background: #faf9fc; }
table.accounts tbody tr.acc-sticky { background: #fff7e6; box-shadow: inset 3px 0 0 #e0a12b; }
table.accounts tbody tr.acc-sticky:hover { background: #fdf0d6; }

/* On-call card (dialer) */
.callprog { position: fixed; right: 20px; bottom: 96px; width: 300px; background: #fff; border: 1px solid var(--border, #e6e4ee); border-radius: 14px; box-shadow: 0 14px 40px rgba(20,20,60,.22); padding: 14px; z-index: 400; }
.callprog-head { display: flex; align-items: center; gap: 8px; }
.callprog-live { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 0 rgba(229,72,77,.6); animation: callpulse 1.4s infinite; }
/* Once 8x8 reports the call ended, stop the pulsing and go green. */
.callprog.ended .callprog-live { animation: none; background: #46a758; box-shadow: none; }
.callprog.ended .callprog-hint { background: #e9f6ec; color: #216e39; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.6); } 70% { box-shadow: 0 0 0 8px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }
.callprog-who { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callprog-timer { font-family: var(--font-mono, monospace); font-weight: 700; font-size: 15px; color: var(--violet-deep, #5a2f9e); }
.callprog-hint { font-size: 10.5px; line-height: 1.35; color: var(--slate, #7a7a8c); background: var(--wash, #f5f3fb); border-radius: 6px; padding: 6px 8px; margin-top: 8px; }
.callprog-label { font-size: 11px; color: var(--slate, #7a7a8c); margin: 10px 0 6px; }
.callprog-outs { display: flex; flex-wrap: wrap; gap: 6px; }
.callprog-out { font-size: 11.5px; padding: 5px 9px; border: 1px solid var(--border, #e6e4ee); border-radius: 999px; background: #fff; cursor: pointer; }
.callprog-out.sel { background: var(--violet-deep, #5a2f9e); color: #fff; border-color: var(--violet-deep, #5a2f9e); }
.callprog-note { width: 100%; min-height: 62px; margin-top: 10px; border: 1px solid var(--border, #e6e4ee); border-radius: 9px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
.callprog-actions { display: flex; gap: 8px; margin-top: 10px; }
.callprog-save { flex: 1; background: linear-gradient(120deg, var(--violet), #3d6ea0 60%, var(--teal)); color: #fff; border: none; border-radius: 9px; padding: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.callprog-skip { background: none; border: none; color: var(--slate, #7a7a8c); font-size: 12.5px; cursor: pointer; padding: 0 8px; }
/* Keep column headers visible while the list scrolls (dashboard tables).
   The table's own overflow:hidden (for rounded corners) traps position:sticky,
   so switch it to visible here; the container's radius still frames it. */
.list-scroll table.accounts { overflow: visible; }
/* top:-6px offsets the container's 6px padding so no row peeks above the header */
.list-scroll table.accounts thead th { position: sticky; top: -6px; z-index: 3; background: #faf9fc; }
.acc-company { display: flex; align-items: center; gap: 11px; }
.acc-company .names { min-width: 0; }
.acc-company .cn { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.acc-company .code { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.chevron { color: var(--slate-light); }

.bulk-bar {
  position: sticky; bottom: 16px; display: flex; align-items: center; gap: 14px; margin-top: 14px;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.bulk-bar b { font-family: var(--font-mono); }

/* ==========================================================================
   Record view
   ========================================================================== */
.record-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.record-head .names h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.record-head .names .sub { color: var(--slate); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.record-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }

/* ==========================================================================
   Account record — matches nos-crm-account-screen-reference.html exactly.
   Scoped under .rec-ref-page with the reference's own palette so it renders
   pixel-for-pixel without affecting the rest of the app.
   ========================================================================== */
.rec-ref-page {
  --r-ink: #16151b; --r-paper: #f2f1f7; --r-white: #ffffff;
  --r-violet-deep: #33066b; --r-violet-mid: #5a2f9e; --r-blue-mid: #3d6ea0; --r-teal: #2aa7a4;
  --r-slate: #807d8c; --r-slate-light: #a8a5b3; --r-border: #e7e4ef;
  --r-good-bg: #dcf5e7; --r-good-text: #1f8f5a; --r-rep-bg: #ece4fa; --r-rep-text: #5a2f9e;
  --r-shadow: 0 1px 2px rgba(22, 10, 45, .04), 0 10px 28px -16px rgba(22, 10, 45, .16);
  max-width: 1560px; margin: 0 auto; padding-bottom: 40px;
  display: grid; grid-template-columns: 360px 1fr 340px; gap: 22px; align-items: start;
  font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--r-ink);
}
.rec-ref-page .card { background: var(--r-white); border-radius: 16px; box-shadow: var(--r-shadow); border: 1px solid var(--r-border); }
.rec-ref-page .card + .card { margin-top: 16px; }

/* ---- LEFT column ---- */
.rec-ref-page .avatar-row { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.rec-ref-page .avatar { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--r-violet-deep), var(--r-violet-mid)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.rec-ref-page .company-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.rec-ref-page .acc-code { font-size: 11px; color: var(--r-slate-light); font-family: 'IBM Plex Mono', monospace; letter-spacing: .4px; margin-top: 1px; }
.rec-ref-page .badge-row { display: flex; gap: 8px; padding: 0 18px 16px; flex-wrap: wrap; }
.rec-ref-page .badge { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 20px; }
.rec-ref-page .badge.type { background: var(--r-good-bg); color: var(--r-good-text); }
.rec-ref-page .badge.rep { background: var(--r-rep-bg); color: var(--r-rep-text); }
.rec-ref-page .action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 18px; }
.rec-ref-page .action-btn { border: 1px solid var(--r-border); background: #fff; border-radius: 10px; padding: 10px 4px; font-size: 12.5px; font-weight: 600; color: var(--r-ink); text-align: center; cursor: pointer; }
.rec-ref-page .action-btn:hover { border-color: var(--r-slate-light); }
.rec-ref-page .action-btn.primary { background: var(--r-violet-deep); border-color: var(--r-violet-deep); color: #fff; }
.rec-ref-page .section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; color: var(--r-slate-light); text-transform: uppercase; padding: 16px 18px 10px; }
.rec-ref-page .info-list { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 8px; }
/* Three aligned columns: label · value/control · action widget. Everything in
   the value column is LEFT-aligned so plain text lines up flush with the
   dropdowns and inputs (no more zig-zag between left and right). */
.rec-ref-page .info-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 24px; align-items: center; column-gap: 8px; font-size: 12px; }
.rec-ref-page .info-row .k { color: var(--r-slate); font-size: 11.5px; }
.rec-ref-page .info-row .v { font-weight: 600; font-size: 12px; text-align: left; border: 1px solid var(--r-border); border-radius: 8px; padding: 5px 8px; background: #fff; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-ref-page .info-row .v.link { cursor: pointer; }
.rec-ref-page .info-row .v.link:hover { border-color: var(--r-violet-mid); }
.rec-ref-page .info-row .v.link { color: var(--r-violet-mid); }
.rec-ref-page .info-row .v.mono { font-family: 'IBM Plex Mono', monospace; }
.rec-ref-page .info-row .v.good { color: var(--r-good-text); }
.rec-ref-page .info-row .about-select { border: 1px solid var(--r-border); border-radius: 8px; padding: 5px 8px; font-size: 12px; font-weight: 600; color: var(--r-ink); background: #fff; width: 100%; max-width: none; cursor: pointer; }
.rec-ref-page .info-row .about-select:hover { border-color: var(--r-violet-mid); }
.rec-ref-page .info-row .about-select:focus { outline: none; border-color: var(--r-violet-deep); }
/* Inline-editable About fields — look like the value until you focus them. */
.rec-ref-page .info-row .about-input { width: 100%; min-width: 0; text-align: left; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--r-ink); border: 1px solid var(--r-border); border-radius: 8px; padding: 5px 8px; margin: 0; background: #fff; }
.rec-ref-page .info-row .about-input::placeholder { color: var(--r-slate-light); font-weight: 400; }
.rec-ref-page .info-row .about-input:hover { border-color: var(--r-violet-mid); background: #fff; }
.rec-ref-page .info-row .about-input:focus { outline: none; border-color: var(--r-violet-deep); background: #fff; }
.rec-ref-page .tags-empty { padding: 0 18px 18px; font-size: 12.5px; color: var(--r-slate-light); }
.rec-ref-page .tags-wrap { padding: 0 18px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
/* Interactive tags card */
.rec-ref-page .tags-card-body { padding: 0 18px 18px; }
.rec-ref-page .tags-card-body .tags-wrap, .rec-ref-page .tags-card-body .tags-empty { padding: 0; }
.rec-ref-page .tag-pill { display: inline-flex; align-items: center; gap: 6px; }
.rec-ref-page .tag-x { background: none; border: none; cursor: pointer; color: inherit; font-size: 15px; line-height: 1; padding: 0; opacity: .55; }
.rec-ref-page .tag-x:hover { opacity: 1; }
.rec-ref-page .tags-add { width: 100%; max-width: none; margin-top: 10px; }

/* ---- MIDDLE column ---- */
.rec-ref-page .page-tabs { display: flex; gap: 26px; padding: 18px 20px 0; border-bottom: 1px solid var(--r-border); }
.rec-ref-page .page-tab { font-size: 14px; font-weight: 600; color: var(--r-slate); padding-bottom: 14px; border-bottom: 2.5px solid transparent; cursor: pointer; }
.rec-ref-page .page-tab.active { color: var(--r-violet-deep); border-bottom-color: var(--r-violet-deep); }
.rec-ref-page .filter-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 20px; }
.rec-ref-page .filter-pill { font-size: 12.5px; font-weight: 600; padding: 7px 15px; border-radius: 20px; border: 1px solid var(--r-border); color: var(--r-slate); background: #fff; cursor: pointer; }
.rec-ref-page .filter-pill.active { background: var(--r-ink); border-color: var(--r-ink); color: #fff; }
.rec-ref-page .date-heading { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--r-slate-light); text-transform: uppercase; padding: 4px 20px 10px; }
.rec-ref-page .activity-list { padding: 0 12px 18px; }
.rec-ref-page .activity-item { display: flex; gap: 13px; padding: 13px 8px; border-radius: 12px; }
.rec-ref-page .activity-item:hover { background: var(--r-paper); }
.rec-ref-page .a-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rec-ref-page .a-icon svg { width: 15px; height: 15px; }
.rec-ref-page .a-icon.note { background: var(--r-rep-bg); color: var(--r-rep-text); }
.rec-ref-page .a-icon.call { background: #e1eef7; color: var(--r-blue-mid); }
.rec-ref-page .a-icon.email { background: var(--r-good-bg); color: var(--r-good-text); }
.rec-ref-page .a-icon.task { background: #fbeede; color: #a5760f; }
.rec-ref-page .a-body { flex: 1; min-width: 0; }
.rec-ref-page .a-title { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.rec-ref-page .a-sub { font-size: 12.5px; color: var(--r-slate); margin-top: 2px; line-height: 1.5; white-space: pre-wrap; }
.rec-ref-page .a-time { font-size: 11px; color: var(--r-slate-light); margin-top: 5px; }
.rec-ref-page .activity-item.done { opacity: .72; }
.rec-ref-page .activity-item.done .done-text { text-decoration: line-through; color: var(--r-slate); }
.rec-ref-page .activity-item.done .done-check { color: var(--r-good-text); font-weight: 700; }
.rec-ref-page .activity-divider { height: 1px; background: var(--r-border); margin: 2px 20px; }
.rec-ref-page .activity-empty { padding: 30px 20px; text-align: center; color: var(--r-slate); font-size: 13px; }
.rec-ref-page .card-pad { padding: 18px 18px; }
.rec-ref-page .sage-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--r-border); padding: 14px 18px 0; }
.rec-ref-page .sage-subtabs button { background: none; border: none; padding: 9px 12px; font-weight: 600; font-size: 13px; color: var(--r-slate); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.rec-ref-page .sage-subtabs button.active { color: var(--r-violet-deep); border-bottom-color: var(--r-violet-deep); }

/* Company intelligence panel — persistent box in the middle column */
.rec-ref-page .rec-mid-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rec-ref-page .rec-intel { padding: 16px 18px; }
.rec-ref-page .intel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
/* Keep the middle cards compact — scroll inside instead of running down the page. */
.rec-ref-page .rec-mid-body { max-height: 430px; overflow-y: auto; padding-right: 4px; }
.rec-ref-page .intel-body { max-height: 320px; overflow-y: auto; padding-right: 4px; }
.rec-ref-page .rec-mid-body::-webkit-scrollbar, .rec-ref-page .intel-body::-webkit-scrollbar { width: 9px; }
.rec-ref-page .rec-mid-body::-webkit-scrollbar-thumb, .rec-ref-page .intel-body::-webkit-scrollbar-thumb { background: var(--r-border); border-radius: 6px; border: 2px solid #fff; }
.rec-ref-page .rec-mid-body::-webkit-scrollbar-thumb:hover, .rec-ref-page .intel-body::-webkit-scrollbar-thumb:hover { background: var(--r-slate-light); }
.rec-ref-page .intel-card { border: 1px solid var(--r-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.rec-ref-page .intel-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--r-slate-light); margin-bottom: 10px; }
.rec-ref-page .intel-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px dashed var(--r-border); font-size: 13px; }
.rec-ref-page .intel-row:last-child { border-bottom: none; }
.rec-ref-page .intel-row .ik { color: var(--r-slate); flex-shrink: 0; }
.rec-ref-page .intel-row .iv { font-weight: 600; text-align: right; }
.rec-ref-page .intel-narr { border: 1px solid rgba(90,47,158,.2); border-radius: 12px; padding: 14px 16px; background: linear-gradient(165deg, rgba(90,47,158,.05), rgba(42,167,164,.04)); }
.rec-ref-page .intel-narr .ai-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(120deg, var(--r-violet-deep), var(--r-violet-mid)); color: #fff; font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }

/* ---- RIGHT column ---- */
.rec-ref-page .right-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rec-ref-page .ai-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(120deg, var(--r-violet-deep), var(--r-violet-mid)); color: #fff; font-size: 11.5px; font-weight: 700; padding: 7px 14px; border-radius: 20px; text-transform: none; letter-spacing: 0; }
.rec-ref-page .theme-btn { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--r-border); border-radius: 20px; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--r-slate); box-shadow: var(--r-shadow); cursor: pointer; }
.rec-ref-page .theme-btn:hover { border-color: var(--r-slate-light); }
.rec-ref-page .theme-btn:disabled { opacity: .6; cursor: default; }
.rec-ref-page .ai-summary-card { background: linear-gradient(165deg, #f2ecfb, #f7f3fc); border: 1px solid #e6dbf7; border-radius: 16px; padding: 16px 17px; font-size: 13px; line-height: 1.6; color: #4a3a63; margin-bottom: 16px; }
.rec-ref-page .ai-summary-card.ai-empty { color: var(--r-slate); }
.rec-ref-page .ai-summary-card.ai-error { color: var(--danger); }
.rec-ref-page .figures-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 16px 18px; }
.rec-ref-page .figure-box { background: var(--r-paper); border-radius: 12px; padding: 13px 14px; }
.rec-ref-page .figure-label { font-size: 11px; color: var(--r-slate); font-weight: 500; margin-bottom: 6px; }
.rec-ref-page .figure-value { font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 700; color: var(--r-ink); }
.rec-ref-page .figure-value.teal { color: var(--r-teal); }
.rec-ref-page .sage-list { padding: 0 10px 14px; }
.rec-ref-page .sage-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.rec-ref-page .sage-row:hover { background: var(--r-paper); }
.rec-ref-page .sage-row .count { display: flex; align-items: center; gap: 6px; color: var(--r-slate); font-weight: 600; }
.rec-ref-page .sage-row .chev svg { width: 15px; height: 15px; color: var(--r-slate-light); display: inline-flex; }

/* ==========================================================================
   Account record — confirmed visual direction (nos-crm-coloured-cards.html):
   gradient hero header, gradient-outlined cards, solid violet AI card,
   gradient key figures.
   ========================================================================== */
/* Gradient hero header (full width, above the 3-col grid) */
.rec-hero { border-radius: 18px; padding: 22px 24px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(120deg, var(--violet-deep) 0%, var(--violet) 55%, var(--teal) 100%);
  box-shadow: 0 14px 34px -18px rgba(51,6,107,.55); }
.rec-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.rec-hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.rec-hero-logo { width: 52px; height: 52px; border-radius: 13px; background: #fff; color: var(--violet-deep);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
  font-size: 18px; flex-shrink: 0; overflow: hidden; padding: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.rec-hero-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.15; }
.rec-hero-contact { font-size: 13px; opacity: .85; margin-top: 3px; }
/* At-a-glance stat chips + health flags on the hero */
.rec-hero-extra { flex-basis: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.rec-hero-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 6px 12px; min-width: 92px; }
.rec-chip .rc-k { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; opacity: .8; }
.rec-chip .rc-v { display: block; font-size: 14px; font-weight: 700; margin-top: 2px; }
.rec-hero-flags { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 20px; }
.rec-flag-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.rec-flag.good { background: #e4f6ec; color: #1f8f5a; }
.rec-flag.warn { background: #fbeed9; color: #9a6a11; }
.rec-flag.bad { background: #fde8e8; color: #c0392b; }
.rec-hero-pills { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rec-hero-pill { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.18); color: #fff;
  border: none; border-radius: 20px; padding: 6px 30px 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; }
.rec-hero-pill:hover { background-color: rgba(255,255,255,.28); }
.rec-hero-pill option { color: #16151b; }
.rec-hero-tools { display: flex; gap: 14px; }
.rec-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: #fff; }
.rec-tool-ic { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; transition: background .12s; }
.rec-tool-ic svg { width: 18px; height: 18px; }
.rec-tool:hover .rec-tool-ic { background: rgba(255,255,255,.3); }
.rec-tool-lbl { font-size: 11.5px; font-weight: 600; }
.rec-tool.primary .rec-tool-ic { background: #fff; color: var(--violet-deep); border-color: #fff; }
.rec-tool.primary:hover .rec-tool-ic { background: #f3eefc; }

/* Full 2px violet→teal gradient outline around every card on the page */
.rec-ref-page .card { border: 2px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, var(--violet-deep), var(--teal)) border-box; }

/* Key figures — four gradient-filled boxes, white text */
.rec-ref-page .figure-box.grad { background: linear-gradient(135deg, var(--violet-deep), var(--violet) 55%, var(--teal)); }
.rec-ref-page .figure-box.grad .figure-label { color: rgba(255,255,255,.82); }
.rec-ref-page .figure-box.grad .figure-value { color: #fff; }

/* AI summary — solid violet gradient card (Option B) */
.rec-ref-page .ai-card { border-radius: 16px; padding: 16px 17px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(160deg, var(--violet-deep), var(--violet)); box-shadow: 0 10px 26px -16px rgba(51,6,107,.6); }
.rec-ref-page .ai-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
/* Matches the .section-label rhythm used by every other card header (in white). */
.rec-ref-page .ai-title { font-weight: 700; font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; }
/* Next-best-action nudge at the top of the AI card. */
.rec-ref-page .ai-nudge { display: flex; gap: 8px; align-items: flex-start; background: rgba(255,255,255,.14); border-left: 3px solid #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.45; margin-bottom: 10px; }
.rec-ref-page .ai-nudge.good { border-left-color: #7ff0b0; }
.rec-ref-page .ai-nudge.warn { border-left-color: #ffd27a; }
.rec-ref-page .ai-nudge.bad { border-left-color: #ff9b9b; }
.rec-ref-page .ai-nudge-ic { font-weight: 800; }
.rec-ref-page .ai-refresh { background: rgba(255,255,255,.18); border: none; border-radius: 50%; width: 30px; height: 30px; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rec-ref-page .ai-refresh svg { width: 15px; height: 15px; }
.rec-ref-page .ai-refresh:hover { background: rgba(255,255,255,.3); }
.rec-ref-page .ai-refresh:disabled { opacity: .6; cursor: default; }
.rec-ref-page .ai-b { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.rec-ref-page .ai-b.ai-empty { opacity: .8; }
.rec-ref-page .ai-b.ai-error { color: #ffd9d9; }
.rec-ref-page .ai-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; opacity: .8; margin-top: 10px; }
.rec-ref-page .ai-sources { position: relative; padding-left: 14px; }
.rec-ref-page .ai-sources::before { content: "•"; position: absolute; left: 4px; }
.rec-ref-page .ai-feedback { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .9; margin-top: 10px; }
.rec-ref-page .ai-feedback.hidden { display: none; }
.rec-ref-page .ai-fb { background: rgba(255,255,255,.16); border: none; border-radius: 8px; padding: 3px 8px; cursor: pointer; font-size: 13px; }
.rec-ref-page .ai-fb:hover { background: rgba(255,255,255,.3); }
.rec-ref-page .ai-ask { display: flex; gap: 6px; margin-top: 14px; }
.rec-ref-page .ai-ask-in { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 12.5px; font-family: inherit; }
.rec-ref-page .ai-ask-in::placeholder { color: rgba(255,255,255,.7); }
.rec-ref-page .ai-ask-in:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.2); }
.rec-ref-page .ai-ask-send { background: #fff; color: var(--violet-deep); border: none; border-radius: 10px; width: 36px; font-size: 16px; font-weight: 700; cursor: pointer; }
.rec-ref-page .ai-answer { margin-top: 10px; font-size: 12.5px; line-height: 1.55; background: rgba(255,255,255,.12); border-radius: 10px; padding: 10px 12px; }

/* Static layout: the gradient hero spans the full width above the three
   columns, which line up beneath it. No drag/resize. */
.rec-ref-page .rec-hero { grid-column: 1 / -1; margin-bottom: 2px; }

@media (max-width: 980px) { .rec-ref-page { grid-template-columns: 1fr; } .rec-hero-inner { align-items: flex-start; } }

/* ==========================================================================
   Tasks page — matches nos-crm-tasks-reference.html exactly. Scoped under
   .tasks-page with the reference's own palette.
   ========================================================================== */
.tasks-page {
  --t-ink: #16151b; --t-paper: #f5f4f8; --t-white: #ffffff;
  --t-violet-deep: #33066b; --t-violet: #5a2f9e; --t-blue-mid: #3d6ea0; --t-teal: #2aa7a4;
  --t-slate: #807d8c; --t-slate-light: #b0adbb; --t-border: #e7e4ef;
  --t-good: #2aa768; --t-warn: #c8862b; --t-danger: #c94b4b;
  --t-shadow: 0 1px 2px rgba(22, 10, 45, .04), 0 10px 28px -16px rgba(22, 10, 45, .16);
  max-width: 1560px; margin: 0 auto; padding-bottom: 40px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--t-ink);
}
/* The slide-over task panel uses this palette; expose the same variables under
   the current page class (.tk-page) so its borders and buttons render. */
.tk-page {
  --t-ink: #16151b; --t-paper: #f5f4f8; --t-white: #ffffff;
  --t-violet-deep: #33066b; --t-violet: #5a2f9e; --t-blue-mid: #3d6ea0; --t-teal: #2aa7a4;
  --t-slate: #807d8c; --t-slate-light: #b0adbb; --t-border: #e7e4ef;
  --t-good: #2aa768; --t-warn: #c8862b; --t-danger: #c94b4b;
  --t-shadow: 0 1px 2px rgba(22, 10, 45, .04), 0 10px 28px -16px rgba(22, 10, 45, .16);
}
.tasks-page .page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 14px; }
.tasks-page .page-head h1 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.tasks-page .page-head .sub { font-size: 12.5px; color: var(--t-slate); margin: 0; }

.tasks-page .tabs-row { display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--t-border); margin-bottom: 16px; flex-wrap: wrap; }
.tasks-page .tab { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--t-slate); background: none; border: none; border-radius: 0; border-bottom: 2.5px solid transparent; padding: 0 0 13px; cursor: pointer; }
.tasks-page .tab.active { color: var(--t-violet-deep); background: none; border-bottom: 2.5px solid var(--t-violet-deep); }
.tasks-page .tab .count { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; background: var(--t-paper); padding: 1px 7px; border-radius: 20px; color: var(--t-slate); font-weight: 600; }
.tasks-page .tab.active .count { background: #ece4fa; color: var(--t-violet-deep); }

.tasks-page .toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tasks-page .search-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--t-border); border-radius: 10px; padding: 9px 12px; box-shadow: var(--t-shadow); min-width: 240px; }
.tasks-page .search-box .sicon { display: inline-flex; }
.tasks-page .search-box svg { width: 15px; height: 15px; color: var(--t-slate); flex-shrink: 0; }
.tasks-page .search-box input { border: none; outline: none; font-size: 13px; width: 100%; background: transparent; color: var(--t-ink); }
.tasks-page .spacer { flex: 1; }
.tasks-page .btn-primary { background: linear-gradient(120deg, var(--t-violet), var(--t-blue-mid) 60%, var(--t-teal)); color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(90, 47, 158, .45); }
.tasks-page .tool-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--t-border); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; font-weight: 600; color: var(--t-ink); cursor: pointer; }
.tasks-page .tool-btn .tb-ico { display: inline-flex; }
.tasks-page .tool-btn .tb-ico svg { width: 14px; height: 14px; }
.tasks-page .tool-btn.active-filter { border-color: var(--t-violet); color: var(--t-violet); }
/* floating Filter / Sort menus (appended to body) */
.tool-menu { position: fixed; z-index: 70; background: #fff; border: 1px solid #e7e4ef; border-radius: 12px; box-shadow: 0 10px 28px -12px rgba(22, 10, 45, .3); padding: 10px; min-width: 190px; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.tool-menu .tm-opt { font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: #16151b; }
.tool-menu .tm-opt:hover { background: #f5f4f8; }
.tool-menu .tm-opt.on { color: var(--violet-deep); font-weight: 700; }
.tool-menu .tm-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #b0adbb; margin: 8px 2px 4px; }
.tool-menu select { width: 100%; border: 1px solid #e7e4ef; border-radius: 8px; padding: 7px 9px; font-size: 13px; background: #fff; color: #16151b; }
.quote-menu { min-width: 236px; }
.quote-menu-item { padding: 9px 11px; border-radius: 9px; cursor: pointer; }
.quote-menu-item:hover { background: #f5f4f8; }
.quote-menu-item .qm-label { font-size: 13px; font-weight: 600; color: #16151b; }
.quote-menu-item .qm-sub { font-size: 11.5px; color: #807d8c; margin-top: 1px; }
.tool-menu .tm-clear { width: 100%; margin-top: 10px; border: 1px solid #e7e4ef; background: #fff; border-radius: 8px; padding: 7px; font-size: 12px; font-weight: 600; color: #16151b; cursor: pointer; }

.tasks-page .bulk-bar { display: none; align-items: center; gap: 12px; background: #fdeee6; border: 1px solid #f0c9ab; border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; color: #96432b; }
.tasks-page .bulk-bar.show { display: flex; }
.tasks-page .bulk-bar .btn-mini { border: 1px solid var(--t-border); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--t-ink); cursor: pointer; }

.tasks-page .table-card { background: var(--t-white); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow); overflow: hidden; }
.tasks-page .t-row { display: grid; grid-template-columns: 24px 26px 2fr 1.1fr 1.4fr 1.2fr 0.9fr 20px; align-items: center; gap: 14px; padding: 0 20px; }
.tasks-page .t-head { padding: 13px 0; border-bottom: 1px solid var(--t-border); background: var(--t-paper); }
.tasks-page .th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--t-slate-light); }

.tasks-page .task-row { padding: 13px 0; border-bottom: 1px solid var(--t-border); cursor: pointer; }
.tasks-page .task-row:last-child { border-bottom: none; }
.tasks-page .task-row:hover { background: var(--t-paper); }
.tasks-page input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--t-violet); cursor: pointer; }

.tasks-page .priority-dot { width: 9px; height: 9px; border-radius: 50%; }
.tasks-page .priority-dot.red { background: var(--t-danger); }
.tasks-page .priority-dot.amber { background: var(--t-warn); }
.tasks-page .priority-dot.green { background: var(--t-good); }
.tasks-page .priority-dot.none { background: var(--t-border); border: 1px solid var(--t-slate-light); }

.tasks-page .task-title { font-size: 13.5px; font-weight: 600; min-width: 0; }
.tasks-page .task-title .type-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 20px; margin-right: 7px; vertical-align: middle; }
.tasks-page .type-tag.callback { background: #e4f6f2; color: #1f8f8a; }
.tasks-page .type-tag.task { background: #fdf0e2; color: #96601f; }

.tasks-page .due-cell { font-size: 12.5px; font-family: 'IBM Plex Mono', monospace; }
.tasks-page .due-cell.overdue { color: var(--t-danger); font-weight: 600; }
.tasks-page .due-cell .rel { display: block; font-size: 10.5px; color: var(--t-slate-light); font-family: 'IBM Plex Sans', sans-serif; margin-top: 1px; }

.tasks-page .company-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tasks-page .company-logo { width: 24px; height: 24px; border-radius: 7px; background: var(--t-paper); border: 1px solid var(--t-border); display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 9.5px; color: var(--t-violet); flex-shrink: 0; }
.tasks-page .company-cell .name { font-size: 12.5px; font-weight: 600; color: var(--t-violet-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tasks-page .contact-cell { font-size: 12.5px; color: var(--t-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasks-page .rep-cell { font-size: 12px; color: var(--t-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasks-page .chevron { color: var(--t-slate-light); width: 15px; height: 15px; }

.tasks-page .tasks-empty { padding: 40px 20px; text-align: center; color: var(--t-slate); font-size: 13px; }

.tasks-page .pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 0 0; font-size: 12.5px; color: var(--t-slate); }
.tasks-page .pagination .pg-link { cursor: pointer; }
.tasks-page .pagination .pg-link.disabled { opacity: .4; cursor: default; }
.tasks-page .pagination .pg-count { margin-left: 8px; color: var(--t-slate-light); }
.tasks-page .page-num { width: 26px; height: 26px; border-radius: 8px; background: var(--t-ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }

/* Completed rows (§2) — kept on the Tasks page, greyed */
.tasks-page .task-row.done { opacity: .6; }
.tasks-page .task-row.done .tt-done { text-decoration: line-through; }

/* §1 task preview slide-over panel */
.tk-page .task-panel-overlay { position: fixed; inset: 0; background: rgba(22, 10, 45, .28); opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 60; }
.tk-page .task-panel-overlay.show { opacity: 1; pointer-events: auto; }
.tk-page .task-panel { position: absolute; top: 0; right: 0; height: 100%; width: 400px; max-width: 92vw; background: #fff; box-shadow: -18px 0 50px -20px rgba(22, 10, 45, .4); border-left: 1px solid var(--t-border); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; }
.tk-page .task-panel-overlay.show .task-panel { transform: none; }
.tk-page .tp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--t-border); }
.tk-page .tp-close { border: none; background: none; font-size: 16px; color: var(--t-slate); cursor: pointer; line-height: 1; }
.tk-page .tp-body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.tk-page .tp-title { width: 100%; font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; margin: -7px -9px; background: transparent; color: var(--t-ink); }
.tk-page .tp-title:hover { background: var(--t-paper); }
.tk-page .tp-title:focus { outline: none; border-color: var(--t-violet); background: #fff; }
.tk-page .tp-account { border: 1px solid var(--t-border); border-radius: 10px; padding: 10px 12px; }
.tk-page .tp-company { font-weight: 700; font-size: 13.5px; color: var(--t-violet-deep); cursor: pointer; }
.tk-page .tp-company:hover { text-decoration: underline; }
.tk-page .tp-meta { font-size: 12px; color: var(--t-slate); margin-top: 2px; }
/* Click-to-call row inside the task panel */
.tk-page .tp-phone { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--t-border); font-size: 13.5px; }
.tk-page .tp-phone-ic { font-size: 14px; }
.tk-page .tp-phone-link { font-weight: 700; color: var(--t-teal, #1c7f7c); text-decoration: none; }
.tk-page .tp-phone-link:hover { text-decoration: underline; }
.tk-page .tp-phone-none { color: var(--t-slate); font-style: italic; }
/* Prev / Next navigation in the panel header */
.tk-page .tp-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; }
.tk-page .tp-nav-btn { border: 1px solid var(--t-border); background: #fff; color: var(--t-violet-deep); border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tk-page .tp-nav-btn:hover:not(:disabled) { background: var(--t-violet-deep); color: #fff; }
.tk-page .tp-nav-btn:disabled { opacity: .4; cursor: default; }
.tk-page .tp-nav-next { background: var(--t-violet-deep); color: #fff; }
.tk-page .tp-nav-next:hover:not(:disabled) { filter: brightness(1.12); }
.tk-page .tp-nav-count { font-size: 11.5px; color: var(--t-slate); font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }
.tk-page .tp-field { display: flex; flex-direction: column; gap: 5px; }
.tk-page .tp-field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--t-slate-light); }
.tk-page .tp-field select, .tk-page .tp-field input, .tk-page .tp-notes { border: 1px solid var(--t-border); border-radius: 9px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--t-ink); background: #fff; width: 100%; }
.tk-page .tp-field select:focus, .tk-page .tp-field input:focus, .tk-page .tp-notes:focus { outline: none; border-color: var(--t-violet); }
.tk-page .tp-due { display: flex; gap: 8px; }
.tk-page .tp-due input[type=date] { flex: 1.4; } .tk-page .tp-due input[type=time] { flex: 1; }
.tk-page .tp-static { font-size: 13px; color: var(--t-ink); padding: 2px 0; }
.hold-badge { display: inline-block; margin-left: 12px; vertical-align: middle; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(229,72,77,.4); }
/* Inline task action bar in the Activity feed (same actions as the popup) */
.task-actionbar-wrap { margin-top: 8px; }
.task-actionbar { display: flex; flex-wrap: wrap; gap: 6px; }
.task-actionbar .tab-btn { font-size: 12px; font-weight: 600; padding: 5px 11px; border: 1px solid var(--border, #e6e4ee); border-radius: 8px; background: #fff; color: var(--ink, #24222b); cursor: pointer; }
.task-actionbar .tab-btn:hover { background: var(--paper, #f6f6fb); }
.task-actionbar .tab-btn.done { border-color: #1c7f7c; color: #1c7f7c; }
.task-actionbar .tab-btn.done:hover { background: #1c7f7c; color: #fff; }
.tab-reschedule { display: none; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tab-reschedule .tab-dt { border: 1px solid var(--border, #e6e4ee); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; }
.bulk-bar .btn-mini.danger { background: #e5484d; color: #fff; border-color: #e5484d; }
.tk-page .tp-del { background: #fff; border: 1px solid #e5484d; color: #e5484d; border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.tk-page .tp-del:hover { background: #e5484d; color: #fff; }
.tasks-page .task-scope-toggle { display: inline-flex; border: 1px solid var(--t-border, #e6e4ee); border-radius: 9px; overflow: hidden; }
.tasks-page .task-scope { border: none; background: #fff; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--t-slate, #7a7a8c); cursor: pointer; }
.tasks-page .task-scope + .task-scope { border-left: 1px solid var(--t-border, #e6e4ee); }
.tasks-page .task-scope.on { background: linear-gradient(120deg, var(--t-violet, #5a2f9e), var(--t-blue-mid, #3d6ea0) 60%, var(--t-teal, #1c7f7c)); color: #fff; }
.tk-page .tp-notes { min-height: 90px; resize: vertical; }
/* Notes history (append-only log) */
.tk-page .tp-notes-wrap { display: flex; flex-direction: column; gap: 10px; }
.tk-page .tp-notes-hist { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.tk-page .tp-note-item { background: var(--t-paper, #f6f6fb); border: 1px solid var(--t-border); border-left: 3px solid var(--t-violet); border-radius: 8px; padding: 8px 10px; }
.tk-page .tp-note-text { font-size: 13px; color: var(--t-ink); white-space: pre-wrap; word-break: break-word; }
.tk-page .tp-note-meta { font-size: 11px; color: var(--t-slate, #7a7a8c); margin-top: 4px; }
.tk-page .tp-note-empty { font-size: 12.5px; color: var(--t-slate, #7a7a8c); padding: 4px 2px; }
.tk-page .tp-note-add { display: flex; flex-direction: column; gap: 8px; }
.tk-page .tp-note-add .tp-notes { min-height: 64px; }
.tk-page .tp-note-add-btn { align-self: flex-end; background: linear-gradient(120deg, var(--t-violet), var(--t-blue-mid) 60%, var(--t-teal)); color: #fff; border: none; border-radius: 9px; padding: 8px 16px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tk-page .tp-note-add-btn:disabled { opacity: .6; cursor: default; }
.tk-page .tp-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--t-border); }
.tk-page .tp-done { background: linear-gradient(120deg, var(--t-violet), var(--t-blue-mid) 60%, var(--t-teal)); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 700; cursor: pointer; }
.tk-page .tp-reopen { background: #fff; color: var(--t-ink); border: 1px solid var(--t-border); border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 700; cursor: pointer; }
.tk-page .tp-open { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--t-violet-deep); cursor: pointer; }

@media (max-width: 980px) {
  .tasks-page .t-row { grid-template-columns: 20px 22px 2fr 1fr; }
  .tasks-page .rep-cell, .tasks-page .contact-cell,
  .tasks-page .company-cell, .tasks-page .th:nth-child(5),
  .tasks-page .th:nth-child(6), .tasks-page .th:nth-child(7),
  .tasks-page .task-row .chevron { display: none; }
}

/* ==========================================================================
   Forms & Templates page (§3) + bulk-send shell (§4B)
   ========================================================================== */
.templates-page { max-width: 1100px; margin: 0 auto; padding-bottom: 40px; }
.templates-page .tpl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.templates-page .tpl-head h1 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.templates-page .tpl-head .sub { font-size: 12.5px; color: var(--slate); margin: 0; max-width: 60ch; }
.templates-page .btn-primary { background: linear-gradient(120deg, var(--violet), var(--blue-mid) 60%, var(--teal)); color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(90, 47, 158, .45); }
.templates-page .tpl-section { margin-bottom: 26px; }
.templates-page .tpl-h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate); margin: 0 0 12px; }

.templates-page .tpl-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.templates-page .tpl-empty { color: var(--slate); font-size: 13px; padding: 20px 0; }
.templates-page .tpl-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 15px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.templates-page .tpl-card:hover { border-color: var(--slate-light); box-shadow: var(--shadow); }
.templates-page .tpl-card-name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }
.templates-page .tpl-card-subj { font-size: 12.5px; font-weight: 600; color: var(--violet-deep); }
.templates-page .tpl-card-prev { font-size: 12px; color: var(--slate); line-height: 1.5; min-height: 34px; }
.templates-page .tpl-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.templates-page .tpl-mini, .tpl-editor .tpl-mini { border: 1px solid var(--border); background: var(--white); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.templates-page .tpl-mini:hover { border-color: var(--slate-light); }
.templates-page .tpl-mini.danger { color: var(--danger); }

/* Editor modal */
.tpl-editor .tpl-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.tpl-editor .tpl-body-input { min-height: 260px; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.tpl-editor .tpl-vars-label, .tpl-editor .tpl-preview-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate-light); margin: 12px 0 6px; }
.tpl-editor .tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-editor .tpl-var { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--border); background: var(--paper); border-radius: 7px; padding: 4px 8px; cursor: pointer; color: var(--violet-deep); }
.tpl-editor .tpl-var:hover { border-color: var(--violet); }
.tpl-editor .tpl-preview { border: 1px solid var(--border); border-radius: 10px; padding: 16px; min-height: 260px; max-height: 420px; overflow: auto; background: #fff; font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 13px; }
@media (max-width: 760px) { .tpl-editor .tpl-editor-grid { grid-template-columns: 1fr; } }

/* Bulk send shell */
.templates-page .bulk-section { background: var(--white); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 18px 20px; }
.templates-page .bulk-note { font-size: 12.5px; color: #8a5a12; background: rgba(200, 134, 43, .1); border: 1px solid rgba(200, 134, 43, .28); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; line-height: 1.5; }
.templates-page .bulk-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.templates-page .bulk-pick { display: flex; flex-direction: column; gap: 5px; }
.templates-page .bulk-pick > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate-light); }
.templates-page .bulk-select { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #fff; color: var(--ink); min-width: 160px; }
.templates-page .bulk-count { margin: 14px 0 4px; }
.templates-page .bulk-count-big { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.templates-page .bulk-count-skip { font-size: 12.5px; color: var(--warn); margin-top: 3px; }
.templates-page .bulk-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.templates-page .bulk-send { background: var(--slate-light); color: #fff; border: none; border-radius: 10px; padding: 11px 22px; font-size: 13px; font-weight: 700; cursor: not-allowed; opacity: .8; }
.templates-page .bulk-foot-note { font-size: 11.5px; color: var(--slate-light); }

/* §4A — template bar at the top of the email composer (per reference) */
.compose-template-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(120deg, #f4f0fb, #f8f5fc); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; }
.compose-template-bar .ctb-ico { display: inline-flex; color: var(--violet-deep); }
.compose-template-bar .ctb-ico svg { width: 16px; height: 16px; }
.compose-template-bar label { font-size: 12px; font-weight: 600; color: var(--violet-deep); white-space: nowrap; }
.compose-template-bar .ctb-select { flex: 1; border: 1px solid #ddd2f0; background: #fff; border-radius: 9px; padding: 8px 10px; font-size: 12.5px; color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Lead referrals — Ian's form + the recipient pop-up
   ========================================================================== */
.lead-size-row { display: flex; gap: 8px; }
.lead-size { flex: 1; border: 1px solid var(--border); background: var(--white); border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.lead-size.on { border-color: var(--violet-deep); background: rgba(90, 47, 158, .08); color: var(--violet-deep); }
.lead-recap { background: var(--paper); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }

/* Refer-a-lead prospect search */
.lead-search-results { border: 1px solid var(--border); border-radius: 10px; margin-top: 6px; overflow: hidden; max-height: 240px; overflow-y: auto; }
.lead-search-results.hidden { display: none; }
.lead-result { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.lead-result:last-child { border-bottom: none; }
.lead-result:hover { background: var(--paper); }
.lr-name { font-weight: 600; font-size: 13.5px; }
.lr-sub { font-size: 12px; color: var(--slate); margin-top: 1px; }
.lead-empty { font-size: 13px; color: var(--slate); padding: 12px; text-align: center; background: var(--paper); border: 1px dashed var(--border); border-radius: 10px; margin-top: 6px; }
.lead-selected { position: relative; border: 1px solid var(--violet-deep); background: rgba(90, 47, 158, .06); border-radius: 10px; padding: 12px 14px; margin-top: 6px; }
.lead-selected.hidden { display: none; }
.ls-name { font-weight: 700; font-size: 14px; color: var(--violet-deep); }
.ls-sub { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.ls-change { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border); background: var(--white); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }

/* Ian's leads-sent widget */
.leads-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.leads-tile { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 12px 10px; text-align: center; }
.leads-n { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--violet-deep); }
.leads-l { font-size: 11px; color: var(--slate); font-weight: 600; margin-top: 2px; }
.leads-breakdown { margin-top: 14px; }
.leads-bd-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate-light); margin-bottom: 6px; }
.lead-bd { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.lead-bd:last-child { border-bottom: none; }
.lead-bd-name { color: var(--slate); font-weight: 600; }
.lead-bd-n { font-family: var(--font-mono); font-weight: 600; }
.leads-conv-list { display: flex; flex-direction: column; }
.leads-conv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.leads-conv-row:last-child { border-bottom: none; }
.leads-conv-row:hover .lcr-name { color: var(--violet); }
.lcr-name { font-weight: 600; color: var(--violet-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcr-rep { font-size: 11px; font-weight: 700; color: var(--slate); background: var(--paper); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; flex-shrink: 0; }

/* Blocking overlay — no dismiss path; only "Create task" closes it. */
.lead-pop-host { position: fixed; inset: 0; z-index: 200; display: none; }
.lead-pop-host.has-leads { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: rgba(22, 10, 45, .5); overflow-y: auto; }
.lead-pop { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--violet-deep); border-radius: 16px; box-shadow: 0 24px 60px rgba(22, 10, 45, .4); padding: 18px 20px; width: 380px; max-width: calc(100vw - 40px); animation: leadPopIn .2s ease; }
@keyframes leadPopIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.lead-pop-head { margin-bottom: 8px; }
.lead-pop-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: linear-gradient(120deg, var(--violet-deep), var(--violet)); padding: 3px 9px; border-radius: 999px; }
.lead-pop-title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.lead-pop-meta { font-size: 12.5px; color: var(--slate); margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.lead-pop-size { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(61,110,160,.14); color: #2c5a86; margin-top: 2px; }
.lead-pop-size.small { background: rgba(42,167,104,.14); color: #1c7f4e; }
.lead-pop-note { color: var(--ink); font-style: italic; margin-top: 4px; }
.lead-pop-actions { display: flex; margin-top: 14px; }
.lead-pop-do { flex: 1; background: var(--violet-deep); color: #fff; border: none; border-radius: 9px; padding: 11px 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.lead-pop-do:hover { background: var(--violet); }
.lead-pop-must { font-size: 11px; color: var(--slate-light); text-align: center; margin-top: 8px; }

/* Moveable / resizable "Ian's leads" box — lists every un-actioned lead at once */
.lead-panel { position: fixed; z-index: 240; width: 420px; max-width: calc(100vw - 24px); height: 440px;
  min-width: 300px; min-height: 130px; max-height: calc(100vh - 24px);
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(22,10,45,.38); display: flex; flex-direction: column;
  overflow: hidden; resize: both; animation: leadPopIn .2s ease; }
.lead-panel.collapsed { height: auto !important; resize: none; min-height: 0; }
.lead-panel.collapsed .lead-panel-body, .lead-panel.collapsed .lead-panel-foot { display: none; }
.lead-panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: move; user-select: none;
  background: linear-gradient(120deg, var(--violet-deep), var(--violet)); color: #fff; }
.lead-panel-badge { font-size: 15px; }
.lead-panel-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; flex: 1; }
.lp-min { background: rgba(255,255,255,.2); color: #fff; border: none; border-radius: 6px; width: 24px; height: 24px;
  cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1; }
.lp-min:hover { background: rgba(255,255,255,.32); }
.lead-panel-body { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.lp-row { border: 1px solid var(--border); border-left: 3px solid var(--violet); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.lp-row-top { display: flex; align-items: center; gap: 8px; }
.lp-row-co { font-weight: 700; font-size: 14px; flex: 1; line-height: 1.2; }
.lp-row-meta { font-size: 12px; color: var(--slate); margin-top: 4px; display: flex; flex-direction: column; gap: 1px; }
.lp-row-note { font-size: 12.5px; font-style: italic; color: var(--ink); margin-top: 5px; }
.lp-row-actions { display: flex; gap: 8px; margin-top: 10px; }
.lp-row-actions button { flex: 1; border: none; border-radius: 8px; padding: 9px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.lp-do { background: var(--violet-deep); color: #fff; }
.lp-do:hover { background: var(--violet); }
.lp-call { background: #fff; color: var(--violet-deep); border: 1px solid var(--violet-deep) !important; }
.lp-call:hover { background: var(--paper); }
.lp-row-actions .lp-done { flex: 0 0 auto; background: #fff; color: var(--good); border: 1px solid rgba(42,167,104,.5) !important; padding: 9px 11px; }
.lp-row-actions .lp-done:hover { background: rgba(42,167,104,.1); }
.lead-panel-foot { padding: 8px 12px; font-size: 10.5px; color: var(--slate-light); border-top: 1px solid var(--border); line-height: 1.35; }

/* ---- Send a Flyer (reps) ---- */
.fl-page { max-width: 1100px; }
.fl-head h2 { font-family: var(--font-display); margin: 0 0 2px; }
.fl-sub { color: var(--slate); font-size: 13px; display: block; margin-bottom: 14px; max-width: 760px; }
.fl-step { display: flex; align-items: center; gap: 9px; margin: 16px 0 10px; font-size: 15px; }
.fl-stepno { width: 24px; height: 24px; border-radius: 50%; background: var(--violet-deep); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; font-family: var(--font-display); }
.fl-hint2 { color: var(--slate); font-size: 12.5px; font-weight: 400; }
.fl-flyers { display: flex; gap: 14px; flex-wrap: wrap; }
.fl-flyer { width: 190px; border: 2px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--white); transition: border-color .12s, box-shadow .12s; }
.fl-flyer:hover { border-color: var(--violet); }
.fl-flyer.on { border-color: var(--violet-deep); box-shadow: 0 6px 18px rgba(90,47,158,.22); }
.fl-thumb { width: 100%; height: 110px; object-fit: cover; display: block; }
.fl-flyer-name { padding: 9px 12px; font-weight: 600; font-size: 13.5px; font-family: var(--font-display); }
.fl-body { margin-top: 6px; }
.fl-cols { display: flex; gap: 20px; align-items: flex-start; }
.fl-left { flex: 1; min-width: 0; }
.fl-right { flex: 0 0 340px; }
.fl-previewlbl { font-size: 11.5px; color: var(--slate); margin-bottom: 6px; }
.fl-preview { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.fl-preview-btn { width: 100%; margin-top: 10px; background: #fff; color: var(--violet-deep); border: 1px solid var(--violet-deep); border-radius: 9px; padding: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.fl-preview-btn:hover { background: var(--paper); }
.fl-recbar { display: flex; gap: 8px; margin-bottom: 10px; }
.fl-sel, .fl-search { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--white); color: var(--ink); font-family: inherit; }
.fl-search { flex: 1; }
.fl-selall { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--violet-deep); margin-bottom: 8px; cursor: pointer; }
.fl-reclist { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.fl-rec { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.fl-rec:last-child { border-bottom: 0; }
.fl-rec:hover { background: var(--paper); }
.fl-rec.on { background: rgba(90,47,158,.07); }
.fl-rec input { width: 16px; height: 16px; accent-color: var(--violet); }
.fl-rec-main { flex: 1; min-width: 0; }
.fl-rec-co { font-weight: 600; font-size: 13.5px; }
.fl-rec-sub { font-size: 11.5px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-rec-type { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(61,110,160,.12); color: #2c5a86; }
.fl-sendrow { display: flex; gap: 10px; margin-top: 12px; }
.fl-send { background: var(--good); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; font-size: 14.5px; font-weight: 700; cursor: pointer; font-family: var(--font-display); }
.fl-send:disabled { background: var(--slate-light); cursor: default; }
.fl-clear { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 13px; cursor: pointer; color: var(--slate); }
.fl-prog { background: var(--violet-deep); color: #fff; border-radius: 9px; padding: 10px 14px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.fl-hint { color: var(--slate); font-size: 13px; padding: 10px 2px; }
.fl-report { margin-top: 8px; }
.fl-rtable { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.fl-rtable th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); background: #faf9fc; }
.fl-rtable td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.fl-rtable tr:last-child td { border-bottom: 0; }
.fl-rtable tr.fl-clicked { background: rgba(42,167,104,.06); }
.fl-rtable .fl-ok { color: var(--good); font-weight: 700; }
@media (max-width: 820px) { .fl-cols { flex-direction: column; } .fl-right { flex: 1; width: 100%; } }

/* Reports (admin) — lead-referral reporting */
.reports-page { max-width: 1100px; margin: 0 auto; padding-bottom: 40px; }
.reports-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.reports-head h1 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.reports-head .sub { font-size: 12.5px; color: var(--slate); margin: 0; }
.reports-filter { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.rep-bar-row { display: flex; flex-direction: column; gap: 5px; }
.rep-bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.rep-bar { height: 9px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.rep-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-deep), var(--teal)); }

/* ==========================================================================
   Quote builder
   ========================================================================== */
.qb-search { position: relative; margin-bottom: 12px; }
.qb-results { position: absolute; z-index: 40; left: 0; right: 0; margin-top: 4px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 78vh; overflow-y: auto; }
.qb-results.hidden { display: none; }
/* Uniform single-line search result: [picture] [code] [description…] [price].
   Every row is the same height; the picture slot is a fixed size (blank if the
   item has no image). */
.qb-result { display: grid; grid-template-columns: 22px 42px 30px 100px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.qb-pick { width: 16px; height: 16px; cursor: pointer; accent-color: var(--violet, #5a2f9e); }
.qb-result:last-child { border-bottom: none; }
.qb-result:hover { background: var(--paper); }
.qb-sup { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; text-align: center; padding: 3px 0; border-radius: 5px; letter-spacing: .3px; }
.qb-sup.sage { background: #eef1f4; color: #6b7280; }
.qb-sup.cat { background: #fff2e0; color: #b26a00; }
.qb-thumb { width: 28px; height: 28px; object-fit: contain; border-radius: 5px; border: 1px solid var(--border); background: #fff; }
.qb-thumb.empty { border: none; background: none; }
.qb-code { font-family: var(--font-mono); font-size: 11px; color: var(--violet-deep); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-desc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qb-desc-txt { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qb-price { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qb-empty { padding: 12px; text-align: center; color: var(--slate); font-size: 13px; }
.qb-cat-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #d97706; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.qb-cat-supp { display: inline-block; margin-left: 6px; font-size: 10.5px; color: #9a6a1a; font-weight: 600; }
.qb-cat-thumb { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; vertical-align: middle; margin-right: 6px; background: #fff; }
.qb-sage-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e7f5ec; color: #1f8f5a; font-size: 9.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.qb-cost-ref { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate); margin-top: 3px; white-space: nowrap; }
.qb-desc-in { width: 100%; max-width: 600px; border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 12.5px; font-family: inherit; line-height: 1.4; resize: vertical; min-height: 42px; }
/* Description is the dominant column; everything else stays on one line. */
.qb-table { width: 100%; }
.qb-table th:nth-child(3), .qb-table td:nth-child(3) { width: 46%; min-width: 220px; max-width: 620px; }
.qb-table th:not(:nth-child(3)), .qb-table td:not(:nth-child(3)) { white-space: nowrap; }
/* Keep the Remove (✕) column pinned to the right so it can never scroll out of reach. */
.qb-table td:last-child, .qb-table th:last-child { position: sticky; right: 0; background: var(--card, #fff); }
.qb-table td, .qb-table th { padding-left: 6px; padding-right: 6px; }
/* Give the customer-quote modal extra width + height so the results box and
   description have room without scrolling. */
.modal:has(.qb) { max-width: min(1060px, 95vw) !important; width: 100%; max-height: 95vh; }
/* Supplier Catalogues admin screen */
.cat-toolbar { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.cat-in { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; font-family: inherit; width: 100%; }
.cat-sel { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; min-width: 240px; }
.cat-addrow { display: grid; grid-template-columns: 1.4fr 0.8fr 0.6fr 1.6fr auto; gap: 8px; align-items: center; margin: 12px 0; padding: 10px; background: var(--paper); border-radius: 10px; }
.cat-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cat-table th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--slate); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cat-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cat-thumb { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: var(--white); }
.cat-thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--slate); font-size: 11px; }
.cat-map { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 10px 0; }
.cat-map label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: var(--slate); }
.cat-map .cat-sel { min-width: 0; width: 100%; }
.qb-table { width: 100%; border-collapse: collapse; }
.qb-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-light); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.qb-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.qb-num { width: 62px; border: 1px solid var(--border); border-radius: 7px; padding: 5px 6px; font-size: 13px; font-family: var(--font-mono); }
.qb-num:focus { outline: none; border-color: var(--violet); }
.qb-pricewrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.qb-mkgroup { display: flex; gap: 3px; }
.qb-mk { font-size: 9.5px; font-weight: 600; padding: 2px 5px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; color: var(--violet-deep); white-space: nowrap; }
.qb-mk:hover { background: var(--paper); border-color: var(--violet); }
.qb-cost-cell { color: var(--slate); white-space: nowrap; }
.qb-margin-pos { color: #1f8f5a; }
.qb-margin-neg { color: #e5484d; }
.qb-foot { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-top: 12px; }
.qb-foot-row { display: flex; justify-content: space-between; gap: 24px; min-width: 240px; font-size: 13px; color: var(--slate); }
.qb-foot-row .mono { font-family: var(--font-mono); color: var(--ink); }
.qb-foot-row.big { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); border-top: 2px solid var(--violet-deep); padding-top: 8px; margin-top: 4px; }
.qb-foot-row.big .mono { color: var(--ink); }
.qb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.compose-template-bar .ctb-quote { margin-left: auto; white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.domain-hint { font-size: 11px; color: var(--slate); margin-top: 4px; }

.feed-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.feed-ico svg { width: 15px; height: 15px; }
.feed-note { background: rgba(90,47,158,.10); color: var(--violet); }
.feed-task { background: rgba(61,110,160,.12); color: var(--blue-mid); }
.feed-email { background: rgba(42,167,164,.14); color: #1c7f7c; }
.feed-body { min-width: 0; flex: 1; }
.feed-body .fb-top { display: flex; align-items: center; gap: 8px; }
.feed-body .fb-time { font-size: 11px; color: var(--slate); font-family: var(--font-mono); }
.feed-body .fb-text { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

.tab-strip { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab-strip button { background: none; border: none; padding: 9px 14px; font-weight: 600; color: var(--slate); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-strip button.active { color: var(--violet-deep); border-bottom-color: var(--violet-deep); }

.item-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.item-row:last-child { border-bottom: none; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .done { text-decoration: line-through; color: var(--slate); }

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 90px; }
.settings-nav button { text-align: left; background: none; border: none; padding: 9px 12px; border-radius: var(--radius-sm); font-weight: 600; color: var(--slate); }
.settings-nav button.active { background: rgba(90,47,158,.1); color: var(--violet-deep); }
.rep-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rep-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--paper); border: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.rep-chip.inactive { opacity: .5; }
.rep-chip button { background: none; border: none; color: var(--slate); font-size: 15px; line-height: 1; padding: 0; }
.dropzone { border: 2px dashed var(--slate-light); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--slate); background: #faf9fc; }
.dropzone.drag { border-color: var(--violet); background: rgba(90,47,158,.05); }

/* Email signatures (Settings → Email signatures) */
.sig-block { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.sig-block:last-child { border-bottom: none; padding-bottom: 0; }
.sig-editor { min-height: 80px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--white); font-size: 13px; line-height: 1.5; }
.sig-editor:focus { outline: none; border-color: var(--violet); }
.sig-editor:empty::before { content: "No signature set — type one here."; color: var(--slate-light); }

/* ==========================================================================
   Auth screen
   ========================================================================== */
#auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #efeaf7 0%, var(--paper) 45%, #e7f3f2 100%); }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-card img { width: 84px; height: 84px; margin-bottom: 12px; }
.auth-card h1 { font-size: 24px; }
.auth-card p.sub { color: var(--slate); margin: 6px 0 22px; }
.auth-card form { text-align: left; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ==========================================================================
   Modal + toast
   ========================================================================== */
/* Modal sits above the lead pop-up's blocking overlay (z-index 200) so
   "Create task" is reachable; toasts/reminders stay above the modal. */
.modal-backdrop { position: fixed; inset: 0; background: rgba(22,21,27,.42); display: flex; align-items: center; justify-content: center; z-index: 210; padding: 20px; }
.modal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 22px; }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#reminder-host { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 230; width: 320px; max-width: calc(100vw - 36px); }
.reminder-card { background: var(--white); border: 1px solid var(--danger); border-left: 4px solid var(--danger); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 14px; animation: toastIn .2s ease; display: flex; flex-direction: column; max-height: 80vh; }
.reminder-card .rc-head { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--danger); font-size: 13px; flex-shrink: 0; }
.reminder-card .rc-title { font-weight: 600; margin: 4px 0 1px; flex-shrink: 0; }
.reminder-card .rc-sub { font-size: 12px; color: var(--slate); flex-shrink: 0; }
/* Long note history scrolls INSIDE the card so the action buttons stay reachable. */
.reminder-card .rc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 4px 0; }
.reminder-card .rc-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; flex-shrink: 0; }

#toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 240; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px; animation: toastIn .2s ease; }
.toast.good { background: var(--good); } .toast.bad { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---- FullCalendar theming ---------------------------------------------- */
.fc {
  --fc-button-bg-color: var(--violet-deep); --fc-button-border-color: var(--violet-deep);
  --fc-button-hover-bg-color: var(--violet); --fc-button-hover-border-color: var(--violet);
  --fc-button-active-bg-color: var(--violet); --fc-button-active-border-color: var(--violet);
  --fc-today-bg-color: rgba(90,47,158,.08);
  --fc-border-color: var(--border); --fc-page-bg-color: var(--white);
  --fc-neutral-bg-color: #faf9fc; --fc-list-event-hover-bg-color: #faf9fc;
  font-family: var(--font-body);
}
.fc .fc-toolbar-title { font-family: var(--font-display); font-size: 18px; }
.fc .fc-button { font-weight: 600; text-transform: capitalize; box-shadow: none; }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: var(--ink); text-decoration: none; }
.fc .fc-event { cursor: pointer; font-weight: 600; }
.fc-theme-standard .fc-scrollgrid { border-radius: var(--radius-sm); overflow: hidden; }
@media (max-width: 720px) { .fc .fc-toolbar { flex-direction: column; gap: 8px; } }

/* ---- Sales-order document -------------------------------------------------- */
.order-pill-active { background: var(--violet-deep) !important; border-color: var(--violet-deep) !important; color: #fff !important; }
.order-doc { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 24px 26px; box-shadow: var(--shadow-sm); }
.order-doc-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--violet-deep); padding-bottom: 14px; margin-bottom: 16px; }
.order-doc-head img { border-radius: 10px; }
.order-doc-table { width: 100%; border-collapse: collapse; }
.order-doc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); border-bottom: 1px solid var(--border); padding: 9px 10px; font-weight: 700; }
.order-doc-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.order-doc-table tbody tr:last-child td { border-bottom: none; }
.order-doc-totals { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--ink); }

.empty { text-align: center; color: var(--slate); padding: 26px; font-size: 13px; }
.spinner-page { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--slate); gap: 10px; }

/* ==========================================================================
   HP Contracts (Full Spec) — organiser + quote builder + document
   Matches hp-contracts-designs.html
   ========================================================================== */
.hp-page { max-width: 1180px; }
.hp-card { padding: 0; overflow: hidden; }
.hp-toolbar { display: flex; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: center; }
.hp-search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; flex: 1; max-width: 320px; }
.hp-search-ic svg { width: 14px; height: 14px; color: var(--slate); display: block; }
.hp-search input { border: none; background: none; outline: none; font-size: 12.5px; width: 100%; font-family: inherit; color: var(--ink); }
.hp-card .btn { background: linear-gradient(120deg, var(--violet), var(--blue-mid) 60%, var(--teal)); color: #fff; border: none; border-radius: 9px; padding: 9px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.hp-card .btn.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--border); }
.hp-card .btn.hidden { display: none; }

.hp-row { display: grid; grid-template-columns: 1.6fr 1.4fr 0.9fr 0.7fr 1fr 0.9fr 28px; gap: 14px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.hp-row:not(.hp-head) { cursor: pointer; }
.hp-row:not(.hp-head):hover { background: #faf9fd; }
.hp-row.is-archived { opacity: .62; }
.hp-head { background: var(--paper); }
.hp-head:hover { background: var(--paper); }
.hp-row .th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate-light); }
.hp-cust .name { font-size: 13px; font-weight: 700; }
.hp-cust .site { font-size: 11.5px; color: var(--slate); margin-top: 1px; }
.hp-device { font-size: 12px; }
.hp-device .serial { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate-light); margin-top: 1px; }
.hp-cell { font-size: 12px; }
.hp-ref { font-family: var(--font-mono); font-size: 11px; color: var(--slate); line-height: 1.5; }
.hp-pill { font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; display: inline-block; }
.hp-pill.active { background: #dcf5e7; color: #1f8f5a; }
.hp-pill.pending { background: #fdf0e2; color: #96601f; }
.hp-pill.expired { background: #f7e2e2; color: #a13d3d; }
.hp-actions { display: flex; justify-content: flex-end; align-items: center; }
/* grouped customer rows + expandable machine dropdown */
.hp-grouprow { cursor: pointer; }
.hp-caret { display: inline-block; transition: transform .12s; color: var(--slate-light); font-size: 11px; }
.hp-caret.open { transform: rotate(90deg); }
.hp-count { font-size: 11px; font-weight: 700; color: var(--slate); background: var(--paper); border-radius: 999px; padding: 2px 8px; }
.hp-detail { background: #fbfafd; border-bottom: 1px solid var(--border); }
.hp-drow { display: grid; grid-template-columns: 1.6fr 1.4fr 0.9fr 0.7fr 1fr 0.9fr 28px; gap: 14px; align-items: center; padding: 9px 20px 9px 34px; border-bottom: 1px solid var(--border); }
.hp-drow:last-child { border-bottom: none; }
.hp-dev { font-size: 12px; }
.hp-dev .serial { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate-light); }
.hp-mini-btn { border: 1px solid var(--border); background: var(--white); border-radius: 7px; font-size: 11px; font-weight: 600; padding: 4px 9px; cursor: pointer; color: var(--ink); margin-left: 5px; }
.hp-mini-btn:hover { border-color: var(--violet); color: var(--violet); }
.hp-mini-btn.ghost { color: var(--slate); }
.hp-icon-btn { width: 24px; height: 24px; border: 1px solid transparent; background: none; border-radius: 7px; cursor: pointer; color: var(--slate); font-size: 14px; line-height: 1; opacity: 0; transition: opacity .12s; }
.hp-row:hover .hp-icon-btn { opacity: 1; }
.hp-icon-btn:hover { background: var(--paper); border-color: var(--border); color: var(--ink); }

/* Quote builder (Screen 2) */
.hp-qb-banner { display: flex; align-items: center; gap: 8px; background: #fdeee6; border: 1px solid #f0c9ab; color: #96432b; font-size: 11.5px; font-weight: 600; padding: 10px 20px; border-radius: 10px; }
.hp-qb-banner svg { width: 14px; height: 14px; flex-shrink: 0; }
.hp-qb-section { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--slate-light); padding: 18px 2px 4px; }
.hp-basefee { display: flex; align-items: center; gap: 12px; margin: 4px 2px 8px; }
.hp-toner-ppp { margin: 8px 2px 2px; font-weight: 700; color: var(--violet, #5a2f9e); font-size: 13px; }
.hp-ppp { font-weight: 700; color: #1f8f5a; }
.hp-tipwrap { position: relative; display: inline-flex; align-items: center; margin-left: 8px; cursor: help; vertical-align: middle; }
.hp-tip-ico { font-size: 13px; color: var(--violet, #5a2f9e); }
.hp-tip-box { position: absolute; left: 0; top: 150%; z-index: 30; width: 240px; background: #16151b; color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s, transform .12s; text-transform: none; letter-spacing: normal; }
.hp-tipwrap:hover .hp-tip-box, .hp-tipwrap:focus-within .hp-tip-box { opacity: 1; visibility: visible; transform: translateY(0); }
.hp-qb-row { display: grid; grid-template-columns: 1.6fr 0.7fr 1fr 1fr 1fr 1fr 24px; gap: 12px; align-items: end; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.hp-qb-fl { font-size: 10px; font-weight: 600; color: var(--slate); margin-bottom: 5px; display: flex; align-items: center; gap: 4px; }
.hp-qb-fl .lock { color: var(--slate-light); }
.hp-qb-row input.dfield { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-family: inherit; }
.hp-cost-box { background: var(--paper); border: 1px dashed var(--slate-light); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-family: var(--font-mono); color: var(--slate); text-align: center; }
.hp-sell-box { border: 1.5px solid var(--teal); border-radius: 8px; padding: 6px 8px; font-size: 12px; font-family: var(--font-mono); font-weight: 700; color: var(--ink); background: #f1faf9; text-align: center; width: 100%; }
.hp-sell-box:focus { outline: none; border-color: var(--violet); }

/* HP import modal */
.hp-drop { border: 1.5px dashed var(--border); border-radius: 12px; padding: 22px; text-align: center; background: var(--paper); }
.hp-drop p { font-size: 13px; color: var(--slate); margin: 0 0 14px; line-height: 1.6; }
.hp-file { font-size: 13px; }
.hp-detect { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hp-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); }
.hp-chip.ok { background: #dcf5e7; color: #1f8f5a; border-color: transparent; }
.hp-chip.miss { background: var(--paper); color: var(--slate-light); }
.hp-imp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hp-stat { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.hp-stat.warn { border-color: #f0c9ab; background: #fdeee6; }
.hp-stat-n { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.hp-stat-l { font-size: 12px; font-weight: 600; margin-top: 2px; }
.hp-stat-s { font-size: 10.5px; color: var(--slate); margin-top: 1px; }
.hp-flags { margin-top: 8px; max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.hp-flag { font-size: 11.5px; font-family: var(--font-mono); color: var(--warn); padding: 3px 4px; border-bottom: 1px solid var(--border); }
.hp-flag:last-child { border-bottom: none; }
.hp-imp-actions { display: flex; gap: 10px; margin-top: 18px; }
.hp-imp-status { font-size: 12.5px; color: var(--slate); margin-top: 10px; min-height: 18px; }
.hp-imp-note { font-size: 11px; color: var(--slate-light); margin-top: 6px; line-height: 1.5; }

/* HP quote — guided step-by-step workflow */
.hp-wf { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.hp-wf-head { font-size: 12.5px; font-weight: 800; color: var(--slate); letter-spacing: .2px; margin-bottom: 4px; }
.hp-wf-step { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.hp-wf-step.active { border-color: var(--violet, #5a2f9e); box-shadow: 0 0 0 3px rgba(90,47,158,.12); background: #faf7ff; }
.hp-wf-step.done { opacity: .68; }
.hp-wf-step.todo { opacity: .55; }
.hp-wf-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: #ece7f5; color: var(--violet, #5a2f9e); }
.hp-wf-step.active .hp-wf-num { background: var(--violet, #5a2f9e); color: #fff; }
.hp-wf-step.done .hp-wf-num { background: #1f8f5a; color: #fff; }
.hp-wf-main { flex: 1; min-width: 0; }
.hp-wf-title { font-size: 13px; font-weight: 700; color: #16151b; }
.hp-wf-desc { font-size: 11.5px; color: var(--slate-light); margin: 2px 0 9px; line-height: 1.45; }
.hp-wf-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hp-wf-badge { margin-left: 8px; font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 20px; vertical-align: middle; }
.hp-wf-badge.ok { background: #e4f6ec; color: #1f8f5a; }
.hp-wf-badge.no { background: #fde8e8; color: #c0392b; }

/* ---- Customer survey: account tab + phone-capture form ---- */
.svq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.svq-pending { font-size: 12.5px; color: var(--slate); background: var(--paper); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.svq-resp { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.svq-resp-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.svq-resp-head::-webkit-details-marker { display: none; }
.svq-resp[open] .svq-resp-head { border-bottom: 1px solid var(--border); background: var(--paper); }
.svq-chan { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.svq-chan.email { background: rgba(90,47,158,.12); color: var(--violet); }
.svq-chan.phone { background: #e4f6ec; color: #1f8f5a; }
.svq-nps-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.svq-nps-pill.good { background: #e4f6ec; color: #1f8f5a; }
.svq-nps-pill.warn { background: #fbeed9; color: #9a6a11; }
.svq-nps-pill.bad { background: #fde8e8; color: #c0392b; }
.svq-resp-body { padding: 12px 14px; }
.svq-ans { padding: 8px 0; border-bottom: 1px solid #f2f0f7; }
.svq-ans:last-child { border-bottom: none; }
.svq-ans-q { font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 3px; }
.svq-ans-a { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; }
.svq-ans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 3px 18px; }
.svq-ans-grow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.svq-rate { font-weight: 700; font-size: 11.5px; }
.svq-rate.r-excellent { color: #1f8f5a; }
.svq-rate.r-good { color: #3d8f4a; }
.svq-rate.r-average { color: #9a6a11; }
.svq-rate.r-poor { color: #c0392b; }
/* phone-capture form inside the modal */
.svq-form .svq-q { padding: 12px 0; border-bottom: 1px solid #f0eef5; }
.svq-form .svq-q:last-child { border-bottom: none; }
.svq-form .svq-l { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.svq-form .svq-opt { display: flex; gap: 9px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; font-size: 13px; cursor: pointer; }
.svq-form .svq-opt:hover { border-color: var(--violet); }
.svq-form .svq-opt input, .svq-form .svq-cell input { width: 17px; height: 17px; accent-color: var(--violet); flex: 0 0 auto; }
.svq-form .svq-text { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; resize: vertical; min-height: 46px; }
.svq-form .svq-text:focus { outline: none; border-color: var(--violet); }
.svq-form .svq-grid { width: 100%; border-collapse: collapse; }
.svq-form .svq-grid th { font-size: 11px; color: var(--slate); font-weight: 600; padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.svq-form .svq-grid th:first-child { text-align: left; }
.svq-form .svq-rowl { font-size: 12.5px; padding: 7px 8px 7px 0; white-space: nowrap; }
.svq-form .svq-cell { text-align: center; padding: 6px 4px; }
.svq-form .svq-nps { display: flex; gap: 5px; flex-wrap: wrap; }
.svq-form .svq-nps-b { position: relative; }
.svq-form .svq-nps-b input { position: absolute; opacity: 0; width: 0; height: 0; }
.svq-form .svq-nps-b span { display: flex; align-items: center; justify-content: center; width: 34px; height: 36px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.svq-form .svq-nps-b.on span { background: var(--violet-deep); color: #fff; border-color: var(--violet-deep); }
.svq-form .svq-nps-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--slate); margin-top: 5px; }

/* ---- Settings: Themes tab ---- */
.theme-h { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--slate-light); margin: 20px 2px 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.theme-card { border: 2px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.theme-card:hover { border-color: var(--violet); }
.theme-card.active { border-color: var(--violet-deep); box-shadow: 0 0 0 3px rgba(90,47,158,.14); }
.theme-swatch { height: 56px; position: relative; }
.theme-tick { position: absolute; right: 8px; top: 7px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--violet-deep); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.theme-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.theme-del { border: none; background: none; color: var(--slate-light); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.theme-del:hover { color: #c0392b; }
.theme-custom { display: flex; gap: 14px; flex-wrap: wrap; }
.theme-colfield { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--slate); }
.theme-color { width: 64px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; padding: 3px; }
.theme-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* HP quote builder */
.hp-qb-modal { max-height: 88vh; overflow: auto; }
.hp-qb-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.hp-qb .dfield { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-family: inherit; }
.hp-qb .btn-sm { margin-top: 8px; }
.hp-ac { position: relative; }
.hp-ac-menu { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 10; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 230px; overflow: auto; }
.hp-ac-opt { padding: 8px 10px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.hp-ac-opt:last-child { border-bottom: none; }
.hp-ac-opt:hover { background: var(--paper); }
.hp-ac-create { color: var(--violet); font-weight: 600; background: rgba(90,47,158,.05); }
.hp-ac-create b { font-weight: 700; }
.hp-cust-badge { font-size: 11px; margin-top: 4px; min-height: 14px; }
.hp-cust-badge.linked { color: #1c7f4f; font-weight: 600; }
.hp-cust-badge.unlinked { color: #b26a1b; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .record-grid, .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .content { padding: 16px; }
  table.accounts .hide-sm { display: none; }
}

/* ---- Mandatory "quote sent" follow-up modal ----------------------------- */
.followup-backdrop { z-index: 250; } /* above the quote-builder / composer modals */
.followup-modal { max-width: 460px; }
.followup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.followup-head h2 { margin: 0; }
.followup-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: #e5484d; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.followup-intro { font-size: 12.5px; color: var(--slate); margin: 0 0 14px; line-height: 1.5; }
.followup-field, .followup-acct { margin-bottom: 12px; }
.followup-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); margin-bottom: 5px; }
.followup-input {
  width: 100%; box-sizing: border-box; font-size: 13.5px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--white);
  font-family: inherit; color: var(--ink);
}
.followup-input:focus { outline: none; border-color: var(--violet); }
textarea.followup-input { resize: vertical; min-height: 44px; }
.followup-acct-name { font-size: 14px; font-weight: 600; color: var(--ink); padding: 8px 11px; background: var(--paper); border-radius: 9px; }
.followup-results {
  position: absolute; z-index: 60; left: 0; right: 0; margin-top: 4px; background: var(--white);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 220px; overflow-y: auto;
}
.followup-opt { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; }
.followup-opt:last-child { border-bottom: none; }
.followup-opt:hover { background: var(--paper); }
.followup-opt-sub { font-size: 11.5px; color: var(--slate); margin-top: 1px; }
.followup-err { color: var(--danger); font-size: 12.5px; margin: -2px 0 10px; }
.followup-actions { justify-content: flex-end; }
.followup-actions .btn-primary { background: #e5484d; border-color: #e5484d; }
.followup-actions .btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Account record: Quotes tab (Sage + HP history) --------------------- */
.quote-hist { display: flex; flex-direction: column; }
.qh-row {
  display: grid; grid-template-columns: 20px 128px 72px minmax(0,1fr) auto auto auto 16px;
  gap: 10px; align-items: center; padding: 10px 10px;
  border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px;
}
.qh-actions { display: flex; gap: 2px; }
.qh-act { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .55; padding: 3px 4px; border-radius: 6px; line-height: 1; }
.qh-act:hover { opacity: 1; background: var(--border); }
.qh-del:hover { background: #fde8e8; }
.qh-status.qh-archived { background: #eceaf1; color: #807d8c; }
.qh-row:last-child { border-bottom: none; }
.qh-row:hover { background: var(--paper); }
.qh-date { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.qh-ref { font-size: 11px; color: var(--slate); }
.qh-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 0; border-radius: 6px; text-align: center; }
.qh-type-sage { background: rgba(90,47,158,.12); color: var(--violet); }
.qh-type-hp { background: rgba(42,167,164,.16); color: #1c7f7c; }
.qh-type-mc { background: rgba(61,110,160,.16); color: #3d6ea0; }
.cq-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border, #e6e3ee); }
.cq-item:last-child { border-bottom: none; }
.cq-item:hover { background: var(--paper, #f6f6fb); }
.qh-total { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh-status { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.qh-draft { background: #ece9f3; color: var(--slate); }
.qh-sent { background: rgba(61,110,160,.15); color: var(--blue-mid); }
.qh-accepted { background: rgba(42,167,104,.16); color: #1c7f4f; }
.qh-declined { background: rgba(201,75,75,.14); color: #b23b3b; }
.qh-by { font-size: 12px; color: var(--slate); white-space: nowrap; }
.qh-open { color: var(--slate-light); font-size: 14px; text-align: center; }
.qh-row:hover .qh-open { color: var(--violet); }

/* ---- Dashboard: Quotes awaiting a decision ------------------------------- */
.qa-list { display: flex; flex-direction: column; }
.qa-row {
  display: grid; grid-template-columns: minmax(0,1fr) 46px auto auto auto; gap: 10px; align-items: center;
  padding: 9px 8px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); border-radius: 8px;
}
.qa-row:last-child { border-bottom: none; }
.qa-row:hover { background: var(--paper); }
.qa-cta { font-size: 11.5px; font-weight: 700; color: var(--violet-deep); white-space: nowrap; opacity: 0; transition: opacity .12s; }
.qa-row:hover .qa-cta { opacity: 1; }
.kpi-click { transition: transform .1s, box-shadow .1s; }
.kpi-click:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,20,60,.10); }
.qa-co { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 0; border-radius: 6px; text-align: center; }
.qa-ref { font-size: 11.5px; color: var(--slate); white-space: nowrap; }
.qa-age { font-size: 11.5px; color: var(--slate); white-space: nowrap; }
.qa-row.stale { background: rgba(229,72,77,.06); }
.qa-row.stale .qa-age { color: #c0392b; font-weight: 600; }

/* Quote-outcome prompt buttons (Accepted / Declined / Still deciding) */
.outcome-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.outcome-actions .btn { flex: 1; min-width: 96px; }
.qh-by { display: flex; align-items: center; gap: 2px; }
.qh-wc { margin-left: 4px; cursor: pointer; font-size: 12px; }
.qh-wc:hover { opacity: .65; }

/* ---- Email thread reader (from the Activity feed) ------------------------ */
.activity-item.clickable { cursor: pointer; border-radius: 8px; transition: background .12s; }
.activity-item.clickable:hover { background: var(--paper); }
.email-thread { max-height: 60vh; overflow-y: auto; margin: 4px 0 2px; }
.email-thread-count { font-size: 11.5px; color: var(--slate); margin-bottom: 10px; }
.email-msg { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.email-msg:last-child { margin-bottom: 0; }
.email-msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.email-msg-dir { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; }
.email-msg-dir.sent { background: rgba(42,167,164,.16); color: #1c7f7c; }
.email-msg-dir.logged { background: #ece9f3; color: var(--slate); }
.email-msg-to { font-size: 12px; color: var(--slate); }
.email-msg-when { font-size: 11.5px; color: var(--slate-light); margin-left: auto; font-family: var(--font-mono); }
.email-msg-subj { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.email-msg-body { font-size: 13px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

/* ---- Duplicate-account warning (create-account form) --------------------- */
.dup-warn-host:empty { display: none; }
.dup-warn { border: 1px solid #f0c36d; background: #fdf6e6; border-radius: 10px; padding: 11px 13px; margin-bottom: 12px; }
.dup-warn-h { font-size: 12.5px; font-weight: 700; color: #9a6a12; margin-bottom: 8px; }
.dup-warn-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.6); margin-bottom: 5px; }
.dup-warn-row:hover { background: #fff; }
.dup-warn-name { font-size: 13px; font-weight: 600; }
.dup-warn-why { font-size: 11px; color: var(--slate); margin-left: 2px; }
.dup-warn-go { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--violet); }
.dup-warn-foot { font-size: 11px; color: #9a6a12; margin-top: 4px; }

/* ---- Multiple phone numbers (account Details tab) ------------------------ */
.phone-mgr { margin-bottom: 10px; }
.phone-row { display: grid; grid-template-columns: 104px 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 7px; }
.phone-label { min-width: 0; }
.phone-num { min-width: 0; }
.phone-call { white-space: nowrap; }
.phone-rm { border: none; background: none; cursor: pointer; color: var(--slate-light); font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.phone-rm:hover { color: var(--danger); background: #f6eef0; }
.phone-add-row .phone-add { grid-column: 3 / 5; }

/* Call button next to the phone in the About card */
.about-phone { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.about-phone .about-input { flex: 1; min-width: 0; }
.about-call { border: 1px solid var(--border); background: var(--white); cursor: pointer; border-radius: 7px; font-size: 12px; line-height: 1; flex-shrink: 0; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.about-call:hover { background: var(--paper); border-color: var(--violet); }

/* Clickable email in the Accounts list */
.row-action-mail { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; text-decoration: none; color: var(--violet); }
.row-action-mail:hover { text-decoration: underline; }
.row-action-mail .rae-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- HubSpot-style email card in the Activity feed ---------------------- */
.ec-card { border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; background: #fff; overflow: hidden; box-shadow: 0 1px 2px rgba(22,10,45,.04); }
.ec-card.open { box-shadow: 0 8px 24px -14px rgba(22,10,45,.22); }
.ec-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; }
.ec-head:hover { background: var(--paper); }
.ec-ico { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: rgba(42,167,164,.14); color: #1c7f7c; display: flex; align-items: center; justify-content: center; }
.ec-ico svg { width: 16px; height: 16px; }
.ec-head-main { flex: 1; min-width: 0; }
.ec-subj { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ec-subj-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; flex: 0 0 auto; }
.ec-tag.sent { background: rgba(42,167,164,.16); color: #1c7f7c; }
.ec-tag.logged { background: #ece9f3; color: var(--slate); }
.ec-tag.received { background: rgba(51,6,107,.12); color: #4a0f8f; }
.inbox-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; padding: 8px 12px; background: #f5f2fb; border: 1px solid #ece6f7; border-radius: 9px; }
.ec-meta { font-size: 11.5px; color: var(--slate); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-chev { color: var(--slate-light); font-size: 12px; flex: 0 0 auto; }
.ec-body { border-top: 1px solid var(--border); padding: 12px 14px; }
.ec-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.ec-actions .ec-del { margin-left: auto; color: var(--danger); }
.ec-frame { width: 100%; border: none; min-height: 60px; background: #fff; }
.ec-plain { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.55; color: var(--ink); }
.ec-stats { margin-bottom: 8px; }
.ec-clicks { font-size: 11.5px; font-weight: 600; color: #1c7f7c; background: rgba(42,167,164,.12); padding: 3px 9px; border-radius: 999px; }

/* ---- Accounts page: count, pager, bulk-assign ---------------------------- */
.acc-count { font-size: 12.5px; color: var(--slate); margin: 2px 0 10px; }
.acc-count b { color: var(--ink); font-size: 14px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 2px; flex-wrap: wrap; }
.pager-size { border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; background: var(--white); }
.pager-info { font-size: 12px; color: var(--slate); }
.pager-page { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.bulk-sel { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.bulk-sel option { color: #16151b; }
.bulk-lbl { font-size: 12px; color: rgba(255,255,255,.85); }
.bulk-clear { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }

/* Person tasks on the People tab (task pinned to a specific contact) */
.person-tasks { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.person-task { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4a4458; }
.pt-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); flex: none; }
.pt-title { font-weight: 600; }
.pt-due { color: #9c97ab; }
.person-task-count { background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex: none; }

/* ============================================================================
   Marketing module (Settings > Marketing) — campaign library + block builder
   ============================================================================ */
.mk { display: flex; flex-direction: column; gap: 14px; }
.mk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mk-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; }
.mk-sub { font-size: 12.5px; color: var(--slate); margin: 4px 0 0; max-width: 640px; line-height: 1.5; }
.mk-list { display: flex; flex-direction: column; gap: 18px; }
.mk-empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--slate); font-size: 13px; }
.mk-empty.small { padding: 16px; }
.mk-cat-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--violet-deep); margin-bottom: 8px; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mk-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .1s; }
.mk-card:hover { border-color: var(--violet); transform: translateY(-1px); }
.mk-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mk-card-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.mk-sent-on { font-size: 11px; color: var(--slate-light); white-space: nowrap; }
.mk-card-subj { font-size: 12.5px; color: var(--slate); margin: 4px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--paper); color: var(--slate); border: 1px solid var(--border); }
.mk-chip.open { background: rgba(42,167,164,.12); color: #1c7370; border-color: rgba(42,167,164,.25); }
.mk-chip.click { background: rgba(90,47,158,.10); color: var(--violet-deep); border-color: rgba(90,47,158,.20); }
.mk-badge-draft { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); background: rgba(200,134,43,.12); color: var(--warn); border: 1px solid rgba(200,134,43,.22); }

/* Builder */
.mk-builder { gap: 12px; position: relative; }
.mk-topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.mk-back { border: 1px solid var(--border); background: var(--white); color: var(--ink); border-radius: var(--radius-sm); padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mk-back:hover { border-color: var(--violet); color: var(--violet); }
.mk-name-input { flex: 1 1 220px; min-width: 160px; font-size: 14px; font-weight: 600; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); }
.mk-select, .mk-input, .mk-field { font-family: inherit; font-size: 13px; color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; background: var(--white); width: 100%; }
.mk-select { width: auto; }
.mk-name-input:focus, .mk-input:focus, .mk-field:focus, .mk-select:focus { outline: none; border-color: var(--violet); }
.mk-topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.mk-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mk-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--slate); }
.mk-lbl > span { color: var(--slate); }
.mk-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .mk-split { grid-template-columns: 1fr; } }
.mk-editor { display: flex; flex-direction: column; gap: 10px; }
.mk-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--paper); }
.mk-palette-label { font-size: 12px; font-weight: 700; color: var(--slate); margin-right: 2px; }
.mk-add { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--white); color: var(--ink); border-radius: var(--radius-pill); padding: 5px 11px; cursor: pointer; }
.mk-add:hover { border-color: var(--violet); color: var(--violet); }
.mk-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.mk-block-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; }
.mk-drag { cursor: grab; color: var(--slate-light); font-size: 15px; line-height: 1; padding: 0 2px; user-select: none; flex: 0 0 auto; }
.mk-drag:hover { color: var(--violet); }
.mk-drag:active { cursor: grabbing; }
.mk-block.mk-dragging { opacity: .45; }
.mk-block.mk-drop-target { box-shadow: 0 -3px 0 var(--violet), var(--shadow-sm); }
.mk-block-title { flex: 1; min-width: 0; }
.mk-block-title { font-size: 12.5px; color: var(--ink); }
.mk-block-btns { display: flex; gap: 4px; }
.mk-ico { border: 1px solid var(--border); background: var(--white); color: var(--slate); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 12px; line-height: 1; }
.mk-ico:hover { border-color: var(--violet); color: var(--violet); }
.mk-ico.danger:hover { border-color: var(--danger); color: var(--danger); }
.mk-block-fields { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mk-textarea { resize: vertical; min-height: 60px; font-family: inherit; line-height: 1.5; }
.mk-img-row { display: flex; gap: 6px; align-items: center; }
.mk-upload { flex: none; border: 1px solid var(--border); background: var(--white); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mk-upload:hover { border-color: var(--violet); color: var(--violet); }
.mk-thumb { margin-top: 6px; max-width: 140px; max-height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.mk-preview { position: sticky; top: 8px; }
.mk-preview-label { font-size: 11.5px; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.mk-preview-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #f4f2f9; }
.mk-audience { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--white); }
.mk-aud-h { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.mk-send-step { min-width: min(560px, 90vw); }
.mk-step-hint { font-size: 12.5px; color: var(--slate); margin-bottom: 14px; line-height: 1.5; }
.mk-fullpreview-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.mk-range { width: 100%; accent-color: var(--violet); cursor: pointer; }
.mk-range-val { font-weight: 700; color: var(--violet-deep); font-size: 12px; }

/* Dashboard data-health strip */
.health-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); font-size: 12px; }
.health-strip.alert { border-color: #f0c9ab; background: #fdeee6; }
.health-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.health-chip.good { color: #1f8f5a; }
.health-chip.warn { color: #9a6a11; }
.health-chip.bad { color: #c0392b; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.health-warn-note { margin-left: auto; color: #96432b; font-weight: 700; }
.mk-add.mk-add-top { border-color: var(--violet); color: var(--violet-deep); font-weight: 700; }
.mk-add.mk-add-top:hover { background: rgba(90,47,158,.08); }
.mk-aud-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.mk-count { margin-top: 12px; }
.mk-count-big { font-size: 14px; font-weight: 700; color: var(--violet-deep); }
.mk-count-skip { font-size: 12px; color: var(--slate); margin-top: 3px; }
.mk-progress { position: sticky; top: 0; z-index: 5; background: var(--white); border: 1px solid var(--violet); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 6px; box-shadow: var(--shadow); }
.mk-progress-track { height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.mk-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--violet-deep), var(--teal)); transition: width .3s; }
.mk-progress-txt { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-top: 7px; }

/* Activity-feed marketing badge + open/click chips */
.ec-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(90,47,158,.10); color: var(--violet-deep); }
.ec-opens { font-size: 12px; color: var(--slate); }

/* ============================================================================
   Recurring meetings — agenda modal, calendar hover card, flashing reminder
   ============================================================================ */
.mtg-brief { display: flex; flex-direction: column; gap: 12px; }
.mtg-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mtg-when { font-size: 12.5px; font-weight: 700; color: var(--violet-deep); background: rgba(90,47,158,.10); border: 1px solid rgba(90,47,158,.20); padding: 4px 10px; border-radius: var(--radius-pill); }
.mtg-hint { font-size: 12px; color: var(--slate); }
.mtg-purpose { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.mtg-tip { font-size: 12px; color: var(--slate); background: var(--paper); border-radius: var(--radius-sm); padding: 8px 11px; }
.mtg-agenda { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .mtg-agenda { grid-template-columns: 1fr; } }
.mtg-sec { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--white); }
.mtg-sec-h { font-size: 12.5px; font-weight: 700; color: var(--violet-deep); margin-bottom: 6px; }
.mtg-sec-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.mtg-sec-list li { font-size: 12.5px; color: var(--body, #3a3844); line-height: 1.45; }

/* Hover preview card on the calendar */
.mtg-hover { position: fixed; z-index: 9000; max-width: 300px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 14px; pointer-events: none; }
.mtg-hover-title { font-size: 13px; font-weight: 700; color: var(--violet-deep); }
.mtg-hover-purpose { font-size: 12px; color: var(--ink); line-height: 1.45; margin-top: 4px; }
.mtg-hover-agenda { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.mtg-hover-sec { font-size: 11.5px; color: var(--slate); }
.mtg-hover-tip { font-size: 11px; color: var(--slate-light); margin-top: 8px; font-style: italic; }

/* Flashing meeting reminder — hard to miss */
.reminder-card.meeting { border-left: 4px solid var(--violet-deep); }
@keyframes rc-flash {
  0%, 100% { box-shadow: 0 4px 16px rgba(22,21,27,.12); border-color: var(--border); }
  50%      { box-shadow: 0 0 0 4px rgba(200,134,43,.55), 0 4px 20px rgba(200,134,43,.35); border-color: var(--warn); }
}
.reminder-card.flashing { animation: rc-flash 1s ease-in-out infinite; }

/* Delete-account: admin-only danger tool + deleted-account banner */
.rec-tool.danger { color: var(--danger); border-color: rgba(201,75,75,.35); }
.rec-tool.danger:hover { background: rgba(201,75,75,.10); border-color: var(--danger); }
.rec-deleted-banner { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(201,75,75,.10); border: 1px solid rgba(201,75,75,.30); color: var(--danger); font-size: 12.5px; font-weight: 600; }
.rec-deleted-banner b { font-weight: 700; }

/* Merge accounts modal */
.mrg-body { display: flex; flex-direction: column; gap: 12px; }
.mrg-primary { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.mrg-primary-name { font-weight: 700; font-size: 14px; color: var(--violet-deep); }
.mrg-search { width: 100%; }
.mrg-results { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.mrg-results:empty { display: none; }
.mrg-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; cursor: pointer; background: var(--white); }
.mrg-row:hover { border-color: var(--violet); background: rgba(90,47,158,.04); }
.mrg-row-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.mrg-row-sub { font-size: 11.5px; color: var(--slate); }
.mrg-empty { font-size: 12.5px; color: var(--slate); padding: 8px 4px; }
.mrg-chosen { border: 1px solid var(--violet); border-radius: var(--radius-sm); padding: 10px 12px; background: rgba(90,47,158,.05); position: relative; }
.mrg-chosen-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.mrg-change { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border); background: var(--white); border-radius: 7px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; color: var(--slate); }
.mrg-change:hover { border-color: var(--violet); color: var(--violet); }
.mrg-warn { font-size: 12.5px; line-height: 1.5; color: var(--ink); background: rgba(200,134,43,.10); border: 1px solid rgba(200,134,43,.30); border-radius: var(--radius-sm); padding: 10px 12px; }
.mrg-warn b { color: var(--violet-deep); }

/* Account record top bar: back link + Prev/Next through the source list */
.rec-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.acct-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 6px; box-shadow: var(--shadow-sm); }
.acct-nav .btn { border-radius: var(--radius-pill); }
.acct-nav-pos { font-size: 12px; font-weight: 600; color: var(--slate); padding: 0 4px; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }

/* Export preset chips */
.export-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.export-chip { border-radius: var(--radius-pill); }
.export-chip:hover { border-color: var(--violet); color: var(--violet); }

/* Task documents (attachments in the slide-over panel) */
.tp-docs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tp-doc-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.tp-doc-ic { flex: none; }
.tp-doc-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--violet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tp-doc-name:hover { text-decoration: underline; }
.tp-doc-size { font-size: 11px; color: var(--slate); flex: none; }
.tp-doc-del { flex: none; border: none; background: transparent; color: var(--slate-light); cursor: pointer; font-size: 13px; padding: 0 2px; }
.tp-doc-del:hover { color: var(--danger); }
.tp-note-empty { font-size: 12px; color: var(--slate); }

/* Meeting agenda documents block */
.mtg-docs-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

/* Marketing — Review Recipients screen */
.mk-review { display: flex; flex-direction: column; gap: 12px; }
.mk-review-privacy { font-size: 12.5px; line-height: 1.55; color: var(--ink); background: rgba(42,167,164,.10); border: 1px solid rgba(42,167,164,.30); border-radius: var(--radius-sm); padding: 10px 12px; }
.mk-review-privacy b { color: #1c7370; }
.mk-review-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
@media (max-width: 820px) { .mk-review-split { grid-template-columns: 1fr; } }
.mk-review-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mk-review-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--slate); }
.mk-review-frame { width: 100%; height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: #f4f2f9; }
.mk-review-list { border: 1px solid var(--border); border-radius: var(--radius); max-height: 380px; overflow-y: auto; background: var(--white); }
.mk-review-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.mk-review-row:last-child { border-bottom: none; }
.mk-review-num { color: var(--slate-light); font-size: 11px; text-align: right; }
.mk-review-co { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-review-em { color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-review-note { font-size: 11.5px; color: var(--slate); }

/* Meeting popup — per-week notes/docs + last-time recap */
.mtg-thisweek { font-size: 12px; font-weight: 600; color: var(--slate); }
.mtg-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--white); }
.mtg-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mtg-recap-block { background: rgba(90,47,158,.05); border-color: rgba(90,47,158,.20); }
.mtg-recap { display: flex; flex-direction: column; gap: 6px; }
.mtg-recap-when { font-size: 11.5px; font-weight: 700; color: var(--violet-deep); }
.mtg-recap-notes { font-size: 12.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.mtg-notes { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; min-height: 90px; }
.mtg-notes:focus { outline: none; border-color: var(--violet); }
.mtg-notes-status { min-height: 14px; }

/* Meeting popup — rearrange (reschedule) row */
.mtg-rs-block { background: var(--paper); }
.mtg-rs-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.mtg-rs-f { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--slate); }

/* Month-end call check reminder */
.reminder-card.monthend { border-left: 4px solid var(--teal); }
.me-list { max-height: 240px; overflow-y: auto; margin: 8px 0 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; text-decoration: none; }
.me-row:last-child { border-bottom: none; }
.me-row:hover { background: rgba(42,167,164,.08); }
.me-co { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-ph { color: var(--slate); font-size: 11.5px; white-space: nowrap; }

/* Call recording mic in the activity feed */
.call-mic { margin-left: 8px; border: 1px solid var(--border); background: var(--white); color: var(--slate); width: 26px; height: 26px; border-radius: 999px; cursor: pointer; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.call-mic svg { width: 14px; height: 14px; }
.call-mic.has-rec { color: var(--violet); border-color: rgba(90,47,158,.35); }
.call-mic.has-rec:hover { background: rgba(90,47,158,.10); }
.call-mic.playing { background: var(--violet); color: #fff; border-color: var(--violet); }
.call-audio-host:not(:empty) { margin: 8px 0 4px; }
.call-audio { width: 100%; max-width: 340px; height: 34px; }

/* Accounts quick-select batch row */
.acc-quickselect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.acc-quickselect .small.muted { margin-right: 2px; }

/* ===== Furniture quote builder ===== */
.fq-backdrop { position: fixed; inset: 0; z-index: 4000; background: rgba(16,15,27,.55); display: flex; align-items: center; justify-content: center; padding: 2vh; }
.fq-panel { width: min(1180px, 97vw); height: 94vh; background: #fff; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.fq-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: linear-gradient(120deg,#33066b,#5a2f9e 60%,#2aa7a4); color: #fff; }
.fq-title { font-weight: 700; font-size: 16px; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-head-controls { display: flex; gap: 14px; margin-left: auto; }
.fq-head .fq-lbl { color: rgba(255,255,255,.9); font-size: 11px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.fq-margin-in { width: 74px; padding: 5px 8px; border-radius: 7px; border: none; font: inherit; font-size: 13px; }
.fq-close { border: none; background: rgba(255,255,255,.18); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.fq-body { flex: 1; display: grid; grid-template-columns: 380px 1fr; min-height: 0; }
.fq-left { border-right: 1px solid var(--border,#e6e3ee); display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 10px; }
.fq-search { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border,#e6e3ee); border-radius: 9px; font: inherit; font-size: 14px; }
.fq-results { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fq-res { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border,#e6e3ee); border-radius: 10px; cursor: pointer; }
.fq-res:hover { background: #f7f6fb; border-color: #c9bbe0; }
.fq-res-img { width: 52px; height: 52px; object-fit: contain; border-radius: 7px; background: #fff; flex: 0 0 52px; }
.fq-res-info { flex: 1; min-width: 0; }
.fq-res-title { font-size: 13px; font-weight: 600; color: #16151b; line-height: 1.3; }
.fq-res-sub { font-size: 11px; color: #807d8c; margin-top: 2px; }
.fq-hint { color: #807d8c; font-size: 13px; padding: 14px; text-align: center; }
.fq-right { display: flex; flex-direction: column; min-height: 0; }
.fq-lines { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fq-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border,#e6e3ee); border-radius: 12px; }
.fq-line-img { width: 74px; height: 74px; object-fit: contain; border: 1px solid var(--border,#e6e3ee); border-radius: 8px; background: #fff; flex: 0 0 74px; }
.fq-line-main { flex: 1; min-width: 0; }
.fq-line-title { font-weight: 700; font-size: 14px; color: #16151b; margin-bottom: 8px; }
.fq-line-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.fq-lbl { font-size: 11px; color: #57545f; font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.fq-head .fq-lbl, .fq-line-price .fq-lbl { flex-direction: row; align-items: center; }
.fq-colour { max-width: 260px; padding: 5px 8px; border: 1px solid var(--border,#e6e3ee); border-radius: 7px; font: inherit; font-size: 12.5px; }
.fq-qty { width: 64px; padding: 5px 8px; border: 1px solid var(--border,#e6e3ee); border-radius: 7px; font: inherit; }
.fq-line-price { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 150px; }
.fq-cost { font-size: 11px; color: #807d8c; }
.fq-sell { width: 90px; padding: 5px 8px; border: 1px solid var(--border,#e6e3ee); border-radius: 7px; font: inherit; text-align: right; }
.fq-margin { font-size: 11px; color: #1c7f7c; font-weight: 600; }
.fq-margin.low { color: #c0392b; }
.fq-line-total { font-size: 16px; font-weight: 700; color: #33066b; font-family: ui-monospace, monospace; }
.fq-del { border: none; background: none; color: #b0adbb; cursor: pointer; font-size: 15px; padding: 2px 4px; }
.fq-del:hover { color: #c0392b; }
.fq-totals { border-top: 1px solid var(--border,#e6e3ee); padding: 12px 18px; background: #faf9fc; }
.fq-trow { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: #57545f; max-width: 340px; margin-left: auto; }
.fq-trow.grand { font-weight: 700; font-size: 16px; color: #16151b; border-top: 2px solid #16151b; margin-top: 4px; padding-top: 6px; }
.fq-profit { font-size: 11.5px; color: #1c7f7c; text-align: right; margin-top: 6px; font-weight: 600; }
.fq-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border,#e6e3ee); }
@media (max-width: 800px) { .fq-body { grid-template-columns: 1fr; } .fq-left { border-right: none; border-bottom: 1px solid var(--border,#e6e3ee); max-height: 40%; } }

/* ===== Quotes to chase — dashboard board ===== */
.qa-card .qa-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qa-scope { display: inline-flex; background: #f1eff6; border-radius: 9px; padding: 3px; gap: 2px; }
.qa-scope-btn { border: none; background: none; padding: 5px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: #57545f; cursor: pointer; }
.qa-scope-btn.on { background: #fff; color: #33066b; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qa-summary { font-size: 12.5px; color: #57545f; margin-bottom: 10px; }
.qa-summary b { color: #16151b; }
.qa-sum-stale { color: #c0392b; font-weight: 600; }
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa-row2 { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 0; border: 1px solid var(--border,#e6e3ee); border-radius: 11px; cursor: pointer; overflow: hidden; transition: box-shadow .12s, transform .12s; background: #fff; }
.qa-row2:hover { box-shadow: 0 3px 12px rgba(51,6,107,.1); }
.qa-bar { width: 5px; align-self: stretch; border-radius: 11px 0 0 11px; flex: 0 0 5px; }
.qa-row2.tone-green .qa-bar { background: #2aa7a4; }
.qa-row2.tone-amber .qa-bar { background: #e6a417; }
.qa-row2.tone-red   .qa-bar { background: #d5453f; }
.qa-row2.tone-red { background: #fdf5f4; border-color: #f3cfcc; }
.qa-main { flex: 1; min-width: 0; }
.qa-co2 { font-weight: 700; font-size: 13.5px; color: #16151b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.qa-ref2 { font-size: 11.5px; color: #807d8c; }
.qa-val { font-size: 11.5px; font-weight: 700; color: #33066b; }
.qa-rep { font-size: 11px; color: #807d8c; background: #f1eff6; padding: 1px 7px; border-radius: 10px; }
.qa-age2 { font-size: 12px; white-space: nowrap; font-weight: 600; }
.qa-age2.age-green { color: #1c7f7c; }
.qa-age2.age-amber { color: #b9791f; }
.qa-age2.age-red   { color: #c0392b; }
.qa-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.qa-btn { border: 1px solid var(--border,#e6e3ee); background: #fff; color: #33066b; border-radius: 8px; padding: 6px 11px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.qa-btn:hover { background: #f7f6fb; }
.qa-btn-primary { background: #33066b; color: #fff; border-color: #33066b; }
.qa-btn-primary:hover { filter: brightness(1.15); background: #33066b; }
@media (max-width: 640px) { .qa-row2 { flex-wrap: wrap; } .qa-age2, .qa-acts { margin-left: 17px; } }

/* ===== Lead Finder ===== */
.lf-page { max-width: 1320px; }
.lf-body { display: flex; gap: 22px; align-items: flex-start; }
.lf-main { flex: 1; min-width: 0; }
.lf-lists { flex: 0 0 280px; width: 280px; position: sticky; top: 12px; background: #faf9fc; border: 1px solid var(--border,#e6e3ee); border-radius: 14px; padding: 14px; }
@media (max-width: 900px) { .lf-body { flex-direction: column; } .lf-lists { width: 100%; flex: none; position: static; } }
.lf-lists-head { font-size: 14px; color: #33066b; margin-bottom: 10px; }
.lf-lists-hint { font-size: 12.5px; color: #807d8c; line-height: 1.5; }
.lf-listcard { display: flex; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.lf-list-open { flex: 1; text-align: left; background: #fff; border: 1px solid var(--border,#e6e3ee); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.lf-list-open:hover { border-color: #c9bbe0; background: #f7f3fd; }
.lf-list-name { font-size: 13px; font-weight: 700; color: #16151b; }
.lf-list-count { font-size: 11px; color: #807d8c; }
.lf-list-del { background: none; border: 1px solid var(--border,#e6e3ee); border-radius: 10px; color: #b0adbb; cursor: pointer; padding: 0 10px; font-size: 13px; }
.lf-list-del:hover { color: #c0392b; border-color: #f3cfcc; }
.lf-emailonly { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #57545f; cursor: pointer; }
.lf-emailonly input { width: 16px; height: 16px; accent-color: #33066b; cursor: pointer; }
.lf-saveaslist { margin-left: 12px; background: #fff; border: 1px solid #c9bbe0; color: #5a2f9e; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.lf-saveaslist:hover { background: #f3eefb; }
/* Hot Leads */
.nav-badge { margin-left: auto; background: #d5453f; color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
.hot-new { border-color: #f0cfcf !important; box-shadow: 0 0 0 3px rgba(213,69,63,.08); }
.hot-when { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.hot-badge { background: #d5453f; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 10px; letter-spacing: .5px; }
.hot-time { font-size: 11.5px; color: #807d8c; }
.hot-url { margin: 8px 0 10px; font-size: 12.5px; color: #57545f; word-break: break-all; }
.hot-url a { color: #33066b; }
.lf-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lf-head h2 { margin: 0; font-size: 22px; }
.lf-sub { color: #807d8c; font-size: 13px; }
.lf-filters { background: #faf9fc; border: 1px solid var(--border,#e6e3ee); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.lf-flabel { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: #807d8c; font-weight: 700; margin-bottom: 8px; }
.lf-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.lf-chip { font-size: 12.5px; padding: 6px 13px; border-radius: 16px; border: 1px solid #d9d5e4; color: #57545f; background: #fff; cursor: pointer; user-select: none; }
.lf-chip.on { background: #33066b; color: #fff; border-color: #33066b; }
.lf-summary { font-size: 13.5px; color: #16151b; margin-bottom: 12px; }
.lf-summary .muted { color: #807d8c; }
.lf-hint { color: #807d8c; font-size: 14px; padding: 24px; text-align: center; }
.lf-list { display: flex; flex-direction: column; gap: 12px; }
.lf-card { border: 1px solid var(--border,#e6e3ee); border-radius: 14px; padding: 16px 18px; background: #fff; }
.lf-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.lf-co { font-size: 16px; font-weight: 700; color: #33066b; }
.lf-meta { font-size: 12.5px; color: #807d8c; margin-top: 2px; }
.lf-signals { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lf-sig { font-size: 11px; background: #efeafc; color: #5a2f9e; padding: 3px 9px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.lf-why { font-size: 13px; color: #3a3844; font-style: italic; margin: 10px 0 12px; }
.lf-actionbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lf-call { background: #d5453f; color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lf-call:hover:not(:disabled) { background: #b83a35; }
.lf-call:disabled { opacity: .45; cursor: default; }
.lf-ask { font-size: 12px; color: #b9791f; font-weight: 600; }
.lf-add { background: #33066b; color: #fff; border: none; border-radius: 9px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lf-add:hover:not(:disabled) { filter: brightness(1.15); }
.lf-dismiss { background: none; border: 1px solid var(--border,#e6e3ee); color: #b0adbb; border-radius: 9px; padding: 8px 11px; cursor: pointer; font-size: 13px; }
.lf-dismiss:hover { color: #c0392b; border-color: #f3cfcc; }
.lf-contacts { margin-top: 12px; border-top: 1px solid #f1eff6; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.lf-contact { display: flex; align-items: center; gap: 14px; background: #f7f6fb; border-radius: 9px; padding: 8px 12px; }
.lf-c-main { min-width: 200px; }
.lf-c-name { font-weight: 700; font-size: 13px; }
.lf-c-role { display: block; font-size: 11.5px; color: #807d8c; }
.lf-email { flex: 1; font-size: 12px; color: #16151b; }
.lf-contact .lf-call { padding: 6px 12px; font-size: 12.5px; }

/* ===== Lead Finder — search + dropdowns + account-style cards ===== */
.lf-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.lf-searchbox { flex: 1; min-width: 240px; padding: 10px 14px; border: 1px solid var(--border,#e6e3ee); border-radius: 10px; font: inherit; font-size: 14px; }
.lf-selects { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lf-select { padding: 9px 10px; border: 1px solid var(--border,#e6e3ee); border-radius: 9px; font: inherit; font-size: 13px; background: #fff; color: #16151b; cursor: pointer; }
.lf-clear { border: 1px solid var(--border,#e6e3ee); background: #fff; color: #57545f; border-radius: 9px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lf-clear:hover { background: #f7f6fb; }
/* card head: logo + titles + signals, like an account row */
.lf-card.card { padding: 16px 18px; }
.lf-card-head { display: flex; align-items: flex-start; gap: 13px; }
.lf-card-head .logo, .lf-card-head img, .lf-card-head .acc-logo { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; }
.lf-titles { flex: 1; min-width: 0; }
.lf-card-head .lf-signals { justify-content: flex-end; }

/* Lead Finder — editable buyer contact */
.lf-addbuyer { background: #fff; border: 1px dashed #c9bbe0; color: #5a2f9e; border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lf-addbuyer:hover { background: #f7f6fb; border-style: solid; }
.lf-ask { font-size: 12px; color: #b9791f; font-weight: 600; }
.lf-editc { background: none; border: 1px solid var(--border,#e6e3ee); color: #807d8c; border-radius: 7px; padding: 5px 9px; cursor: pointer; font-size: 12px; }
.lf-editc:hover { color: #33066b; border-color: #c9bbe0; }
/* Live (Apollo) Lead Finder additions */
.lf-searchbtn { background: #33066b; color: #fff; border: none; border-radius: 9px; padding: 9px 20px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lf-searchbtn:hover { filter: brightness(1.15); }
.lf-credits { font-size: 12.5px; color: #57545f; background: #f5f2fb; border: 1px solid #ece6f7; border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 3px; line-height: 1.45; }
.lf-credits b { color: #33066b; }
.lf-used { color: #b9791f; font-weight: 600; margin-left: 4px; }
.lf-hint2 { width: 100%; font-size: 12px; color: #807d8c; margin: -4px 0 2px; }
.lf-sourcebar { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 10px 14px; background: #f5f2fb; border: 1px solid #ece6f7; border-radius: 10px; }
.lf-sourcebar .lf-flbl { margin: 0; }
.lf-sourcebar .lf-select { max-width: 260px; }
.lf-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; margin-bottom: 12px; }
@media (max-width: 720px) { .lf-fields { grid-template-columns: repeat(2, 1fr); } }
.lf-field { display: flex; flex-direction: column; gap: 5px; }
.lf-flbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #807d8c; font-weight: 700; }
.lf-field .lf-select, .lf-field .lf-searchbox { width: 100%; box-sizing: border-box; }
.lf-searchrow { display: flex; gap: 10px; margin-bottom: 14px; }
.lf-preview { background: #fcfbfe; }
.lf-reveal { background: #fff; border: 1px solid #c9bbe0; color: #5a2f9e; border-radius: 9px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lf-reveal:hover:not(:disabled) { background: #f3eefb; }
.lf-reveal:disabled { opacity: .6; cursor: default; }
.lf-revealall { margin-left: 12px; background: #fff; border: 1px solid #c9bbe0; color: #5a2f9e; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lf-revealall:hover { background: #f3eefb; }
.lf-addall { margin-left: 12px; background: #33066b; border: none; color: #fff; border-radius: 8px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.lf-addall:hover { filter: brightness(1.12); }
.lf-bulkall { background: #d5453f; }
.lf-bulkall:hover { filter: brightness(1.08); }
.lf-warnadded { margin-top: 6px; font-size: 12.5px; color: #854f0b; background: #faeeda; border: 1px solid #f0d9a8; border-radius: 8px; padding: 6px 10px; }
/* Tick-box selection */
.lf-chk { flex: 0 0 auto; display: flex; align-items: center; padding-top: 3px; cursor: pointer; }
.lf-chk input { width: 18px; height: 18px; accent-color: #33066b; cursor: pointer; }
.lf-chk-dis { width: 18px; height: 18px; display: inline-block; }
.lf-sig.lf-incrm { background: #eae7f2; color: #5a2f9e; border: 1px solid #d3c7ea; }
.lf-selall { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #5a2f9e; cursor: pointer; }
.lf-selall input { width: 16px; height: 16px; accent-color: #33066b; cursor: pointer; }
.lf-selbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; padding: 10px 14px; background: #f3eefb; border: 1px solid #d8c9ef; border-radius: 10px; }
.lf-selcount { font-size: 13px; color: #33066b; }
.lf-selcount b { font-size: 15px; }
.lf-selbtn { background: #fff; border: 1px solid #c9bbe0; color: #5a2f9e; border-radius: 8px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lf-selbtn:hover:not(:disabled) { background: #ece2fb; }
.lf-selbtn:disabled { opacity: .55; cursor: default; }
.lf-selprimary { background: #33066b; border: none; color: #fff; font-weight: 700; }
.lf-selprimary:hover { filter: brightness(1.12); }
.lf-selclear { margin-left: auto; background: none; border: none; color: #7c6f92; font-size: 12px; cursor: pointer; text-decoration: underline; }
.lf-hist-clear { margin-left: auto; background: none; border: none; color: #9a97a5; font-size: 11px; cursor: pointer; text-decoration: underline; }
.lf-histcard { border: 1px solid #ece6f7; border-radius: 8px; padding: 7px 10px; margin-top: 6px; background: #fcfbfe; }
.lf-histclick { cursor: pointer; transition: background .12s, border-color .12s; }
.lf-histclick:hover { background: #f3eefb; border-color: #d3c7ea; }
.lf-hist-reopen { margin-top: 4px; font-size: 11px; font-weight: 600; color: #5a2f9e; }
.lf-hist-text { font-size: 12.5px; font-weight: 600; color: #33066b; }
.lf-hist-meta { font-size: 11px; color: #807d8c; margin-top: 2px; }
.lf-sig.lf-ok { background: #e6f6ec; color: #1f8a4c; }
.lf-sig.lf-no { background: #f4f2f7; color: #9a97a5; }
.lf-emailrow { flex: 1; display: flex; align-items: center; gap: 8px; }
.lf-verified { font-size: 10.5px; font-weight: 700; color: #1f8a4c; background: #e6f6ec; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.lf-guessed { font-size: 10.5px; font-weight: 700; color: #b9791f; background: #fbf3e3; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.lf-email.lf-no { color: #9a97a5; font-style: italic; }
.lf-li { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: #0a66c2; color: #fff; border-radius: 7px; font-weight: 800; font-size: 12px; text-decoration: none; }
.lf-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.lf-pagebtn { border: 1px solid var(--border,#e6e3ee); background: #fff; color: #33066b; border-radius: 9px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lf-pagebtn:hover:not(:disabled) { background: #f7f6fb; }
.lf-pagebtn:disabled { opacity: .4; cursor: default; }
.lf-pageno { font-size: 12.5px; color: #807d8c; }
/* Buying Rhythm — account badge */
.br-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.br-tier { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.br-rhythm { display: flex; align-items: center; gap: 8px; border-radius: 9px; padding: 9px 12px; margin: 10px 0; font-size: 13.5px; }
.br-rhythm-ic { font-size: 16px; }
.br-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.br-stat { background: #faf8fd; border: 1px solid #ece7f5; border-radius: 9px; padding: 8px 10px; }
.br-stat-l { display: block; font-size: 11px; color: #807d8c; }
.br-stat-v { display: block; font-size: 15px; font-weight: 700; color: #16151b; margin-top: 2px; }
.br-rec { margin-top: 10px; font-size: 12.5px; font-weight: 600; }
.br-foot { margin-top: 6px; font-size: 11px; color: #9a97a5; }
/* Buying Rhythm — dashboard card */
.br-book h3 { margin: 0; font-size: 16px; }
.br-bars { display: flex; flex-direction: column; gap: 9px; }
.br-bar-row { display: flex; align-items: center; gap: 10px; }
.br-bar-lbl { width: 118px; flex: 0 0 118px; font-size: 13px; color: #57545f; }
.br-bar-track { flex: 1; height: 16px; background: #f0edf6; border-radius: 8px; overflow: hidden; }
.br-bar-track i { display: block; height: 100%; border-radius: 8px; }
.br-bar-val { width: 150px; flex: 0 0 150px; text-align: right; font-size: 12.5px; color: #16151b; font-variant-numeric: tabular-nums; }
.br-callout { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; background: #fcebeb; border-radius: 9px; font-size: 13px; color: #501313; }
.br-clickable { cursor: pointer; border-radius: 8px; padding: 3px 6px; margin: 0 -6px; transition: background .12s; }
.br-clickable:hover { background: #f5f2fb; }
.br-clickable.open { background: #efe7fb; }
.br-bar-chev { flex: 0 0 auto; color: #b0adbb; font-weight: 800; transition: transform .12s; }
.br-clickable.open .br-bar-chev { transform: rotate(90deg); color: #5a2f9e; }
.br-detail { margin-top: 12px; border: 1px solid #ece7f5; border-radius: 10px; overflow: hidden; }
.br-detail-head { background: #faf8fd; padding: 8px 12px; font-size: 12px; font-weight: 700; color: #33066b; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid #ece7f5; }
.br-drow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #f4f2f8; }
.br-drow:last-child { border-bottom: none; }
.br-dco { font-weight: 700; font-size: 13px; color: #33066b; text-decoration: none; flex: 0 0 auto; min-width: 160px; }
.br-dco:hover { text-decoration: underline; }
.br-dmeta { flex: 1; font-size: 12px; color: #807d8c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-phone { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.br-num { font-size: 12px; font-weight: 600; color: #16151b; border: 1px solid #e6e3ee; border-radius: 8px; padding: 5px 9px; background: #fff; white-space: nowrap; }
.br-callbtn { width: 30px; height: 30px; border: 1px solid #e6e3ee; background: #fff; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }
.br-callbtn:hover:not(:disabled) { border-color: #e0447f; background: #fdeef5; }
.br-callbtn:disabled { opacity: .4; cursor: default; }
@media (max-width: 600px) { .br-drow { flex-wrap: wrap; } .br-dmeta { width: 100%; order: 3; } }
@media (max-width: 600px) { .br-bar-lbl { width: 84px; flex-basis: 84px; } .br-bar-val { width: 110px; flex-basis: 110px; } }
/* Win-back */
.wb-page { max-width: 1000px; }
.wb-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wb-head h2 { margin: 0; font-size: 22px; }
.wb-sub { color: #807d8c; font-size: 13px; }
.wb-summary { font-size: 13.5px; margin: 6px 0 14px; }
.wb-summary .muted { color: #807d8c; }
.wb-hint { color: #807d8c; font-size: 14px; padding: 24px; text-align: center; }
.wb-list { display: flex; flex-direction: column; gap: 10px; }
.wb-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--border,#e6e3ee); border-radius: 12px; background: #fff; }
.wb-rank { font-weight: 800; color: #b0adbb; font-size: 13px; width: 34px; flex: 0 0 34px; }
.wb-card .logo, .wb-card img, .wb-card .acc-logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 9px; }
.wb-main { flex: 1; min-width: 0; }
.wb-co { font-size: 15px; font-weight: 700; color: #33066b; text-decoration: none; }
.wb-co:hover { text-decoration: underline; }
.wb-meta { font-size: 12px; color: #807d8c; margin-top: 2px; }
.wb-value { text-align: right; flex: 0 0 auto; min-width: 96px; }
.wb-value-n { font-size: 18px; font-weight: 800; color: #16151b; font-variant-numeric: tabular-nums; }
.wb-value-l { font-size: 10.5px; color: #9a97a5; text-transform: uppercase; letter-spacing: .3px; }
.wb-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.wb-call { background: #d5453f; color: #fff; border: none; border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.wb-call:hover:not(:disabled) { background: #b83a35; }
.wb-call:disabled { opacity: .45; cursor: default; }
.wb-assign { padding: 8px 10px; border: 1px solid var(--border,#e6e3ee); border-radius: 9px; font: inherit; font-size: 12.5px; background: #fff; cursor: pointer; }
.wb-gone { background: #fff; border: 1px solid #e6e3ee; color: #9a97a5; border-radius: 9px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; }
.wb-gone:hover { color: #c0392b; border-color: #f3cfcc; }
@media (max-width: 640px) { .wb-card { flex-wrap: wrap; } .wb-actions { width: 100%; } }
/* Accounts list — Order history column */
.acc-orders { display: flex; align-items: center; gap: 7px; min-width: 0; }
.acc-ord-chip { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 10px; white-space: nowrap; flex: 0 0 auto; }
.acc-ord-txt { font-size: 12px; color: #57545f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Revealed-card add form: tidy phone control + rep/status dropdowns */
.lf-addform { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 12px; border-top: 1px solid #f1eff6; padding-top: 12px; }
.lf-af { display: flex; flex-direction: column; gap: 5px; }
.lf-phonebox { display: flex; align-items: center; gap: 8px; }
.lf-phoneinput { padding: 9px 12px; border: 1px solid var(--border,#e6e3ee); border-radius: 10px; font: inherit; font-size: 13px; min-width: 168px; }
.lf-callicon { width: 42px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #f0cfcf; border-radius: 10px; color: #d5453f; font-size: 16px; cursor: pointer; }
.lf-callicon:hover { background: #fdeeed; border-color: #e7b3b0; }
.lf-addform .lf-select { min-width: 148px; }
.lf-addform .lf-add { align-self: flex-end; height: 40px; }
.lf-addform .lf-dismiss { align-self: flex-end; height: 40px; }
.lf-card-head .lf-li { align-self: flex-start; }

/* Signed documents card (account) + Send to Westcoast */
.sd-card .section-label { margin-bottom: 8px; }
.sd-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #efeafb; }
.sd-row:first-of-type { border-top: none; }
.sd-title { font-weight: 700; font-size: 13.5px; color: #33066b; }
.sd-meta { font-size: 12px; color: #807d8c; margin-top: 2px; }
.sd-wc-done { font-size: 12px; color: #0f6e56; margin-top: 4px; font-weight: 600; }
.sd-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.sd-actions .btn { white-space: nowrap; }

/* Signed-document mandatory pop-up (reuses .lead-pop chrome) */
.sp-badge { background: #0f6e56 !important; }
.sp-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sp-field { display: flex; flex-direction: column; gap: 3px; }
.sp-lbl { font-size: 11px; font-weight: 600; color: #efeafb; }
.sp-input { padding: 8px 10px; border-radius: 8px; border: 1px solid #c9bbe0; font-size: 13px; }
.lead-pop-do.alt { background: #fff; color: #33066b; }

/* Furniture quote — sort dropdown */
.fq-sort { width: 100%; margin: 8px 0 4px; padding: 8px 10px; border: 1px solid #d8c9ef; border-radius: 8px; font-size: 13px; background: #fff; color: #33066b; font-weight: 600; }

/* Ian's Lead Handover box (dashboard) */
.lh-summary { font-size: 12.5px; color: #33066b; background: #f3eefb; border: 1px solid #e2d8f5; border-radius: 8px; padding: 8px 11px; margin-bottom: 8px; }
.lh-week { color: #5a2f9e; }
.lh-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.lh-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid #ece6f7; border-radius: 8px; background: #fff; cursor: pointer; }
.lh-row:hover { background: #f6f3fc; }
.lh-main { flex: 1; min-width: 0; }
.lh-co { font-weight: 700; font-size: 13px; color: #16151b; }
.lh-note { font-size: 12px; color: #5f5e5a; margin-top: 2px; line-height: 1.35; }
.lh-meta { font-size: 11px; color: #9a97a5; margin-top: 3px; }
.lh-pill { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; align-self: flex-start; }
.lh-new { background: #fbe9e9; color: #a32727; }
.lh-working { background: #faeeda; color: #854f0b; }
.lh-conv { background: #e1f5ee; color: #0f6e56; }
.lh-gone { background: #f1efe8; color: #5f5e5a; }
