/* HUB-713 Sales › Sales Analytics: the 13 Nov design's sales-analytics.css. Rules that are not
   .sa-* (textarea, :disabled, lp-*, ep-switch, :root) are scoped to :where(.sa, .sa-layer) so they
   stay on this page. */
/* ---------------------------------------------------------------------------
 *  Sales analytics suite - sales-analytics.php / assets/js/sales-analytics.js
 *  CRM tokens from base.css. Chart series use the validated categorical palette
 *  (fixed order, light + dark steps). Responsive: nav becomes a drawer <= 900px,
 *  report settings move under the chart <= 1100px.
 * ------------------------------------------------------------------------- */
.sa {
    --sa-surface: var(--surface, #fff);
    --sa-s1: var(--brand);
    --sa-s2: #eb6834;
    --sa-s3: #1baf7a;
    --sa-s4: #eda100;
    --sa-s5: #e87ba4;
    --sa-s6: #008300;
    --sa-s7: #6250d6;
    --sa-s8: #e34948;
    --sa-up: #067647;
    --sa-dn: #c01048;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid var(--border, #e4e7ec);
    border-radius: 12px;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    font-size: 15px;
}

[data-theme="dark"] .sa {
    --sa-s1: var(--brand);
    --sa-s2: #d95926;
    --sa-s3: #199e70;
    --sa-s4: #c98500;
    --sa-s5: #d55181;
    --sa-s6: #008300;
    --sa-s7: #9085e9;
    --sa-s8: #e66767;
    --sa-up: #47cd89;
    --sa-dn: #fd6f8e;
}

.sa :is(button, a, input, select, [tabindex]):focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .25));
}
:where(.sa, .sa-layer) textarea{resize: none !important;}
.sa p {
    margin: 0;
}

.sa-i {
    width: 18px;
    height: 18px;
    flex: none;
}

.sa-i--sm {
    width: 15px;
    height: 15px;
}

.sa-i--xs {
    width: 12px;
    height: 12px;
}

.sa-flip {
    transform: rotate(180deg);
}

