/* Lead / Client 360 view - presentation layer only.
   Everything is scoped under #detail-panel.lead360-on (the classic modal with the
   new view mounted) or the lead360- prefix. Nothing here applies to any other
   portal or to the classic view: the class is only ever added by rg-lead360.js
   while the new view is active, and removed again when the user switches back. */

#detail-panel.lead360-on,
#leadDialog.lead360-on {
  --l360-ink: #0A1628;
  --l360-ink-2: rgba(10, 22, 40, .62);
  --l360-ink-3: rgba(10, 22, 40, .42);
  --l360-gold: #C9A227;
  --l360-gold-soft: rgba(201, 162, 39, .14);
  --l360-line: rgba(10, 22, 40, .1);
  --l360-bg: #F4F5F7;
  --l360-card: #FFFFFF;
  --l360-head: #0A1628;
  --l360-ok: #0F7B4F;
  --l360-warn: #B45309;
  --l360-bad: #B91C1C;
}

html.lead360-lock,
html.lead360-lock body { overflow: hidden !important; }

#detail-panel.lead360-on {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(96vw, 1600px) !important;
  max-width: none !important;
  height: min(92vh, 980px) !important;
  height: min(92dvh, 980px) !important;
  max-height: 94vh !important;
  border-radius: 14px !important;
  background: var(--l360-bg) !important;
  overflow: hidden !important;
  flex-direction: column !important;
  font-family: inherit;
}

#detail-panel.lead360-on > #dm-header,
#detail-panel.lead360-on > .dm-header { display: none !important; }

#detail-panel.lead360-on .lead360-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  color: var(--l360-ink);
  font-size: 12px;
  line-height: 1.45;
}

/* ---------- header ---------- */
.lead360-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--l360-head);
  color: #fff;
  border-bottom: 2px solid var(--l360-gold);
}
.lead360-ident {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.lead360-ident-text { min-width: 0; flex: 1 1 auto; }
.lead360-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
#detail-panel.lead360-on .lead360-head #dm-name,
#detail-panel.lead360-on .lead360-head .dm-hname {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1.2 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#detail-panel.lead360-on .lead360-head #dm-av,
#detail-panel.lead360-on .lead360-head .dm-av {
  width: 46px !important;
  height: 46px !important;
  font-size: 15px !important;
  flex: 0 0 auto;
  border: 2px solid rgba(201, 162, 39, .7);
}
.lead360-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, .55);
  color: #E9D48A;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.lead360-meta {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.lead360-meta span { white-space: nowrap; }
.lead360-meta i { color: var(--l360-gold); margin-right: 3px; }
#detail-panel.lead360-on .lead360-head #dm-badges,
#detail-panel.lead360-on .lead360-head .dm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px !important;
}
#detail-panel.lead360-on .lead360-head .dm-badge { font-size: 11px; padding: 3px 9px; }

.lead360-qa {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
#detail-panel.lead360-on .lead360-qa .dm-hbtn,
.lead360-qbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  white-space: nowrap;
}
#detail-panel.lead360-on .lead360-qa .dm-hbtn:hover,
.lead360-qbtn:hover { background: rgba(255, 255, 255, .16); }
#detail-panel.lead360-on .lead360-qa .dm-hbtn-p {
  background: var(--l360-gold);
  color: #0A1628;
  border-color: var(--l360-gold);
}
#detail-panel.lead360-on .lead360-qa .dm-hbtn-p:hover { background: #d9b53a; }
#detail-panel.lead360-on .lead360-qa .dm-close-btn,
#detail-panel.lead360-on .lead360-qa [onclick*="closeDetail"] {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  justify-content: center;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, .1) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  margin: 0 0 0 4px !important;
}
.lead360-menu-wrap { position: relative; }
.lead360-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  max-width: 88vw;
  background: #fff;
  color: var(--l360-ink);
  border: 1px solid var(--l360-line);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(10, 22, 40, .28);
  padding: 6px;
  z-index: 30;
  display: none;
}
.lead360-menu.lead360-open { display: block; }
.lead360-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--l360-ink);
  font-size: 12px;
  font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
}
.lead360-menu button:hover,
.lead360-menu button:focus-visible { background: var(--l360-gold-soft); outline: none; }
.lead360-menu button i { width: 16px; color: var(--l360-ink-3); font-size: 15px; }
.lead360-menu hr { border: 0; border-top: 1px solid var(--l360-line); margin: 4px 2px; }
.lead360-menu-cap {
  padding: 6px 10px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
}

