/* Lead workspace shares the deal window structure, with its own violet identity. */
#leadDialog .lead-inline-check{display:flex;flex-direction:row;align-items:center;gap:8px;align-self:center}
#leadDialog .lead-inline-check input[type=checkbox]{width:17px;height:17px;flex:0 0 17px;margin:0;padding:0;accent-color:#a77bc7}
#leadDialog .lead-title-editor{min-width:0}
#leadDialog .lead-title-editor>label{display:flex;flex-direction:column;gap:6px}
#leadDialog .lead-title-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:8px}
#leadDialog .lead-title-tools .btn{font-size:11px;white-space:normal}
#leadDialog .lead-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
#leadDialog .lead-section-heading h4{margin:0}
#leadDialog .lead-communications-card,#leadDialog .lead-product-photos{margin-top:14px;min-width:0}
#leadDialog .lead-communications-card ul{display:flex;gap:10px;flex-wrap:wrap;margin:0;padding:0;list-style:none}
#leadDialog .lead-communications-card a{display:inline-block;padding:8px 10px;border:1px solid #59416d;border-radius:9px;background:#22172e;color:#dac4f1;overflow-wrap:anywhere}
#leadDialog .lead-photo-help{font-size:11px;line-height:1.5;margin:0 0 12px}
#leadDialog .lead-photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
#leadDialog .lead-product-photo{min-width:0;margin:0;border:1px solid #493754;border-radius:12px;overflow:hidden;background:#17121e}
#leadDialog .lead-product-photo>a{display:block;background:#0e0c13}
#leadDialog .lead-product-photo img{display:block;width:100%;height:160px;object-fit:contain}
#leadDialog .lead-product-photo figcaption{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px;font-size:10px;color:#cbb8da}
#leadDialog .lead-product-photo figcaption span{min-width:0;overflow-wrap:anywhere}
#leadDialog .lead-product-photo .btn{font-size:10px;padding:6px 8px;min-height:32px}
#leadDialog .lead-product-photos .lead-photo-upload{position:relative;cursor:pointer}
#leadDialog .lead-product-photos .lead-photo-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
#leadDialog .lead-photo-status{color:#bde1c9;font-size:12px;margin-top:8px}
#leadDialog .lead-photo-status:empty,#leadDialog [data-lead-photo-error]:empty{display:none}
#leadDialog .lead-create-grid>label.lead-inline-check{flex-direction:row;align-items:center;align-self:center;justify-content:flex-start;gap:8px}
#leadDialog .lead-create-grid textarea{width:100%;box-sizing:border-box;min-height:64px;resize:vertical;background:#151a22;border:1px solid #303846;border-radius:9px;color:#eef2f7;padding:10px 11px;font:inherit}
#leadDialog.lead-workspace-dialog{
  width:calc(100vw - 24px)!important;
  height:calc(100dvh - 24px)!important;
  max-height:calc(100dvh - 24px)!important;
  min-height:0;
  margin:auto;
  padding:0;
  border:1px solid #554070;
  border-radius:18px;
  overflow:hidden;
  background:#100e17;
}
#leadDialog.lead-workspace-dialog .lead-workspace{
  width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:0;
  display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto;
  background:#100e17;color:#f3edf9;
}
#leadDialog.lead-workspace-dialog [hidden]{display:none!important}
#leadDialog .lead-workspace-head{
  padding:16px 20px 14px;border-bottom:1px solid #40304e;
  background:linear-gradient(115deg,#2c1c40,#191322 60%,#201729);
}
#leadDialog .lead-workspace-head .deal-workspace-head-main{min-width:0;gap:13px}
#leadDialog .lead-workspace-mark{
  width:46px;height:46px;min-width:46px;display:grid;place-items:center;
  border:1px solid #9c75c2;border-radius:13px;
  background:linear-gradient(135deg,#8352b0,#503078);color:#fff;
  font-size:23px;font-weight:800;box-shadow:0 5px 18px #09070c3d;
}
#leadDialog .lead-workspace-head .eyebrow{color:#d0afea;font-size:10px;letter-spacing:.12em}
#leadDialog .lead-workspace-head h3{font-size:22px;line-height:1.25;margin:3px 0 7px;color:#fbf7ff}
#leadDialog .lead-workspace-head .deal-workspace-meta{gap:6px}
#leadDialog .lead-workspace-head .deal-workspace-meta span{
  padding:3px 8px;border-color:#59436d;background:#352442;color:#d9c5e9;
}
#leadDialog .lead-workspace-head [data-close]{min-width:42px;min-height:42px;color:#d9c3eb;background:#ffffff06;border-radius:10px}
#leadDialog .lead-workspace-stagebar{min-width:0;padding:12px 20px 10px;background:#17121f;border-bottom:1px solid #34283f;display:grid;grid-template-columns:minmax(0,1fr) 210px;align-items:center;gap:12px}
#leadDialog .lead-stage-strip{min-width:0;display:flex;align-items:stretch;overflow-x:auto;padding:2px 0 6px;gap:2px;scrollbar-width:thin;scrollbar-color:#63497c #17121f}
#leadDialog .lead-stage-step{
  position:relative;min-width:122px;flex:1 0 122px;min-height:42px;
  border:0;border-radius:0;padding:9px 16px 9px 19px;
  clip-path:polygon(0 0,calc(100% - 11px) 0,100% 50%,calc(100% - 11px) 100%,0 100%,11px 50%);
  background:#32263e;color:#bdaacb;font-size:11px;line-height:1.3;font-weight:600;
  cursor:pointer;text-align:center;transition:background .15s,color .15s;
}
#leadDialog .lead-stage-step:first-child{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 50%,calc(100% - 11px) 100%,0 100%);border-radius:7px 0 0 7px;padding-left:12px}
#leadDialog .lead-stage-step:hover:not(:disabled){background:#684184;color:#fff}
#leadDialog .lead-stage-step.is-complete{background:#58406e;color:#eadcf5}
#leadDialog .lead-stage-step.is-current{background:#9663c6;color:#fff;font-weight:800}
#leadDialog .lead-stage-step.lost{background:#3b2931;color:#d9b0bd}
#leadDialog .lead-stage-step.lost.is-current{background:#9e485c;color:#fff}
#leadDialog .lead-stage-step.converted{background:#28523e;color:#c3f0d4}
#leadDialog .lead-stage-step:disabled{cursor:default;opacity:.72}
#leadDialog .lead-stage-step.is-current:disabled{opacity:1}
#leadDialog .lead-stage-step:focus-visible{outline:none;box-shadow:inset 0 0 0 3px #f0ceff}
#leadDialog .lead-stage-select{display:grid;gap:4px;font-size:10px;color:#baa3cb;min-width:0}
#leadDialog .lead-stage-control{min-width:0;display:grid;gap:4px}
#leadDialog .lead-stage-select select{padding:8px 10px;min-height:39px;border-radius:8px;background:#241a30;border-color:#705083;color:#f1e8f9;font-size:12px}
#leadDialog .lead-workspace-stagebar [role="status"]{grid-column:1/-1;color:#bfa8cf;font-size:11px;line-height:1.4}
#leadDialog .lead-workspace-stagebar [role="status"]:empty{display:none}
#leadDialog .lead-workspace-stagebar #leadFormError{grid-column:1/-1;margin:0;min-height:0;font-size:12px;line-height:1.4}
#leadDialog .lead-workspace-stagebar #leadFormError:empty{display:none}
#leadDialog .lead-workspace-tabs{padding:5px 14px;border-bottom:1px solid #35283f;background:#15101c;gap:4px;min-width:0}
#leadDialog .lead-workspace-tabs button{min-height:40px;white-space:nowrap;color:#ad9abb}
#leadDialog .lead-workspace-tabs button.active{background:#362343;color:#f5eaff;box-shadow:inset 0 -2px 0 #bc8be7}
#leadDialog .lead-workspace .deal-workspace-body{min-width:0;min-height:0;padding:18px 20px;overflow:auto;overscroll-behavior:contain;scrollbar-color:#5b436f #15101b}
#leadDialog .lead-workspace .workspace-pane{min-width:0}
#leadDialog .lead-workspace .deal-overview-grid{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:16px}
#leadDialog .lead-workspace .deal-summary-card{border-color:#3b2e46;background:#19131f}
#leadDialog .lead-workspace .deal-summary-card h4{color:#bea3d1}
#leadDialog .lead-workspace .deal-summary-card dt{color:#a692b6}
#leadDialog .lead-workspace .deal-summary-card dd{color:#eee4f6}
#leadDialog .lead-workspace .deal-summary-card .deal-summary-primary{color:#fff0ff}
#leadDialog .lead-workspace .deal-summary-card .deal-summary-amount{color:#dcb8fa}
#leadDialog .lead-workspace-description p{margin:0;color:#d4c2df;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
#leadDialog .lead-workspace-overdue{margin:0 0 12px;padding:9px 12px;border:1px solid #814753;border-radius:9px;background:#3c202d;color:#ffc7d2;font-size:12px}
#leadDialog .lead-workspace-next{min-width:0;border:1px solid #483254;background:#1a1223;border-radius:14px;padding:16px;display:grid;gap:13px;align-content:start}
#leadDialog .lead-workspace-next h4{margin:0;color:#e8d4f8;font-size:15px}
#leadDialog .lead-workspace-next p{font-size:12px;line-height:1.5;color:#aa93bb;margin:0;overflow-wrap:anywhere}
#leadDialog .lead-workspace-next label{display:grid;gap:6px;color:#c1adcf;font-size:11px}
#leadDialog .lead-workspace-next textarea{min-height:100px;resize:vertical}
#leadDialog .lead-workspace-next textarea[name="notes"]{min-height:150px}
#leadDialog .lead-workspace :is(input,select,textarea){min-width:0;background:#1a1322;border-color:#44314f;color:#f0e6f8}
#leadDialog .lead-workspace :is(input,select,textarea):focus{border-color:#b77fe3;box-shadow:0 0 0 3px #a564ce24}
#leadDialog .lead-workspace :is(button,a,input,select,textarea):focus-visible{outline:2px solid #d5a3fa;outline-offset:2px}
#leadDialog .lead-workspace :is(input,select,textarea):disabled{color:#b4a4bf;opacity:.8;cursor:default}
#leadDialog .lead-workspace .lead-form-grid{gap:14px}
#leadDialog .lead-workspace .lead-form-grid label{color:#bdaacb}
#leadDialog .lead-workspace .lead-form-details{background:#19131f;border-color:#44314f}
#leadDialog .lead-workspace .lead-form-details summary{color:#dbc1ef}
#leadDialog .lead-workspace .lead-form-details dt{color:#b49ac7}
#leadDialog .lead-workspace .lead-form-details dd{color:#f0e6f8}
#leadDialog .lead-workspace .workspace-empty{background:#17111e;border-color:#4c355c;color:#b29cc2}
#leadDialog .lead-workspace-actions{
  width:100%;max-width:100%;min-width:0;display:flex!important;flex-direction:column;flex-wrap:nowrap;grid-template-columns:none!important;overflow:hidden;
  padding:0!important;gap:0!important;background:#140e1b!important;border-top:1px solid #40304d;box-shadow:0 -10px 30px #08060b26;
}
#leadDialog .lead-workspace-actions .lead-dialog-actions{width:100%;max-width:100%;margin:0;padding:10px 16px 8px;border:0;display:flex;align-items:center;gap:12px;justify-content:space-between;min-width:0}
#leadDialog .lead-workspace-actions .lead-dialog-actions>div{min-width:0;display:flex;gap:7px;align-items:center;flex-wrap:wrap}
#leadDialog .lead-workspace-actions .lead-dialog-actions>div:last-child{flex-shrink:0}
#leadDialog .lead-workspace-actions .btn{min-height:39px;padding:8px 12px;font-size:11px;border-radius:9px;white-space:nowrap}
#leadDialog .lead-workspace-actions .btn.ghost{border-color:#483253;color:#d1bbdf}
#leadDialog .lead-workspace-actions .btn.primary{background:linear-gradient(135deg,#925bc0,#71409e);box-shadow:0 5px 15px #7f46b326}
#leadDialog .lead-workspace-actions [data-payment]{background:#372347;border:1px solid #71448d;color:#efdaff}
#leadDialog .lead-workspace-actions [data-convert]{background:#27513b;border:1px solid #43785b;color:#d0f7df}
#leadDialog .lead-workspace-actions .lead-lifecycle-actions{width:100%;max-width:100%;min-width:0;display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap;padding:0 16px 9px}
#leadDialog .lead-workspace-actions .lead-lifecycle-actions .btn{min-height:30px;padding:5px 9px;font-size:10px}
#leadDialog .lead-workspace-actions #leadFormError{margin:0;padding:0 16px 9px;min-height:0;line-height:1.4}
#leadDialog .lead-workspace-actions #leadFormError:empty{display:none}
#leadDialog .lead-workspace .lead-converted-note,#leadDialog .lead-workspace .lead-archive-note{margin-bottom:12px}
@media(max-width:1050px){
  #leadDialog .lead-workspace-stagebar{grid-template-columns:minmax(0,1fr) 185px;padding:10px 15px 8px;gap:10px}
  #leadDialog .lead-stage-step{min-width:115px;flex-basis:115px}
  #leadDialog .lead-workspace .deal-overview-grid{grid-template-columns:1fr}
  #leadDialog .lead-workspace .deal-overview-cards{grid-template-columns:1fr 1fr}
  #leadDialog .lead-workspace .deal-summary-card.customer{grid-column:1/-1}
  #leadDialog .lead-workspace .deal-summary-card dl>div{grid-template-columns:96px minmax(0,1fr);gap:10px}
}
@media(max-width:760px){
  #leadDialog.lead-workspace-dialog{width:calc(100vw - 8px)!important;height:calc(100dvh - 8px)!important;max-height:calc(100dvh - 8px)!important;border-radius:13px}
  #leadDialog .lead-workspace-head{padding:12px 12px 10px;gap:8px}
  #leadDialog .lead-workspace-head .deal-workspace-head-main{gap:9px}
  #leadDialog .lead-workspace-mark{width:36px;height:36px;min-width:36px;font-size:19px;border-radius:10px}
  #leadDialog .lead-workspace-head h3{font-size:17px;margin:3px 0 6px}
  #leadDialog .lead-workspace-head .deal-workspace-meta{gap:4px}
  #leadDialog .lead-workspace-head .deal-workspace-meta span{font-size:9px;padding:2px 6px}
  #leadDialog .lead-workspace-head [data-close]{min-width:34px;min-height:34px;align-self:flex-start}
  #leadDialog .lead-workspace-stagebar{display:flex;flex-direction:column;align-items:stretch;padding:8px 12px;gap:6px}
  #leadDialog .lead-stage-strip{padding:0 0 5px}
  #leadDialog .lead-stage-step{min-width:116px;flex-basis:116px;min-height:36px;padding-top:7px;padding-bottom:7px;font-size:10px}
  #leadDialog .lead-stage-select{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:11px}
  #leadDialog .lead-stage-select select{flex:1;min-height:35px;padding:6px 9px}
  #leadDialog .lead-workspace-tabs{padding:4px 8px;overflow-x:auto}
  #leadDialog .lead-workspace-tabs button{padding:7px 10px;min-height:37px;font-size:11px}
  #leadDialog .lead-workspace .deal-workspace-body{padding:12px}
  #leadDialog .lead-workspace .deal-summary-card{padding:11px}
  #leadDialog .lead-workspace .deal-summary-card dl>div{grid-template-columns:85px minmax(0,1fr);gap:8px}
  #leadDialog .lead-workspace .deal-summary-card .deal-summary-primary{font-size:14px}
  #leadDialog .lead-workspace .deal-summary-card .deal-summary-amount{font-size:16px}
  #leadDialog .lead-workspace-next{padding:13px;gap:11px}
  #leadDialog .lead-workspace-actions .lead-dialog-actions{flex-direction:column;align-items:stretch;padding:8px 10px 6px;gap:7px}
  #leadDialog .lead-workspace-actions{max-height:45dvh;overflow-x:hidden;overflow-y:auto}
  #leadDialog .lead-workspace-actions .lead-dialog-actions>div:first-child{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;padding-bottom:0;gap:6px}
  #leadDialog .lead-workspace-actions .lead-dialog-actions>div:last-child{justify-content:flex-end}
  #leadDialog .lead-workspace-actions .lead-dialog-actions>div:first-child .btn{min-width:0;white-space:normal;line-height:1.35}
  #leadDialog .lead-workspace-actions .btn{min-height:36px;padding:7px 10px;font-size:11px}
  #leadDialog .lead-workspace-actions .lead-lifecycle-actions{padding:0 10px 8px;gap:6px}
  #leadDialog .lead-workspace-actions .lead-lifecycle-actions .btn{min-height:30px}
}
@media(max-width:390px){
  #leadDialog .lead-workspace .deal-overview-cards{grid-template-columns:1fr}
  #leadDialog .lead-workspace .deal-summary-card.customer{grid-column:auto}
}
@media(prefers-reduced-motion:reduce){#leadDialog .lead-stage-step{transition:none}}

#leadDialog .lead-workspace-head-actions{display:flex;align-items:flex-start;justify-content:flex-end;gap:10px;flex-shrink:0}
#leadDialog .lead-workspace-head-actions .btn{min-height:40px;font-size:12px;white-space:nowrap;border-color:#79578f;background:#32213f;color:#f3e7fb}
#leadDialog .lead-contract-card{display:flex;gap:16px;align-items:flex-start;max-width:850px;padding:22px;border:1px solid #644878;border-radius:14px;background:linear-gradient(125deg,#2c1d39,#1a1322);min-width:0}
#leadDialog .lead-contract-icon{display:grid;place-items:center;flex:0 0 46px;height:46px;border:1px solid #9163ae;border-radius:12px;background:#47305a;color:#ead1fc;font-size:28px}
#leadDialog .lead-contract-card>div{min-width:0}
#leadDialog .lead-contract-card h4{margin:0 0 8px;font-size:18px;color:#f6eafd}
#leadDialog .lead-contract-card p{margin:0 0 12px;color:#cdb6dc;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
#leadDialog .lead-contract-card .lead-contract-note{color:#eed19e}
#leadDialog .lead-contract-note:empty,#leadDialog .lead-contract-status:empty,#leadDialog .lead-contract-error:empty{display:none}
#leadDialog .lead-contract-card .lead-contract-save-note{font-size:11px;color:#bba1cc}
#leadDialog .lead-contract-card .btn.primary{background:#8152a6;border-color:#a77bc7;color:#fff}
#leadDialog .lead-contract-card .btn:disabled{opacity:.5;cursor:default}
#leadDialog .lead-contract-status,#leadDialog .lead-contract-error{max-width:850px;margin-top:14px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#leadDialog .lead-contract-status{color:#bfdfc8}
#leadDialog .lead-contract-error{padding:11px 13px;border:1px solid #825267;border-radius:10px;background:#351d2b;color:#ffc1cc}
#leadDialog .lead-contract-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
#leadDialog .lead-contract-links .btn{font-size:12px;white-space:normal}
@media(max-width:760px){
  #leadDialog .lead-workspace-head-actions{gap:6px;flex-wrap:wrap;max-width:122px}
  #leadDialog .lead-workspace-head-actions [data-close]{order:-1}
  #leadDialog .lead-workspace-head-actions .btn{min-height:34px;font-size:10px;padding:6px 8px}
  #leadDialog .lead-contract-card{padding:15px;gap:11px}
  #leadDialog .lead-contract-icon{flex-basis:34px;height:34px;border-radius:9px;font-size:23px}
  #leadDialog .lead-contract-card h4{font-size:16px}
  #leadDialog .lead-contract-card p{font-size:12px}
  #leadDialog .lead-contract-links{display:grid;grid-template-columns:minmax(0,1fr)}
}


/* CRM reference layout: one property rail and an independent activity column. */
#leadDialog.lead-workspace-dialog{width:min(1760px,calc(100vw - 260px))!important;height:calc(100dvh - 40px)!important;max-height:calc(100dvh - 40px)!important;margin:20px 18px 20px auto;border-radius:16px}
#leadDialog .crm-card-layout{grid-template-rows:auto auto auto minmax(0,1fr) auto}
#leadDialog .crm-record-header{position:relative;z-index:6;align-items:flex-start;background:#1c1525;padding:18px 20px 14px;gap:18px}
#leadDialog .crm-record-header .deal-workspace-head-main{flex:1;min-width:0;align-items:flex-start}
#leadDialog .crm-record-header .deal-workspace-head-main>div{min-width:0}
#leadDialog .crm-record-header h3{font-size:23px;font-weight:650;line-height:1.35;margin:2px 0 8px;overflow-wrap:anywhere}
#leadDialog .crm-record-header .eyebrow{font-size:9px;letter-spacing:.08em}
#leadDialog .crm-record-header .deal-workspace-meta span{font-size:10px;padding:3px 7px;background:#251d2f;border-color:#45344f}
#leadDialog .crm-record-header .lead-workspace-head-actions{max-width:52%;flex-wrap:wrap;align-items:center;gap:8px}
#leadDialog .crm-record-header .lead-workspace-head-actions>.btn{min-height:35px;font-size:11px;padding:8px 11px;border-radius:8px;background:#2c2038;border-color:#59416c}
#leadDialog .crm-record-header .crm-primary-payment{background:#8052a5!important;border-color:#a36cc9!important;color:#fff}
#leadDialog .crm-record-header [data-close]{min-width:35px;min-height:35px;align-self:flex-start}
#leadDialog .crm-record-more{position:relative;min-width:0}
#leadDialog .crm-record-more>summary{list-style:none;min-height:35px;display:flex;align-items:center;justify-content:center;padding:8px 11px;font-size:11px;background:#2b2233;border:1px solid #59416c;border-radius:8px;cursor:pointer;color:#dfd1e8}
#leadDialog .crm-record-more>summary::-webkit-details-marker{display:none}
#leadDialog .crm-record-more[open]>summary{border-color:#bb85e0;background:#3c2a4b}
#leadDialog .crm-record-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:10;width:248px;max-height:min(490px,65dvh);overflow-y:auto;padding:8px;display:grid;gap:5px;background:#211827;border:1px solid #684d7c;border-radius:11px;box-shadow:0 12px 34px #0008}
#leadDialog .crm-record-menu .btn{display:block;white-space:normal;text-align:left;padding:10px 11px;font-size:12px;min-height:38px;width:100%;border-color:transparent;background:transparent}
#leadDialog .crm-record-menu .btn:hover{background:#352441;border-color:#654274}
#leadDialog .crm-record-menu .lead-lifecycle-actions{display:grid;gap:4px;padding-top:7px;border-top:1px solid #45314f;margin-top:4px}
#leadDialog .crm-record-menu .danger{color:#f2a6b5}
#leadDialog .crm-record-stagebar{display:grid;grid-template-columns:minmax(0,1fr);padding:10px 20px 8px;gap:5px;background:#18121f}
#leadDialog .crm-record-stagebar .lead-stage-strip{padding:0 0 2px;gap:3px}
#leadDialog .crm-record-stagebar .lead-stage-step{min-width:104px;flex:1 0 104px;min-height:34px;padding-top:7px;padding-bottom:7px;font-size:10px;font-weight:650}
#leadDialog .crm-record-stagebar .lead-stage-control{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
#leadDialog .crm-record-stagebar .lead-stage-select{display:flex;align-items:center;gap:9px;font-size:10px;white-space:nowrap}
#leadDialog .crm-record-stagebar .lead-stage-select select{width:180px;min-height:28px;padding:3px 8px;font-size:11px;background:#211829;border-color:#483451}
#leadDialog .crm-record-stagebar .lead-stage-status{font-size:10px;line-height:1.4;text-align:right;color:#a18cad}
#leadDialog .crm-record-tabs{padding:4px 15px;background:#17111e;gap:3px}
#leadDialog .crm-record-tabs button{min-height:38px;padding:8px 12px;font-size:12px}
#leadDialog .crm-card-layout .deal-workspace-body{padding:18px 20px;background:#15101c}
#leadDialog .crm-card-layout .crm-record-overview{grid-template-columns:minmax(300px,.4fr) minmax(0,.6fr);gap:22px;align-items:start}
#leadDialog .crm-record-properties{display:block;min-width:0;border:1px solid #403048;border-radius:14px;background:#1b1422;overflow:hidden}
#leadDialog .crm-record-properties .deal-summary-card{border:0;border-bottom:1px solid #392b42;border-radius:0;background:transparent;margin:0;padding:16px}
#leadDialog .crm-record-properties>.deal-summary-card:last-child{border-bottom:0}
#leadDialog .crm-record-properties .deal-summary-card h4{font-size:11px;font-weight:500;color:#ad98bc;margin:0 0 10px}
#leadDialog .crm-record-properties .lead-section-heading{margin-bottom:8px}
#leadDialog .crm-record-properties .lead-section-heading h4{margin:0}
#leadDialog .crm-record-properties .lead-section-heading>.btn{padding:4px 7px;min-height:27px;font-size:10px;color:#ccb8dd;background:transparent;border-color:#4a3558}
#leadDialog .crm-record-properties .lead-photo-help{font-size:10px;color:#95809f;line-height:1.4;margin:7px 0 0}
#leadDialog .crm-record-properties [data-lead-photo-empty]{font-size:12px;margin:8px 0 0;color:#a994b8}
#leadDialog .crm-record-properties .lead-photo-gallery:empty{display:none}
#leadDialog .crm-record-properties .lead-photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}
#leadDialog .crm-record-properties .lead-product-photo img{height:145px}
#leadDialog .crm-record-properties .lead-product-photo figcaption{padding:7px;font-size:9px;align-items:flex-start;flex-wrap:wrap}
#leadDialog .crm-customer-contact{padding:14px;border:1px solid #4b3756;border-radius:11px;background:#241a2e}
#leadDialog .crm-customer-contact strong{font-size:16px;font-weight:600;color:#f1e7f8;line-height:1.5;display:block}
#leadDialog .crm-customer-contact>div{font-size:11px;line-height:1.7;margin-top:5px;color:#b9a4ca;overflow-wrap:anywhere}
#leadDialog .crm-customer-contact a{color:#d2afea;text-decoration:none}
#leadDialog .crm-customer-contact a:hover{text-decoration:underline}
#leadDialog .crm-record-properties .deal-summary-card dl{gap:13px;margin:14px 0 0}
#leadDialog .crm-record-properties .deal-summary-card dl>div{display:grid;grid-template-columns:1fr;gap:3px}
#leadDialog .crm-record-properties .deal-summary-card dt{font-size:10px;color:#a68eb6}
#leadDialog .crm-record-properties .deal-summary-card dd{font-size:12px;line-height:1.5;color:#e1d1ec;overflow-wrap:anywhere}
#leadDialog .crm-property-amount{display:flex;align-items:center;justify-content:space-between;gap:12px}
#leadDialog .crm-property-amount>div{min-width:0;display:grid;gap:5px}
#leadDialog .crm-property-amount span{font-size:11px;color:#aa93ba}
#leadDialog .crm-property-amount strong{font-size:30px;font-weight:500;color:#ecd8fa;font-variant-numeric:tabular-nums;line-height:1.2;overflow-wrap:anywhere}
#leadDialog .crm-property-amount>.btn{flex-shrink:0;min-height:32px;font-size:10px;padding:7px 9px;background:#8153aa;border-color:#a879cc}
#leadDialog .crm-payment-details{padding:13px;margin-top:15px;border:1px solid #493453;border-radius:10px;background:#21182a}
#leadDialog .crm-payment-details>b{font-size:11px;font-weight:600;color:#d8bcea}
#leadDialog .crm-payment-details>p{font-size:10px;line-height:1.6;color:#a88eb8;margin:7px 0}
#leadDialog .crm-payment-details>.btn{padding:4px 0;min-height:25px;font-size:11px;border:0;background:transparent;color:#cca2eb;text-align:left}
#leadDialog .crm-record-activity.lead-workspace-next{min-width:0;display:grid;gap:16px;border:0;background:transparent;padding:0;border-radius:0;align-content:start}
#leadDialog .crm-activity-composer{min-width:0;border:1px solid #46334f;border-radius:14px;padding:14px 17px 15px;background:#201729}
#leadDialog .crm-activity-tabs{display:flex;gap:7px;align-items:center;overflow-x:auto;margin:0 0 15px;padding:0 0 2px}
#leadDialog .crm-activity-tabs button{border:1px solid transparent;border-radius:7px;background:transparent;color:#b49ec5;padding:7px 11px;font-size:12px;min-height:34px;white-space:nowrap;cursor:pointer}
#leadDialog .crm-activity-tabs button.active{background:#352343;border-color:#684579;color:#ebd6fc}
#leadDialog .crm-activity-compose-pane{min-width:0}
#leadDialog .crm-activity-compose-pane label{display:grid;gap:7px;font-size:11px;color:#bea6ce}
#leadDialog .crm-activity-compose-pane textarea{min-height:76px;padding:12px;border:1px solid #503a5b;border-radius:9px;background:#17101e;font-size:12px;line-height:1.6;resize:vertical;box-sizing:border-box;width:100%}
#leadDialog .crm-activity-compose-pane textarea[name=notes]{min-height:118px}
#leadDialog .crm-activity-task-tools{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:11px}
#leadDialog .crm-activity-task-tools>label{flex:1;max-width:290px}
#leadDialog .crm-activity-task-tools input{min-height:36px;padding:7px 10px;border-radius:7px;font-size:11px;width:100%;box-sizing:border-box}
#leadDialog .crm-activity-compose-pane>.btn,#leadDialog .crm-activity-task-tools>.btn{min-height:36px;padding:8px 12px;font-size:11px;flex-shrink:0}
#leadDialog .crm-activity-compose-pane>.btn{margin-top:10px}
#leadDialog .crm-activity-compose-hint{font-size:10px!important;margin:9px 0 0!important;color:#9d86ad!important}
#leadDialog .crm-activity-save-status{font-size:11px!important;margin:10px 0 0!important;color:#bdd4bf!important}
#leadDialog .crm-activity-save-status:empty{display:none}
#leadDialog .crm-activity-contact-links{display:flex;flex-wrap:wrap;gap:8px;min-height:38px}
#leadDialog .crm-next-action{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border:1px solid #605136;border-radius:12px;background:#302719;padding:15px 17px}
#leadDialog .crm-next-action h4{font-size:11px!important;font-weight:600;color:#edce91!important;margin:0 0 5px!important}
#leadDialog .crm-next-action p{font-size:13px!important;line-height:1.55;color:#e5d4b9!important;white-space:pre-wrap}
#leadDialog .crm-next-action time{display:block;font-size:10px;color:#bba986;margin-top:7px}
#leadDialog .crm-next-action .btn{font-size:10px;min-height:30px;padding:6px 9px;border-color:#73603e;background:#3b301f;color:#ead5ac}
#leadDialog .crm-activity-history-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 0 0}
#leadDialog .crm-activity-history-heading h4{font-size:12px!important;color:#c2a8d3!important;font-weight:500}
#leadDialog .crm-activity-history-heading span{font-size:10px;color:#8d769e}
#leadDialog .crm-activity-timeline{display:grid;gap:13px;min-width:0;border-left:1px solid #483452;padding-left:19px;margin-left:7px}
#leadDialog .crm-activity-event{position:relative;border:1px solid #46314f;border-radius:11px;padding:14px 16px;background:#211728;min-width:0}
#leadDialog .crm-activity-event:before{content:"";position:absolute;left:-24px;top:18px;width:8px;height:8px;background:#a06ac5;border:2px solid #1b1422;border-radius:50%}
#leadDialog .crm-activity-event-head{display:flex;align-items:baseline;gap:11px;flex-wrap:wrap}
#leadDialog .crm-activity-event-head b{font-size:11px;font-weight:600;color:#dec3ee}
#leadDialog .crm-activity-event-head time{font-size:10px;color:#9f86af}
#leadDialog .crm-activity-event p{font-size:12px!important;line-height:1.6;margin:8px 0 0!important;color:#d2bbdf!important;white-space:pre-wrap}
#leadDialog .crm-activity-empty{border:1px dashed #4c3759;border-radius:11px;padding:18px;color:#bda7ca}
#leadDialog .crm-activity-empty b{font-size:12px;font-weight:500}
#leadDialog .crm-activity-empty p{font-size:11px!important;margin-top:8px!important}
#leadDialog .crm-card-layout .lead-workspace-actions{background:#17111e!important;box-shadow:none}
#leadDialog .crm-card-layout .lead-workspace-actions .lead-dialog-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:8px 20px;min-height:50px}
#leadDialog .crm-record-save-hint{font-size:10px;color:#967da6;margin:0;line-height:1.5}
#leadDialog .crm-card-layout .lead-workspace-actions .lead-dialog-actions>div{display:flex;flex-wrap:wrap;gap:7px}
#leadDialog .crm-card-layout .lead-workspace-actions .btn{min-height:33px;padding:7px 13px;font-size:11px}
#leadDialog .crm-record-mobile-switch{display:none}
@media(max-width:1200px){
 #leadDialog.lead-workspace-dialog{width:calc(100vw - 24px)!important;height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;margin:12px auto}
 #leadDialog .crm-record-header h3{font-size:21px}
 #leadDialog .crm-record-header .lead-workspace-head-actions{max-width:50%}
 #leadDialog .crm-card-layout .crm-record-overview{grid-template-columns:minmax(280px,.4fr) minmax(0,.6fr);gap:16px}
}
@media(max-width:760px){
 #leadDialog.lead-workspace-dialog{width:calc(100vw - 12px)!important;height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px)!important;margin:6px auto;border-radius:13px}
 #leadDialog .crm-record-header{padding:13px 12px 11px;display:flex;flex-direction:column;gap:11px}
 #leadDialog .crm-record-header .lead-workspace-head-main{width:100%}
 #leadDialog .crm-record-header h3{font-size:18px;margin:1px 0 7px}
 #leadDialog .crm-record-header .lead-workspace-head-actions{max-width:none;width:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:6px}
 #leadDialog .crm-record-header .lead-workspace-head-actions>.btn{font-size:10px;padding:7px 9px;min-height:34px}
 #leadDialog .crm-record-header [data-close]{position:absolute;right:8px;top:8px;min-width:30px;min-height:30px}
 #leadDialog .crm-record-header .deal-workspace-head-main>div{padding-right:30px}
 #leadDialog .crm-record-header .deal-workspace-meta{gap:4px}
 #leadDialog .crm-record-more>summary{font-size:10px;padding:7px 10px;min-height:34px}
 #leadDialog .crm-record-menu{right:0;width:min(290px,calc(100vw - 36px))}
 #leadDialog .crm-record-stagebar{padding:8px 12px 7px;gap:4px}
 #leadDialog .crm-record-stagebar .lead-stage-step{min-width:110px;flex-basis:110px;min-height:33px;padding-top:6px;padding-bottom:6px}
 #leadDialog .crm-record-stagebar .lead-stage-control{align-items:center;gap:8px}
 #leadDialog .crm-record-stagebar .lead-stage-select{font-size:9px;gap:7px}
 #leadDialog .crm-record-stagebar .lead-stage-select select{width:148px;min-height:28px;font-size:10px}
 #leadDialog .crm-record-stagebar .lead-stage-status{max-width:130px;font-size:9px;line-height:1.4}
 #leadDialog .crm-record-tabs{padding:4px 7px}
 #leadDialog .crm-record-tabs button{min-height:35px;padding:7px 9px;font-size:10px}
 #leadDialog .crm-card-layout .deal-workspace-body{padding:11px}
 #leadDialog .crm-card-layout .crm-record-overview{grid-template-columns:minmax(0,1fr);gap:14px}
 #leadDialog .crm-record-mobile-switch{display:flex;position:sticky;top:-1px;z-index:3;gap:5px;padding:5px;margin-bottom:11px;border:1px solid #4a3458;border-radius:9px;background:#1d1426}
 #leadDialog .crm-record-mobile-switch button{flex:1;min-width:0;border:1px solid transparent;border-radius:6px;background:transparent;color:#af94bf;padding:8px 7px;font-size:11px;min-height:34px;cursor:pointer}
 #leadDialog .crm-record-mobile-switch button.active{background:#49305d;border-color:#795192;color:#f0dcff}
 #leadDialog #lead-pane-overview:not(.is-activity-view) .crm-record-activity{display:none}
 #leadDialog #lead-pane-overview.is-activity-view .crm-record-properties{display:none}
 #leadDialog .crm-record-properties .deal-summary-card{padding:13px}
 #leadDialog .crm-property-amount strong{font-size:26px}
 #leadDialog .crm-customer-contact{padding:12px}
 #leadDialog .crm-customer-contact strong{font-size:14px}
 #leadDialog .crm-record-properties .deal-summary-card dl>div{grid-template-columns:1fr}
 #leadDialog .crm-activity-composer{padding:12px}
 #leadDialog .crm-activity-tabs{gap:2px}
 #leadDialog .crm-activity-tabs button{font-size:11px;padding:7px 9px}
 #leadDialog .crm-activity-task-tools{align-items:stretch;flex-direction:column;gap:9px}
 #leadDialog .crm-activity-task-tools>label{max-width:none}
 #leadDialog .crm-activity-task-tools>.btn{align-self:flex-start}
 #leadDialog .crm-next-action{padding:12px;gap:10px}
 #leadDialog .crm-next-action .btn{max-width:110px;white-space:normal}
 #leadDialog .crm-activity-history-heading{padding:2px 0}
 #leadDialog .crm-activity-history-heading span{font-size:9px}
 #leadDialog .crm-activity-timeline{padding-left:15px;margin-left:5px}
 #leadDialog .crm-activity-event{padding:12px}
 #leadDialog .crm-activity-event:before{left:-20px}
 #leadDialog .crm-card-layout .lead-workspace-actions .lead-dialog-actions{padding:7px 11px;gap:9px}
 #leadDialog .crm-record-save-hint{font-size:9px;max-width:170px}
 #leadDialog .crm-card-layout .lead-workspace-actions .lead-dialog-actions>div{flex-shrink:0;gap:6px}
 #leadDialog .crm-card-layout .lead-workspace-actions .btn{min-height:32px;font-size:10px;padding:7px 10px}
}

/* Reference-density refinements: contact, amount and activity remain above fold. */
#leadDialog .crm-record-header{padding-top:13px;padding-bottom:11px}
#leadDialog .crm-record-header h3{margin-top:0;margin-bottom:6px;font-size:22px;line-height:1.3}
#leadDialog .crm-record-stagebar{padding-top:6px;padding-bottom:5px;gap:0}
#leadDialog .crm-stage-announcement{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#leadDialog .crm-record-menu .lead-stage-control{padding:6px 8px 10px;border-bottom:1px solid #483450;margin-bottom:3px}
#leadDialog .crm-record-menu .lead-stage-select{display:grid;gap:7px;color:#bba0cd;font-size:10px}
#leadDialog .crm-record-menu .lead-stage-select select{min-height:35px;width:100%;box-sizing:border-box;padding:7px 8px;border:1px solid #624675;border-radius:7px;font-size:12px}
#leadDialog .crm-record-properties .crm-property-photo{padding-top:13px;padding-bottom:13px}
#leadDialog .crm-record-properties .lead-photo-help{font-size:9px;margin-top:5px}
#leadDialog .crm-record-properties .customer{padding-top:13px;padding-bottom:14px}
#leadDialog .crm-activity-composer{padding:11px 15px 12px}
#leadDialog .crm-activity-tabs{margin-bottom:10px;gap:6px}
#leadDialog .crm-activity-tabs button{min-height:30px;padding:5px 10px}
#leadDialog .crm-activity-compose-pane textarea{min-height:52px;padding:9px 11px;line-height:1.5}
#leadDialog .crm-activity-task-tools{margin-top:8px;gap:10px}
#leadDialog .crm-activity-task-tools>label{gap:4px;font-size:10px}
#leadDialog .crm-activity-task-tools input{min-height:31px;padding:5px 8px}
#leadDialog .crm-activity-task-tools>.btn{min-height:31px;padding:6px 11px}
@media(max-width:760px){
 #leadDialog .crm-record-header{padding-top:12px;padding-bottom:10px}
 #leadDialog .crm-record-header h3{font-size:17px;line-height:1.35}
 #leadDialog .crm-record-stagebar{padding-top:6px;padding-bottom:5px}
 #leadDialog .crm-activity-composer{padding:11px}
 #leadDialog .crm-activity-compose-pane textarea{min-height:65px}
 #leadDialog .crm-activity-task-tools{gap:8px}
}

/* Bound photo density: all originals remain accessible through a scrollable strip. */
#leadDialog .crm-record-properties .lead-photo-gallery{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;max-height:150px;padding:0 0 6px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#76528c #21182a}
#leadDialog .crm-record-properties .lead-product-photo{flex:0 0 108px;max-width:108px;scroll-snap-align:start;align-self:flex-start}
#leadDialog .crm-record-properties .lead-product-photo img{height:70px}
#leadDialog .crm-record-properties .lead-product-photo figcaption{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:6px;min-height:57px;box-sizing:border-box}
#leadDialog .crm-record-properties .lead-product-photo figcaption>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.3;max-height:24px}
#leadDialog .crm-record-properties .lead-product-photo figcaption>.btn{min-height:23px;padding:4px 5px;font-size:9px;align-self:flex-start}
#leadDialog.lead-workspace-dialog::backdrop{background:#05040a99;backdrop-filter:blur(1.5px)}
/* Closing a lead protects both ordinary fields and the module composition. */
dialog.lead-unsaved-dialog{width:min(480px,calc(100vw - 24px))!important;height:fit-content!important;min-height:0;max-height:calc(100dvh - 24px)!important;margin:auto;overflow:auto}
dialog.lead-unsaved-dialog>.dialog-card{min-height:0}
.lead-unsaved-dialog h3,.lead-unsaved-dialog p{margin:0}
.lead-unsaved-dialog p{line-height:1.5;color:#c7d2e2}
.lead-unsaved-actions{display:grid;gap:10px}
.lead-unsaved-actions button{min-height:44px;white-space:normal}
