/* InomERP CRM — themed with inom_chat's tokens, never hardcoded colours: the
   portal has a light and a dark theme, and a panel painted one way shows
   invisible text in the other. */

/* The pipeline sits in the app grid where the list and chat normally are, so
   the rail stays visible and reachable. `position:fixed` covered the whole
   window including the navigation, which left no way back except a Close
   button drawn inside the panel. */
/* A solid panel, matching the others: it carries `panel` too, but the
   background is stated here so the section never renders transparent over
   whatever happens to be behind it. */
/* A column layout, so the board can take the remaining height.

   It used to be a plain scrolling block: the board was only as tall as its
   columns, so with more stages than fit the horizontal scrollbar appeared
   directly under them — floating in the middle of an empty panel. Filling the
   height puts it at the bottom where a scrollbar belongs. */
.crm-root{grid-column:2 / -1;min-width:0;min-height:0;overflow:hidden;
  padding:16px 18px;background:var(--panel);border:1px solid var(--brd);
  border-radius:var(--r-xl,16px);display:flex;flex-direction:column}
@media(max-width:900px){.crm-root{grid-column:1 / -1}}

.crm-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin-bottom:12px;flex:none}
.crm-bar h2{font-size:18px;font-weight:650;letter-spacing:-.01em;color:var(--text)}
.crm-mini{font-size:11.5px;color:var(--mut)}
.crm-sel{border:1px solid var(--brd);border-radius:8px;padding:6px 10px;
  font-size:12.5px;background:var(--panel);color:var(--text);font-family:inherit}
.crm-btn{border:1px solid var(--brd);background:var(--panel);border-radius:8px;
  padding:7px 13px;font-size:12.5px;font-weight:600;color:var(--text);
  cursor:pointer;font-family:inherit}
.crm-btn:hover{background:var(--panel-3)}
.crm-btn.pri{background:var(--accent);border-color:var(--accent);color:#fff}
.crm-btn.pri:hover{filter:brightness(1.07)}
.crm-btn.sm{padding:5px 10px;font-size:11.5px}
.crm-btn.dan{border-color:rgba(229,72,77,.35);color:#e5484d}
.crm-btn:disabled{opacity:.5;cursor:not-allowed}
.crm-empty{padding:40px;text-align:center;color:var(--dim);font-size:13px}

.crm-stat{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));
  gap:10px;margin-bottom:13px;flex:none}
.crm-sbox{border:1px solid var(--brd);border-radius:10px;padding:11px 13px;
  background:var(--panel)}
