/* Demo CRM: everything else comes from demo-erp.css, in the same corporate colours as the ERP. */
.crm-badge{position:relative}
.crm-badge-btn{display:inline-flex;align-items:center;min-height:40px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;text-decoration:underline dotted rgba(174,187,216,.6);text-underline-offset:4px}
.crm-badge-btn:hover{color:#fff}
.crm-disclaimer{position:absolute;left:0;top:calc(100% + 6px);z-index:30;width:min(340px,80vw);margin:0;padding:12px 14px;border:1px solid var(--blue);border-radius:12px;background:#18366f;color:#fff;font-size:14px;line-height:1.5;box-shadow:0 12px 30px rgba(0,0,0,.35)}
.crm-disclaimer[hidden]{display:none}
.crm-footer-note{margin:0 0 6px;color:#c7d4e9}

.crm-home-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;margin-bottom:18px;align-items:start}
.crm-chart{color:inherit;text-decoration:none}
.crm-chart:hover{border-color:var(--blue)}
.crm-chart .erp-mini-bar.wide{grid-template-columns:132px minmax(0,1fr) 78px}
.erp-mini-bar.wide a{color:#dfe7ff}
.crm-new h3{margin:0 0 4px}
.crm-new .erp-note{margin:0 0 6px}
.crm-new .erp-feed li{grid-template-columns:76px minmax(0,1fr)}
.crm-resp-line{color:var(--good);font-size:13.5px;font-weight:700}

.crm-chance{display:grid;gap:6px;margin:0 0 12px;padding:12px 14px;border:1px solid rgba(98,214,173,.35);border-radius:14px;background:rgba(24,77,64,.18)}
.crm-chance span{color:var(--muted);font-size:14px;line-height:1.5}
.crm-chance .erp-actions{margin-top:4px}

/* Funnel */
.crm-funnel-sum{margin:4px 0 12px}
.crm-board{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;padding-bottom:12px}
.crm-col{display:flex;flex-direction:column;min-height:240px;border:1px solid var(--line);border-radius:16px;background:rgba(9,23,51,.6)}
.crm-col.is-over{border-color:var(--blue);background:rgba(80,119,225,.16)}
.crm-col-head{display:grid;gap:3px;padding:12px 12px 10px;border:0;border-bottom:1px solid var(--line);background:none;color:#fff;font:inherit;text-align:left;cursor:default}
.crm-col-head strong{font-size:14.5px}
.crm-col-head span{color:var(--muted);font-size:13.5px}
.crm-col[data-stage="lost"] .crm-col-head strong{color:var(--bad)}
.crm-col-body{display:grid;align-content:start;gap:8px;padding:10px;max-height:640px;overflow-y:auto;scrollbar-width:thin}
.crm-col-empty{margin:6px 2px;color:var(--muted);font-size:13.5px}
.crm-deal{display:grid;gap:4px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(145deg,rgba(16,38,80,.9),rgba(7,19,45,.9));cursor:grab;font-size:14px}
.crm-deal.is-drag{opacity:.45}
.crm-deal.is-stuck{border-color:rgba(255,210,122,.6);box-shadow:inset 3px 0 0 var(--warn)}
.crm-deal.is-waiting{border-color:rgba(255,139,155,.7);box-shadow:inset 3px 0 0 var(--bad)}
.crm-deal-name{color:#fff;font-weight:700;text-decoration:none}
.crm-deal-name:hover{text-decoration:underline}
.crm-deal-dir{color:#c7d4e9;font-size:13.5px}
.crm-deal-row{display:flex;justify-content:space-between;gap:8px;font-size:13.5px;color:var(--muted)}
.crm-deal-row b{color:#fff}
.crm-deal.is-stuck .crm-deal-days{color:var(--warn)}
.crm-card-btn{display:none}

/* Deal page */
.crm-stepper{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px;padding:0;list-style:none}
.crm-stepper li{padding:6px 11px;border:1px solid var(--line);border-radius:99px;color:var(--muted);font-size:13.5px}
.crm-stepper li.done{border-color:rgba(98,214,173,.45);color:var(--good)}
.crm-stepper li.now{border-color:var(--blue);background:rgba(80,119,225,.3);color:#fff;font-weight:700}
.crm-stepper li.lost{border-color:rgba(255,139,155,.6);color:var(--bad)}
.crm-deal-actions{margin:0 0 16px}
.crm-deal-grid{margin-top:16px}
.crm-deal-grid>div{display:grid;gap:16px;align-content:start}

.crm-live{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;align-items:start}
.crm-chat-card{border-color:rgba(124,155,255,.55)}
.crm-chat-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.crm-chat-head h3{margin:0}
.crm-resp{display:inline-flex;padding:5px 11px;border-radius:99px;background:rgba(98,214,173,.16);color:var(--good);font-weight:700;font-size:14px}
.crm-chat{display:grid;gap:8px;max-height:520px;overflow-y:auto;padding:4px 2px}
.crm-msg{max-width:86%;padding:10px 13px;border-radius:16px;font-size:15px;line-height:1.55;animation:erpIn .35s ease}
.crm-msg.client{justify-self:start;background:#1b2c52;border:1px solid var(--line);border-bottom-left-radius:5px}
.crm-msg.ai{justify-self:end;background:rgba(80,119,225,.38);border-bottom-right-radius:5px}
.crm-msg-who{display:block;margin-bottom:3px;color:#cfdcff;font-size:12.5px;font-weight:700}
.crm-msg-stamp{display:block;margin-top:5px;color:#a8f0d3;font-size:12.5px;font-weight:700}
.crm-typing{display:inline-flex;gap:4px;padding:13px 15px}
.crm-typing i{width:7px;height:7px;border-radius:50%;background:#dfe7ff;opacity:.4;animation:crmDot 1s infinite}
.crm-typing i:nth-child(2){animation-delay:.15s}
.crm-typing i:nth-child(3){animation-delay:.3s}
@keyframes crmDot{50%{opacity:1;transform:translateY(-2px)}}
.crm-answers{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.crm-answers span{width:100%;color:var(--muted);font-size:13.5px}
.crm-result{margin:12px 0 10px;padding:12px 14px;border:1px solid rgba(98,214,173,.35);border-radius:12px;background:rgba(24,77,64,.2);line-height:1.55;font-size:14.5px}
.crm-result b{color:var(--good)}
.crm-ordinary{padding:16px;border:1px dashed rgba(174,187,216,.35);border-radius:18px;background:rgba(40,46,62,.35);color:#9aa3b5;display:grid;gap:8px;align-content:start;filter:grayscale(1)}
.crm-ordinary h3{margin:0;color:#b6bdcc;font-size:15px}
.crm-ordinary .crm-msg{max-width:92%;font-size:14px;animation:none}
.crm-ordinary .crm-msg.client{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.1)}
.crm-msg.template{justify-self:end;background:rgba(255,255,255,.1);color:#c3c8d3}
.crm-ordinary p{margin:4px 0 0;font-size:13.5px}

.crm-summary dl{display:grid;gap:8px;margin:0}
.crm-summary dl div{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.crm-summary dt{color:var(--muted);font-size:14px}
.crm-summary dd{margin:0}
.crm-summary h3 .erp-tag,.crm-offer h3 .erp-tag{font-size:12.5px}
.crm-offer{margin:0 0 16px;border-color:rgba(98,214,173,.4)}
.crm-offer p{margin:0 0 4px;line-height:1.55}
.erp-task-item.crm-late{border-color:rgba(255,139,155,.5)}
.erp-tab-body .erp-history li strong a{color:#eef3ff}

@media(max-width:1100px){.crm-home-grid,.crm-live{grid-template-columns:1fr}}

@media(max-width:720px){
  .crm-disclaimer{left:auto;right:-120px}
  .crm-board{display:grid;grid-auto-flow:row;grid-auto-columns:auto;gap:8px;overflow:visible}
  .crm-col{min-height:0}
  .crm-col-head{grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:52px;cursor:pointer;border-bottom:0}
  .crm-col-head::after{content:'▾';grid-column:2;grid-row:1/3;margin-left:10px;color:var(--muted);transition:transform .2s}
  .crm-col.is-open .crm-col-head{border-bottom:1px solid var(--line)}
  .crm-col.is-open .crm-col-head::after{transform:rotate(180deg)}
  .crm-col-body{display:none;max-height:none;overflow:visible}
  .crm-col.is-open .crm-col-body{display:grid}
  .crm-deal{cursor:default}
  .crm-card-btn{display:inline-flex;width:100%;margin-top:6px}
  .crm-chart .erp-mini-bar.wide{grid-template-columns:104px minmax(0,1fr) 70px}
  .crm-new .erp-feed li{grid-template-columns:62px minmax(0,1fr)}
  .crm-msg{max-width:92%;font-size:14.5px}
  .crm-answers .erp-btn{flex:1 1 100%}
  .crm-summary dl div{grid-template-columns:96px minmax(0,1fr)}

  .crm-stepper{display:none}
}

/* Phone: every button at least 44 px high. */
@media(max-width:720px){.crm .erp-btn,.crm .erp-btn-sm,.crm .erp-back,.crm .erp-chip,.crm .erp-tab,.crm .erp-bell,.crm .erp-menu-toggle,.crm .crm-badge-btn,.crm .erp-mic,.crm .erp-reset{min-height:44px}.crm .erp-bell,.crm .erp-menu-toggle{width:44px;height:44px}}
@media(min-width:721px){.crm [data-action="live-start"]{white-space:nowrap;flex:none}}
.erp-card h3.crm-subhead,.crm-subhead{margin:26px 0 12px;padding-top:22px;border-top:1px solid var(--line)}
/* v4: analytics home, assistant page, notices that never cover the page */
.crm-attn{margin:0 0 18px;padding:14px 18px}.crm-attn-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}.crm-attn-head h2{margin:0;font-size:18px}
.crm-attn ul,.crm-bell-menu ul{list-style:none;margin:0;padding:0}
.crm-attn li{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:12px;padding:9px 0;border-top:1px solid var(--line)}.crm-attn li:first-child{border-top:0}.crm-attn li strong{font-size:15px;font-weight:600}
.crm-attn-dot{width:10px;height:10px;border-radius:50%;background:var(--warn)}.crm-attn li.tone-bad .crm-attn-dot{background:var(--bad)}
.crm-ai-page{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:16px;align-items:start;margin-bottom:16px}
.crm-ai-page h2,.crm-ai-history h2{margin:0 0 10px;font-size:19px;display:flex;align-items:center;gap:10px}
.crm-ai-chat .erp-chat{max-height:460px;overflow-y:auto}
.crm .erp-ai .erp-chips{flex-wrap:wrap;overflow:visible}
.crm-notes{list-style:none;margin:0;padding:0}.crm-notes li{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 14px;padding:9px 0;border-top:1px solid var(--line)}.crm-notes li:first-child{border-top:0}.crm-notes li strong{font-weight:500}.crm-notes a{color:#dfe7ff}.crm-notes li span{color:var(--muted);font-size:13.5px}
.crm-stage-now{margin:0 0 12px;color:var(--muted);font-size:14.5px}.crm-stage-now b{color:#fff}.crm-stage-now span{font-size:13.5px}
.crm-stepper-lost{margin:-4px 0 14px}
.crm-deal-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:0 0 16px}.crm-deal-actions .erp-actions{margin:0}.crm-lost-btn{margin-left:auto}
.crm .erp-btn[disabled]{opacity:.5;cursor:not-allowed}
.crm .erp-toast{display:flex;align-items:flex-start;gap:10px;padding-right:8px;bottom:88px}.crm .erp-toast.is-visible{pointer-events:auto}.crm-toast-text{flex:1;min-width:0}
.crm-toast-x{flex:0 0 auto;width:30px;height:30px;margin:-4px 0 0;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:20px;line-height:1;cursor:pointer}
.crm-bell-menu{position:fixed;top:80px;right:16px;z-index:46;width:min(380px,calc(100vw - 24px));max-height:calc(100vh - 100px);overflow-y:auto;padding:12px 16px 14px;border:1px solid var(--blue);border-radius:16px;background:#091733;box-shadow:0 20px 50px rgba(0,0,0,.45)}
.crm-bell-menu[hidden]{display:none}.crm-bell-menu header{display:flex;align-items:center;justify-content:space-between}.crm-bell-menu h2{margin:0;font-size:17px}
.crm-bell-menu header button{width:36px;height:36px;border:0;border-radius:50%;background:rgba(124,155,255,.14);color:#fff;font-size:22px;cursor:pointer}
.crm-bell-label{margin:12px 0 4px;color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.04em}
.crm-bell-menu li{display:grid;gap:4px;padding:8px 0;border-top:1px solid var(--line)}.crm-bell-menu li:first-child{border-top:0}.crm-bell-menu li strong{font-weight:600;font-size:14.5px}.crm-bell-menu li strong a{color:#fff}.crm-bell-menu li>span{color:var(--muted);font-size:13.5px}
.crm-bell-menu .erp-actions{margin-top:10px}
@media(max-width:1100px){.crm-ai-page{grid-template-columns:1fr}}
@media(max-width:720px){
  .crm .erp-ba{display:block}.crm .erp-ba>span{display:inline}.crm .erp-ba-arrow{margin:0 6px}
  .crm .erp-tabs,.crm .erp-chips,.crm .erp-report-btns{flex-wrap:wrap;overflow:visible}
  .crm .erp-report-btns .erp-btn{width:auto}
  .crm-attn li{grid-template-columns:12px minmax(0,1fr)}.crm-attn-act{grid-column:2}.crm-attn-act .erp-btn{width:auto}.crm-attn-head{flex-wrap:wrap}.crm-attn-head .erp-btn{width:100%;justify-content:center}
  .crm-deal-actions{display:grid;gap:12px}.crm-deal-actions .erp-actions .erp-btn{width:100%}.crm-lost-btn{margin-left:0;justify-self:start;width:auto}
  .crm .erp-toast{top:70px;bottom:auto;left:10px;right:10px;max-width:none;padding:8px 8px 8px 12px;font-size:13.5px;line-height:1.35;transform:translateY(-8px)}
  .crm .erp-toast.is-visible{transform:none}
  .crm-bell-menu{top:70px;right:12px}
}

@media(max-width:720px){.crm-head-stage{display:none}.erp-page-head .erp-actions:has(>.crm-head-stage:only-child){display:none}}
.crm-footer-note{max-width:760px;margin-left:auto;margin-right:auto}
/* Home: four charts in two rows; the opportunity is the last line of "needs attention" */
.crm-charts{grid-template-columns:repeat(2,minmax(0,1fr))}
.crm-new{margin:0 0 18px}
.crm-attn li.tone-chance .crm-attn-dot{background:var(--blue)}
.crm-attn li strong small{display:block;margin-top:3px;color:var(--muted);font-size:14px;font-weight:400;line-height:1.45}
.crm-answer ul{margin:8px 0;padding-left:20px}.crm-answer .erp-actions{margin-top:12px}
@media(max-width:720px){.crm-charts{grid-template-columns:1fr}}
/* v7: nothing scrolls sideways — tables fit the screen, rows of buttons wrap, the funnel columns wrap into rows */
.crm .erp-table{min-width:0}
.crm .erp-table-wrap{overflow:visible}
