/* TeamAct CRM — Lead Commercial Header V1
   User / Agent lead drawer only. Keeps the existing full-drawer scroll architecture intact.
*/

body.crm-user-panel .mlv4-identity{
  display:block!important;
  padding:10px 12px 12px!important;
  background:#fff!important;
}
body.crm-user-panel .mlv4-identity-main{width:100%;min-width:0}
body.crm-user-panel .mlv4-header-tools{
  width:100%;
  display:grid;
  grid-template-columns:minmax(250px,auto) 1px minmax(360px,1fr) 1px auto;
  align-items:center;
  gap:22px;
  min-height:104px;
  padding:12px 14px;
  border:1px solid #e3eaf0;
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  box-shadow:0 4px 14px rgba(24,45,68,.05);
}
body.crm-user-panel .mlv4-lead-summary{
  min-width:0;
  display:grid;
  align-content:center;
  gap:10px;
}
body.crm-user-panel .mlv4-lead-summary h2{
  margin:0!important;
  padding:0!important;
  border:0!important;
  font-size:20px!important;
  line-height:1.15!important;
  font-weight:700!important;
  color:#17263a!important;
  letter-spacing:-.01em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.crm-user-panel .mlv4-lead-controls{
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}
body.crm-user-panel .mlv4-separator{
  width:1px;
  height:72px;
  background:#dbe5ec;
  border-radius:99px;
  display:block;
}
body.crm-user-panel .mlv4-status-wrap{min-width:0}
body.crm-user-panel .mlv4-status-wrap .mlv3-status-control{display:inline-block;position:relative}
body.crm-user-panel .mlv4-status-wrap .mlv3-status-trigger{
  min-height:36px!important;height:36px!important;min-width:0!important;
  padding:5px 12px!important;
  border:1px solid color-mix(in srgb,var(--ls-color,#8b8b84) 25%,#d7dee4)!important;
  border-radius:11px!important;
  background:var(--ls-soft,#eef3f2)!important;
  color:var(--ls-text,#315f5a)!important;
  box-shadow:none!important;
  font-size:13px!important;font-weight:650!important;
}
body.crm-user-panel .mlv4-status-wrap .mlv3-status-trigger:hover:not(:disabled),
body.crm-user-panel .mlv4-status-wrap .mlv3-status-trigger[aria-expanded="true"]{
  border-color:color-mix(in srgb,var(--ls-color,#8b8b84) 48%,#fff)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--ls-soft,#eef3f2) 70%,#fff)!important;
}
body.crm-user-panel .mlv4-status-wrap .mlv3-status-trigger-caret{font-size:10px!important;margin-left:5px}

body.crm-user-panel .mlv4-rating{display:flex;align-items:center;gap:3px;white-space:nowrap}
body.crm-user-panel .mlv4-rating button{
  min-width:0!important;width:23px!important;height:32px!important;min-height:32px!important;
  padding:0!important;border:0!important;background:transparent!important;background-image:none!important;
  box-shadow:none!important;color:#c5ced6!important;font-size:22px!important;line-height:1!important;cursor:pointer;
  transform:translateZ(0);
}
body.crm-user-panel .mlv4-rating button:hover:not(:disabled),
body.crm-user-panel .mlv4-rating button.is-on{color:#f2a400!important}
body.crm-user-panel .mlv4-rating button:hover:not(:disabled){transform:translateY(-1px) scale(1.04)}
body.crm-user-panel .mlv4-rating button:disabled{cursor:default;opacity:.72}

body.crm-user-panel .mlv4-followup-preview{
  position:relative;
  min-width:0;
  min-height:76px;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 38px;
  align-items:center;
  gap:14px;
  padding:10px 14px;
  border:1px solid #dce9f4;
  border-radius:14px;
  outline:none;
  color:#33475b;
  cursor:default;
  background:linear-gradient(180deg,#f8fbff 0%,#f3f8fd 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
body.crm-user-panel .mlv4-followup-icon{
  width:48px;height:48px;
  display:grid;place-items:center;
  border-radius:50%;
  background:#e5f3ff;
  color:#3183c9;
}
body.crm-user-panel .mlv4-followup-icon svg{width:22px;height:22px}
body.crm-user-panel .mlv4-followup-copy{
  min-width:0;
  display:grid;
  gap:3px;
}
body.crm-user-panel .mlv4-followup-copy>span{
  font-size:12px!important;
  color:#71859a!important;
  font-weight:500!important;
  white-space:nowrap;
}
body.crm-user-panel .mlv4-followup-copy>strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:16px!important;
  line-height:1.25!important;
  font-weight:700!important;
  color:#1d2e42!important;
}
body.crm-user-panel .mlv4-followup-note-icon{
  position:relative;
  width:38px;height:38px;
  display:grid;place-items:center;
  border-left:1px solid #dce8f1;
  color:#6d8398;
}
body.crm-user-panel .mlv4-followup-note-icon svg{width:19px;height:19px}
body.crm-user-panel .mlv4-followup-note-icon:after{
  content:"";
  position:absolute;
  top:5px;right:2px;
  width:7px;height:7px;
  border:2px solid #f3f8fd;
  border-radius:50%;
  background:#0aa3a0;
}
body.crm-user-panel .mlv4-followup-preview:hover,
body.crm-user-panel .mlv4-followup-preview:focus{
  border-color:#c7ddea;
  box-shadow:0 5px 16px rgba(45,94,126,.08);
}
body.crm-user-panel .mlv4-followup-tooltip{
  position:absolute;z-index:120;left:50%;top:calc(100% + 9px);transform:translateX(-50%);
  width:min(330px,72vw);padding:10px 12px;border:1px solid #dce4ea;border-radius:9px;
  background:#fff;box-shadow:0 10px 28px rgba(25,42,56,.16);display:none;gap:4px;
}
body.crm-user-panel .mlv4-followup-tooltip:before{
  content:"";position:absolute;left:50%;top:-5px;width:9px;height:9px;background:#fff;
  border-left:1px solid #dce4ea;border-top:1px solid #dce4ea;transform:translateX(-50%) rotate(45deg);
}
body.crm-user-panel .mlv4-followup-tooltip b{font-size:11px!important;color:#6b7a88!important;font-weight:650!important}
body.crm-user-panel .mlv4-followup-tooltip span{font-size:12px!important;color:#273746!important;line-height:1.45!important;white-space:normal!important}
body.crm-user-panel .mlv4-followup-preview:hover .mlv4-followup-tooltip,
body.crm-user-panel .mlv4-followup-preview:focus .mlv4-followup-tooltip{display:grid}

body.crm-user-panel .mlv4-action-menu{position:relative;justify-self:end}
body.crm-user-panel .mlv4-action-menu>summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:122px;
  min-height:48px;
  padding:8px 16px;
  border:1px solid #5747e5;
  border-radius:12px;
  background:linear-gradient(180deg,#6256ef 0%,#4939df 100%);
  color:#fff;
  cursor:pointer;
  font-size:14px!important;
  font-weight:650!important;
  white-space:nowrap;
  box-shadow:0 5px 12px rgba(74,58,222,.18);
}
body.crm-user-panel .mlv4-action-menu>summary:hover,
body.crm-user-panel .mlv4-action-menu[open]>summary{
  background:linear-gradient(180deg,#594ce9 0%,#4232d6 100%);
  box-shadow:0 7px 16px rgba(74,58,222,.24);
}
body.crm-user-panel .mlv4-action-menu>summary::-webkit-details-marker{display:none}
body.crm-user-panel .mlv4-action-plus{font-size:20px!important;line-height:1!important;font-weight:400!important}
body.crm-user-panel .mlv4-action-caret{font-size:11px!important;opacity:.9}
body.crm-user-panel .mlv4-action-popover{
  position:absolute;z-index:125;right:0;top:56px;width:250px;max-height:360px;overflow:auto;
  padding:8px;background:#fff;border:1px solid #dedede;border-radius:8px;box-shadow:0 9px 28px rgba(0,0,0,.16);
}
body.crm-user-panel .mlv4-action-search{
  display:flex;align-items:center;gap:6px;padding:0 9px;margin-bottom:6px;border-radius:5px;background:#f3f3f3;color:#8a8a8a;
}
body.crm-user-panel .mlv4-action-search input{
  width:100%;height:32px!important;min-height:32px!important;padding:0!important;border:0!important;background:transparent!important;
  box-shadow:none!important;font-size:13px!important;color:#333!important;
}
body.crm-user-panel .mlv4-action-list{display:grid}
body.crm-user-panel .mlv4-action-list button{
  width:100%!important;min-height:36px!important;display:grid!important;grid-template-columns:24px 1fr!important;align-items:center!important;
  gap:3px!important;text-align:left!important;padding:6px 8px!important;border:0!important;border-radius:5px!important;
  background:#fff!important;background-image:none!important;box-shadow:none!important;color:#656565!important;
}
body.crm-user-panel .mlv4-action-list button:hover:not(:disabled){background:#f6f4ff!important;color:#4e36bd!important}
body.crm-user-panel .mlv4-action-list button>span{font-size:16px!important;color:#7c7c7c!important}
body.crm-user-panel .mlv4-action-list button>b{font-size:13px!important;font-weight:500!important;color:inherit!important}
body.crm-user-panel .mlv4-custom-actions{
  display:flex;align-items:center;justify-content:space-between;margin-top:9px;padding:9px 8px 4px;border-top:1px solid #eeeeee;
  font-size:12px!important;color:#777!important;
}

/* Full-screen payment editor. */
body.crm-user-panel .mlv4-payment-overlay{
  position:fixed;inset:0;z-index:14000;display:grid;place-items:center;padding:22px;
  background:rgba(21,26,34,.58);backdrop-filter:blur(2px);
}
body.crm-user-panel .mlv4-payment-shell{
  width:min(980px,96vw);max-height:94vh;overflow:auto;background:#fff;border-radius:12px;
  box-shadow:0 24px 70px rgba(0,0,0,.3);border:1px solid #e1e1e1;
}
body.crm-user-panel .mlv4-payment-head{
  position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:flex-start;gap:20px;
  padding:18px 20px 14px;background:#fff;border-bottom:1px solid #ebebeb;
}
body.crm-user-panel .mlv4-payment-head>div>span{font-size:10px!important;letter-spacing:.08em;color:#7f70cf!important;font-weight:700!important}
body.crm-user-panel .mlv4-payment-head h2{margin:3px 0 2px!important;font-size:21px!important;color:#202020!important;border:0!important;padding:0!important}
body.crm-user-panel .mlv4-payment-head p{margin:0;color:#777!important;font-size:12px!important}
body.crm-user-panel .mlv4-payment-head button{
  width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;border:1px solid #ddd!important;border-radius:7px!important;
  background:#fff!important;background-image:none!important;box-shadow:none!important;color:#666!important;font-size:21px!important;
}
body.crm-user-panel .mlv4-payment-form{display:grid;gap:14px;padding:20px}
body.crm-user-panel .mlv4-payment-form>label,
body.crm-user-panel .mlv4-payment-reference{display:grid;gap:6px;color:#666!important;font-size:12px!important;font-weight:600!important}
body.crm-user-panel .mlv4-payment-form label>span{font-weight:400!important;color:#9a9a9a!important}
body.crm-user-panel .mlv4-payment-form input,
body.crm-user-panel .mlv4-payment-form select,
body.crm-user-panel .mlv4-payment-form textarea{
  width:100%;border:1px solid #d8d8d8!important;border-radius:5px!important;background:#fff!important;background-image:none!important;
  box-shadow:none!important;color:#292929!important;font-size:13px!important;
}
body.crm-user-panel .mlv4-payment-form input,
body.crm-user-panel .mlv4-payment-form select{height:38px!important;min-height:38px!important}
body.crm-user-panel .mlv4-payment-form input[readonly]{background:#f3f3f3!important;color:#7c7c7c!important}
body.crm-user-panel .mlv4-payment-money{display:grid;grid-template-columns:180px 1fr;gap:10px}
body.crm-user-panel .mlv4-payment-money label{display:grid;gap:6px;color:#666!important;font-size:12px!important;font-weight:600!important}
body.crm-user-panel .mlv4-payment-form textarea{min-height:110px;padding:10px;resize:vertical}
body.crm-user-panel .mlv4-payment-actions{display:flex;justify-content:flex-end;gap:9px;padding-top:4px}
body.crm-user-panel .mlv4-payment-actions button{min-height:38px!important;padding:7px 16px!important;border-radius:6px!important}
body.crm-user-panel .mlv4-payment-actions .secondary{background:#fff!important;color:#563cc8!important;border:1px solid #684ce0!important;box-shadow:none!important}
body.crm-user-panel #mlv4PaymentSubmit{background:#5a3bc7!important;color:#fff!important;border:1px solid #5a3bc7!important;box-shadow:none!important}

/* Payment reports. */
body.crm-user-panel .mr-payment-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.crm-user-panel .mr-payment-kpis b{font-size:19px!important;overflow-wrap:anywhere}
body.crm-user-panel .mr-payment-status{display:inline-flex;align-items:center;padding:4px 7px;border-radius:5px;background:#f1effa;color:#533cc0!important;font-size:11px!important;font-weight:650!important}
body.crm-user-panel .mr-payment-status.is-completed{background:#e3f5ea;color:#166c46!important}
body.crm-user-panel .mr-payment-status.is-pending,
body.crm-user-panel .mr-payment-status.is-processing{background:#fff2d8;color:#966000!important}
body.crm-user-panel .mr-payment-status.is-failed,
body.crm-user-panel .mr-payment-status.is-cancelled{background:#ffe8ea;color:#ad2f3b!important}
body.crm-user-panel .mr-payment-status.is-refunded{background:#e8eef9;color:#3e5b8e!important}

@media(max-width:1080px){
  body.crm-user-panel .mlv4-header-tools{grid-template-columns:minmax(220px,auto) 1px minmax(300px,1fr) 1px auto;gap:14px;padding:10px 12px}
  body.crm-user-panel .mlv4-followup-copy>strong{font-size:14px!important}
}
@media(max-width:820px){
  body.crm-user-panel .mlv4-header-tools{
    grid-template-columns:1fr auto;
    gap:12px;
    min-height:0;
  }
  body.crm-user-panel .mlv4-lead-summary{grid-column:1/2}
  body.crm-user-panel .mlv4-header-tools>.mlv4-separator{display:none}
  body.crm-user-panel .mlv4-action-menu{grid-column:2/3;grid-row:1;align-self:center}
  body.crm-user-panel .mlv4-followup-preview{grid-column:1/3;grid-row:2;width:100%}
}
@media(max-width:560px){
  body.crm-user-panel .mlv4-identity{padding:8px 7px 10px!important}
  body.crm-user-panel .mlv4-header-tools{display:flex;flex-wrap:wrap;align-items:center;padding:10px;border-radius:12px}
  body.crm-user-panel .mlv4-lead-summary{width:100%}
  body.crm-user-panel .mlv4-lead-controls{gap:10px;flex-wrap:wrap}
  body.crm-user-panel .mlv4-followup-preview{order:3;width:100%;grid-template-columns:42px minmax(0,1fr) 34px;min-height:68px;padding:8px 10px}
  body.crm-user-panel .mlv4-followup-icon{width:42px;height:42px}
  body.crm-user-panel .mlv4-action-menu{margin-left:auto}
  body.crm-user-panel .mlv4-payment-money{grid-template-columns:1fr}
  body.crm-user-panel .mr-payment-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