.sa-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sa-muted {
    color: var(--text-muted, #475467);
}

.sa-caret {
    width: 16px;
    height: 16px;
    flex: none;
}

/* header */
.sa-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-head__t {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.sa-head__acts {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-navtoggle {
    display: none;
}

/* buttons */
.sa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.sa-btn--sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13.5px;
}

.sa-btn--primary {
    background: var(--brand);
    color: var(--brand-contrast, #fff);
}

.sa-btn--primary:hover {
    background: var(--brand-hover, var(--brand));
}

.sa-btn--outline {
    border-color: var(--border-strong, #d0d5dd);
    background: var(--surface, #fff);
    color: var(--text, #101828);
}

.sa-btn--outline:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-btn--icon {
    width: 38px;
    padding: 0;
    border-color: var(--border-strong, #d0d5dd);
    background: var(--surface, #fff);
    color: var(--text, #101828);
}

.sa-btn--icon:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sa-link:hover {
    text-decoration: underline;
}

.sa-x {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text, #101828);
    cursor: pointer;
}

.sa-x:hover {
    background: var(--surface-hover, #f2f4f7);
}

/* layout */
.sa-body {
    position: relative;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
}

.sa-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 16px 24px 20px;
    border-right: 1px solid var(--border, #e4e7ec);
}

.sa-main {
    min-width: 0;
    padding: 24px clamp(16px, 2.6vw, 24px) 24px;
    outline: 0;
}

.sa-main.sa-main-div {
    padding: 0;
}

.sa-search {
    position: relative;
    display: block;
    margin-bottom: 12px;
}

.sa-search .sa-i {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted, #475467);
    transform: translateY(-50%);
}

.sa-search input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: inherit;
    font: inherit;
}

.sa-nav__it {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text, #101828);
    text-decoration: none;
}

.sa-nav__it:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-count {
    min-width: 26px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-2, #eef0f3);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
}

.sa-nav__h {
    margin: 18px 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.sa-nav__none {
    padding: 8px 4px;
}

.sa-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sa-tree--sub {
    margin-left: 18px;
}

.sa-tree__node, .sa-tree__rep {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    background: transparent;
    color: var(--text, #101828);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sa-tree__node:hover, .sa-tree__rep:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-tree__node.is-cur {
    border-left-color: var(--text, #101828);
    background: var(--surface-2, #f2f4f7);
}

.sa-tree__node--flat {
    padding-left: 33px;
    justify-content: space-between;
}

.sa-tree__up {
    color: var(--text-muted, #475467);
}

.sa-tree__rep {
    padding-left: 32px;
    font-size: 14.5px;
}

.sa-tree__rep[aria-current] {
    border-left-color: var(--brand);
    background: var(--brand-soft, var(--surface-hover));
    font-weight: 600;
}

.sa-navov {
    position: fixed;
    inset: 0;
    z-index: 10039;
    background: rgba(16, 24, 40, .45);
}

/* home */
.sa-home {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sa-intro {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sa-h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.sa-h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 21px;
    font-weight: 600;
}

.sa-h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.sa-beta {
    padding: 2px 8px;
    border-radius: 6px;
    background: #6250d6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.sa-qa {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 20px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 12px;
}

.sa-qa__head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sa-qa__k {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .03em;
}

.sa-qa__pop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, #475467);
}

.sa-qa__all {
    margin-left: auto;
}

.sa-qa__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
}

.sa-qchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 16px;
    border: 1px solid var(--text-muted, #475467);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.sa-qchip:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-qa__foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e4e7ec);
}

.sa-qa__foot p:last-child {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sa-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px 16px;
}

.sa-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--text-muted, #475467);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.sa-tile .sa-i {
    width: 15px;
    height: 15px;
    color: #6250d6;
}

[data-theme="dark"] .sa-tile .sa-i, [data-theme="dark"] .sa-card__btn .sa-i {
    color: #9085e9;
}

.sa-tile:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 24px 32px;
}

.sa-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 360px;
    padding: 20px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 6px;
    background: var(--surface, #fff);
}

.sa-card:hover {
    border-color: var(--text-muted, #475467);
}

.sa-card__t {
    margin: 0;
}

.sa-card__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text, #101828);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sa-card__btn::after {
    content: "";
    position: absolute;
    inset: 0;
}

.sa-card {
    position: relative;
}

.sa-card__btn .sa-i {
    width: 16px;
    height: 16px;
    color: #6250d6;
}

.sa-card__d {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sa-card__pv {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    text-align: center;
}

.sa-card__pv > .sa-chip {
    align-self: flex-start;
    margin-bottom: auto;
}

.sa-card__pv > .sa-chip + .sa-kpi__l {
    margin-top: auto;
}

.sa-card__pv > :last-child {
    margin-bottom: auto;
}

.sa-card__pv--txt {
    gap: 4px;
}

.sa-chip {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface-2, #eef0f3);
    font-size: 13px;
    font-weight: 600;
}

.sa-kpi__l {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.sa-kpi__v {
    font-size: 30px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sa-kpi__v--lg {
    font-size: 34px;
    color: var(--text, #101828);
}

.sa-kpi__v--xl {
    font-size: clamp(36px, 6vw, 60px);
}

.sa-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.sa-delta .sa-i {
    width: 14px;
    height: 14px;
}

.sa-delta.is-up .sa-i {
    color: var(--sa-up);
}

.sa-delta.is-dn .sa-i {
    color: var(--sa-dn);
}

.sa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}

.sa-empty__art {
    width: 160px;
    height: 120px;
    color: var(--text-muted, #475467);
}

/* report view */
.sa-rep {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.sa-rep__main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.sa-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
}

.sa-crumbs [aria-current] {
    color: var(--text-muted, #475467);
}

.sa-rep__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-fchip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text, #101828);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

span.sa-fchip {
    cursor: default;
}

.sa-fchip--on {
    background: var(--surface-2, #eef0f3);
}

button.sa-fchip:hover {
    background: var(--surface-hover, #e4e7ec);
}

.sa-rep__grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sa-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 10px;
    background: var(--surface, #fff);
}

.sa-sum {
    align-items: flex-start;
}

.sa-chartp__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-chart {
    min-height: 220px;
}

.sa-svg {
    display: block;
    width: 100%;
    height: auto;
}

.sa-svg__grid {
    stroke: var(--border, #e4e7ec);
    stroke-width: 1;
}

.sa-svg__base {
    stroke: var(--text-muted, #475467);
    stroke-width: 1;
}

.sa-svg__ax {
    fill: var(--text-muted, #475467);
    font-size: 12px;
}

.sa-svg__big {
    fill: var(--text, #101828);
    font-size: 22px;
    font-weight: 600;
}

.sa-svg__sm {
    fill: var(--text-muted, #475467);
    font-size: 12px;
}

.sa-hbars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sa-hbar {
    display: grid;
    grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
    border-radius: 4px;
}

.sa-hbar:hover .sa-hbar__f, .sa-hbar:focus-visible .sa-hbar__f {
    filter: brightness(.9);
}

.sa-hbar__l {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.sa-hbar__track {
    display: block;
    height: 20px;
}

.sa-hbar__f {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--sa-s1);
}

.sa-hbar__v {
    color: var(--text-muted, #475467);
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

.sa-pie {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.sa-pie svg {
    width: min(260px, 100%);
    height: auto;
}

.sa-pie path:hover, .sa-pie path:focus-visible {
    filter: brightness(.92);
}

.sa-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.sa-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-legend strong {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.sa-sw {
    width: 12px;
    height: 12px;
    flex: none;
    border-radius: 3px;
}

.sa-kpibig {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 12px;
    text-align: center;
}

.sa-rank {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: r;
}

.sa-rank li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border, #e4e7ec);
    counter-increment: r;
}

.sa-rank li span::before {
    content: counter(r) ". ";
    color: var(--text-muted, #475467);
}

.sa-tablewrap {
    overflow-x: auto;
}

.sa-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 14px;
}

.sa-table th, .sa-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, #e4e7ec);
    text-align: left;
}

.sa-table thead th {
    background: var(--surface-2, #f9fafb);
    font-weight: 600;
}

.sa-table tbody th {
    font-weight: 500;
}

.sa-table tfoot th, .sa-table tfoot td {
    font-weight: 700;
    border-bottom: 0;
}

.sa-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.sa-set {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 10px;
    background: var(--surface, #fff);
}

.sa-fs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0 0 18px;
    border: 0;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-fs:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.sa-fs legend, .sa-fs__l {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0;
    font-weight: 700;
}

.sa-fs__l {
    margin-bottom: 0;
}

.sa-ctypes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.sa-ctype {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--sa-s1);
    cursor: pointer;
}

.sa-ctype .sa-i {
    width: 24px;
    height: 24px;
}

.sa-ctype:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-ctype[aria-pressed="true"] {
    border-color: var(--text, #101828);
    background: var(--surface-2, #f2f4f7);
    box-shadow: inset 0 0 0 1px var(--text, #101828);
}

.sa-prop {
    padding: 9px 12px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface-2, #f9fafb);
}

.sa-select {
    position: relative;
    display: block;
}

.sa-select select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: inherit;
    font: inherit;
}

/* menus, tooltip, dialog */
.sa-menu {
    position: absolute;
    z-index: 10060;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 12px;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    box-shadow: 0 14px 36px rgba(16, 24, 40, .18);
}

.sa-menu--wide {
    min-width: 240px;
}

.sa-menu__it {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.sa-menu__it:hover, .sa-menu__it:focus-visible, .sa-menu__it.is-on {
    background: var(--surface-hover, #f2f4f7);
    outline: 0;
}

.sa-menu__it.is-on {
    font-weight: 700;
}

.sa-menu__checks {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
}

.sa-menu__foot {
    display: flex;
    justify-content: flex-end;
    padding: 8px 6px 2px;
    border-top: 1px solid var(--border, #e4e7ec);
    margin-top: 4px;
}

.sa-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.sa-check:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--brand);
}

.sa-tip {
    position: absolute;
    z-index: 10080;
    max-width: 260px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #1f2430;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

.sa-tip[hidden] {
    display: none;
}

.sa-modal-ov {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(16, 24, 40, .5);
}

.sa-modal {
    display: flex;
    flex-direction: column;
    width: min(480px, 100%);
    max-height: calc(100vh - 32px);
    border-radius: 14px;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
}

.sa-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px 24px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-modal__head h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
}

.sa-modal__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
    overflow-y: auto;
}

.sa-modal__foot {
    display: flex;
    gap: 10px;
    padding: 0 24px 22px;
}

.sa-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sa-field label {
    font-weight: 600;
}

.sa-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: inherit;
    font: inherit;
}

/* responsive */
@media (max-width: 1100px) {
    .sa-rep {
        grid-template-columns: minmax(0, 1fr);
    }

    .sa-set {
        position: static;
    }

    .sa-ctypes {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sa-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .sa-navtoggle {
        display: inline-flex;
    }

    .sa-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10040;
        width: min(320px, 88vw);
        overflow-y: auto;
        background: var(--surface, #fff);
        box-shadow: 12px 0 32px rgba(16, 24, 40, .2);
        transform: translateX(-105%);
        transition: transform .2s ease;
        visibility: hidden;
    }

    .sa.is-nav .sa-nav {
        transform: none;
        visibility: visible;
    }
}

@media (max-width: 600px) {
    .sa {
        font-size: 14.5px;
        border-radius: 8px;
    }

    .sa-head {
        padding: 14px;
    }

    .sa-main {
        padding: 18px 14px 28px;
    }

    .sa-ctypes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sa-card {
        min-height: 0;
    }

    .sa-card__pv {
        min-height: 180px;
    }

    .sa-hbar {
        grid-template-columns: minmax(70px, 100px) minmax(0, 1fr) auto;
        gap: 8px;
    }

    .sa-qa__all {
        margin-left: 0;
    }

    .sa-panel {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sa-nav {
        transition: none;
    }
}

.sa-btn.sa-navtoggle {
    display: none;
}

.sa-navtoggle svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .sa-btn.sa-navtoggle {
        display: inline-flex;
    }
}

.sa .sa-main:focus, .sa .sa-main:focus-visible {
    outline: 0;
    box-shadow: none;
}

.sa-svg .sa-svg__ax {
    font-size: 16px;
}

/* ==========================================================================
   ACTIVITIES & LEADS  -  group page + Call outcomes / Chats / Completed
   activities report view. Shared lp-* components (list-page.css) are used for
   popovers, menus, drawers, modals, inputs and selects; tokens from base.css.
   ========================================================================== */
.sa [hidden] {
    display: none !important;
}

.sa-nav__h {
    margin: 18px 0 6px;
}

.sa-nav__fav {
    gap: 8px;
    justify-content: flex-start;
    color: var(--brand-ink, var(--brand));
    font-weight: 600;
}

.sa-grp .sa-crumbs {
    margin-bottom: 6px;
}

.sa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: flex-start;
}

.sa-chip--warn {
    background: #f5b82e;
    color: #3a2a00;
}

.sa-chip[data-tip] {
    cursor: default;
}

.sa-card__pv--act {
    align-items: center;
}

.sa-card__pv--act .sa-chips {
    margin-bottom: auto;
}

.sa-card__pv--act .sa-kpi__l--n {
    margin-top: auto;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.sa-card__pv--act > :last-child {
    margin-bottom: auto;
}

.sa-card__pv > .sa-chips {
    align-self: flex-start;
}

.sa-btn--block {
    width: 100%;
}

.sa-small {
    font-size: 13.5px;
}

.sa-mt {
    margin-top: 12px;
}

.sa-right {
    text-align: right;
}

.sa-pad {
    padding: 12px 16px;
}

.sa-x--sm {
    min-width: 28px;
    width: 28px;
    height: 28px;
}

.sa-x.is-on {
    color: var(--brand);
    background: var(--brand-soft);
}

.sa-round {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 50%;
    background: var(--surface, #fff);
    color: var(--text, #101828);
    cursor: pointer;
}

.sa-round:hover, .sa-round.is-open {
    background: var(--surface-hover, #f2f4f7);
    border-color: var(--text-muted);
}

/* layout */
.sa-rv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 16px;
    align-items: start;
}
.sa-rv-area {gap: 0 !important;}

.sa-rv.has-set {
    grid-template-columns: minmax(0, 1fr) 320px 40px;
}

.sa-rv__main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 20px 16px 24px 16px;
}

.sa-rv__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sa-rv__set {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 0;
    background: var(--surface, #fff);
}

.sa-rv__strip {
    position: sticky;
    top: 12px;
    display: flex;
    justify-content: center;
    padding: 8px 8px 0 8px;
    height: 100%;
    border-left: 1px solid var(--border);
}

.sa-rv.has-set .sa-rv__strip {
    grid-column: 3;
}

.sa-rv:not(.has-set) .sa-rv__strip {
    grid-column: 2;
}

.sa-rv__strip .sa-x {
    border: 1px solid var(--border, #e4e7ec);
}

.sa-rv__strip .sa-x[aria-pressed="true"] {
    background: var(--surface-2, #eef0f3);
}

.sa-rv__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 8px;
    padding: 2px 0 14px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-fsep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: var(--border-strong, #d0d5dd);
}

.sa-fsearch {
    padding: 0 8px;
    gap: 2px;
}

.sa-fchip.is-open {
    background: var(--surface-hover, #e4e7ec);
}

.sa-fadv {
    background: transparent;
}

.sa-fadv.sa-fchip--on {
    background: var(--brand-soft, var(--surface-hover));
    color: var(--brand-ink, var(--brand));
}

.sa-fclear {
    min-height: 34px;
    padding: 0 6px;
    font-weight: 600;
}

.sa-fclear:disabled {
    color: var(--text-subtle, #98a2b3);
    cursor: default;
    text-decoration: none;
}

.sa-fq {
    max-width: 280px;
}

/* summary */
.sa-sum2 {
    padding: 0;
    gap: 0;
}

.sa-sum2__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-sum2__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.sa-sum2__l {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px 20px;
    border-right: 1px solid var(--border, #e4e7ec);
}

.sa-sum2__r {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px 18px;
    min-width: 0;
}

.sa-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.sa-kpi2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 0;
    outline: 0;
}

.sa-kpi2:nth-child(odd) {
    border-right: 1px solid var(--border, #e4e7ec);
}

.sa-kpi2:nth-child(n+3) {
    border-top: 1px solid var(--border, #e4e7ec);
}

.sa-kpi2:hover, .sa-kpi2:focus-visible {
    background: var(--surface-2, #f2f4f7);
}

.sa-kpi2__l {
    font-size: 15px;
    font-weight: 500;
}

.sa-kpi2__v {
    font-size: 34px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.sa-ins__wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 5.2em;
    overflow: hidden;
    position: relative;
}

.sa-ins__wrap.is-open {
    max-height: none;
    overflow: visible;
}

.sa-ins__wrap:not(.is-open)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.2em;
    background: linear-gradient(transparent, var(--surface, #fff));
    pointer-events: none;
}

.sa-ins {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    font-size: 14.5px;
    line-height: 1.55;
}

.sa-ins p {
    margin: 0;
}

.sa-ins__ic {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    color: var(--text);
}

.sa-fb {
    display: inline-flex;
    gap: 0;
}

.sa-ins__more {
    align-self: center;
}

.sa-ins__gen, .sa-ins__foot {
    font-size: 13px;
}

.sa-ins__foot {
    margin-top: auto;
}

.sa-ins.sa-muted {
    display: flex;
    gap: 8px;
}

.sa-empty p {
    max-width: 420px;
}

/* chart card */
.sa-chartp2 {
    align-items: stretch;
}

.sa-seg {
    display: inline-flex;
    align-self: flex-start;
    border: 1px solid var(--text-muted, #475467);
    border-radius: 999px;
    overflow: hidden;
}

.sa-seg button {
    min-width: 92px;
    height: 36px;
    padding: 0 18px;
    border: 0;
    background: var(--surface, #fff);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sa-seg button + button {
    border-left: 1px solid var(--text-muted, #475467);
}

.sa-seg button.is-on {
    background: var(--surface-hover, #e4e7ec);
}

.sa-ctbtn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.sa-ctbtn:hover, .sa-ctbtn.is-open {
    background: var(--surface-hover, #f2f4f7);
}

.sa-ctbtn__ic {
    display: inline-grid;
    color: var(--brand);
}

.sa-ctbtn b {
    font-weight: 600;
}

.sa-leg2 {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
}

.sa-leg2 li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sa-leg2--col {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}

.sa-leg2--col li {
    width: 100%;
}

.sa-leg2 strong {
    margin-left: auto;
    padding-left: 14px;
    font-variant-numeric: tabular-nums;
}

.sa-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
}

.sa-axisT {
    margin: 4px 0 -4px;
    font-size: 13.5px;
    font-weight: 700;
}

.sa-chart2 {
    min-height: 120px;
    max-height: 640px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sa-svg2 {
    display: block;
    max-width: 100%;
    overflow: visible;
}

.sa-svg2 text {
    font-family: inherit;
}

.sa-svg__axt {
    fill: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.sa-svg__val {
    fill: var(--text);
    font-size: 11.5px;
    font-weight: 700;
}

.sa-svg__cat {
    fill: var(--text);
}

.sa-svg2 .sa-svg__ax {
    font-size: 11.5px;
}

.sa-hit:hover .sa-seg-r {
    filter: brightness(.92);
}

.sa-hit:hover rect[fill="transparent"] {
    fill: var(--surface-2, rgba(0, 0, 0, .04));
}

.sa-pie2 {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    padding: 8px 4px;
}

.sa-pie2 svg {
    max-width: 100%;
    height: auto;
}

.sa-slice:hover {
    filter: brightness(.92);
}

.sa-gauge, .sa-kpibig2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 12px;
    text-align: center;
}

.sa-kpibig2__l {
    width: min(360px, 100%);
    margin-top: 12px;
}

.sa-ctip {
    position: fixed;
    z-index: 10090;
    min-width: 220px;
    max-width: 320px;
    padding: 0 0 8px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: var(--text);
    font-size: 13px;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(16, 24, 40, .18));
    pointer-events: none;
}

.sa-ctip[hidden] {
    display: none;
}

.sa-ctip__h {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #e4e7ec);
    background: var(--surface-2, #f2f4f7);
    font-weight: 600;
}

.sa-ctip__m {
    padding: 8px 12px 4px;
}

.sa-ctip__r {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
}

.sa-ctip__r span {
    flex: 1;
}

.sa-ctip__r em {
    min-width: 44px;
    color: var(--text-muted);
    font-style: normal;
    text-align: right;
}

.sa-ctip__r.is-hot span, .sa-ctip__r.is-hot b {
    font-weight: 700;
}

.sa-ctip__t {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 6px 12px 0;
    border-top: 1px solid var(--border, #e4e7ec);
}

.sa-ctip__t span {
    color: var(--text-muted);
}

/* table card */
.sa-tblp {
    gap: 0;
    /*padding-top: 6px;*/
}

.sa-tabs2 {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-tabs2 button {
    padding: 12px 18px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.sa-tabs2 button:hover {
    color: var(--text);
}

.sa-tabs2 button.is-on {
    color: var(--text);
    font-weight: 600;
    border-bottom-color: var(--text);
}

.sa-table--rv {
    min-width: 520px;
}

.sa-table--rv thead th {
    background: transparent;
    border-bottom: 1px solid var(--text);
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

.sa-table--rv td, .sa-table--rv tbody th {
    padding: 13px 12px;
}

.sa-tv {
    color: var(--brand-ink, var(--brand));
    font-weight: 600;
}

.sa-table--rv tfoot th, .sa-table--rv tfoot td {
    background: var(--surface-2, #eef0f3);
}

.sa-table .is-up {
    color: var(--sa-up);
}

.sa-table .is-dn {
    color: var(--sa-dn);
}

.sa-info {
    display: inline-flex;
    vertical-align: middle;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: help;
}

.sa-pager2 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.sa-pgt, .sa-pgn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.sa-pgt {
    padding: 0 10px;
    color: var(--text-muted);
}

.sa-pgn {
    min-width: 32px;
    padding: 0 8px;
}

.sa-pgt:hover:not(:disabled), .sa-pgn:hover:not(.is-on) {
    background: var(--surface-hover);
    color: var(--text);
}

.sa-pgt:disabled {
    opacity: .45;
    cursor: default;
}

.sa-pgn.is-on {
    border-color: var(--text, #33475b);
    font-weight: 700;
    cursor: default;
}

.sa-pgel {
    min-width: 22px;
    text-align: center;
    color: var(--text-muted);
}

.sa-pgsize {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 32px;
    height: 34px;
    margin-left: 12px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--surface-subtle, var(--surface-hover, #eef1f5));
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.sa-pgsize:hover:not(:disabled), .sa-pgsize[aria-expanded="true"] {
    background: var(--surface-hover);
}

.sa-pgmenu .lp-menu__item {
    font-size: 14px;
    padding: 10px 18px;
}

.sa-pgmenu .lp-menu__check {
    display: none;
}

:where(.sa, .sa-layer) .lp-menu__item.is-checked {
    font-weight: 700;
    background: var(--surface-hover);
}
.sa-pgcount {
    font-size: 13px;
}

.sa-rawsearch {
    width: 260px;
    max-width: 100%;
    margin-bottom: 14px;
}

.sa-rawempty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px 0 8px;
}

.sa-rawempty h3 {
    margin: 0 0 6px;
}

/* settings panel */
.sa-set2__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-set2__sec {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-ctypes2 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.sa-ctype2 {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--sa-s1);
    cursor: pointer;
}

.sa-ctype2 .sa-i {
    width: 22px;
    height: 22px;
}

.sa-ctype2:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-ctype2[aria-pressed="true"] {
    border-color: var(--text);
    background: var(--surface-2, #f2f4f7);
    box-shadow: inset 0 0 0 1px var(--text);
}

.sa-dprop {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-2, #f2f4f7);
}

.sa-sel {
    height: 38px;
}

:where(.sa, .sa-layer) .lp-select:disabled {
    opacity: .55;
    cursor: default;
}

.sa-set2__adv {
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.sa-set2__adv > summary {
    padding: 14px 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
}
.sa-set2__adv.data-quality[open] summary::after {
    transform: rotate(90deg) !important;
}
.sa-set2__adv.data-quality summary {
    cursor: no-drop;
    opacity: 0.5;
}
.sa-adv.sa-adv-data-quality {display: none !important;}

.sa-set2__adv > summary::after {
    content: "›";
    transform: rotate(90deg);
    transition: transform .15s;
}

.sa-set2__adv[open] > summary::after {
    transform: rotate(-90deg);
}

.sa-adv {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
}

.sa-adv ul {
    margin: 0;
    padding-left: 20px;
}

.sa-adv p {
    margin: 0;
}

/* popovers / pickers */
.sa-pd small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.sa-pd.is-dis {
    opacity: .5;
}

.sa-pd-empty {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.sa-mrow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
}

.sa-mrow:hover {
    background: var(--surface-hover, #f2f4f7);
}

.sa-mrow b {
    font-weight: 500;
}

.sa-mrow small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.sa-mrow .lp-cb {
    margin-top: 2px;
    flex: none;
}

.sa-msep {
    height: 1px;
    margin: 4px 0;
    background: var(--border, #e4e7ec);
}

.sa-multi__list {
    max-height: 340px;
    overflow-y: auto;
    padding-bottom: 4px;
}

.sa-more {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.sa-moreit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sa-moreit:hover, .sa-moreit.is-open {
    background: var(--surface-hover, #f2f4f7);
}

.sa-moreit.is-on {
    color: var(--brand-ink, var(--brand));
}

.sa-vform {
    display: grid;
    gap: 12px;
    min-width: 250px;
}

.sa-vrow {
    display: flex;
    gap: 8px;
}

.sa-vrow .lp-select {
    width: auto;
    min-width: 110px;
}

.sa-vacts {
    display: flex;
    gap: 8px;
}

.sa-sform {
    display: grid;
    gap: 10px;
    min-width: 270px;
    font-size: 14px;
}

.sa-sform p {
    margin: 0;
}

.sa-pp {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sa-pp__t {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.sa-pp__tools {
    display: flex;
    justify-content: space-between;
}

.sa-pp__tools .lp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
}

.sa-pp__list {
    max-height: 360px;
    overflow-y: auto;
    margin: 0 -16px -16px;
    padding-bottom: 8px;
}

.sa-pp .lp-propdd__gh {
    padding-left: 16px;
}

.sa-prow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 16px;
    font-size: 13.5px;
    cursor: pointer;
}

.sa-prow:hover, .sa-prow:focus-visible {
    outline: 0;
    background: var(--surface-hover, #f2f4f7);
}

.sa-prow__n {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-prow:hover .sa-prow__n {
    text-decoration: underline;
}

.sa-prow__i {
    display: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.sa-prow:hover .sa-prow__i, .sa-prow:focus-within .sa-prow__i {
    display: inline-flex;
}

.sa-badge {
    display: inline-block;
    min-width: 28px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--surface-3, var(--border));
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 700;
    text-align: center;
}

.sa-typepop, .sa-typelist {
    display: grid;
    gap: 8px;
}

.sa-typepop {
    padding: 4px;
    min-width: 240px;
}

.sa-typelist {
    max-height: 260px;
    overflow-y: auto;
}

.sa-infocard {
    display: grid;
    gap: 8px;
    width: 270px;
    font-size: 13.5px;
}

.sa-infocard h3 {
    margin: 0;
    font-size: 15px;
}

.sa-infocard p {
    margin: 0;
}

.sa-infocard hr {
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border, #e4e7ec);
}

.sa-infocard dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    margin: 0;
}

.sa-infocard dt {
    color: var(--text-muted);
}

.sa-infocard dd {
    margin: 0;
    font-weight: 600;
}

/* modals + drawers */
.sa-qfmodal {
    width: min(520px, 100%);
}

.sa-qfm__n {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.sa-qfm__row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.sa-qfm__acts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sa-dgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sa-rerr {
    margin: 10px 0 0;
    color: var(--danger, #c01048);
    font-size: 13px;
    font-weight: 600;
}

.sa-ta {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.4;
}

.sa-sumdlg__g {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 12px;
}

.sa-styles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sa-stylebtn {
    display: grid;
    gap: 2px;
    padding: 8px 6px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

.sa-stylebtn.is-on {
    border-color: var(--text);
    box-shadow: inset 0 0 0 1px var(--text);
}

.sa-prevbox {
    min-height: 220px;
    height: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-2, #f2f4f7);
    font-size: 13.5px;
    line-height: 1.5;
}

.sa-prevbox p {
    margin: 0 0 10px;
}

.sa-advdrawer .lp-side__body {
    gap: 12px;
}

.sa-advtop {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sa-adverr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--danger, #c01048);
    border-radius: 10px;
    background: color-mix(in srgb, var(--danger, #c01048) 10%, var(--surface, #fff));
    color: var(--danger, #c01048);
}

.sa-adverr .lp-i {
    width: 18px;
    height: 18px;
}

.sa-advempty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 20px 0;
    text-align: center;
}

.sa-advempty p {
    margin: 0;
}

.sa-cond {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-2, #eef0f3);
}

.sa-cond.is-bad {
    border: 1px solid var(--danger, #c01048);
    background: color-mix(in srgb, var(--danger, #c01048) 8%, var(--surface, #fff));
}

.sa-cond__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.sa-cond__err {
    margin: 0;
    color: var(--danger, #c01048);
    font-size: 12.5px;
    font-weight: 700;
}

:where(.sa, .sa-layer) .lp-select.is-err, :where(.sa, .sa-layer) .lp-input.is-err {
    border-color: var(--danger, #c01048);
}

.sa-addf {
    width: 100%;
    justify-content: flex-start;
}

.sa-or {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 24px;
}
.sa-or:before {
    position: absolute;
    content: "";
    top: -14px;
    left: 20px;
    height: 15px;
    width: 1px;
    background-color: var(--border-strong);
}
.sa-orb {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 32px;
    border: 1px solid var(--border-strong, #d0d5dd);
    border-radius: 999px;
    background: var(--surface, #fff);
    font-size: 13px;
    font-weight: 600;
}

.sa-ppop .lp-pop__body {
    width: 360px;
}
:where(.sa, .sa-layer) .lp-pop--pick.lp-pop--pick-big .lp-pop__body {
    width: 100%;
}

.sa-vpop .lp-pop__body, .sa-spop .lp-pop__body, .sa-morepop .lp-pop__body {
    padding: 14px !important;
}

.sa-infopop .lp-pop__body {
    width: 300px !important;
}

.sa-confpop .lp-pop__body {
    width: 330px !important;
}

.sa-confirm {
    display: grid;
    gap: 10px;
}

.sa-confirm h3 {
    margin: 0;
    font-size: 17px;
}

.sa-confirm p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.sa-selpop .lp-pop__body {
    overflow: hidden;
}

.sa-selpop .lp-propdd {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.sa-valmodal {
    width: min(480px, 100%);
}
.lp-propdd__item.sa-pd {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 9px 16px;
}
.lp-propdd__item.sa-pd svg, .sa-ctbtn__ic svg {
    min-width: 20px;
    width: 20px;
    height: 20px;
}
.sa-home, .sa-home.sa-grp {padding: 20px 16px 24px}
.sa-sumdlg__g-area .sa-fs__l {margin: 8px 0 4px 0;}
.sa-sumdlg__g-area .sa-styles {margin: 0 0 16px 0;}
.sa-sumdlg__g.sa-sumdlg__g-area {margin-top: 0;}
.sa-panel.sa-tblp .sa-tabs2 {overflow-y: hidden;overflow-x: auto;flex-wrap: nowrap;}
.sa-panel.sa-tblp .sa-tabs2 button {min-width: fit-content;padding: 10px 6px;}

@media (max-width: 1300px) {
    .sa-rv, .sa-rv.has-set {
        grid-template-columns: minmax(0, 1fr);
    }

    .sa-rv__strip, .sa-rv.has-set .sa-rv__strip, .sa-rv:not(.has-set) .sa-rv__strip {
        grid-column: 1;
        position: static;
        justify-content: flex-end;
        order: -1;
    }
    .sa-rv__strip {order: 1;}
    .sa-rv__set {
        order: 2;
        position: static;
        max-height: none;
        margin: 0 0 16px 0;
        border-left: none;
        padding-top: 2px;
    }
    .sa-rv__main {order: 3;padding-top: 2px;}
    .sa-sum2__grid {
        grid-template-columns: 1fr;
    }

    .sa-sum2__l {
        border-right: 0;
        border-bottom: 1px solid var(--border, #e4e7ec);
    }
}

@media (max-width: 700px) {
    .sa-kpis {
        grid-template-columns: 1fr;
    }

    .sa-kpi2:nth-child(odd) {
        border-right: 0;
    }

    .sa-kpi2:nth-child(n+2) {
        border-top: 1px solid var(--border, #e4e7ec);
    }

    .sa-sumdlg__g, .sa-dgrid {
        grid-template-columns: 1fr;
    }

    .sa-seg button {
        min-width: 80px;
    }
}


/* Export dialog refinements and summarized-data record drill-in */
.sa-modal__body .sa-chips { align-self: center; }
.sa-modal__body .sa-export-help {
    line-height: 1.55;
    color: var(--text, #344054);
    margin: 2px 0 8px;
}
.sa-modal__body .sa-export-notice {
    font-size: 16px;
    line-height: 1.5;
    margin: 4px 0 8px;
}
.sa-modal__body .sa-muted a {
    color: var(--brand);
    font-weight: 600;
}
.sa-modal__body select.sa-input { appearance: auto; }
/* value -> records popup */
.sa-record-ov .sa-modal {
    width: min(1380px, 96vw);
    max-width: 1380px;
    max-height: calc(100vh - 48px);
    border-radius: 12px;
}
.sa-record-ov .sa-modal__head { padding: 20px 28px 18px; }
.sa-record-ov .sa-modal__head h2 { font-size: 18px; font-weight: 600; }
.sa-record-ov .sa-modal__body { padding: 0 28px 4px; gap: 0; overflow-y: auto; }
.sa-record-ov .sa-modal__foot { display: none; }
.sa-rec { min-width: 0; font-size: 13px; }
.sa-rec-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 0; }
.sa-rec-count { font-size: 13px; font-weight: 500; white-space: nowrap; }
.sa-rec-sep { align-self: stretch; width: 1px; min-height: 28px; background: var(--border, #dfe3eb); }
.sa-rec-bar .sa-chips { margin: 0; }
.sa-rec-gbtn, .sa-rec-more {
    display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px;
    border: 1px solid var(--text, #33475b); background: var(--surface, #fff); color: var(--text);
    font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.sa-rec-gbtn { border-radius: 6px; }
.sa-rec-gbtn:hover, .sa-rec-more:hover { background: var(--surface-hover, #f2f5f8); }
.sa-rec-gbtn.is-open { background: var(--brand-soft, var(--surface-hover)); border-color: var(--brand); }
.sa-rec-more { margin-left: auto; height: 36px; padding: 0 18px; border-radius: 6px; }
.sa-rec-grid { overflow: auto; max-height: calc(100vh - 320px); min-height: 120px; }
.sa-rec-table { width: 100%; min-width: 1300px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sa-rec-table thead th {
    position: sticky; top: 0; z-index: 1; padding: 14px 12px 12px; background: var(--surface, #fff);
    border-bottom: 1px solid var(--text-muted, #7c98b6); color: var(--text-muted, #516f90);
    font-weight: 400; text-align: left; white-space: nowrap;
}
.sa-rec-table tbody td {
    height: 37px; padding: 0 12px; border-bottom: 1px solid var(--border, #dfe3eb);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.sa-rec-table th:first-child, .sa-rec-table td:first-child { padding-left: 20px; }
.sa-rec-table tbody tr:hover td { background: var(--surface-hover, #f5f8fa); }
.sa-rec-sort {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0;
    border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.sa-rec-sort .sa-i { color: var(--text-muted, #7c98b6); }
.sa-rec-sort.is-on, .sa-rec-sort.is-on .sa-i { color: var(--text, #33475b); }
.sa-rec-link { color: var(--brand-ink, var(--brand)); font-weight: 700; text-decoration: none; }
.sa-rec-link:hover { text-decoration: underline; }
.sa-rec-ext { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; color: var(--brand-ink, var(--brand)); }
.sa-rec-grp th {
    padding: 8px 20px; background: var(--surface-subtle, #f5f8fa); border-bottom: 1px solid var(--border, #dfe3eb);
    color: var(--text); font-size: 12px; font-weight: 600; text-align: left;
}
.sa-rec-grp th span { color: var(--text-muted); font-weight: 400; }
.sa-rec-empty { padding: 28px 20px !important; color: var(--text-muted); text-align: center !important; }
.sa-rec-foot { display: flex; justify-content: center; padding: 14px 0 18px; }
.sa-rec-pager { display: flex; align-items: center; gap: 8px; }
.sa-rp {
    display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px;
    border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text);
    font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.sa-rp:hover:not(:disabled):not(.is-on) { background: var(--surface-hover, #eef1f5); }
.sa-rp.is-on { border-color: var(--text, #33475b); cursor: default; }
.sa-rp--arr:disabled { background: var(--surface-hover, #eaf0f6); color: var(--text-muted); cursor: default; }
.sa-rp-el { min-width: 20px; text-align: center; color: var(--text-muted); font-size: 12px; }
.sa-rec-menu {
    position: fixed; z-index: 5; display: flex; flex-direction: column; background: var(--surface, #fff);
    border: 1px solid var(--border, #dfe3eb); border-radius: 10px; box-shadow: 0 8px 28px rgba(16, 24, 40, .2);
}
.sa-rec-gmenu { width: 272px; padding: 12px 6px 8px; }
.sa-rec-gsearch {
    display: flex; align-items: center; gap: 8px; height: 40px; margin: 0 6px 10px; padding: 0 12px;
    border: 2px solid var(--brand); border-radius: 10px; color: var(--text-muted);
}
.sa-rec-gsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.sa-rec-glist { overflow-y: auto; }
.sa-rec-gopt {
    display: block; width: 100%; padding: 9px 14px; border: 0; border-radius: 4px; background: transparent;
    color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.sa-rec-gopt:hover, .sa-rec-gopt:focus-visible, .sa-rec-gopt.is-on { background: var(--surface-hover, #eef1f5); }
.sa-rec-gopt.is-on { font-weight: 700; }
.sa-rec-gopt--clear { color: var(--brand-ink, var(--brand)); font-weight: 600; }
.sa-rec-gnone { padding: 12px 14px; color: var(--text-muted); font-size: 13px; }
.sa-rec-mmenu { min-width: 210px; padding: 6px; }
.sa-rec-mmenu button {
    padding: 9px 12px; border: 0; border-radius: 4px; background: transparent; color: inherit;
    font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.sa-rec-mmenu button:hover { background: var(--surface-hover, #f2f4f7); }
td.sa-num.sa-tv {cursor: pointer;}
td.sa-num.sa-tv:hover {text-decoration: underline;}
:where(.sa, .sa-layer) .list-ul-dot {list-style-type: disc !important;}
:where(.sa, .sa-layer) .iconSize-12 {min-width: 12px;width: 12px;height: 12px;}

/* switch */
:where(.sa, .sa-layer) .ep-switch { position: relative; flex: none; display: inline-block; cursor: pointer; }
:where(.sa, .sa-layer) .ep-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
:where(.sa, .sa-layer) .ep-switch__track {
    position: relative; display: block; width: 52px; height: 28px; border-radius: 6px;
    background: var(--surface); border: 1.5px solid var(--panel-subtle); transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
:where(.sa, .sa-layer) .ep-switch__thumb {
    position: absolute; top: 0;bottom: 0; left: 2px; margin: auto;display: grid; place-items: center; width: 21px; height: 21px;
    border-radius: 4px; background: var(--surface); border: 1.5px solid var(--panel-subtle); color: transparent;
    transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
:where(.sa, .sa-layer) .ep-switch input:checked + .ep-switch__track { background: var(--brand);border: 1.5px solid var(--brand); }
:where(.sa, .sa-layer) .ep-switch input:checked + .ep-switch__track .ep-switch__thumb { transform: translateX(24px); color: var(--text);border: 1.5px solid var(--brand); }
:where(.sa, .sa-layer) .ep-switch input:focus-visible + .ep-switch__track { box-shadow: var(--focus-ring); }
:where(.sa, .sa-layer) .ep-switch.is-locked, :where(.sa, .sa-layer) .ep-switch.is-locked input { cursor: not-allowed; }
:where(.sa, .sa-layer) .ep-switch.is-locked .ep-switch__track { opacity: 0.45; }

@media (max-width: 700px) {
 .sa-record-ov { padding: 6px; }
 .sa-record-ov .sa-modal { width: 100%; max-width: none; }
 .sa-record-ov .sa-modal__head { padding: 14px 16px; }
 .sa-record-ov .sa-modal__body { padding: 0 12px 4px; }
 .sa-rec-more { margin-left: 0; }
 .sa-rec-grid { max-height: calc(100vh - 280px); }
 .sa-pgsize { margin-left: 0; }
}

/* Save report side panel, matching the report-save reference screenshots. */
.sa-save-drawer.sa-modal-ov {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    background: rgba(16, 24, 40, .42);
}
.sa-save-drawer .sa-modal {
    width: min(420px, 100%);
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: -10px 0 34px rgba(16,24,40,.16);
}
.sa-save-drawer .sa-modal__head { padding: 18px 20px; }
.sa-save-drawer .sa-modal__head h2 { font-size: 18px; }
.sa-save-drawer .sa-modal__body { padding: 18px 20px; gap: 14px; }
.sa-save-intro { margin: 0; color: var(--text-muted, #667085); font-size: 13px; line-height: 1.45; }
.sa-save-dash { border: 0; padding: 0; margin: 2px 0 0; display: flex; flex-direction: column; gap: 11px; }
.sa-save-dash legend { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.sa-save-dash label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sa-save-dash input[type="radio"] { accent-color: var(--brand); min-width: 16px; width: 16px; height: 16px; flex: 0 0 16px; }
.sa-save-dash #saSaveDashboard { margin-top: 2px; }
.sa-save-drawer .sa-modal { min-width: 0; }
.sa-modal-ov.sa-record-ov { box-sizing: border-box; overflow: auto; align-items: center; justify-content: center; }
.sa-modal-ov.sa-record-ov .sa-modal { box-sizing: border-box; width: min(1380px, calc(100vw - 32px)); max-width: calc(100vw - 32px); min-width: 0; }
.sa-rec-grid { width: 100%; max-width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
.sa-rec-table { width: max-content; min-width: 100%; }
.sa-rec-ent {display: flex;align-items: center;gap: 2px;}

@media (max-width: 700px) { .sa-modal-ov.sa-record-ov { align-items: flex-start; padding: 8px; } .sa-modal-ov.sa-record-ov .sa-modal { width: 100%; max-width: 100%; max-height: calc(100vh - 16px); } .sa-record-ov .sa-modal__body { min-width: 0; overflow-x: hidden; } .sa-rec-grid { max-height: calc(100vh - 240px); } }
.sa-save-drawer .sa-modal__foot { padding: 12px 20px 20px; margin-top: auto; justify-content: flex-end; border-top: 1px solid var(--border, #e4e7ec); }
@media (max-width: 520px) { .sa-save-drawer .sa-modal { width: 100%; } }

/* ===== Save report drawer: layering + controls (matches reference screenshots) ===== */
.sa-save-drawer.sa-modal-ov { z-index: 10090; }               /* above the records modal (10080) */
.sa-save-drawer ~ .lp-pop { z-index: 10100; }                  /* popovers above the drawer */
.sa-save-drawer .sa-modal { width: min(480px, 100%); }
.sa-save-drawer .sa-modal__head { border-bottom: 1px solid var(--border, #e4e7ec); }
.sa-save-drawer .sa-modal__body { overflow-y: auto; flex: 1; }
.sa-save-drawer .sa-field label { font-size: 13px; font-weight: 600; }
.sa-save-drawer .sa-ta { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical;font-size: 14px;}
.sa-save-drawer .sa-modal__foot .sa-btn { gap: 6px; padding: 0 22px; border-radius: 999px; }
.sa-save-drawer .sa-btn:disabled {
    background: var(--surface-hover, #e5e9ef); color: var(--text-muted, #98a2b3);
    border-color: transparent; cursor: not-allowed;
}
.sa-save-back {
    display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 0; border: 0;
    background: none; color: var(--brand-ink, var(--brand)); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sa-combo {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px;
    padding: 4px 12px; border: 1px solid var(--border-strong, #d0d5dd); border-radius: 8px;
    background: var(--surface, #fff); color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.sa-combo:hover, .sa-combo[aria-expanded="true"] { border-color: var(--text-muted, #667085); }
.sa-combo:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sa-combo__v { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sa-combo__ph { color: var(--text-muted, #667085); }
.sa-combo .sa-i { flex: none; }
.sa-tagchip {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--brand);
    border-radius: 6px; background: var(--brand-soft, var(--surface-hover)); color: var(--brand); font-size: 12px; line-height: 20px;
}
.sa-tagchip button { padding: 0 0 0 2px; border: 0; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.sa-tagdd { min-width: 240px; }
.sa-tagdd__list { max-height: 240px; padding: 6px; overflow: auto; }
.sa-tagrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.sa-tagrow:hover { background: var(--surface-hover, #f2f4f7); }
.sa-tagdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.sa-tagdd__foot { padding: 12px 18px; border-top: 1px solid var(--border, #e4e7ec); }
.sa-tagdd__foot a { font-weight: 700; }
.sa-save-cnt { display: block; margin: 0; text-align: right; font-size: 13px; }
.sa-save-ai { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; font-size: 12.5px; }
.sa-save-gen { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text); font: 12px; cursor: pointer; }
.sa-save-fb span {font-size: 12px;}
.sa-save-gen:hover { color: var(--brand-ink, var(--brand)); }
.sa-save-fb { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sa-save-fb button { display: inline-grid; place-items: center; padding: 2px; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; }
.sa-save-fb button:hover, .sa-save-fb button.is-on { color: var(--brand-ink, var(--brand)); }
.sa-save-exist { margin: -2px 0 2px; }
.sa-selpop .sa-dd-ic { display: inline-flex; flex: none; justify-content: center; width: 24px; margin: 0; }
.sa-selpop .sa-dd-star { color: #f5a623; }


/* ==========================================================================
   Activities & leads: metric reports (Emails, Lead response time, Prospecting, Team summary),
   Lead journey funnel, Activity timeline, report tabs, Report / drill-down modal
   ========================================================================== */
.sa-rtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; border-bottom: 1px solid var(--border-strong, #d0d5dd); }
.sa-rtab { margin-bottom: -1px; padding: 12px 22px; border: 1px solid var(--border-strong, #d0d5dd); border-bottom-color: var(--border-strong, #d0d5dd); border-radius: 6px 6px 0 0; background: var(--surface-2, #f2f4f7); color: var(--text, #101828); font: inherit; font-size: 14px; cursor: pointer; }
.sa-rtab:hover { background: var(--surface-hover, #eaecf0); }
.sa-rtab.is-on { border-bottom-color: var(--surface, #fff); background: var(--surface, #fff); font-weight: 600; }
.sa-rtabs + .sa-rv__filters { margin-top: 12px; }

/* summary carousel */
.sa-sum2__grid--car { grid-template-columns: minmax(250px, 360px) minmax(0, 1fr); }
.sa-sum2__grid--one { grid-template-columns: minmax(0, 1fr); }
.sa-emc { position: relative; align-items: stretch; justify-content: space-between; gap: 8px; padding: 14px 58px; }
.sa-emc--one { padding: 24px 32px; }
.sa-emc__list { display: flex; flex: 1; flex-direction: column; justify-content: center; margin: 0; padding: 0; list-style: none; }
.sa-emc__list li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 6px; border-bottom: 1px solid var(--border, #e4e7ec); text-align: center; }
.sa-emc--one .sa-emc__list li { align-items: flex-start; border: 0; text-align: left; }
.sa-emc__list li:last-child { border-bottom: 0; }
.sa-emc__list p { margin: 0; }
.sa-emc__l { font-size: 14px; }
.sa-emc__v { padding: 0; border: 0; background: transparent; color: var(--text, #101828); font: inherit; font-size: 30px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; cursor: pointer; }
.sa-emc__v:hover, .sa-emc__v:focus-visible { color: var(--brand-ink, var(--brand)); text-decoration: underline; }
.sa-emc__nav { position: absolute; top: 50%; margin-top: -16px; }
.sa-emc__nav--l { left: 14px; } .sa-emc__nav--r { right: 14px; }
.sa-emc__nav:disabled { opacity: .4; cursor: default; }
.sa-emc__pg { align-self: center; margin: 0; color: var(--text-muted, #475467); font-size: 13px; }
.sa-ins__foot--end { margin-top: auto; padding-top: 12px; }

/* table */
.sa-emchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sa-mrt thead th { vertical-align: bottom; }
.sa-mrt__edit { margin: 4px 0 8px; font-weight: 600; }
.sa-mrwrap { overflow-x: auto; }
.sa-mrt--sticky th:first-child, .sa-mrt--sticky td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); }
.sa-mrt { min-width: 640px; }
.sa-mrt--sticky { min-width: 1500px; }
.sa-mrt__tot th, .sa-mrt__tot td { background: var(--surface-2, #eef0f3); font-weight: 700; border-top: 2px solid var(--border-strong, #d0d5dd); }
.sa-mrt .sa-num { text-align: right; white-space: nowrap; }
.sa-emth { display: inline-flex; align-items: flex-end; gap: 3px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: right; cursor: pointer; }
.sa-emth:hover { color: var(--text, #101828); }
.sa-emth__t { display: inline-block; max-width: 130px; white-space: normal; line-height: 1.3; }
.sa-emth__s { flex: none; margin-bottom: 2px; }
.sa-emn { padding: 0; border: 0; background: transparent; color: var(--brand-ink, var(--brand)); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.sa-emn:hover, .sa-emn:focus-visible { text-decoration: underline; }
.sa-emprops { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.sa-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }

/* bar chart (Totals / Over time) */
.sa-axisT { margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
.sa-mrc { padding: 0 8px 4px; }
.sa-mrc__plot { position: relative; padding-left: 130px; padding-right: 64px; }
.sa-mrc__lines { position: absolute; top: 0; bottom: 0; left: 130px; right: 64px; border-left: 1px solid var(--text, #101828); pointer-events: none; }
.sa-mrc__lines i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border, #e4e7ec); }
.sa-mrc__lines i:first-child { border-left: 0; }
.sa-mrc__row { position: relative; display: flex; align-items: center; height: 26px; }
.sa-mrc__l { position: absolute; left: -130px; width: 118px; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.sa-mrc__t { position: relative; flex: 1; height: 16px; }
.sa-mrc__t b { position: absolute; top: 0; left: 0; height: 16px; background: var(--brand-chart, var(--brand)); }
.sa-mrc__t em { position: absolute; top: 0; font-size: 11px; font-style: normal; font-weight: 700; line-height: 16px; white-space: nowrap; }
.sa-mrc__ax { position: relative; height: 22px; margin: 6px 64px 0 130px; font-size: 11px; }
.sa-mrc__ax span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sa-mrc__ax span:first-child { transform: none; }
.sa-mrc__tt { margin: 2px 0 0; text-align: center; font-size: 12px; font-weight: 600; }

/* Lead journey */
.sa-jr__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 12px 24px; }
.sa-jrk { padding: 18px 20px; }
.sa-jrk:nth-child(odd) { border-right: 1px solid var(--border, #e4e7ec); }
.sa-jrk:nth-child(-n+2) { border-bottom: 1px solid var(--border, #e4e7ec); }
.sa-jrk p { margin: 0; }
.sa-jrk__l { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 14px; }
.sa-jrk__l > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-jrk__v { margin-top: 8px; font-size: 30px; font-weight: 500; }
.sa-fn { padding: 6px 4px 10px; font-size: 13px; color: var(--text, #1d2939); }
.sa-fn__row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px 96px; column-gap: 4px; align-items: start; margin-bottom: 4px; }
.sa-fn__row--h { margin-bottom: 8px; color: var(--text-muted, #475467); align-items: center; }
.sa-fn__track { display: flex; align-items: center; min-width: 0; height: 28px; background: var(--surface-2, #eef0f3); }
.sa-fn__row--h .sa-fn__track { background: transparent; justify-content: space-between; padding-right: 4px; }
.sa-fn__sh { text-align: right; white-space: nowrap; }
.sa-fn__l { flex: 0 0 min(230px, 48%); padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 28px; }
.sa-fn__plot { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.sa-fn__bar { flex: 0 0 auto; display: flex; align-items: center; height: 100%; min-width: 5px; max-width: 100%; }
.sa-fn__num.sa-emn { color: inherit; font-weight: 600; text-decoration: none; padding: 0; background: none; border: 0; cursor: pointer; }
.sa-fn__num.sa-emn:hover { text-decoration: underline; }
.sa-fn__bar.is-in { padding-left: 8px; }
.sa-fn__bar.is-in .sa-fn__num.sa-emn { color: #fff; }
/* ribbon-shaped metric cells: flat top, V-shaped bottom */
.sa-fn__c { display: flex; align-items: center; justify-content: center; height: 32px; padding-bottom: 6px; background: var(--surface-2, #eef0f3); font-size: 13px; text-align: center; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 50% 100%, 0 calc(100% - 6px)); }
.sa-fn__row--h .sa-fn__c { background: transparent; clip-path: none; height: auto; padding: 0 2px; gap: 4px; font-weight: 500; }
.sa-fn__ht { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-jrt { min-width: 760px; }
.sa-jrt th, .sa-jrt td { border: 1px solid var(--border, #e4e7ec); padding: 10px 12px; }
.sa-jrt thead th { background: var(--surface-2, #f6f7f9); text-align: center; font-weight: 600; }
.sa-jrt tbody th { text-align: left; font-weight: 400; vertical-align: middle; background: var(--surface, #fff); }
.sa-jrt__m { border-bottom: 1px solid var(--border, #e4e7ec); }
.sa-jrf__anon, .sa-jrf__h { display: block; margin: 0 0 8px; font-size: 14px; }
.sa-jrf__h { margin-top: 20px; font-weight: 700; }
.sa-jrf__gap { height: 12px; }
.sa-jrf__acts { display: flex; gap: 8px; margin-top: 14px; }
.sa-jrf__add { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sa-seg__r { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; }
.sa-segdlg .lp-modal__body { padding-top: 8px; }

/* timeline feed */
.sa-tl { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border, #e4e7ec); }
.sa-tl__i { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 12px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--border, #e4e7ec); }
.sa-tl__av .sa-av { margin: 0; width: 28px; height: 28px; font-size: 10.5px; }
.sa-tl__b p { margin: 0 0 3px; font-size: 13px; line-height: 1.4; }
.sa-tl__d { color: var(--text-muted, #475467); }
.sa-tl__s { font-weight: 700; }
.sa-tl__p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sa-tl__go { align-self: center; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted, #475467); cursor: pointer; }
.sa-tl__go:hover { background: var(--surface-hover, #f2f4f7); color: var(--text, #101828); }
.sa-tl__pg { justify-content: center; margin-top: 14px; }
.sa-tl__dbl { margin-left: -9px; }

/* "Report" / drill-down modal */
.sa-emmodal.lp-modal { width: min(1380px, 100%); height: min(calc(100vh - 48px), 760px); max-height: none; }
.sa-emmodal .lp-modal__head { padding: 20px 24px 16px 36px; }
.sa-emmodal .lp-modal__body { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.sa-emmodal .lp-modal__foot { display: none; }
.sa-emm { display: flex; flex-direction: column; gap: 12px; height: 100%; min-width: 0; padding: 16px 36px 8px; }
.sa-emm__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sa-emm__bar .sa-fsep { align-self: stretch; margin: 2px 0; }
.sa-emm__n { font-size: 14px; }
.sa-emm__sp { flex: 1; }
.sa-emm__s { width: 240px; max-width: 100%; }
.sa-emm__tbl { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.sa-emm__scroll { flex: 1; min-height: 0; overflow: auto; }
.sa-emm__t { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.sa-emm__t thead th { position: sticky; top: 0; z-index: 1; padding: 12px 10px; border-bottom: 1px solid var(--border-strong, #d0d5dd); background: var(--surface, #fff); color: var(--text-muted, #475467); font-weight: 400; text-align: left; white-space: nowrap; }
.sa-emm__t thead th.sa-num { text-align: right; }
.sa-emm__t thead th.is-sort { background: var(--surface-2, #eef0f3); color: var(--text, #101828); }
.sa-emm__t th.sa-emm__ck, .sa-emm__t td.sa-emm__ck { width: 52px; padding-right: 0; }
.sa-emm__t td { padding: 11px 10px; border-bottom: 1px solid var(--border, #e4e7ec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-emm__t td.sa-num { text-align: right; }
.sa-emm__t tbody tr:hover, .sa-emm__t tbody tr.is-sel { background: var(--surface-hover, #f2f4f7); }
.sa-emm__none { padding: 24px 10px; }
.sa-emm__who .sa-av { vertical-align: middle; }
.sa-emm__who span:last-child { vertical-align: middle; }
.sa-emm__pg { justify-content: center; padding: 6px 0; }
.sa-emm__sel { font-size: 13px; }
.sa-emlink { max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--brand-ink, var(--brand)); font: inherit; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.sa-emlink--ext { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
button.sa-emlink:hover { text-decoration: underline; }
.sa-av { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: hsl(var(--h, 210), 40%, 85%); color: #1b2a3a; font-size: 10px; font-weight: 700; }
.sa-exh { font-size: 17px; line-height: 1.4; }

@media (max-width: 900px) {
    .sa-sum2__grid--car { grid-template-columns: 1fr; }
    .sa-emm { padding-left: 16px; padding-right: 16px; }
    .sa-emmodal .lp-modal__head { padding-left: 16px; }
    .sa-fn__row { grid-template-columns: minmax(0, 1fr) 70px 70px 70px; }
    .sa-fn__l { flex-basis: min(140px, 40%); }
}
.sa-ins__foot .sa-i, .sa-ins__foot a { display: inline-block; vertical-align: -2px; }
.sa-mrt tbody th[scope="row"], .sa-mrt tfoot th[scope="row"] { white-space: nowrap; }
.sa-sum2__grid--jr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sa-jr__kpis { min-width: 0; }
.sa-sum2__grid--one .sa-sum2__l { border-right: 0; }
.sa-jrk__v { white-space: nowrap; }
.sa-emmodal.lp-modal { min-width: 0; max-width: calc(100vw - 48px); flex: 0 1 auto; }
.sa-emmodal .lp-modal__body { min-width: 0; display: flex; flex-direction: column; }
.sa-jrf__anon { display: flex; align-items: center; gap: 6px; }
.lp-pop.lp-pop--pick.sa-selpop.sa-tagpop .lp-pop__body {width: 100%;}

/* ===== Edit columns modal (Properties | Selected columns) - self-contained, brand coloured ===== */
.sa-ec-ov { z-index: 10095; }
.sa-ec-ov .sa-modal { width: min(764px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.sa-ec-ov .sa-modal__head { padding: 22px 36px; border-bottom: 1px solid var(--border, #e4e7ec); }
.sa-ec-ov .sa-modal__head h2 { font-size: 20px; font-weight: 500; }
.sa-ec-ov .sa-modal__body { padding: 22px 36px 8px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.sa-ec-ov .sa-modal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px; padding: 18px 36px 26px; border-top: 0; }
.sa-ec-ov .sa-modal__foot .sa-btn { height: 40px; min-width: 80px; padding: 0 24px; border-radius: 999px; font-weight: 700; }
.sa-ec-ov .sa-modal__foot .sa-btn--outline { border: 1px solid var(--text-muted, #475467); background: var(--surface, #fff); color: var(--text); }
.sa-ec__clear { padding: 0 4px; border: 0; background: none; color: var(--brand-ink, var(--brand)); font: inherit; font-weight: 700; cursor: pointer; }
.sa-ec__clear:hover { text-decoration: underline; }
.sa-ec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; align-items: start; }
.sa-ec__l { padding-right: 28px; border-right: 1px solid var(--border, #e4e7ec); min-width: 0; }
.sa-ec__r { padding-left: 28px; min-width: 0; }
.sa-ec__h { margin: 0 0 14px; font-size: 20px; font-weight: 600; line-height: 1.2; }
.sa-ec__g { margin: 22px 0 8px; font-size: 16px; font-weight: 700; }
.sa-ec__s { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--text-muted, #475467); border-radius: 999px; background: var(--surface, #fff); }
.sa-ec__s:focus-within { border: 1px solid var(--brand);}
.sa-ec__s input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.sa-ec__s .sa-i { flex: none; color: var(--text-muted); }
.sa-ec__list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.sa-ec__chk { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; cursor: pointer; }
.sa-ec__chk input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.sa-ec__sel { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow: auto; }
.sa-ec__it { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--text-muted, #475467); border-radius: 8px; background: var(--surface, #fff); font-size: 14px; cursor: grab; }
.sa-ec__it:focus-visible { border: 1px solid var(--brand); }
.sa-ec__it.is-drag { opacity: .45; }
.sa-ec__it.is-over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft, rgba(0,0,0,.08)); }
.sa-ec__grip { flex: none; width: 8px; height: 16px; background-image: radial-gradient(circle, var(--text-muted, #667085) 1.1px, transparent 1.3px); background-size: 4px 4px; background-position: 0 0; }
.sa-ec__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-ec__x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--text-muted, #667085); font-size: 16px; line-height: 1; cursor: pointer; }
.sa-ec__x:hover { background: var(--surface-hover, #f2f4f7); color: var(--text); }
@media (max-width: 640px) {
  .sa-ec { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sa-ec__l { padding-right: 0; border-right: 0; padding-bottom: 20px; border-bottom: 1px solid var(--border, #e4e7ec); }
  .sa-ec__r { padding-left: 0; }
  .sa-ec-ov .sa-modal__head, .sa-ec-ov .sa-modal__body, .sa-ec-ov .sa-modal__foot { padding-left: 18px; padding-right: 18px; }
  .sa-ec__list, .sa-ec__sel { max-height: 220px; }
}

/* clickable KPI tiles (open the records modal) */
.sa-kpi--go { cursor: pointer; border-radius: 0; transition: background .12s; }
.sa-kpi--go:hover { background: var(--surface-hover, #f2f4f7); }
.sa-kpi--go:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sa-mrt__bar {
    display: flex; align-items: start; justify-content: start; gap: 2px; flex-direction: column; flex-wrap: wrap; margin-bottom: 8px; }
.sa-mrt__bar .sa-chips { margin: 0; }

/* metric-report charts: type dropdown, metric picker, svg + pie */
.sa-mrc__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.sa-mrc__tools .sa-ctbtn { margin: 0; max-width: 100%; }
.sa-ctbtn--m { max-width: 340px; }
.sa-ctbtn--m b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-svgc { width: 100%; overflow-x: auto; }
.sa-svgc svg { display: block; width: 100%; min-width: 420px; height: auto; }
.sa-svgc__g { stroke: var(--border, #e4e7ec); stroke-width: 1; }
.sa-svgc__ax { stroke: var(--text, #101828); stroke-width: 1; }
.sa-svgc__t { fill: var(--text-muted, #475467); font-size: 11px; }
.sa-mrpie { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 8px 8px 4px; }
.sa-mrpie svg { flex: 0 0 auto; width: min(280px, 100%); height: auto; }
.sa-mrpie__l { flex: 1 1 260px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sa-mrpie__l li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.sa-mrpie__l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-mrpie__l em { min-width: 48px; text-align: right; font-style: normal; color: var(--text-muted); }

/* journey KPIs: never push the page wider than the viewport */
.sa-jr__kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sa-jrk { min-width: 0; }
.sa-jrk__v { overflow: hidden; text-overflow: ellipsis; }

.sa-set2__adv.data-quality[open] summary::after {
    transform: rotate(90deg) !important;
}
.sa-set2__adv.data-quality summary {
    cursor: no-drop;
    opacity: 0.5;
}
.sa-adv.sa-adv-data-quality {display: none !important;}



@media (max-width: 700px) {
  .sa-sum2__grid--jr { grid-template-columns: minmax(0, 1fr); }
  .sa-jr__kpis { padding: 8px 12px; }
  .sa-jrk { padding: 12px; }
  .sa-jrk__v { font-size: 24px; }
}

/* Lead journey settings panel */
.sa-jrset__reset:disabled { color: var(--text-muted, #667085); cursor: default; text-decoration: none; opacity: .75; }
.sa-jrset .sa-btn--pill { border-radius: 999px; }
.sa-check--dis { color: var(--text-muted, #98a2b3); cursor: not-allowed; padding: 2px 0; }
.sa-jrset__sw { gap: 14px; }
.sa-jrset__sw .ep-switch { width: 100%; }
.sa-sum2__grid--one { grid-template-columns: minmax(0, 1fr); }
.sa-sum2__r .sa-muted.sa-ins__foot {margin: auto 0 0 0 !important;}

/* ---- Deals reports: True / False quick filter, removable quick filters in More, KPI / gauge views, displayed property row */
.sa-boolf { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.sa-boolf__row { display: flex; align-items: center; gap: 12px; }
.sa-boolf__l { font-weight: 600; white-space: nowrap; }
.sa-seg--sm button { min-width: 64px; height: 34px; padding: 0 14px; }
.sa-boolf__u { margin: 0; }
.sa-moreit__w { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.sa-moreit__w.has-x { background: var(--surface-hover, #f2f4f7); }
.sa-moreit__w .sa-moreit { flex: 1; }
.sa-moreit__x { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; }
.sa-moreit__x:hover { background: var(--surface-2, #e4e7ec); color: var(--text); }
.sa-mrkpi, .sa-mrgauge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.sa-mrkpi__l { margin: 0; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.sa-mrkpi__v { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.2; }
.sa-mrgauge svg { width: min(320px, 100%); height: auto; }
.sa-dprop2 { display: flex; align-items: center; gap: 8px; }
.sa-dprop2 .sa-dprop { flex: 1;width: calc(100% - 34px);}

/* ---- Property picker (Advanced filters > Add filter, Add a quick filter): reference sizes and field-type marks */
.sa-ppop .lp-pop__body { width: 400px; }
.sa-pp { gap: 14px; }
.sa-pp .lp-search input { height: 44px; font-size: 15px; }
.sa-pp__tools { align-items: center; padding: 0 2px; }
.sa-pp__tools .lp-link { gap: 8px; padding: 2px 0; font-size: 15px; font-weight: 500; text-decoration: none; }
.sa-pp__tools .lp-link:hover span { text-decoration: underline; }
.sa-pp__ic { width: 20px; height: 20px; flex: none; fill: none; }
.sa-pp__tri { width: 9px; height: 6px; flex: none; }
.sa-pp__list { max-height: 520px; padding-bottom: 10px; }
.sa-pp .lp-propdd__gh { padding: 12px 16px 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.sa-pp .sa-prow { gap: 12px; min-height: 40px; padding: 8px 14px 8px 22px; font-size: 15px; }
.sa-ptype { display: inline-grid; place-items: center; width: 24px; height: 20px; flex: none; color: var(--text-muted); }
.sa-ptype svg { width: 20px; height: 20px; }
.sa-ptype b { font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.sa-infocard .sa-ptype { vertical-align: middle; margin-right: 2px; }
.sa-multi .sa-multi__list .lp-cb, .sa-multi input[type=checkbox] { width: 20px; height: 20px; border-radius: 6px; }
:where(.sa, .sa-layer) .a.lp-menu__item { display: flex; align-items: center; width: 100%; color: inherit; text-decoration: none; box-sizing: border-box; }
:where(.sa, .sa-layer) :disabled {cursor: not-allowed !important;}


/*.lp-pop.lp-pop--panel.sa-ppop.is-open {width: 320px;max-width: 320px;top: auto;bottom: -8px;}*/
/*.lp-pop.lp-pop--panel.sa-ppop.is-open,*/
/*.lp-pop.lp-pop--panel.sa-ppop.is-open .lp-pop__body {max-height: 340px !important;}*/
/*.lp-pop.lp-pop--panel.sa-ppop.is-open .sa-pp__list {max-height: 280px;}*/

/* ---- Add a quick filter popover: compact size, opens just under the + button */
.sa-ppop--qf .lp-pop__body { width: 320px; max-height: 390px; display: flex; flex-direction: column; overflow: hidden; }
.sa-ppop--qf .sa-pp { flex: 1 1 auto; min-height: 0; gap: 12px; }
.sa-ppop--qf .sa-pp__list { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }


/* Deal loss reasons: summary comparison, stacked chart (matches the HubSpot report) */
:where(.sa, .sa-layer) { --sa-stk1: #00525a; --sa-stk2: #8ccdd3; }
.sa-emc--cmp { flex-direction: column; align-items: stretch; padding: 16px 20px 20px; gap: 14px; }
.sa-emc--cmp .sa-emc__list { flex-direction: row; align-items: stretch; justify-content: flex-start; }
.sa-emc--cmp .sa-emc__list li { flex: 1 1 0; align-items: flex-start; gap: 4px; padding: 10px 20px; border-bottom: 0; border-right: 1px solid var(--border, #e4e7ec); text-align: left; }
.sa-emc--cmp .sa-emc__list li:first-child { padding-left: 4px; }
.sa-emc--cmp .sa-emc__list li:last-child { border-right: 0; }
.sa-emc--cmp .sa-emc__list .sa-delta { margin: 0; font-size: 12px; font-weight: 500; color: var(--text-muted, #475467); }
.sa-emc--cmp .sa-emc__list .sa-delta--flat .sa-i { width: 10px; height: 10px; color: var(--text-muted, #475467); }
.sa-emc--cmp .sa-emchips { margin-bottom: 0; }
.sa-mrc__seg { position: absolute; top: 0; height: 16px; }


/* Deal pipeline waterfall: chart colours come from the theme (--brand / --panel-accent) */
.sa { --sa-wf-total: var(--brand, #00525a); --sa-wf-up: var(--panel-accent, #8ccdd3); --sa-wf-dn: #e5484d; }
.sa-wf--total { fill: var(--sa-wf-total); }
.sa-wf--up { fill: var(--sa-wf-up); }
.sa-wf--dn { fill: var(--sa-wf-dn); }
.sa-wf__con { stroke: var(--text-muted, #475467); stroke-width: 1; stroke-dasharray: 1.5 3; }
.sa-wfsum { display: grid; grid-template-columns: 1fr 1fr; padding: 22px 20px 26px; text-align: center; }
.sa-wfk__l { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sa-wfk__v { margin: 0; font-size: 30px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .sa-wfsum { grid-template-columns: 1fr; gap: 18px; } }


/* Deal velocity: side-by-side (grouped) bars per owner */
.sa-mrc__row--grp { height: 48px; }
.sa-mrc__row--grp .sa-mrc__t { height: 40px; }
.sa-mrc__row--grp .sa-mrc__seg { height: 18px; }
.sa-mrc__row--grp .sa-mrc__t em { height: 18px; line-height: 18px; }


/* Time spent in deal stage: "problem building your report" state */
.sa-err { display: flex; flex-direction: column; gap: 8px; margin: auto 0; padding: 22px 24px; text-align: center; }
.sa-err__t { margin: 0; font-size: 15px; font-weight: 600; }
.sa-err__s { margin: 0; font-size: 14.5px; line-height: 1.5; }


/* ------------------------------------------------------------------ Deals tabs: responsive fixes */
.sa-mrc { max-width: 100%; box-sizing: border-box; }
.sa-mrc__row { min-width: 0; }
.sa-svgc svg[aria-label="Deal pipeline waterfall chart"] { min-width: 760px; }   /* 7 labelled columns need room; the chart scrolls inside its own box */
.sa-svgc svg[viewBox^="0 0 720"] { min-width: 560px; }
.sa-mrc__tools .sa-ctbtn--m { max-width: min(340px, 100%); }
.sa-mrt__bar { width: 100%; }


/* axis with many ticks (small counts use quarter steps): drop every other label before they collide */
@media (max-width: 1300px) { .sa-ax-alt { display: none; } }

@media (max-width: 900px) {
    .sa-mrc { padding: 0 4px 4px; }
    .sa-mrc__plot { padding-left: 104px; padding-right: 48px; }
    .sa-mrc__lines { left: 104px; right: 48px; }
    .sa-mrc__l { left: -104px; width: 94px; font-size: 11px; }
    .sa-mrc__ax { margin: 6px 48px 0 104px; }
    .sa-emc { padding: 14px 52px; }
    .sa-emc--cmp { padding: 14px 16px 18px; }
    .sa-ec-ov .sa-modal { width: calc(100vw - 16px); }
}

@media (max-width: 700px) {
    .sa-mrc__plot { padding-left: 84px; padding-right: 40px; }
    .sa-mrc__lines { left: 84px; right: 40px; }
    .sa-mrc__l { left: -84px; width: 76px; font-size: 10.5px; }
    .sa-mrc__ax { margin: 6px 40px 0 84px; }
    .sa-mrc__ax span:nth-child(even) { display: none; }
    .sa-mrc__t em { font-size: 10.5px; }
    .sa-emc--cmp .sa-emc__list { flex-direction: column; }
    .sa-emc--cmp .sa-emc__list li, .sa-emc--cmp .sa-emc__list li:first-child { padding: 10px 4px; border-right: 0; border-bottom: 1px solid var(--border, #e4e7ec); }
    .sa-emc--cmp .sa-emc__list li:last-child { border-bottom: 0; }
    .sa-emc--one { padding: 18px 16px; }
    .sa-emc__v { font-size: 24px; }
    .sa-mrt { min-width: 560px; }
    .sa-emth__t { max-width: 96px; }
    .sa-mrpie { justify-content: center; }
    .sa-mrkpi, .sa-mrgauge { padding: 20px 8px; }
    .sa-mrkpi__v { font-size: 28px; }
    .sa-wfk__v { font-size: 24px; }
    .sa-err { padding: 16px 8px; }
    .sa-pager2 { gap: 4px; }
}

@media (max-width: 639px) {
    .lp-search.lp-search--pill.lp-search--sm.sa-emm__s {flex: unset;}
}
@media (max-width: 480px) {
    .sa-mrc__plot { padding-left: 72px; padding-right: 34px; }
    .sa-mrc__lines { left: 72px; right: 34px; }
    .sa-mrc__l { left: -72px; width: 66px; }
    .sa-mrc__ax { margin: 6px 34px 0 72px; }
    .sa-mrc__ax span:not(:nth-child(3n+1)) { display: none; }
    .sa-emc { padding: 14px 40px; }
    .sa-emc__nav--l { left: 6px; }
    .sa-emc__nav--r { right: 6px; }
    .sa-mrc__tools { gap: 6px; }
    .sa-mrc__tools .sa-ctbtn { flex: 1 1 100%; }
}

/* Deal journey progress: Sankey flow chart */
.sa-flow { padding: 8px 4px 4px; }
.sa-flow .sa-svgc svg { width: 100%; height: auto; display: block; }
.sa-flow__lk { fill-opacity: .5; cursor: pointer; transition: fill-opacity .15s ease; }
.sa-flow__lk:hover, .sa-flow__lk:focus-visible { fill-opacity: .75; outline: none; }
.sa-flow__p { pointer-events: none; opacity: .55; }
.sa-flow__n { cursor: pointer; }
.sa-flow__n:focus-visible { outline: 2px solid var(--brand, #2563eb); outline-offset: 2px; }
.sa-flow__v { fill: var(--text, #1d2939); font-size: 15px; font-weight: 700; paint-order: stroke; stroke: var(--surface, #fff); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.sa-flow .sa-flow__x { fill: var(--text, #1d2939); font-size: 15px; }

/* Forecasts & sales: "N deals / $amount" cells, quota marker, Revenue (Beta) empty state */
.sa-cnt { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.35; text-decoration: none; }
.sa-cnt:hover .sa-cnt__n, .sa-cnt:focus-visible .sa-cnt__n { text-decoration: underline; }
.sa-cnt__n { font-weight: 600; white-space: nowrap; }
.sa-cnt__a { color: var(--text, #1d2939); font-weight: 400; white-space: nowrap; }
.sa-mrc__q { position: absolute; top: -3px; width: 2px; height: 22px; margin-left: -1px; background: var(--text, #1d2939); border-radius: 1px; z-index: 1; }
.sa-leg2__line { display: inline-block; width: 16px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--text, #1d2939); }
.sa-tree__rep .sa-tree__beta { margin-left: 8px; padding: 1px 8px; font-size: 11px; vertical-align: 1px; }
.sa-rev { padding: 4px 0 32px; }
.sa-rev__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 40px; }
.sa-rev__head .sa-h1 { display: flex; align-items: center; gap: 10px; margin: 0; }
.sa-rev__empty { display: flex; align-items: center; justify-content: center; gap: 48px; flex-wrap: wrap; padding: 24px 16px; }
.sa-rev__txt { max-width: 420px; }
.sa-rev__t { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--text, #1d2939); }
.sa-rev__txt p { margin: 0 0 18px; color: var(--text-muted, #475467); line-height: 1.5; }
.sa-rev__txt .sa-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.sa-rev__art { width: 200px; height: auto; flex: 0 0 auto; }
/* compared KPIs in a row: long amounts shrink instead of overlapping */
.sa-emc--cmp .sa-emc__list li { min-width: 0; }
.sa-emc--cmp .sa-emc__l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-emc--cmp .sa-emc__v { max-width: 100%; font-size: clamp(16px, 1.45vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
/* KPIs on top, AI summary underneath (reports with many compared amounts) */
.sa-sum2__grid--stack { grid-template-columns: minmax(0, 1fr) !important; }
.sa-sum2__grid--stack > * + * { border-left: 0 !important; border-top: 1px solid var(--border, #e4e7ec); }

/* HubSpot template summary: one KPI, no AI panel */
.sa-psum { padding: 28px 40px 36px; }
.sa-psum__l { margin: 0 0 16px; font-size: 14px; color: var(--text, #1d2939); }
.sa-psum__v { padding: 0; border: 0; background: transparent; color: var(--text, #101828); font: inherit; font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; cursor: pointer; }
.sa-psum__v:hover, .sa-psum__v:focus-visible { color: var(--brand-ink, var(--brand)); text-decoration: underline; }
.sa-psum__v { display: block; }
.sa-psum--c .sa-psum__v { margin: 0 auto; }
.sa-psum .sa-delta { display: flex; margin: 4px 0 0; }
.sa-psum--c { padding: 22px 24px 26px; text-align: center; }
.sa-psum--c .sa-psum__l { margin-bottom: 4px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.sa-psum--c .sa-delta { justify-content: center; }
/* paged chart legend */
.sa-leg2__pg { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; white-space: nowrap; }
.sa-leg2__pg button { padding: 0 3px; border: 0; background: transparent; color: var(--text, #1d2939); font: inherit; font-weight: 700; cursor: pointer; }
.sa-leg2__pg button:disabled { opacity: .35; cursor: default; }

/* Over time: vertical columns by month */
.sa-vcol__v { fill: var(--text, #1d2939); font-size: 12px; font-weight: 700; }
.sa-vcol__x { font-size: 12px; fill: var(--text, #1d2939); }
.sa-vcol__q { stroke: var(--text, #1d2939); stroke-width: 2.5; }
.sa-vcol:focus-visible { outline: 2px solid var(--brand, #2563eb); outline-offset: 2px; }
.sa-cnt--s { cursor: default; }
.sa-cnt--s .sa-cnt__n { color: var(--brand-ink, var(--brand)); }

/* Settings panel: section spacing for the rebuilt Deals / Forecasts & sales settings.
   Hooks for designers - panel: .sa-set--<reportId> .sa-set--<report-name> .sa-set--grp-<activities|deals|forecasts> .sa-set--type-<jr|mr|tl|std>
   sections: .sa-set2__sec--ctype --props --dprop --dim --stages --sort --toggles ; accordions: .sa-set2__adv--settings --adv --about --dq
   e.g.  .sa-set--grp-forecasts .sa-set2__sec--props { display: none; } */
.sa-set2__adv--adv > .sa-adv { display: flex; flex-direction: column; gap: 6px; }
.sa-set2__fld .lp-select + .lp-select { margin-top: 8px; }
.sa-set2__sec--toggles .sa-adv { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.sa-set2__sw .sa-i--sm { vertical-align: -2px; margin-left: 4px; }

/* Blue chart palette for every report chart (series, stacks, Sankey, funnel).
   Change the --sa-b* values to retheme all charts at once. */
.sa, [data-theme="dark"] .sa {
    --sa-b1: var(--brand, #2563eb); --sa-b2: #93c5fd; --sa-b3: #1e3a8a; --sa-b4: #60a5fa; --sa-b5: #1d4ed8;
    --sa-b6: #bfdbfe; --sa-b7: #3b82f6; --sa-b8: #172554; --sa-b9: #7dd3fc; --sa-b10: #0369a1;
    --sa-s1: var(--sa-b1); --sa-s2: var(--sa-b2); --sa-s3: var(--sa-b3); --sa-s4: var(--sa-b4);
    --sa-s5: var(--sa-b5); --sa-s6: var(--sa-b6); --sa-s7: var(--sa-b7); --sa-s8: var(--sa-b8);
    --sa-stk1: var(--sa-b1); --sa-stk2: var(--sa-b2);
}
[data-theme="dark"] .sa { --sa-b3: #4f74e3; --sa-b8: #a5b8f5; --sa-b6: #dbeafe; --sa-b10: #38bdf8; }

.sa-set.sa-rv__set {
    padding: 0 !important;
    border: none !important;
    border-left: 1px solid var(--border-strong, #d0d5dd) !important;
}
.sa-set2__sec.sa-set2__sec--toggles .sa-adv {padding: 0 !important;}
:where(.sa, .sa-layer) .ep-switch span.crm-flex-grow-1 {display: flex;justify-content: left;align-items: center;gap: 2px;}
.sa-sum2__grid.sa-sum2__grid--stack {grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;}
.sa-main.sa-main-div .sa-rev {padding: 20px 16px 24px 16px;}
.sa-main.sa-main-div .sa-rev .sa-rev__head button.sa-btn.sa-btn--outline:disabled {opacity: 0.5;}

@media (max-width: 1300px) {
    .sa-sum2__grid.sa-sum2__grid--stack {grid-template-columns: minmax(0, 1fr) !important;}
}



/* ---- Invoice tabs (Aging summary, Balance due, Billed vs. actual revenue, Invoice status): range popover + filters drawer */
.sa-rangepop .lp-pop__body { padding: 16px; min-width: 300px; }
.sa-rangep { display: flex; flex-direction: column; gap: 14px; }
.sa-rangep__sel.lp-select { width: 100%; border-radius: 999px; justify-content: space-between; }
.sa-rangep__chk { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.sa-rangep__chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand, #0b6e75); }

.sa-pillc {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 6px 6px 12px; border-radius: 16px; min-height: 32px;
    background: var(--surface-2, #eef0f3); font-size: 14px; line-height: 1.3; cursor: pointer;
}
.sa-pillc:hover { background: color-mix(in srgb, var(--surface-2, #eef0f3) 85%, #000); }
.sa-pillc.is-bad { border: 1px solid var(--danger, #c01048); }
.sa-pillc--view { cursor: default; padding-right: 12px; }
.sa-pillc--view:hover { background: var(--surface-2, #eef0f3); }
.sa-advg--view .lp-adv__and { margin: 8px 0; }
.sa-or--view { margin: 4px 0 4px 20px; }
.sa-vchip {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin-right: 4px;
    border: 1px solid var(--border, #cbd6e2); border-radius: 6px; background: var(--surface-2, #eef0f3); font-size: 13px;
}
.sa-vchip i { font-style: normal; opacity: .6; }
