/* Specialized stage transitions. All values and permissions come from the CRM. */
#modal.sw-dialog{position:fixed;inset:auto;left:50%;top:min(20.16vh,200px);transform:translateX(-50%);margin:0;padding:0;width:510px;max-width:calc(100vw - 32px);max-height:calc(100dvh - min(20.16vh,200px) - 20px);border:1px solid #DAE5F1;border-radius:17px;background:#fff;color:#080D40;box-shadow:0 25px 80px #061A4725;overflow:auto}
#modal.sw-dialog .modal-head{padding:27px 28px 0;border:0;align-items:center;min-height:66px;gap:16px}
#modal.sw-dialog .modal-head h2{font-size:24px;line-height:1.35;letter-spacing:-.65px;font-weight:700}
#modal.sw-dialog .modal-head>.btn{width:35px;min-width:35px;height:39px;min-height:39px;padding:8px;border:1px solid #dae5f1;border-radius:11px;color:#4d65a0;background:white}
#modal.sw-dialog .modal-body{padding:0}
#modal.sw-dialog .sw-body{padding:20px 28px 47px}
#modal.sw-dialog .sw-intro{font-size:14px;line-height:24px;color:#6c7caf;margin:0 0 21px}
#modal.sw-dialog .change-stage{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);gap:14px;align-items:center;margin:0 0 21px}
#modal.sw-dialog .stage-mini{background:#f6f9fd;border:1px solid #dce6f4;border-radius:10px;padding:14px 15px;min-height:74px;font-size:14px;line-height:22px;overflow-wrap:anywhere}
#modal.sw-dialog .stage-mini small{display:block;font-size:11px;line-height:20px;color:#7b8eb7;margin-bottom:2px}
#modal.sw-dialog .stage-mini.to{background:#effdf9;border-color:#a4e5d7;color:#008b8f}
#modal.sw-dialog .stage-mini.lost{background:#fff1f3;border-color:#edcbd0}
#modal.sw-dialog .field{margin:0 0 17px;gap:0}
#modal.sw-dialog .field label{display:block;font-size:13px;font-weight:500;color:#38528f;margin-bottom:8px}
#modal.sw-dialog .field label span{color:#008c8f}
#modal.sw-dialog .field select,#modal.sw-dialog .field textarea{width:100%;font:inherit;font-size:14px;line-height:22px;color:#38528f;background:#fff;border:1px solid #d8e3f2;border-radius:11px;padding:11px 13px;min-height:46px}
#modal.sw-dialog .field textarea{height:98px;resize:none;display:block}
#modal.sw-dialog .notice{margin:0;padding:16px 19px;display:flex;align-items:flex-start;gap:12px;background:#f2fbf8;border:1px solid #d7ece9;border-radius:11px;font-size:13px;line-height:20px;color:#447f82}
#modal.sw-dialog .notice b{display:block;font-size:13px;line-height:20px;margin:0 0 3px;color:#008883}
#modal.sw-dialog .notice>.ph{font-size:18px;line-height:23px;flex-shrink:0}
#modal.sw-dialog .notice.warning{background:#fffaee;border-color:#f5e1b9;color:#a5741a}
#modal.sw-dialog .notice.warning b{color:#93600c}
#modal.sw-dialog .notice.warning>.ph-info:before{content:"\e4e0"}
#modal.sw-dialog .notice.info{margin-bottom:20px;background:#eff6ff;border-color:#d8e6ff;color:#5074ac}
#modal.sw-dialog .notice.info b{color:#3469ad}
#modal.sw-dialog .notice+.notice{margin-top:16px}
#modal.sw-dialog .sw-audit{font-size:11px;color:#6c7caf;line-height:18px;margin:16px 0 0}
#modal.sw-dialog .sw-footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:20px 23px;border-top:1px solid #e1e9f4;background:#fbfdff}
#modal.sw-dialog .sw-footer .btn{font-size:14px;line-height:20px;min-height:39px;padding:8px 13px;border-radius:11px;background:#fff;border:1px solid #d8e5f2;color:#102755;gap:8px}
#modal.sw-dialog .sw-footer .btn.primary{background:linear-gradient(#00a4a0,#007c7b);border-color:#00a4a0;color:white;box-shadow:0 5px 12px #008c8c25}
#modal.sw-dialog .sw-footer .btn.danger{background:#d73552;border-color:#d73552;color:white}
#modal.sw-dialog .sw-comparison{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:0 0 19px}
#modal.sw-dialog .form-error:empty{display:none}
#modal.sw-dialog .form-error:not(:empty){margin-bottom:15px}
#modal.sw-dialog :focus-visible{outline:3px solid #008f95;outline-offset:3px}
@media(max-width:600px){
  #modal.sw-dialog{top:min(9.72vh,82px);max-height:calc(100dvh - min(9.72vh,82px) - 16px);max-width:calc(100vw - 32px)}
  #modal.sw-dialog .modal-head{padding:20px 22px 0}
  #modal.sw-dialog .modal-head h2{font-size:24px}
  #modal.sw-dialog .sw-body{padding:17px 22px 44px}
  #modal.sw-dialog .sw-intro{font-size:13px;margin-bottom:18px}
  #modal.sw-dialog .stage-mini{line-height:21px}
  #modal.sw-dialog .field select,#modal.sw-dialog .field textarea{font-size:14px}
  #modal.sw-dialog .notice{font-size:12px;line-height:19px;padding:16px 19px}
  #modal.sw-dialog .notice b{line-height:19px}
  #modal.sw-dialog .sw-footer{padding:16px 20px 18px;flex-wrap:wrap}
  #modal.sw-dialog .sw-footer .btn{font-size:12px;min-height:40px;padding:9px 13px}
  #modal.sw-dialog .sw-footer .btn.danger{padding-inline:11px;gap:6px}
  #modal.sw-dialog .sw-footer .btn.danger .ph{font-size:18px}
  #modal.sw-dialog .sw-comparison{gap:12px}
}

/* Transient state only: a direct gesture never claims persistence before the API. */
.sp-lead[data-stage-saving="true"]{opacity:.72;cursor:progress}
.sp-lead>.stage-saving-label{position:absolute;z-index:3;inset:auto 8px 8px auto;background:var(--surface,#fff);padding:3px 7px;border:1px solid currentColor;border-radius:4px;font-size:11px}
.stage-move-recovery{pointer-events:auto;display:flex;gap:12px;align-items:center}