/* ---------- body: left + right ---------- */
.lead360-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.lead360-left {
  flex: 0 0 340px;
  width: 340px;
  min-height: 0;
  background: var(--l360-card);
  border-right: 1px solid var(--l360-line);
  display: flex;
  flex-direction: column;
}
.lead360-left-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--l360-line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
}
.lead360-collapse {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--l360-line);
  background: #fff;
  color: var(--l360-ink);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.lead360-collapse:hover { background: var(--l360-gold-soft); }
.lead360-left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0 14px;
}
.lead360-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}
.lead360-rail .lead360-rail-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: #DBEAFE;
  color: #1D4ED8;
  border: 2px solid rgba(201, 162, 39, .6);
}
.lead360-rail .lead360-rail-st {
  max-width: 54px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--l360-ink-2);
  word-break: break-word;
}
.lead360-rail button {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--l360-line);
  background: #fff;
  color: var(--l360-ink);
  cursor: pointer;
  font-size: 16px;
}
.lead360-rail button:hover { background: var(--l360-gold-soft); }
.lead360-left.lead360-collapsed { flex-basis: 64px; width: 64px; }
.lead360-left.lead360-collapsed .lead360-left-scroll,
.lead360-left.lead360-collapsed .lead360-left-title { display: none; }
.lead360-left.lead360-collapsed .lead360-rail { display: flex; }
.lead360-left.lead360-collapsed .lead360-left-bar { justify-content: center; padding: 8px 0; }

.lead360-acc { border-bottom: 1px solid var(--l360-line); }
.lead360-acc-h {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  color: var(--l360-ink);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.lead360-acc-h:hover { background: rgba(10, 22, 40, .03); }
.lead360-acc-h:focus-visible { outline: 2px solid var(--l360-gold); outline-offset: -2px; }
.lead360-acc-h > i:first-child { color: var(--l360-gold); font-size: 15px; }
.lead360-acc-h .lead360-acc-t { flex: 1 1 auto; }
.lead360-acc-h .lead360-acc-chev { transition: transform .2s ease; color: var(--l360-ink-3); }
.lead360-acc.lead360-acc-open .lead360-acc-chev { transform: rotate(90deg); }
.lead360-acc-b { display: none; padding: 2px 14px 12px; }
.lead360-acc.lead360-acc-open .lead360-acc-b { display: block; }
.lead360-acc-b:empty::after { content: 'Nothing on file'; color: var(--l360-ink-3); font-size: 11px; }

#detail-panel.lead360-on .lead360-acc-b .dm-kv,
.lead360-kv {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 !important;
  padding: 5px 0;
  font-size: 12px !important;
  color: var(--l360-ink-2) !important;
  border-bottom: 1px dashed rgba(10, 22, 40, .07);
}
#detail-panel.lead360-on .lead360-acc-b .dm-kv:last-child,
.lead360-kv:last-child { border-bottom: 0; }
#detail-panel.lead360-on .lead360-acc-b .dm-kv > span:last-child,
.lead360-kv > span:last-child {
  color: var(--l360-ink) !important;
  font-weight: 600 !important;
  text-align: right;
  word-break: break-word;
  max-width: 62%;
}
#detail-panel.lead360-on .lead360-acc-b .dm-row {
  margin: 0 !important;
  padding: 5px 0;
  align-items: flex-start;
  border-bottom: 1px dashed rgba(10, 22, 40, .07);
}
#detail-panel.lead360-on .lead360-acc-b .dm-row span {
  font-size: 12px !important;
  word-break: break-word;
}
#detail-panel.lead360-on .lead360-acc-b .dm-row span[style*="font-size:8px"] {
  font-size: 10px !important;
  margin-left: auto !important;
  white-space: nowrap;
}
#detail-panel.lead360-on .lead360-acc-b .dm-box {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
#detail-panel.lead360-on .lead360-acc-b .dm-bh {
  font-size: 0 !important;
  line-height: 0 !important;
  margin: 0 0 4px !important;
  text-align: right;
  display: block !important;
}
#detail-panel.lead360-on .lead360-acc-b .dm-bh button {
  font-size: 12px !important;
  line-height: 1.3 !important;
  padding: 3px 4px;
}
#detail-panel.lead360-on .lead360-acc-b .dm-inp { font-size: 12px !important; }
#detail-panel.lead360-on .lead360-acc-b .dm-lbl { font-size: 10px !important; }
#detail-panel.lead360-on .lead360-acc-b .dm-btn,
#detail-panel.lead360-on .lead360-acc-b .dm-hbtn {
  font-size: 12px !important;
  padding: 6px 10px !important;
  height: auto !important;
  background: #fff !important;
  color: var(--l360-ink) !important;
  border: 1px solid var(--l360-line) !important;
}
.lead360-asg-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lead360-empty-note { font-size: 11px; color: var(--l360-ink-3); padding: 4px 0; }

