/* Sfera Opportunities 1.142 — table parity with Companies, robust detail,
   custom filter menus and responsive sales-gauges.  Last style in page. */

/* Shared Sfera company/lead directory vocabulary, no decorative header card. */
#opportunity-view[data-studio="v4"] .s4-workspace{
  border:0!important;border-radius:16px!important;background:transparent!important;box-shadow:none!important;
}
#opportunity-view[data-studio="v4"] #opportunity-management-pane{
  border:0!important;box-shadow:none!important;background:transparent!important;padding:13px 0 16px!important;
}
#opportunity-view[data-studio="v4"] #opportunity-management-pane > :is(.opportunity-pane__header,.opportunity-results-head,.opp-desk-list-labels,.s4-table-head),
#opportunity-view[data-studio="v4"] #opportunity-management-pane > :is(h1,h2,h3,header):not(#opportunity-filters){
  display:none!important;margin:0!important;padding:0!important;min-height:0!important;border:0!important;box-shadow:none!important;
}
#opportunity-view[data-studio="v4"] .s8-directory-table-wrap{
  box-sizing:border-box!important;overflow:hidden!important;
  border:1px solid #e3eaf4!important;border-radius:15px!important;
  background:#fff!important;box-shadow:0 7px 20px rgba(25,55,105,.055)!important;
}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table{
  display:table!important;width:100%!important;
  table-layout:fixed!important;border-collapse:collapse!important;
  margin:0!important;background:#fff!important;
  border:0!important;font-family:"Open Sans",sans-serif!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table thead{
  display:table-header-group!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table thead tr{
  display:table-row!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table thead th{
  display:table-cell!important;text-align:left!important;
  background:#f5f7fc!important;border:0!important;
  border-bottom:1px solid #e5eaf3!important;
  padding:15px 13px!important;
  color:#637491!important;font:700 11px/1.3 "Open Sans",sans-serif!important;
  letter-spacing:.045em!important;text-transform:uppercase!important;
  white-space:nowrap!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(1){width:25%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(2){width:16%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(3){width:13%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(4){width:17%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(5){width:14%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(6){width:13%}
#opportunity-view[data-studio="v4"] .s8-opportunity-table th:nth-child(7){width:2%}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results{
  display:table-row-group!important;min-width:0!important;gap:0!important;
  padding:0!important;margin:0!important;background:#fff!important;
}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row{
  display:table-row!important;position:static!important;
  height:66px!important;min-height:0!important;
  padding:0!important;margin:0!important;
  background:#fff!important;box-shadow:none!important;
  border:0!important;transform:none!important;translate:none!important;
  animation:none!important;transition:background-color .12s ease-out!important;
  cursor:pointer!important;
}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row:nth-child(even){
  background:#fcfdff!important;
}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row:hover,
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row:focus-visible{
  background:#f2f6ff!important;
}
#opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row>td{
  box-sizing:border-box!important;display:table-cell!important;
  height:auto!important;min-width:0!important;max-width:0!important;
  padding:13px 12px!important;
  border:0!important;border-bottom:1px solid #eef1f6!important;
  border-radius:0!important;box-shadow:none!important;background:transparent!important;
  color:#243855!important;font:500 12px/1.4 "Open Sans",sans-serif!important;
  vertical-align:middle!important;text-align:left!important;
  overflow:hidden!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s8-table-identity{
  display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s8-table-identity>span:last-child{
  display:grid!important;gap:3px!important;min-width:0!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s4-row-id strong{
  font:700 12px/1.4 "Open Sans",sans-serif!important;color:#183460!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s4-row-id small{
  color:#8596ae!important;font:500 11px/1.4 "Open Sans",sans-serif!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s4-row-phase .s4-badge,
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s4-row-phase [class*="badge"]{
  font-size:10px!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s4-row-amount strong{
  font:700 13px/1.3 "Open Sans",sans-serif!important;color:#132d5f!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table td.s7-probability{
  vertical-align:middle!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s7-prob-label{
  display:block!important;margin-bottom:6px!important;
  font-size:11px!important;font-weight:700!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s7-prob-track{
  display:block!important;height:9px!important;max-width:132px!important;
  border-radius:7px!important;background:#eaf0f8!important;
  box-shadow:inset 0 1px 2px rgba(16,50,95,.05)!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table .s7-prob-fill{
  border-radius:7px!important;
  transition:transform .36s cubic-bezier(.19,1,.22,1)!important;
}
#opportunity-view[data-studio="v4"] .s8-opportunity-table tr .s4-row-arrow{
  text-align:right!important;color:#96a9c7!important;
}

/* Filters: original selects keep server-backed values, bespoke CSS popovers
   render the ENTIRE menu including all options. */
#opportunity-view[data-studio="v4"] #opportunity-filters{
  overflow:visible!important;
}
#opportunity-view[data-studio="v4"] #opportunity-filters label{
  position:relative!important;min-width:0!important;
}
#opportunity-view[data-studio="v4"] .s8-select-dropdown{
  position:relative!important;display:block!important;
  width:100%!important;min-width:0!important;
}
#opportunity-view[data-studio="v4"] .s8-select-dropdown.is-open{z-index:35!important}
#opportunity-view[data-desk][data-studio="v4"] #opportunity-filters .s8-select-dropdown select.s8-native-select{
  position:absolute!important;clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;width:1px!important;height:1px!important;
  overflow:hidden!important;border:0!important;opacity:0!important;
  pointer-events:none!important;
}
#opportunity-view[data-studio="v4"] .s8-select-trigger{
  box-sizing:border-box!important;display:flex!important;align-items:center!important;
  justify-content:space-between!important;gap:8px!important;
  width:100%!important;min-height:42px!important;
  padding:10px 13px!important;
  background:#fff!important;border:1px solid #dce5f2!important;
  border-radius:10px!important;box-shadow:none!important;
  color:#214475!important;font:600 12px/1.4 "Open Sans",sans-serif!important;
  text-align:left!important;cursor:pointer!important;
}
#opportunity-view[data-studio="v4"] .s8-select-trigger:after{
  content:"";width:7px;height:7px;flex:0 0 7px;
  border-right:1.6px solid #607b9f;border-bottom:1.6px solid #607b9f;
  transform:rotate(45deg);transition:transform .16s ease;
}
#opportunity-view[data-studio="v4"] .is-open>.s8-select-trigger{
  border-color:#8db5f1!important;box-shadow:0 0 0 3px #3b78eb14!important;
}
#opportunity-view[data-studio="v4"] .is-open>.s8-select-trigger:after{transform:rotate(225deg)}
#opportunity-view[data-studio="v4"] .s8-select-options{
  box-sizing:border-box!important;position:absolute!important;
  left:0!important;right:0!important;top:calc(100% + 5px)!important;
  display:none!important;max-height:260px!important;overflow-y:auto!important;
  padding:5px!important;background:#fff!important;
  border:1px solid #dfe8f5!important;border-radius:11px!important;
  box-shadow:0 16px 30px rgba(17,51,107,.15)!important;
}
#opportunity-view[data-studio="v4"] .is-open>.s8-select-options{display:grid!important;gap:2px!important}
#opportunity-view[data-studio="v4"] .s8-option{
  box-sizing:border-box!important;display:flex!important;width:100%!important;
  align-items:center!important;justify-content:space-between!important;
  padding:9px 11px!important;min-height:35px!important;
  background:transparent!important;border:0!important;border-radius:7px!important;
  text-align:left!important;color:#315173!important;
  font:500 12px/1.4 "Open Sans",sans-serif!important;cursor:pointer!important;
}
#opportunity-view[data-studio="v4"] .s8-option[aria-selected="true"]{
  background:#eef5ff!important;color:#245bbb!important;font-weight:700!important;
}
#opportunity-view[data-studio="v4"] .s8-option[aria-selected="true"]:after{content:"✓";font-weight:800}
#opportunity-view[data-studio="v4"] .s8-option:hover,
#opportunity-view[data-studio="v4"] .s8-option:focus-visible{
  background:#f1f6ff!important;outline:2px solid transparent!important;
}
#opportunity-view[data-studio="v4"] .s8-option:disabled{opacity:.35;cursor:not-allowed}

/* Kanban phase meters: compact half-arc, neutral with no source probability. */
#opportunity-view[data-studio="v4"] .s4-lane-heading{
  min-height:70px!important;position:relative!important;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter{
  position:relative!important;display:flex!important;
  flex:0 0 76px!important;width:76px!important;height:65px!important;
  flex-direction:column!important;align-items:center!important;
  justify-content:flex-end!important;
  color:#274a85!important;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter:before{
  content:"";position:absolute;top:1px;left:6px;width:64px;height:64px;
  border-radius:50%;
  background:conic-gradient(from 270deg,#3b78eb 0 var(--phase-arc),#e5edf8 var(--phase-arc) 50%,transparent 50% 100%);
  transition:background .36s ease;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter:after{
  content:"";position:absolute;top:12px;left:18px;width:40px;height:40px;
  background:#fff;border-radius:50%;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter strong{
  z-index:2;position:relative;margin-top:9px!important;
  font:700 13px/1 Poppins,sans-serif!important;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter small{
  position:relative;z-index:2;color:#8296b3!important;
  font:600 9px/1.2 "Open Sans",sans-serif!important;white-space:nowrap!important;
}
#opportunity-view[data-studio="v4"] .s8-lane-meter.is-unavailable:before{
  background:conic-gradient(from 270deg,#e5edf8 0 50%,transparent 50% 100%)!important;
}
#opportunity-view[data-studio="v4"] .s8-lane-weight{
  display:block!important;position:relative!important;margin:2px 0 13px!important;
  padding:0 3px 10px!important;border-bottom:1px solid #e9eef7!important;
  font:600 10px/1.3 "Open Sans",sans-serif!important;color:#7b91ad!important;
}

/* The scroll wrapper is the ONLY flex scroller; customer node is a stable sibling
   of the replaceable detail DATA. Prevents null.replaceChildren on reopen. */
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail.opportunity-dialog__panel{
  display:flex!important;flex-direction:column!important;
  justify-content:flex-start!important;overflow:hidden!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>.s8-detail-scroll{
  position:relative!important;display:block!important;
  flex:1 1 0!important;min-height:0!important;
  overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  scrollbar-width:thin!important;
  padding:0 0 8px!important;background:#f7faff!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>.s8-detail-scroll>#opportunity-detail-data.s6-detail-body{
  display:block!important;
  width:100%!important;min-height:0!important;
  max-height:none!important;
  overflow:visible!important;flex:none!important;
  padding:14px 16px!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>.s8-detail-scroll>#opportunity-customer-link{
  display:flex!important;
  margin:3px 16px 14px!important;
  padding:10px!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer.s6-detail-actions{
  position:relative!important;z-index:20!important;
  display:flex!important;flex:0 0 auto!important;
  min-height:78px!important;max-height:none!important;
  padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px))!important;
  border-top:1px solid #dae5f5!important;
  background:#fff!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer.s6-detail-actions button.s6-detail-action:not([hidden]){
  color:#3468b0!important;visibility:visible!important;opacity:1!important;
  min-height:55px!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer.s6-detail-actions button.s6-detail-action:not([hidden]) .s6-action-icon,
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer.s6-detail-actions button.s6-detail-action:not([hidden]) .s6-action-label{
  display:flex!important;opacity:1!important;visibility:visible!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer #opportunity-detail-footer-close.s8-footer-fallback-close:not([hidden]){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  margin:auto!important;min-height:42px!important;
  color:#336bbf!important;background:#eff6ff!important;
  border:1px solid #d6e6fb!important;border-radius:10px!important;
  font:700 12px "Open Sans",sans-serif!important;
}
#opportunity-detail-dialog.opp-desk-dialog #opportunity-detail>footer #opportunity-detail-footer-close[hidden]{display:none!important}
#opportunity-detail-dialog.opp-desk-dialog .s6-detail-prob-ring{
  animation:none!important;
}
#opportunity-detail-dialog.opp-desk-dialog .s8-value-counter,
#opportunity-detail-dialog.opp-desk-dialog .s8-ring-counter{
  font-variant-numeric:tabular-nums!important;
}

/* Mobile header search: identical compact search-icon behavior to Sfera directories */
#signed-in .opp-desk-topbar .s8-mobile-search-toggle{display:none}
@media(max-width:760px),(hover:none) and (pointer:coarse){
  #signed-in.app-shell:has(#opportunity-view:not([hidden])) .app-topbar{
    display:flex!important;flex-wrap:nowrap!important;
    align-items:center!important;min-width:0!important;
  }
  #signed-in.app-shell:has(#opportunity-view:not([hidden])) .opp-desk-topbar{
    display:flex!important;position:relative!important;
    align-items:center!important;justify-content:flex-end!important;
    gap:7px!important;flex:1 1 auto!important;min-width:0!important;
    width:auto!important;max-width:none!important;flex-wrap:nowrap!important;
  }
  #signed-in .opp-desk-topbar h1{display:none!important}
  #signed-in .opp-desk-topbar .s8-mobile-search-toggle{
    display:grid!important;place-items:center!important;
    flex:0 0 38px!important;width:38px!important;height:38px!important;
    min-width:38px!important;min-height:38px!important;
    background:#ffffff16!important;border:1px solid #ffffff35!important;
    border-radius:11px!important;color:#f7faff!important;cursor:pointer!important;
  }
  #signed-in .opp-desk-topbar .opp-desk-search{
    display:none!important;
    position:absolute!important;
    right:0!important;top:calc(100% + 10px)!important;
    z-index:1100!important;box-sizing:border-box!important;
    width:min(310px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important;min-width:0!important;
    min-height:48px!important;padding:5px 10px!important;
    background:#142f78!important;border:1px solid #4565aa!important;
    border-radius:12px!important;
    box-shadow:0 10px 25px rgba(10,27,73,.18)!important;
  }
  #signed-in .opp-desk-topbar.s8-search-open .opp-desk-search{
    display:flex!important;
  }
  #signed-in .opp-desk-topbar .opp-desk-search input{
    width:100%!important;min-width:0!important;font-size:13px!important;
  }
  #signed-in .opp-desk-topbar #opportunity-new{
    flex:0 0 38px!important;width:38px!important;min-width:38px!important;
    height:38px!important;min-height:38px!important;
  }
  #opportunity-view[data-studio="v4"] .s8-directory-table-wrap{
    border:0!important;box-shadow:none!important;background:transparent!important;
    overflow:visible!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table,
  #opportunity-view[data-studio="v4"] .s8-opportunity-table tbody{
    display:block!important;width:100%!important;min-width:0!important;
    background:transparent!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table thead{
    display:none!important;
  }
  #opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results{
    display:grid!important;gap:10px!important;
  }
  #opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-areas:"identity identity" "phase amount" "follow expiry" "prob prob" "arrow arrow"!important;
    gap:10px!important;min-height:0!important;height:auto!important;
    padding:14px!important;margin:0!important;
    border:1px solid #e3eaf5!important;border-radius:14px!important;
    background:#fff!important;box-shadow:0 5px 15px rgba(25,55,105,.045)!important;
  }
  #opportunity-view[data-desk][data-studio="v4"] .s8-opportunity-table #opportunity-results tr.opportunity-card.s7-row>td{
    display:block!important;min-width:0!important;max-width:none!important;
    height:auto!important;padding:6px 4px!important;
    border:0!important;background:transparent!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-id{grid-area:identity!important}
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-phase{grid-area:phase!important}
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-amount{grid-area:amount!important}
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-follow{grid-area:follow!important}
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-expiry{grid-area:expiry!important}
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s7-probability{
    grid-area:prob!important;
    display:grid!important;grid-template-columns:90px minmax(0,1fr)!important;
    gap:4px 12px!important;
    border-top:1px solid #eaf0f8!important;
    padding-top:11px!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s7-probability:before{
    content:"Probabilità";grid-column:1!important;
    color:#8498b3;font-size:10px;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s7-probability .s7-prob-label{
    grid-column:1!important;grid-row:2!important;margin:0!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s7-probability .s7-prob-track{
    grid-column:2!important;grid-row:2!important;max-width:none!important;height:10px!important;
  }
  #opportunity-view[data-studio="v4"] .s8-opportunity-table td.s4-row-arrow{
    display:none!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #opportunity-view[data-studio="v4"] .s7-prob-fill,
  #opportunity-view[data-studio="v4"] .s8-lane-meter:before{
    animation:none!important;transition:none!important;
  }
}