.crm-sbox .n{font-size:21px;font-weight:700;letter-spacing:-.02em;color:var(--text)}
.crm-sbox .l{font-size:11.5px;color:var(--mut);margin-top:2px}
.crm-sbox.cold .n{color:#e5484d}
.crm-sbox.ok .n{color:#16a34a}

#crmBoardView{flex:1;min-height:0;display:flex;flex-direction:column}
.crm-board{display:flex;gap:11px;overflow-x:auto;overflow-y:hidden;
  align-items:stretch;flex:1;min-height:0;padding-bottom:4px}
/* Columns sit on the panel, so they take the secondary tone rather than the
   page background — which is the same colour as the panel here. */
/* Columns fill the board's height rather than a guessed viewport fraction, so
   they end where the panel ends whatever the window size. */
.crm-col{flex:0 0 268px;background:var(--panel-2);border:1px solid var(--brd);
  border-radius:10px;display:flex;flex-direction:column;min-height:0;
  max-height:100%}
.crm-col.over{border-color:var(--accent);background:var(--accent-soft,rgba(47,109,240,.07))}
.crm-col.won{border-top:3px solid #16a34a}
.crm-col.lost{border-top:3px solid #e5484d}
.crm-colh{padding:10px 12px;border-bottom:1px solid var(--brd)}
.crm-colh .t{display:flex;align-items:center;gap:8px}
.crm-colh .nm{font-weight:650;font-size:12.5px;flex:1;color:var(--text)}
.crm-colh .ct{font-size:11px;color:var(--mut);background:var(--panel);
  border:1px solid var(--brd);border-radius:20px;padding:1px 8px}
.crm-colh .val{font-size:12.5px;font-weight:700;margin-top:4px;color:var(--text)}
.crm-colh .wt{font-size:10.5px;color:var(--dim)}
.crm-cards{padding:9px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;
  min-height:64px;flex:1}

.crm-card{background:var(--panel);border:1px solid var(--brd);border-radius:9px;
  padding:10px 11px;cursor:grab}
.crm-card:hover{border-color:var(--brd-2)}
.crm-card.drag{opacity:.4}
.crm-card.rot{border-left:3px solid #e5484d}
.crm-card .nm{font-weight:600;font-size:12.5px;line-height:1.35;color:var(--text)}
.crm-card .org{font-size:11px;color:var(--dim);margin-top:1px}
.crm-card .row{display:flex;align-items:center;gap:7px;margin-top:8px}
.crm-card .v{font-weight:700;font-size:12.5px;color:var(--text)}
.crm-addcard{border:1px dashed var(--brd-2);background:none;border-radius:9px;
  padding:8px;font-size:12px;color:var(--mut);cursor:pointer;width:100%;
  font-family:inherit}
.crm-addcard:hover{border-color:var(--accent);color:var(--accent)}

/* Avatars.

   Scoped to BOTH the panel and the dialog. The dialog is appended to
   document.body, outside .crm-root — so a rule scoped only to the panel left
   every avatar in a dialog square, with its initials in the corner instead of
   centred. Any future dialog would have inherited the same bug.

   `.av` alone would be too broad: this stylesheet loads alongside the chat's
   own, which has its own avatars. */
.crm-root .av,.crm-dlg .av,.crm-drawer .av{border-radius:50%;
  display:inline-grid;place-items:center;color:#fff;font-weight:700;flex:none;
  width:22px;height:22px;font-size:9px;line-height:1;text-align:center;
  overflow:hidden;box-sizing:border-box}
.crm-root .avs{display:flex;align-items:center}
.crm-root .avs .av{margin-left:-6px;border:2px solid var(--panel)}
.crm-root .avs .av:first-child{margin-left:0}
.crm-root .dot{width:7px;height:7px;border-radius:50%;flex:none}
.crm-root .dot.ok{background:#16a34a}
.crm-root .dot.warn{background:#d97706}
.crm-root .dot.cold{background:#e5484d}
.crm-root .dot.none{background:var(--brd-2)}
.crm-root .cmt{font-size:10.5px;font-weight:700;color:var(--mut);
  background:var(--panel-3);border-radius:20px;padding:1px 7px}
/* Unread reads differently from a comment count: one is news, the other is
   history. */
.crm-root .cmt.new{background:var(--accent);color:#fff}

/* Rail badge, matching the chat's own ping but carrying a number — "three
   people commented" and "somebody commented" are different facts. */
.crm-ping{position:absolute;top:5px;right:5px;min-width:16px;height:16px;
  padding:0 4px;border-radius:9px;background:#e5484d;color:#fff;font-size:9.5px;
  font-weight:700;line-height:16px;text-align:center;border:2px solid var(--panel);
  box-sizing:content-box}

/* ---- detail drawer ----
   Slides in from the right over the board, which stays visible: the column a
   lead sits in and what is beside it are the context you are reading it in.
   Replacing the board with the lead throws that away. */
.crm-scrim{position:fixed;inset:0;background:rgba(8,12,20,.28);z-index:75;
  opacity:0;pointer-events:none;transition:opacity .22s}
.crm-scrim.on{opacity:1;pointer-events:auto}

.crm-drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,94vw);
  background:var(--panel);border-left:1px solid var(--brd);z-index:76;
  transform:translateX(100%);transition:transform .26s cubic-bezier(.2,.8,.2,1);
  display:flex;flex-direction:column;box-shadow:-10px 0 40px rgba(0,0,0,.14)}
.crm-drawer.on{transform:translateX(0)}
@media(prefers-reduced-motion:reduce){
  .crm-drawer{transition:none}.crm-scrim{transition:none}
}
.crm-dx{position:absolute;top:12px;right:12px;z-index:2;border:none;
  background:none;font-size:22px;line-height:1;color:var(--dim);cursor:pointer;
  padding:2px 7px;border-radius:8px}
.crm-dx:hover{background:var(--panel-3);color:var(--text)}

.crm-dmain{flex:1;overflow-y:auto;min-height:0}
.crm-dhead{padding:16px 46px 14px 18px;border-bottom:1px solid var(--brd)}
.crm-dhead h2{font-size:17px;font-weight:650;color:var(--text)}
.crm-dhead .org{font-size:12.5px;color:var(--dim);margin-top:2px}
.crm-dhead .acts{display:flex;gap:7px;margin-top:12px;flex-wrap:wrap}

/* One column in a drawer: details first, then the discussion, because the
   discussion is the part that grows and should own the bottom of the panel. */
.crm-dbody{display:flex;flex-direction:column-reverse}
.crm-dside{padding:14px 18px;border-bottom:1px solid var(--brd);
  background:var(--panel-2)}
.crm-dside label{display:block;font-size:10.5px;font-weight:650;color:var(--dim);
  text-transform:uppercase;letter-spacing:.05em;margin:14px 0 5px}
.crm-dside label:first-child{margin-top:0}
.crm-dfeed{padding:15px 18px 20px}
.crm-kv{display:flex;justify-content:space-between;gap:9px;padding:6px 0;
  border-top:1px solid var(--brd);font-size:12.5px}
.crm-kv:first-of-type{border-top:none}
.crm-kv .k{color:var(--mut)}
.crm-kv .v{font-weight:600;color:var(--text);text-align:right}

/* The card behind the drawer is marked, so it is obvious which one is open
   when the drawer is closed again. */
.crm-card.open{border-color:var(--accent);
  box-shadow:0 0 0 2px var(--accent-soft,rgba(47,109,240,.18))}

/* ---- discussion feed ---- */
.crm-feed .ev{display:flex;gap:10px;margin-bottom:14px}
.crm-feed .ev .av{width:28px;height:28px;font-size:10px}
.crm-feed .evh{font-size:12px;font-weight:650;color:var(--text)}
.crm-feed .evh small{font-weight:400;color:var(--dim);margin-left:6px}
.crm-feed .evb{font-size:13.5px;margin-top:2px;line-height:1.55;
  word-break:break-word;color:var(--text)}
/* Events sit quieter than comments: context, not conversation. */
.crm-feed .ev.sys{align-items:center;font-size:12px;color:var(--mut);
  margin-bottom:11px}
.crm-feed .ev.sys small{color:var(--dim);margin-left:5px}
.crm-feed .dotx{width:6px;height:6px;border-radius:50%;background:var(--brd-2);
  flex:none;margin-left:11px}
.crm-feed .men{color:var(--accent);font-weight:650}
.crm-cbox{border-top:1px solid var(--brd);padding-top:13px;margin-top:12px}
.crm-cbox textarea{width:100%;border:1px solid var(--brd);border-radius:9px;
  padding:10px 12px;font-size:13.5px;font-family:inherit;resize:vertical;
  min-height:72px;background:var(--panel);color:var(--text)}
.crm-cbox textarea:focus{outline:none;border-color:var(--accent)}
.crm-crow{display:flex;align-items:center;gap:8px;margin-top:6px}
.crm-clip{border:1px solid var(--brd);background:var(--panel);border-radius:8px;
  width:30px;height:30px;display:grid;place-items:center;cursor:pointer;
  color:var(--mut);flex:none}
.crm-clip:hover{color:var(--accent);border-color:var(--accent)}
.crm-clip svg{width:16px;height:16px}

/* Files chosen but not yet sent. */
.crm-staged{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.crm-staged:empty{display:none}
.crm-sfile{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--brd);
  background:var(--panel-2);border-radius:8px;padding:4px 6px 4px 9px;
  font-size:11.5px;max-width:230px}
.crm-sfile b{font-weight:600;color:var(--text);overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.crm-sfile small{color:var(--dim);flex:none}
.crm-sfile button{border:none;background:none;color:var(--dim);cursor:pointer;
  font-size:14px;line-height:1;padding:0 2px}
.crm-sfile button:hover{color:#e5484d}

/* The drop hint only exists while something is being dragged over the box. */
.crm-cbox{position:relative}
.crm-drop{position:absolute;inset:0;border:2px dashed var(--accent);
  border-radius:10px;background:var(--accent-soft,rgba(47,109,240,.08));
  display:none;align-items:center;justify-content:center;font-size:12.5px;
  font-weight:650;color:var(--accent);pointer-events:none}
.crm-cbox.dropping .crm-drop{display:flex}

/* ---- files on a comment ---- */
.crm-feed .evw{min-width:0;flex:1}
.crm-feed .evf{display:flex;flex-wrap:wrap;gap:8px;margin-top:7px}
.crm-feed .evimg{display:block;max-width:240px;border-radius:9px;overflow:hidden;
  border:1px solid var(--brd);line-height:0}
.crm-feed .evimg img{max-width:100%;height:auto;display:block}
.crm-feed .evimg .fallback{display:none}
/* A broken image drawing its alt text over the layout reads as corruption,
   so it becomes a plain chip instead. */
.crm-feed .evimg.broke img{display:none}
.crm-feed .evimg.broke .fallback{display:block;padding:9px 11px;font-size:12px;
  color:var(--mut);line-height:1.4}
.crm-feed .evvid{max-width:300px;width:100%;border-radius:9px;
  border:1px solid var(--brd);background:#000}
.crm-feed .evaud{width:100%;max-width:300px}
.crm-feed .evfile{display:inline-flex;align-items:center;gap:9px;
  border:1px solid var(--brd);background:var(--panel-2);border-radius:9px;
  padding:8px 12px;text-decoration:none;color:var(--text);max-width:260px}
.crm-feed .evfile:hover{border-color:var(--accent)}
.crm-feed .evfile svg{width:19px;height:19px;color:var(--mut);flex:none}
.crm-feed .evfile span{min-width:0;display:flex;flex-direction:column}
.crm-feed .evfile b{font-size:12.5px;font-weight:600;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.crm-feed .evfile small{font-size:11px;color:var(--dim)}

/* ---- people on a lead ---- */
.crm-people{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.crm-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--brd);
  background:var(--panel);border-radius:20px;padding:3px 9px 3px 3px;
  font-size:11.5px;font-weight:600;color:var(--text)}
.crm-chip.owner{border-color:var(--accent);color:var(--accent)}
.crm-chip .rm{border:none;background:none;color:var(--dim);cursor:pointer;
  font-size:14px;line-height:1;padding:0 2px}
.crm-chip .rm:hover{color:#e5484d}
.crm-addsel{border:1px dashed var(--brd-2);background:none;border-radius:20px;
  padding:4px 9px;font-size:11.5px;color:var(--mut);cursor:pointer;
  font-family:inherit}
.crm-pill{font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:20px}
.crm-pill.ok{background:#dcfce7;color:#15803d}
.crm-pill.warn{background:#fef3c7;color:#92400e}
.crm-pill.cold{background:#fee2e2;color:#b91c1c}
.crm-pill.none{background:var(--panel-3);color:var(--mut)}
.crm-note{font-size:11.5px;line-height:1.55;border-radius:9px;padding:10px 12px;
  margin:0 0 14px;background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.crm-note b{color:#78350f}

.crm-bg{position:fixed;inset:0;background:rgba(8,12,20,.5);display:none;z-index:80;
  align-items:center;justify-content:center;padding:18px}
.crm-bg.on{display:flex}
.crm-dlg{background:var(--panel);border-radius:12px;padding:17px;width:100%;
  max-width:430px;max-height:88vh;overflow:auto;color:var(--text);
  box-shadow:0 20px 60px rgba(0,0,0,.28)}
.crm-dlg h3{font-size:15.5px;margin:0 0 4px}
.crm-dlg p{font-size:12.5px;color:var(--mut);margin:0 0 12px;line-height:1.6}
.crm-dlg label{display:block;font-size:10.5px;font-weight:650;color:var(--dim);
  text-transform:uppercase;letter-spacing:.05em;margin:10px 0 4px}
.crm-dlg input,.crm-dlg select{width:100%;border:1px solid var(--brd);
  border-radius:8px;padding:9px 11px;font-size:13px;background:var(--panel);
  color:var(--text);font-family:inherit}
.crm-dlg textarea{width:100%;border:1px solid var(--brd);border-radius:8px;
  padding:9px 11px;font-size:13px;background:var(--panel);color:var(--text);
  font-family:inherit;resize:vertical}
.crm-dlg .acts{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}

/* ---- customer picker ---- */
.crm-m2o{position:relative}
.crm-m2o input[type="text"],.crm-m2o input:not([type="hidden"]){padding-right:30px}
.crm-m2o-x{position:absolute;right:6px;top:6px;border:none;background:none;
  color:var(--dim);cursor:pointer;font-size:16px;line-height:1;padding:2px 5px;
  border-radius:6px}
.crm-m2o-x:hover{background:var(--panel-3);color:var(--text)}
.crm-m2o-list{position:absolute;left:0;right:0;top:calc(100% + 4px);
  background:var(--panel);border:1px solid var(--brd);border-radius:9px;
  box-shadow:0 10px 30px rgba(0,0,0,.14);max-height:230px;overflow-y:auto;
  z-index:5;display:none}
.crm-m2o-list.on{display:block}
.crm-m2o-i{padding:8px 11px;cursor:pointer;border-bottom:1px solid var(--brd)}
.crm-m2o-i:last-child{border-bottom:none}
.crm-m2o-i:hover{background:var(--panel-2)}
.crm-m2o-i b{display:block;font-size:12.5px;font-weight:600;color:var(--text)}
.crm-m2o-i small{font-size:11px;color:var(--dim)}
.crm-dup{font-size:9.5px;font-weight:700;margin-left:7px;padding:1px 6px;
  border-radius:20px;background:#fef3c7;color:#92400e;vertical-align:middle}
.crm-m2o-i.new{color:var(--accent);font-size:12.5px}
.crm-m2o-i.new b{display:inline;color:var(--accent)}
.crm-m2o-e{padding:10px 11px;font-size:11.5px;color:var(--dim)}
/* Keyboard highlight, so arrowing through the list is visible. */
.crm-m2o-i.sel{background:var(--accent-soft,rgba(47,109,240,.10))}
.crm-m2o-i .av{width:20px;height:20px;font-size:8px;margin-right:7px;
  vertical-align:middle;display:inline-grid}
.crm-m2o-i .av + b{display:inline;vertical-align:middle}

/* ---- share picker ---- */
.crm-sel.owner{width:100%}
.crm-sharebox{position:relative;display:inline-block;min-width:140px}
.crm-sharebox input{width:100%;border:1px dashed var(--brd-2);background:none;
  border-radius:20px;padding:4px 10px;font-size:11.5px;color:var(--text);
  font-family:inherit}
.crm-sharebox input:focus{outline:none;border-style:solid;
  border-color:var(--accent)}
.crm-sharebox .crm-m2o-list{min-width:210px}

.crm-desc{font-size:12.5px;color:var(--text);line-height:1.6;
  background:var(--panel);border:1px solid var(--brd);border-radius:8px;
  padding:9px 11px;word-break:break-word}
.crm-desc.empty{background:none;border-style:dashed}
.crm-desc.editing{border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(47,109,240,.09);outline:none;min-height:90px}
/* Anything the sanitiser lets through has to look right in here. */
.crm-desc p{margin:0 0 8px}
.crm-desc p:last-child{margin-bottom:0}
.crm-desc ul,.crm-desc ol{margin:0 0 8px;padding-left:20px}
.crm-desc li{margin:2px 0}
.crm-desc a{color:var(--accent)}
.crm-desc img{max-width:100%;height:auto;border-radius:8px;margin:6px 0;
  display:block;border:1px solid var(--brd)}
.crm-desc table{border-collapse:collapse;font-size:12px}
.crm-desc td,.crm-desc th{border:1px solid var(--brd);padding:4px 7px}

/* ---- who can use the CRM ----
   Rows are divs, not labels. `.crm-dlg label` is uppercased for field
   captions, and using a label per row inherited that — every name came out
   shouting. */
.crm-accbar{display:flex;align-items:center;gap:10px;margin:14px 0 8px}
.crm-accbar input{flex:1;border:1px solid var(--brd);border-radius:8px;
  padding:8px 11px;font-size:12.5px;background:var(--panel);color:var(--text);
  font-family:inherit}
.crm-accbar input:focus{outline:none;border-color:var(--accent)}
.crm-accbar .crm-mini{white-space:nowrap}

.crm-acc{display:flex;flex-direction:column;max-height:300px;overflow-y:auto;
  border:1px solid var(--brd);border-radius:10px}
.crm-accr{display:flex;align-items:center;gap:11px;padding:9px 12px;
  border-bottom:1px solid var(--brd)}
.crm-accr:last-child{border-bottom:none}
.crm-accr:hover{background:var(--panel-2)}
.crm-accr.on{background:var(--accent-soft,rgba(47,109,240,.05))}
/* The avatar was being squashed by the flex row — it needs a fixed box. */
.crm-accr .av{width:30px;height:30px;font-size:11px;flex:none}
.crm-accr .nm{flex:1;min-width:0;font-size:13px;font-weight:600;
  color:var(--text);line-height:1.25;text-transform:none;letter-spacing:0}
.crm-accr .nm small{display:block;font-weight:400;color:var(--dim);
  font-size:11px;margin-top:1px}
.crm-accempty{padding:18px 12px;text-align:center;font-size:12px;
  color:var(--dim)}

.crm-lock{color:var(--dim);flex:none;display:grid;place-items:center;
  width:34px;height:20px}
.crm-lock svg{width:15px;height:15px}

/* A switch rather than a checkbox: this grants access to a pipeline, so it
   should read as a decision, not a form field. */
.crm-sw{flex:none;width:34px;height:20px;border-radius:11px;border:none;
  background:var(--brd-2);cursor:pointer;padding:0;position:relative;
  transition:background .15s}
.crm-sw i{position:absolute;top:2px;left:2px;width:16px;height:16px;
  border-radius:50%;background:#fff;transition:transform .15s;
  box-shadow:0 1px 3px rgba(0,0,0,.25);display:block}
.crm-sw.on{background:var(--accent)}
.crm-sw.on i{transform:translateX(14px)}
.crm-sw:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(prefers-reduced-motion:reduce){
  .crm-sw,.crm-sw i{transition:none}
}

.crm-mini-btn{border:none;background:none;color:var(--accent);cursor:pointer;
  font-size:10.5px;font-weight:700;text-transform:none;letter-spacing:0;
  padding:0 0 0 6px;font-family:inherit}
.crm-mini-btn:hover{text-decoration:underline}

/* Editor toolbar */
.crm-rt{display:flex;gap:4px;align-items:center;margin-bottom:6px;
  border:1px solid var(--brd);border-radius:8px;padding:4px;
  background:var(--panel-2)}
.crm-rt button{border:1px solid transparent;background:none;cursor:pointer;
  color:var(--text);border-radius:6px;width:26px;height:26px;font-size:12.5px;
  font-family:inherit;line-height:1;display:grid;place-items:center}
.crm-rt button:hover{background:var(--panel-3)}
.crm-rt button.save{width:auto;padding:0 10px;background:var(--accent);
  color:#fff;font-weight:600;font-size:11.5px}
.crm-rt button[data-cancel]{width:auto;padding:0 10px;font-size:11.5px;
  color:var(--mut)}

.crm-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);
  background:var(--text);color:var(--panel);padding:9px 16px;border-radius:9px;
  font-size:12.5px;z-index:90;opacity:0;transition:.2s;pointer-events:none}
.crm-toast.on{opacity:1}

/* ---- pipeline stages ---- */
.crm-stg{display:flex;flex-direction:column;border:1px solid var(--brd);
  border-radius:10px;overflow:hidden;margin-top:12px;max-height:320px;
  overflow-y:auto}
.crm-stgr{display:flex;align-items:center;gap:8px;padding:8px 10px;
  border-bottom:1px solid var(--brd)}
.crm-stgr:last-child{border-bottom:none}
.crm-stgr.fixed{background:var(--panel-2)}
.crm-stgh{display:flex;gap:2px;flex:none;width:46px}
.crm-stgh button{border:1px solid var(--brd);background:var(--panel);
  border-radius:6px;width:21px;height:21px;font-size:10px;cursor:pointer;
  color:var(--mut);padding:0;line-height:1}
.crm-stgh button:hover:not(:disabled){color:var(--accent);border-color:var(--accent)}
.crm-stgh button:disabled{opacity:.3;cursor:default}
.crm-stgk{font-size:9.5px;font-weight:700;color:var(--dim);
  text-transform:uppercase;letter-spacing:.04em;line-height:21px}
.crm-stgn{flex:1;min-width:0;border:1px solid transparent;background:none;
  border-radius:6px;padding:4px 7px;font-size:12.5px;font-weight:600;
  color:var(--text);font-family:inherit}
.crm-stgn:hover:not(:disabled){border-color:var(--brd)}
.crm-stgn:focus{outline:none;border-color:var(--accent);background:var(--panel)}
.crm-stgn:disabled{color:var(--mut)}
.crm-stgp{display:flex;align-items:center;gap:3px;flex:none;width:64px}
.crm-stgp input{width:44px;border:1px solid transparent;background:none;
  border-radius:6px;padding:4px 5px;font-size:12px;color:var(--text);
  font-family:inherit;text-align:right}
.crm-stgp input:hover{border-color:var(--brd)}
.crm-stgp input:focus{outline:none;border-color:var(--accent);background:var(--panel)}
.crm-stgp small{font-size:11px;color:var(--dim)}
/* How many deals sit in a stage, so nobody deletes one holding half the
   pipeline without knowing. */
.crm-stgc{flex:none;width:26px;text-align:center;font-size:11px;
  color:var(--mut);background:var(--panel-3);border-radius:20px;padding:1px 0}
.crm-stgx{flex:none;width:24px;border:none;background:none;color:var(--dim);
  font-size:16px;line-height:1;cursor:pointer;border-radius:6px;padding:2px}
button.crm-stgx:hover{background:#fee2e2;color:#e5484d}

/* @-mention list. Sits above the box rather than below: the composer is at the
   bottom of the drawer, so a menu underneath would open off-screen. */
.crm-ment{position:absolute;left:0;right:0;bottom:calc(100% - 4px);
  background:var(--panel);border:1px solid var(--brd);border-radius:9px;
  box-shadow:0 -8px 26px rgba(0,0,0,.14);max-height:200px;overflow-y:auto;
  z-index:6;display:none}
.crm-ment.on{display:block}
.crm-cbox{position:relative}

/* ---- activity ---- */
.crm-bell{position:relative;border:1px solid var(--brd);background:var(--panel);
  border-radius:8px;width:32px;height:32px;display:grid;place-items:center;
  cursor:pointer;color:var(--mut);flex:none}
.crm-bell:hover{color:var(--accent);border-color:var(--accent)}
.crm-bell svg{width:16px;height:16px}
.crm-belln{position:absolute;top:-5px;right:-5px;min-width:16px;height:16px;
  padding:0 4px;border-radius:9px;background:#e5484d;color:#fff;font-size:9.5px;
  font-weight:700;line-height:16px;text-align:center;border:2px solid var(--panel);
  box-sizing:content-box}

/* Anchored under the bar rather than fixed to the window, so it moves with the
   panel and cannot end up over the chat when the CRM is closed. */
.crm-notif{position:absolute;top:56px;right:18px;width:min(400px,92vw);
  background:var(--panel);border:1px solid var(--brd);border-radius:12px;
  box-shadow:0 16px 48px rgba(0,0,0,.18);z-index:40;display:none;overflow:hidden}
.crm-notif.on{display:block}
.crm-root{position:relative}
.crm-nh{display:flex;align-items:center;padding:11px 14px;
  border-bottom:1px solid var(--brd);background:var(--panel-2);font-size:13px}
.crm-nh b{flex:1;font-weight:650;color:var(--text)}
.crm-nl{max-height:min(420px,60vh);overflow-y:auto}
.crm-ni{display:flex;gap:10px;align-items:flex-start;padding:10px 14px;
  border-bottom:1px solid var(--brd);cursor:pointer}
.crm-ni:last-child{border-bottom:none}
.crm-ni:hover{background:var(--panel-2)}
/* Unread carries a bar rather than a colour wash, so it survives whichever
   theme is on. */
.crm-ni.new{box-shadow:inset 3px 0 0 var(--accent)}
.crm-ni .av{width:28px;height:28px;font-size:10px;margin-top:1px}
.crm-ni .b{flex:1;min-width:0}
.crm-ni .t{display:block;font-size:12.5px;color:var(--text);line-height:1.4}
.crm-ni .l{display:block;font-size:11px;color:var(--dim);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-ni .w{font-size:10.5px;color:var(--dim);white-space:nowrap;flex:none;
  margin-top:2px}
.crm-nempty{padding:26px 18px;text-align:center;font-size:12.5px;
  color:var(--dim);line-height:1.6}