/* ---------- right workspace ---------- */
.lead360-right {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lead360-summary {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px 0;
}
.lead360-cell {
  background: var(--l360-card);
  border: 1px solid var(--l360-line);
  border-radius: 10px;
  padding: 7px 11px;
  min-width: 0;
}
.lead360-cell-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
}
.lead360-cell-v {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 700;
  color: var(--l360-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead360-cell-s {
  font-size: 11px;
  color: var(--l360-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead360-cell.lead360-tone-warn .lead360-cell-v { color: var(--l360-warn); }
.lead360-cell.lead360-tone-bad .lead360-cell-v { color: var(--l360-bad); }
.lead360-cell.lead360-tone-ok .lead360-cell-v { color: var(--l360-ok); }
.lead360-cell[hidden] { display: none; }

.lead360-tabbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 10px 14px 0;
  background: var(--l360-card);
  border: 1px solid var(--l360-line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.lead360-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.lead360-tabs::-webkit-scrollbar { display: none; }
#detail-panel.lead360-on .lead360-tabbar .dm-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 15px;
  font-size: 12px !important;
  font-weight: 600;
  color: var(--l360-ink-2);
  background: transparent;
  border: 0;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
#detail-panel.lead360-on .lead360-tabbar .dm-tab:hover { color: var(--l360-ink); background: rgba(10, 22, 40, .03); }
#detail-panel.lead360-on .lead360-tabbar .dm-tab.active {
  color: var(--l360-ink);
  font-weight: 700;
  border-bottom-color: var(--l360-gold);
}
#detail-panel.lead360-on .lead360-tabbar .dm-tab:focus-visible { outline: 2px solid var(--l360-gold); outline-offset: -2px; }
.lead360-tab-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--l360-gold-soft);
  color: #7A5B00;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 17px;
}
.lead360-more { position: relative; flex: 0 0 auto; border-left: 1px solid var(--l360-line); }
.lead360-more > button {
  height: 100%;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--l360-ink-2);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.lead360-more.lead360-more-active > button { color: var(--l360-ink); border-bottom-color: var(--l360-gold); }
.lead360-more > button:hover { background: rgba(10, 22, 40, .03); }
.lead360-more .lead360-menu { right: 0; left: auto; }
#detail-panel.lead360-on .lead360-more .lead360-menu .dm-tab {
  display: flex;
  width: 100%;
  border-bottom: 0;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 12px !important;
}
#detail-panel.lead360-on .lead360-more .lead360-menu .dm-tab.active { background: var(--l360-gold-soft); }

.lead360-panes {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 14px 14px;
  background: var(--l360-bg);
  border: 1px solid var(--l360-line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
#detail-panel.lead360-on .lead360-panes > .lead360-scroll-orig,
#detail-panel.lead360-on .lead360-panes-inner {
  overflow: visible !important;
  height: auto !important;
  flex: none !important;
  padding: 14px 16px 22px !important;
}

/* legacy blocks inside the panes */
#detail-panel.lead360-on .lead360-panes .dm-box {
  background: #fff;
  border: 1px solid var(--l360-line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
#detail-panel.lead360-on .lead360-panes .dm-bh {
  font-size: 11px;
  color: var(--l360-ink-2);
  margin-bottom: 8px;
}
#detail-panel.lead360-on .lead360-panes .dm-kv { font-size: 12px; margin-bottom: 6px; color: var(--l360-ink-2); }
#detail-panel.lead360-on .lead360-panes .dm-kv span:last-child { color: var(--l360-ink); }
#detail-panel.lead360-on .lead360-panes .dm-lbl { font-size: 11px; }
#detail-panel.lead360-on .lead360-panes .dm-inp { font-size: 12.5px; padding: 8px 10px; }
#detail-panel.lead360-on .lead360-panes .dm-btn,
#detail-panel.lead360-on .lead360-panes .dm-btn-p { font-size: 12px; padding: 8px 14px; }
#detail-panel.lead360-on .lead360-panes .dm-badge { font-size: 11px; }
#detail-panel.lead360-on .lead360-panes .dm-act-title { font-size: 12.5px; }
#detail-panel.lead360-on .lead360-panes .dm-act-sub { font-size: 11.5px; }
#detail-panel.lead360-on .lead360-panes .dm-act-ts { font-size: 10.5px; }
#detail-panel.lead360-on .lead360-panes .dm-fpill { font-size: 11px; }
#detail-panel.lead360-on .lead360-panes .dm-stage-lbl { font-size: 10.5px; }
#detail-panel.lead360-on .lead360-panes .dm-stage-dot { width: 28px; height: 28px; margin-bottom: 4px; }
#detail-panel.lead360-on .lead360-panes .dm-alert { padding: 10px 12px; }
#detail-panel.lead360-on .lead360-panes .dm-sc div[style*="grid-template-columns"],
#detail-panel.lead360-on .lead360-panes .dm-g2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}
#detail-panel.lead360-on .lead360-panes .dm-sc div[style*="grid-template-columns:1fr 1fr 1fr"] {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

/* ---------- overview snapshot ---------- */
.lead360-ov { margin-bottom: 12px; }
.lead360-alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lead360-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  border: 1px solid;
}
.lead360-alert i { font-size: 16px; flex: 0 0 auto; }
.lead360-alert-warn { background: #FFFBEB; border-color: rgba(201, 162, 39, .4); color: #78350F; }
.lead360-alert-bad { background: #FEF2F2; border-color: rgba(185, 28, 28, .25); color: #7F1D1D; }
.lead360-alert button {
  margin-left: auto;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.lead360-ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.lead360-card {
  background: #fff;
  border: 1px solid var(--l360-line);
  border-radius: 10px;
  padding: 9px 12px;
  min-width: 0;
}
.lead360-card-k {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
}
.lead360-card-k i { color: var(--l360-gold); font-size: 13px; }
.lead360-card-v { margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--l360-ink); word-break: break-word; }
.lead360-card-s { font-size: 11px; color: var(--l360-ink-2); margin-top: 1px; word-break: break-word; }
.lead360-card.lead360-tone-warn .lead360-card-v { color: var(--l360-warn); }
.lead360-card.lead360-tone-bad .lead360-card-v { color: var(--l360-bad); }
.lead360-card.lead360-tone-ok .lead360-card-v { color: var(--l360-ok); }
.lead360-card-wide { grid-column: span 2; }

/* ---------- lazy tab content ---------- */
.lead360-pane-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.lead360-pane-h h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--l360-ink); }
.lead360-pane-h .lead360-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lead360-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--l360-line);
  background: #fff;
  color: var(--l360-ink);
  cursor: pointer;
  font-family: inherit;
}
.lead360-btn:hover { background: var(--l360-gold-soft); }
.lead360-btn-p { background: var(--l360-ink); color: var(--l360-gold); border-color: var(--l360-ink); }
.lead360-btn-p:hover { background: #12233d; }
.lead360-btn[disabled] { opacity: .5; cursor: not-allowed; }
.lead360-group { margin-bottom: 14px; }
.lead360-group-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
  margin: 0 0 6px;
}
.lead360-list { display: flex; flex-direction: column; gap: 6px; }
.lead360-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--l360-line);
  border-radius: 9px;
  background: #fff;
}
.lead360-item-main { flex: 1 1 auto; min-width: 0; }
.lead360-item-t { font-size: 12.5px; font-weight: 600; color: var(--l360-ink); word-break: break-word; }
.lead360-item-s { font-size: 11px; color: var(--l360-ink-2); margin-top: 1px; word-break: break-word; }
.lead360-item-a { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lead360-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(10, 22, 40, .08);
  color: var(--l360-ink);
  white-space: nowrap;
}
.lead360-pill-ok { background: #D1FAE5; color: #065F46; }
.lead360-pill-warn { background: #FFF3CD; color: #856404; }
.lead360-pill-bad { background: #FEE2E2; color: #991B1B; }
.lead360-pill-info { background: #DBEAFE; color: #1D4ED8; }
.lead360-note { font-size: 11.5px; color: var(--l360-ink-2); padding: 10px 2px; }
.lead360-note-bad { color: var(--l360-bad); }
.lead360-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.lead360-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--l360-line);
  background: #fff;
  color: var(--l360-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.lead360-tile:hover { background: var(--l360-gold-soft); }
.lead360-tile i { font-size: 18px; color: var(--l360-gold); }

/* ---------- classic-view affordance ---------- */
.lead360-tryrow {
  display: flex;
  justify-content: flex-end;
  padding: 0 22px 8px;
  background: #fff;
}
.lead360-try {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(201, 162, 39, .6);
  background: rgba(201, 162, 39, .1);
  color: #7A5B00;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.lead360-try:hover { background: rgba(201, 162, 39, .2); }

/* ---------- skeleton ---------- */
.lead360-skel { position: relative; color: transparent !important; }
.lead360-skel * { visibility: hidden; }
.lead360-skel::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 30%;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  border-radius: 5px;
  background: rgba(10, 22, 40, .1);
}
@media (prefers-reduced-motion: no-preference) {
  #detail-panel.lead360-on { animation: lead360-in .18s ease-out; }
  @keyframes lead360-in { from { opacity: 0; } to { opacity: 1; } }
  .lead360-menu.lead360-open { animation: lead360-menu-in .12s ease-out; }
  @keyframes lead360-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .lead360-acc-chev { transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .lead360-left { flex-basis: 300px; width: 300px; }
  .lead360-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #detail-panel.lead360-on .lead360-qa .lead360-qlabel { display: none; }
}
@media (max-width: 900px) {
  #detail-panel.lead360-on {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
  .lead360-head { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .lead360-ident { flex: 1 1 100%; }
  .lead360-qa { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .lead360-qa::-webkit-scrollbar { display: none; }
  #detail-panel.lead360-on .lead360-qa .dm-hbtn,
  .lead360-qbtn { height: 40px; }
  #detail-panel.lead360-on .lead360-head #dm-name,
  #detail-panel.lead360-on .lead360-head .dm-hname { font-size: 16px !important; }
  .lead360-body { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .lead360-left,
  .lead360-left.lead360-collapsed {
    flex: 0 0 auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--l360-line);
  }
  .lead360-left-scroll { max-height: 55vh; }
  .lead360-left.lead360-collapsed .lead360-rail { display: none; }
  .lead360-left.lead360-collapsed .lead360-left-scroll { display: none; }
  .lead360-left.lead360-collapsed .lead360-left-title { display: inline; }
  .lead360-left.lead360-collapsed .lead360-left-bar { justify-content: space-between; padding: 8px 12px; }
  .lead360-collapse { width: 40px; height: 40px; }
  .lead360-right { flex: 0 0 auto; overflow: visible; }
  .lead360-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 10px 0; }
  .lead360-tabbar { margin: 10px 10px 0; position: sticky; top: 0; z-index: 5; }
  #detail-panel.lead360-on .lead360-tabbar .dm-tab { padding: 13px 14px; }
  .lead360-panes { margin: 0 10px 12px; overflow: visible; }
  .lead360-card-wide { grid-column: auto; }
  .lead360-item { flex-wrap: wrap; }
  .lead360-item-a { width: 100%; justify-content: flex-start; }
  .lead360-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; max-width: none; }
  .lead360-more .lead360-menu { left: 10px; right: 10px; }
  #detail-panel.lead360-on .lead360-panes .dm-inp { font-size: 16px; min-height: 40px; }
  #detail-panel.lead360-on .lead360-panes .dm-btn,
  #detail-panel.lead360-on .lead360-panes .dm-btn-p { min-height: 40px; }
}
@media (max-width: 520px) {
  .lead360-summary { grid-template-columns: 1fr 1fr; }
  #detail-panel.lead360-on .lead360-panes .dm-sc div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-height: 640px) and (min-width: 901px) {
  .lead360-head { padding: 8px 16px; }
  .lead360-summary { padding-top: 8px; }
}

/* the root shell forces a text colour on bare spans; these must keep theirs */
.lead360-head .lead360-chip { color: #E9D48A !important; }
.lead360-head .lead360-meta, .lead360-head .lead360-meta span { color: rgba(255, 255, 255, .75) !important; }
.lead360-root .lead360-pill { color: var(--l360-ink) !important; }
.lead360-root .lead360-pill-ok { color: #065F46 !important; }
.lead360-root .lead360-pill-warn { color: #856404 !important; }
.lead360-root .lead360-pill-bad { color: #991B1B !important; }
.lead360-root .lead360-pill-info { color: #1D4ED8 !important; }
.lead360-root .lead360-tab-count { color: #7A5B00 !important; }

@media (max-width: 900px) {
  .lead360-collapse i { display: inline-block; transform: rotate(90deg); }
}
@media (max-width: 900px) {
  .lead360-ov-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lead360-card-v { font-size: 13px; }
  .lead360-alert { flex-wrap: wrap; }
}

/* the team-leader shell shrinks every .dm-hbtn to an icon on phones; keep labels in the new header */
#detail-panel.lead360-on .lead360-qa .dm-hbtn {
  font-size: 12px !important;
  padding: 0 12px !important;
  gap: 6px !important;
}
#detail-panel.lead360-on .lead360-qa .dm-hbtn i { font-size: 15px !important; }

.lead360-tip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 14px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(201, 162, 39, .12);
  border: 1px solid rgba(201, 162, 39, .4);
  color: #5B4300;
  font-size: 12px;
}
.lead360-tip > i { font-size: 16px; color: var(--l360-gold); flex: 0 0 auto; }
.lead360-tip > span { flex: 1 1 auto; }
.lead360-tip button {
  flex: 0 0 auto;
  border: 1px solid rgba(201, 162, 39, .7);
  background: #fff;
  color: #5B4300;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.lead360-tip + .lead360-summary { padding-top: 8px; }
@media (max-width: 900px) { .lead360-tip { margin: 8px 10px 0; } }

/* ---------- edit lead, payment schedule, change history (20260929) ---------- */
.lead360-edit-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(201, 162, 39, .12);
  border: 1px solid rgba(201, 162, 39, .4);
  color: #5B4300;
  font-size: 11.5px;
  line-height: 1.4;
}
.lead360-edit-note[hidden] { display: none; }
.lead360-edit-note > i { color: var(--l360-gold); font-size: 15px; flex: 0 0 auto; }
.lead360-sched { margin-bottom: 14px; }
.lead360-sched-src { padding: 0 2px 8px; }
.lead360-card.lead360-card-unset .lead360-card-v { color: var(--l360-ink-3); font-weight: 600; }
.lead360-sched-kpi { margin-bottom: 12px; }
.lead360-changes { margin-bottom: 14px; }
.lead360-tbl-wrap { overflow-x: auto; border: 1px solid var(--l360-line); border-radius: 9px; background: #fff; }
.lead360-tbl { width: 100%; border-collapse: collapse; font-size: 12px; color: var(--l360-ink); }
.lead360-tbl th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l360-ink-3);
  padding: 7px 10px;
  border-bottom: 1px solid var(--l360-line);
  white-space: nowrap;
}
.lead360-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--l360-line); vertical-align: top; word-break: break-word; }
.lead360-tbl tr:last-child td { border-bottom: 0; }
.lead360-tbl .lead360-r { text-align: right; white-space: nowrap; }
.lead360-tbl tr.lead360-row-overdue td { background: #FEF2F2; }
.lead360-tbl tr.lead360-row-due td { background: #FFFBEB; }
@media (max-width: 900px) {
  .lead360-tbl thead { display: none; }
  .lead360-tbl, .lead360-tbl tbody, .lead360-tbl tr, .lead360-tbl td { display: block; width: 100%; }
  .lead360-tbl tr { padding: 6px 0; border-bottom: 1px solid var(--l360-line); }
  .lead360-tbl tr:last-child { border-bottom: 0; }
  .lead360-tbl td { border-bottom: 0; padding: 3px 10px; }
  .lead360-tbl td[data-l]::before {
    content: attr(data-l);
    display: inline-block;
    min-width: 108px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--l360-ink-3);
  }
  .lead360-tbl .lead360-r { text-align: left; }
}
