/* Shell polish: faster paint and fluid resize. IDs and controls stay the same. */

html {
    height: 100%;
}

html, body.appbody {
    margin: 0;
    height: 100%;
    min-height: 100%;
    overflow-x: hidden;
    background-image: none;
    -webkit-transform: none;
    transform: none;
}

body.appbody {
    /* Shared vertical density (~20–30% tighter than prior polish) */
    --crm-v-pad: 2px;
    --crm-v-gap: 3px;
    --crm-section-pad: 6px;
    --crm-row-gap: 4px;
    --crm-toolbar-min-h: 34px;
    --crm-control-h: 30px;
    padding: 1px 6px 2px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

#search {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

#search > tbody {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
}

#search > tbody > tr {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
}

#spleft,
#spright {
    min-width: 0;
    vertical-align: top;
    overflow: hidden;
}

#spleft {
    width: min(520px, 42vw);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#spright {
    flex: 1 1 auto;
    width: auto;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#crm-left-top,
#crm-left-bottom {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

#crm-left-top {
    flex: 1 1 48%;
    min-height: 140px;
}

#crm-left-bottom {
    flex: 1 1 auto;
    min-height: 120px;
}

.crm-split {
    flex: 0 0 6px;
    background: darkgray;
}

.crm-split-v,
#vsplit {
    cursor: col-resize;
    /* same painted size as .crm-split-h; zero td padding so it does not look thicker */
    width: 6px;
    min-width: 6px;
    max-width: 6px;
    height: 100%;
    padding: 0 !important;
    border: 0 !important;
    margin: 0;
    box-sizing: border-box;
}

.crm-split-h {
    cursor: row-resize;
    height: 6px;
    min-height: 6px;
    width: 100%;
    margin: 1px 0;
}

.crm-split:hover,
body.crm-col-resizing .crm-split-v,
body.crm-row-resizing .crm-split-h {
    background: gray;
}

body.crm-col-resizing,
body.crm-col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

body.crm-row-resizing,
body.crm-row-resizing * {
    cursor: row-resize !important;
    user-select: none !important;
}

#dashcontainer {
    margin-left: 0;
    margin-top: 0;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#dashboard,
#dashboardheader,
#searchrows,
#searchcontrols,
#results,
#resultsfooter,
#listsheader,
#listsfooter,
#tablist,
.dashboardcontent {
    max-width: 100%;
    box-sizing: border-box;
}

#dashboard {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    contain: layout;
    margin-top: 0;
    padding-top: 0;
    box-sizing: border-box;
}

#searchrows {
    flex: 0 1 auto;
    max-height: 22vh;
    overflow-y: auto;
    min-height: 0;
}

#results {
    flex: 1 1 auto !important;
    max-height: none !important;
    min-height: 48px;
    height: auto;
    overflow-y: auto;
    align-self: stretch;
}

#tablist {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#liststabs {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    max-height: 100%;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

#liststabs .ui-tabs-nav {
    flex: 0 0 auto;
}

#liststabs .ui-tabs-panel,
.tabspage {
    flex: 1 1 auto;
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    margin-top: 0 !important;
    padding-top: 2px !important;
}

#spright .ui-tabs .ui-tabs-nav,
#spright .dashboardcontent > .ui-tabs-nav {
    margin: 0 0 5px 0 !important;
}

/* Dashboard tab strip (RECORD display only): keep labels prominent without
   default bold. Exclude object Configure pane (.configuretabpage) and
   configure dialogs — those share .dashboardcontent/.ui-tabs-nav and were
   picking up 15px/500, stacking/overlapping tab + "Object:" header text. */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)).ui-tabs .ui-tabs-nav > li > a.ui-tabs-anchor,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)).ui-tabs .ui-tabs-nav > li > a.ui-tabs-anchor,
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-nav > li > a,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-nav > li > a,
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-nav > li > .ui-tabs-anchor,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-nav > li > .ui-tabs-anchor {
    font-size: 15px !important;
    font-weight: 500 !important;
}

#spright .ui-tabs .ui-tabs-panel,
#spright .dashboardcontent .ui-tabs-panel,
#spright #tabs-view {
    margin: 5px 0 0 0 !important;
    padding: 4px 6px 0 6px !important;
}

#spright .ui-tabs .ui-tabs-panel > .dashitemline:first-child,
#spright .ui-tabs .ui-tabs-panel > .dashitemhalfline:first-child,
#spright .ui-tabs .ui-tabs-panel > .dashitemthirdline:first-child,
#spright .dashboardcontent .ui-tabs-panel > .dashitemline:first-child,
#spright .dashboardcontent .ui-tabs-panel > .dashitemhalfline:first-child,
#spright .dashboardcontent .ui-tabs-panel > .dashitemthirdline:first-child {
    margin-top: 2px !important;
}

#spright .dashboardcontent {
    margin: 0;
    padding: var(--crm-section-pad, 6px) !important;
    box-sizing: border-box;
}

#spright .dashitemline,
#spright .dashitemhalfline,
#spright .dashitemthirdline {
    margin: 0 0 var(--crm-row-gap, 4px) 0 !important;
    padding: 0;
    box-sizing: border-box;
}

/* Panel: wrap full + half + third rows. Each row is itself a flex line so the
   control fills to the row's right edge (69% left a ~2px miss vs titles).
   RECORD panes only — never Configure (.configuretabpage / .objectconfigure).
   Unscoped flex-wrap made Data tab (Object/Visible/Plural/Icon/wrenches) stack. */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure) .ui-tabs-panel,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure) .ui-tabs-panel,
#spright .dashboardcontent:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-panel,
#dashboard .dashboardcontent:not(.objectconfigure):not(:has(.configuretabpage)) .ui-tabs-panel,
#spright .ui-tabs .ui-tabs-panel:not(.configuretabpage),
#dashboard .ui-tabs .ui-tabs-panel:not(.configuretabpage),
#spright #tabs-view {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    column-gap: 12px; /* middle gutter between left/right half fields */
    row-gap: 0;
}
#spright .dashitemline,
#dashboard .dashitemline {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: var(--crm-row-align, flex-start);
    gap: 8px; /* label/control breathing room */
}
/* Full-width restore: when format.halfline/thirdline cleared, row must be
   .dashitemline only. If a stale half/third class remains, prefer full-width
   so the field stays visible/editable (half/third rules above would otherwise
   win on equal specificity by source order). */
#spright .dashitemline:not(.dashitemhalfline):not(.dashitemthirdline),
#dashboard .dashitemline:not(.dashitemhalfline):not(.dashitemthirdline) {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    min-height: var(--crm-control-h, 26px);
}
#spright .dashitemhalfline,
#dashboard .dashitemhalfline {
    /* 50% minus half the column-gap so a pair + gutter still fills the row */
    flex: 0 0 calc(50% - 6px);
    width: calc(50% - 6px);
    max-width: calc(50% - 6px);
    display: flex;
    flex-wrap: nowrap;
    align-items: var(--crm-row-align, flex-start);
    gap: 8px;
}
#spright .dashitemthirdline,
#dashboard .dashitemthirdline {
    /* 33.333% minus (12px gutter * 2 / 3) so three + gutters fill the row */
    flex: 0 0 calc(33.333% - 8px);
    width: calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
    display: flex;
    flex-wrap: nowrap;
    align-items: var(--crm-row-align, flex-start);
    gap: 8px;
}
#spright .dashitemtitle,
#dashboard .dashitemtitle {
    flex: 0 0 40%;
    width: 40%;
    max-width: 40%;
    min-width: 0;
    box-sizing: border-box;
    padding-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Opt-in format.captionwidth presets (20 / 30 / 40 default / 50). Ignored when snug. */
#spright .dash-caption-w20 > .dashitemtitle,
#dashboard .dash-caption-w20 > .dashitemtitle {
    flex: 0 0 20%;
    width: 20%;
    max-width: 20%;
}
#spright .dash-caption-w30 > .dashitemtitle,
#dashboard .dash-caption-w30 > .dashitemtitle {
    flex: 0 0 30%;
    width: 30%;
    max-width: 30%;
}
#spright .dash-caption-w40 > .dashitemtitle,
#dashboard .dash-caption-w40 > .dashitemtitle {
    flex: 0 0 40%;
    width: 40%;
    max-width: 40%;
}
#spright .dash-caption-w50 > .dashitemtitle,
#dashboard .dash-caption-w50 > .dashitemtitle {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
}
/* Opt-in format.snugtocaption / snug: title hugs caption; control fills rest.
   Row already has gap:8px. Snug overrides/ignores caption width. Default
   (non-snug) fields keep the 40% title column above. */
#spright .dash-snug > .dashitemtitle,
#dashboard .dash-snug > .dashitemtitle {
    flex: 0 1 auto;
    width: auto;
    max-width: 45%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Text, date, and combo/dropdown controls all fill the row the same way */
#spright .dashinputitem,
#dashboard .dashinputitem,
#spright .dashitemcombo,
#dashboard .dashitemcombo,
#spright .dashitemdropdown,
#dashboard .dashitemdropdown,
#spright select.dashitemcombo,
#dashboard select.dashitemcombo {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}
#spright .dashitemcombo,
#dashboard .dashitemcombo,
#spright .dashitemdropdown,
#dashboard .dashitemdropdown {
    display: inline-flex !important;
    align-items: var(--crm-valign, center);
    height: var(--crm-control-h, 30px) !important;
    min-height: var(--crm-control-h, 30px) !important;
    line-height: calc(var(--crm-control-h, 30px) - 2px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

/* Date/datetime (xdsoft) inputs are <input class="dashinputitem">; htextarea
   sizes textareas via nlines floor (~30px) but inputs had no floor and looked short. */
#spright input.dashinputitem,
#dashboard input.dashinputitem {
    height: var(--crm-control-h, 30px) !important;
    min-height: var(--crm-control-h, 30px) !important;
    line-height: calc(var(--crm-control-h, 30px) - 2px) !important;
    box-sizing: border-box;
    vertical-align: middle;
    padding-top: 0;
    padding-bottom: 0;
}

/* LOCAL MOCK (uncommitted): denser Stats dash rows — ONE shared size for RO + RW.
   Match General datachart RH legend: system-ui/-apple-system/Segoe UI 13px +
   tabular-nums; control height ~26px. Same title font,
   control font, height, padding, border box whether .dashreadonly or .dashreadwrite.
   Half/third-lines always; full-width single-line (not multi-line memos). */
#spright .dashitemhalfline,
#spright .dashitemthirdline,
#dashboard .dashitemhalfline,
#dashboard .dashitemthirdline,
#spright .dashitemline.crm-dash-oneline,
#dashboard .dashitemline.crm-dash-oneline,
#spright .dashitemline:has(> input.dashinputitem),
#dashboard .dashitemline:has(> input.dashinputitem),
#spright .dashitemline:has(> .dashitemcombo),
#dashboard .dashitemline:has(> .dashitemcombo),
#spright .dashitemline:has(> .dashitemdropdown),
#dashboard .dashitemline:has(> .dashitemdropdown),
#spright .dashitemline:has(> select.dashitemcombo),
#dashboard .dashitemline:has(> select.dashitemcombo),
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]),
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]),
#spright .dashitemline:has(> textarea.dashinputitem:not([data-nlines])),
#dashboard .dashitemline:has(> textarea.dashinputitem:not([data-nlines])),
#spright .dashitemline:has(> .dashmetricvalue),
#dashboard .dashitemline:has(> .dashmetricvalue),
#spright .dashitemhalfline:has(> .dashmetricvalue),
#spright .dashitemthirdline:has(> .dashmetricvalue),
#dashboard .dashitemhalfline:has(> .dashmetricvalue),
#dashboard .dashitemthirdline:has(> .dashmetricvalue),
#spright .crm-dash-metric,
#dashboard .crm-dash-metric {
    --crm-control-h: 26px;
    --crm-row-gap: 2px;
    --crm-dash-fs: 13px; /* shared title + control font */
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    font-variant-numeric: tabular-nums;
    margin-bottom: var(--crm-row-gap, 2px) !important;
    line-height: var(--crm-control-h, 26px);
    align-items: var(--crm-row-align, center);
}

/* Titles: identical on every denser row (RO and RW share the same parent rules) */
#spright .dashitemhalfline .dashitemtitle,
#spright .dashitemthirdline .dashitemtitle,
#dashboard .dashitemhalfline .dashitemtitle,
#dashboard .dashitemthirdline .dashitemtitle,
#spright .dashitemline:has(> input.dashinputitem) > .dashitemtitle,
#dashboard .dashitemline:has(> input.dashinputitem) > .dashitemtitle,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemtitle,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemtitle,
#spright .dashitemline:has(> .dashitemdropdown) > .dashitemtitle,
#dashboard .dashitemline:has(> .dashitemdropdown) > .dashitemtitle,
#spright .dashitemline:has(> select.dashitemcombo) > .dashitemtitle,
#dashboard .dashitemline:has(> select.dashitemcombo) > .dashitemtitle,
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > .dashitemtitle,
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > .dashitemtitle,
#spright .dashitemline:has(> textarea.dashinputitem:not([data-nlines])) > .dashitemtitle,
#dashboard .dashitemline:has(> textarea.dashinputitem:not([data-nlines])) > .dashitemtitle,
#spright .dashitemline:has(> .dashmetricvalue) > .dashitemtitle,
#dashboard .dashitemline:has(> .dashmetricvalue) > .dashitemtitle,
#spright .crm-dash-metric > .dashitemtitle,
#dashboard .crm-dash-metric > .dashitemtitle {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: var(--crm-control-h, 26px) !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Controls: .dashinputitem covers RO + RW; also list input/textarea/combo explicitly.
   Same font/height/padding/border — transparent RO bg must not change box size. */
#spright .dashitemhalfline .dashinputitem:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemthirdline .dashinputitem:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemhalfline .dashinputitem:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemthirdline .dashinputitem:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemhalfline input.dashinputitem,
#spright .dashitemthirdline input.dashinputitem,
#dashboard .dashitemhalfline input.dashinputitem,
#dashboard .dashitemthirdline input.dashinputitem,
#spright .dashitemhalfline textarea.dashinputitem[data-nlines="1"],
#spright .dashitemthirdline textarea.dashinputitem[data-nlines="1"],
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines="1"],
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines="1"],
#spright .dashitemhalfline textarea.dashinputitem:not([data-nlines]),
#spright .dashitemthirdline textarea.dashinputitem:not([data-nlines]),
#dashboard .dashitemhalfline textarea.dashinputitem:not([data-nlines]),
#dashboard .dashitemthirdline textarea.dashinputitem:not([data-nlines]),
#spright .dashitemhalfline .dashitemcombo,
#spright .dashitemthirdline .dashitemcombo,
#dashboard .dashitemhalfline .dashitemcombo,
#dashboard .dashitemthirdline .dashitemcombo,
#spright .dashitemhalfline .dashitemdropdown,
#spright .dashitemthirdline .dashitemdropdown,
#dashboard .dashitemhalfline .dashitemdropdown,
#dashboard .dashitemthirdline .dashitemdropdown,
#spright .dashitemhalfline select.dashitemcombo,
#spright .dashitemthirdline select.dashitemcombo,
#dashboard .dashitemhalfline select.dashitemcombo,
#dashboard .dashitemthirdline select.dashitemcombo,
#spright .dashitemline:has(> input.dashinputitem) > input.dashinputitem,
#dashboard .dashitemline:has(> input.dashinputitem) > input.dashinputitem,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo,
#spright .dashitemline:has(> .dashitemdropdown) > .dashitemdropdown,
#dashboard .dashitemline:has(> .dashitemdropdown) > .dashitemdropdown,
#spright .dashitemline:has(> select.dashitemcombo) > select.dashitemcombo,
#dashboard .dashitemline:has(> select.dashitemcombo) > select.dashitemcombo,
#spright .dashitemline textarea.dashinputitem[data-nlines="1"],
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"],
#spright .dashitemline textarea.dashinputitem:not([data-nlines]),
#dashboard .dashitemline textarea.dashinputitem:not([data-nlines]),
#spright .dashitemhalfline .dashinputitem.dashreadonly:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemthirdline .dashinputitem.dashreadonly:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemhalfline .dashinputitem.dashreadonly:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemthirdline .dashinputitem.dashreadonly:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemhalfline .dashinputitem.dashreadwrite:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemthirdline .dashinputitem.dashreadwrite:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemhalfline .dashinputitem.dashreadwrite:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemthirdline .dashinputitem.dashreadwrite:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemline:has(> input.dashinputitem) > .dashinputitem.dashreadonly,
#dashboard .dashitemline:has(> input.dashinputitem) > .dashinputitem.dashreadonly,
#spright .dashitemline:has(> input.dashinputitem) > .dashinputitem.dashreadwrite,
#dashboard .dashitemline:has(> input.dashinputitem) > .dashinputitem.dashreadwrite,
#spright .dashitemline textarea.dashinputitem[data-nlines="1"].dashreadonly,
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"].dashreadonly,
#spright .dashitemline textarea.dashinputitem[data-nlines="1"].dashreadwrite,
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"].dashreadwrite {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: calc(var(--crm-control-h, 26px) - 2px) !important;
    height: var(--crm-control-h, 26px) !important;
    min-height: var(--crm-control-h, 26px) !important;
    max-height: var(--crm-control-h, 26px) !important;
    padding: var(--crm-val-pad-top, 0px) 4px var(--crm-val-pad-bottom, 0px) !important;
    box-sizing: border-box !important;
    border: var(--crm-val-border, 1px solid #e5e5e5) !important;
    vertical-align: middle;
    overflow: hidden;
}


/* Object combo chips (display:object / objectlink — Yes/No boxes etc.) in denser
   half/third/one-line rows: vertically center text in the 26px control, no
   scrollbar, match dense control padding/font (system-ui 13px). */
#spright .dashitemhalfline .dashitemcombo,
#spright .dashitemthirdline .dashitemcombo,
#dashboard .dashitemhalfline .dashitemcombo,
#dashboard .dashitemthirdline .dashitemcombo,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    align-items: var(--crm-valign, center) !important;
    flex-wrap: nowrap !important;
    /* Tighten horizontal chrome vs top/bottom; keep 26px height */
    padding-left: 1px !important;
    padding-right: 2px !important;
    text-indent: 0 !important;
}

#spright .dashitemhalfline .dashitemcombo .mscomboitem,
#spright .dashitemthirdline .dashitemcombo .mscomboitem,
#dashboard .dashitemhalfline .dashitemcombo .mscomboitem,
#dashboard .dashitemthirdline .dashitemcombo .mscomboitem,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem,
#spright .dashitemhalfline .dashitemcombo .mscomboinput,
#spright .dashitemthirdline .dashitemcombo .mscomboinput,
#dashboard .dashitemhalfline .dashitemcombo .mscomboinput,
#dashboard .dashitemthirdline .dashitemcombo .mscomboinput,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboinput,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboinput,
#spright .dashitemhalfline .dashitemcombo .emptytext,
#spright .dashitemthirdline .dashitemcombo .emptytext,
#dashboard .dashitemhalfline .dashitemcombo .emptytext,
#dashboard .dashitemthirdline .dashitemcombo .emptytext,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo .emptytext,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo .emptytext {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: calc(var(--crm-control-h, 26px) - 2px) !important;
    height: calc(var(--crm-control-h, 26px) - 2px) !important;
    min-height: calc(var(--crm-control-h, 26px) - 2px) !important;
    max-height: calc(var(--crm-control-h, 26px) - 2px) !important;
    margin: 0 !important;
    /* Less left gap than top/bottom; keep vertical pad 0 so chip stays 26px */
    padding: 0 2px 0 1px !important;
    box-sizing: border-box !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle;
    overflow: hidden !important;
    text-indent: 0 !important;
    white-space: nowrap;
}

/* Keep room for the remove "x" without taller box / scrollbar */
#spright .dashitemhalfline .dashitemcombo .mscomboitem,
#spright .dashitemthirdline .dashitemcombo .mscomboitem,
#dashboard .dashitemhalfline .dashitemcombo .mscomboitem,
#dashboard .dashitemthirdline .dashitemcombo .mscomboitem,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem {
    padding-right: 18px !important;
    position: relative;
}

#spright .dashitemhalfline .dashitemcombo .mscomboitem .crossdiv,
#spright .dashitemthirdline .dashitemcombo .mscomboitem .crossdiv,
#dashboard .dashitemhalfline .dashitemcombo .mscomboitem .crossdiv,
#dashboard .dashitemthirdline .dashitemcombo .mscomboitem .crossdiv,
#spright .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem .crossdiv,
#dashboard .dashitemline:has(> .dashitemcombo) > .dashitemcombo .mscomboitem .crossdiv {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 100%;
    line-height: 1;
    font-size: 12px;
}

/* Object combo dropdown list (appended to body, not under .dashitemcombo):
   match dense chip font family. Size may differ slightly. */
.mscombodropdown,
.mscombodropdown .mscombodropdownitem {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
}

/* Metric display: compact span value — same typography, no input chrome */
#spright .dashmetricvalue,
#dashboard .dashmetricvalue,
#spright .crm-dash-metric > .dashmetricvalue,
#dashboard .crm-dash-metric > .dashmetricvalue {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: var(--crm-control-h, 26px) !important;
    height: var(--crm-control-h, 26px) !important;
    min-height: var(--crm-control-h, 26px) !important;
    max-height: var(--crm-control-h, 26px) !important;
    padding: 0 4px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
    display: inline-flex;
    align-items: var(--crm-valign, center);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-weight: 600;
    color: #2e2e2e;
}

/* Multi-line memos (nlines>1): densify FONT/padding only.
   Do NOT touch height/min-height/max-height — !important here used to override
   completeLayout/htextarea's nlines×22+8 floor (Max lines 8 → ~2 lines).
   Half/third single-line 26px clamp is scoped to data-nlines=1 only, so
   multi-line rows never get that clamp. JS owns configured height. */
#spright .dashitemhalfline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]),
#spright .dashitemthirdline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]),
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]),
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]),
#spright .dashitemline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]),
#dashboard .dashitemline textarea.dashinputitem[data-nlines]:not([data-nlines="1"]) {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: 22px !important;
    overflow: auto !important;
    padding: 2px 4px !important;
}

/* Small text is an explicit format option. Keep the normal dense baseline
   at 13px; only fields marked by format.smalltext (completeLayout writes
   data-smalltext on the control — textarea/input.dashinputitem or
   span.dashmetricvalue) get the compact 9.5px/14px type and line box.
   Selectors must match densify specificity: densify uses
   .dashitemline textarea.dashinputitem[data-nlines]… and
   .dashmetricvalue with font-size:13px !important, which beat the old
   bare .dashinputitem[data-smalltext] rule (specificity lose). */
#spright .dashitemhalfline .dashinputitem[data-smalltext="true"],
#spright .dashitemthirdline .dashinputitem[data-smalltext="true"],
#dashboard .dashitemhalfline .dashinputitem[data-smalltext="true"],
#dashboard .dashitemthirdline .dashinputitem[data-smalltext="true"],
#spright .dashitemline .dashinputitem[data-smalltext="true"],
#dashboard .dashitemline .dashinputitem[data-smalltext="true"],
#spright .dashitemhalfline input.dashinputitem[data-smalltext="true"],
#spright .dashitemthirdline input.dashinputitem[data-smalltext="true"],
#dashboard .dashitemhalfline input.dashinputitem[data-smalltext="true"],
#dashboard .dashitemthirdline input.dashinputitem[data-smalltext="true"],
#spright .dashitemline input.dashinputitem[data-smalltext="true"],
#dashboard .dashitemline input.dashinputitem[data-smalltext="true"],
#spright .dashitemhalfline textarea.dashinputitem[data-smalltext="true"],
#spright .dashitemthirdline textarea.dashinputitem[data-smalltext="true"],
#dashboard .dashitemhalfline textarea.dashinputitem[data-smalltext="true"],
#dashboard .dashitemthirdline textarea.dashinputitem[data-smalltext="true"],
#spright .dashitemline textarea.dashinputitem[data-smalltext="true"],
#dashboard .dashitemline textarea.dashinputitem[data-smalltext="true"],
#spright .dashitemhalfline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#spright .dashitemthirdline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#spright .dashitemline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#dashboard .dashitemline textarea.dashinputitem[data-nlines][data-smalltext="true"],
#spright .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#spright .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#spright .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#spright .dashitemhalfline .dashinputitem.dashreadonly[data-smalltext="true"],
#spright .dashitemthirdline .dashinputitem.dashreadonly[data-smalltext="true"],
#dashboard .dashitemhalfline .dashinputitem.dashreadonly[data-smalltext="true"],
#dashboard .dashitemthirdline .dashinputitem.dashreadonly[data-smalltext="true"],
#spright .dashitemline .dashinputitem.dashreadonly[data-smalltext="true"],
#dashboard .dashitemline .dashinputitem.dashreadonly[data-smalltext="true"],
#spright .dashitemhalfline .dashinputitem.dashreadwrite[data-smalltext="true"],
#spright .dashitemthirdline .dashinputitem.dashreadwrite[data-smalltext="true"],
#dashboard .dashitemhalfline .dashinputitem.dashreadwrite[data-smalltext="true"],
#dashboard .dashitemthirdline .dashinputitem.dashreadwrite[data-smalltext="true"],
#spright .dashitemline .dashinputitem.dashreadwrite[data-smalltext="true"],
#dashboard .dashitemline .dashinputitem.dashreadwrite[data-smalltext="true"],
#spright .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#spright .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#dashboard .dashitemline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#spright .dashmetricvalue[data-smalltext="true"],
#dashboard .dashmetricvalue[data-smalltext="true"],
#spright .crm-dash-metric > .dashmetricvalue[data-smalltext="true"],
#dashboard .crm-dash-metric > .dashmetricvalue[data-smalltext="true"],
/* Beat densify .dashreadonly/.dashreadwrite:not(textarea[data-nlines]:not([data-nlines="1"])) at (1,5,1) */
#spright .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#spright .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#spright .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#spright .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#spright .dashitemhalfline .dashinputitem.dashreadonly[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemthirdline .dashinputitem.dashreadonly[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemhalfline .dashinputitem.dashreadonly[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemthirdline .dashinputitem.dashreadonly[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemhalfline .dashinputitem.dashreadwrite[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemthirdline .dashinputitem.dashreadwrite[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemhalfline .dashinputitem.dashreadwrite[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#dashboard .dashitemthirdline .dashinputitem.dashreadwrite[data-smalltext="true"]:not(textarea[data-nlines]:not([data-nlines="1"])),
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"],
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadonly,
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines="1"]) > textarea.dashinputitem[data-nlines="1"][data-smalltext="true"].dashreadwrite,
#spright .dashitemline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"],
#dashboard .dashitemline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"],
#spright .dashitemhalfline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"],
#spright .dashitemthirdline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"],
#dashboard .dashitemhalfline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"],
#dashboard .dashitemthirdline textarea.dashinputitem[data-nlines]:not([data-nlines="1"])[data-smalltext="true"] {
    font-size: 9.5px !important;
    line-height: 14px !important;
}

/* Multi-line titles: same dense type as single-line (half/third already match;
   full-width nlines>1 was still on the old 1em System font). */
#spright .dashitemline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle,
#dashboard .dashitemline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle,
#spright .dashitemhalfline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle,
#spright .dashitemthirdline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle,
#dashboard .dashitemhalfline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle,
#dashboard .dashitemthirdline:has(> textarea.dashinputitem[data-nlines]:not([data-nlines="1"])) > .dashitemtitle {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
    line-height: var(--crm-control-h, 26px) !important;
    padding: 0 !important;
    box-sizing: border-box;
}

#spright .dashitemline:last-child,
#spright .dashitemhalfline:last-child,
#spright .dashitemthirdline:last-child {
    margin-bottom: 0 !important;
}

/* LOCAL MOCK (uncommitted): dash section dividers — left title + hairline.
   Classic "Label ———" via flex; system-ui 13px (match chart legend) muted #555.
   All dash dividers. */
#spright .dashitemline.dash-divider,
#dashboard .dashitemline.dash-divider {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 8px !important;
    margin-bottom: 6px !important;
    margin-left: 6px;
    line-height: 26px;
    height: auto !important;
    min-height: 26px;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}
#spright .dashitemline.dash-divider > .divider,
#dashboard .dashitemline.dash-divider > .divider {
    flex: 0 0 auto;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #555 !important;
    margin: 0;
    padding: 0;
    line-height: 26px;
    white-space: nowrap;
}
#spright .dashitemline.dash-divider::after,
#dashboard .dashitemline.dash-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 0;
    border-top: 1px solid #c8c8c8;
    min-width: 24px;
}

/* Help-text divider: muted guidance, wrap OK, no hairline */
#spright .dashitemline.dash-divider.dash-divider-help,
#dashboard .dashitemline.dash-divider.dash-divider-help {
    align-items: flex-start;
    gap: 0;
}
#spright .dashitemline.dash-divider.dash-divider-help::after,
#dashboard .dashitemline.dash-divider.dash-divider-help::after {
    content: none;
    display: none;
    border: none;
    flex: 0 0 0;
    min-width: 0;
}
#spright .dashitemline.dash-divider.dash-divider-help > .divider,
#dashboard .dashitemline.dash-divider.dash-divider-help > .divider {
    flex: 1 1 auto;
    font-weight: 400;
    font-size: 12px !important;
    /* Soft amber/olive guidance tint (readable, not loud yellow/green) */
    color: #8a6d3b !important;
    white-space: normal;
    line-height: 1.45;
}

#spright .dashinputitem {
    box-sizing: border-box;
}

#dashboardheader {
    flex: 0 0 auto;
    margin-bottom: var(--crm-v-gap, 3px);
}

/* LOCAL MOCK (uncommitted): record top heading (icon + title caption).
   Drop dark/heavy fill; open clean band that fills the header width.
   system-ui at heading size/weight (18px / 600); compact vertical pad.
   RECORD only (.dashboard-record, never .objectconfigure / :has(.configuretabpage)).
   Broad #spright/#dashboard .nametitle was restyling Configure tab tops. */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection {
    background: transparent !important;
    margin: 0 !important;
    padding: 2px 8px 3px 4px !important;
    text-indent: 0 !important;
    box-sizing: border-box;
    width: 100%;
}

#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent !important;
    color: #0f172a;
    position: relative;
    min-height: 32px;
}

/* Inner wrapper from drawHeading (inline 1.4em/600) — flatten to flex row */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle > div,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle > div {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: transparent !important;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    text-align: left;
    position: relative;
    min-height: 32px;
}

#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle img,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle img {
    height: 24px !important;
    width: 24px !important;
    flex: 0 0 auto;
    display: block;
}

#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle img.dash-design-icon,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle img.dash-design-icon {
    height: 16px !important;
    width: 16px !important;
}

/* Title caption input: leave absolute layout; fill remaining header space */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle input.autoupdateelements,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle input.autoupdateelements {
    position: absolute !important;
    left: 36px !important;
    right: 8px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%);
    width: auto !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 2px 4px !important;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    box-sizing: border-box !important;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
}

/* Reserve room for the graphical design toggle without shrinking the value text. */
#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle.dash-design-toggle-host input.autoupdateelements,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle.dash-design-toggle-host input.autoupdateelements {
    right: 44px !important;
}

#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle input.autoupdateelements.dashreadwrite:focus,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle input.autoupdateelements.dashreadwrite:focus {
    background: #f8fafc !important;
    outline: 1px solid #e2e8f0;
}

#spright .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle #backgroundgauge,
#dashboard .dashboardcontent.dashboard-record:not(.objectconfigure):not(:has(.configuretabpage)) > .namesection .nametitle #backgroundgauge {
    float: none !important;
    margin: 0 !important;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}


#nowtime {
    position: static !important;
    width: auto !important;
    left: auto !important;
    top: auto !important;
}

.crm-toolbar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--crm-v-gap, 3px);
    height: auto !important;
    min-height: var(--crm-toolbar-min-h, 34px);
    line-height: 1.2 !important;
    padding: var(--crm-v-pad, 2px) var(--crm-v-gap, 3px) !important;
    width: 100%;
    box-sizing: border-box;
}

.crm-toolbar .headertext {
    /* searchcore sets color:transparent but the label still took width */
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0);
    border: 0 !important;
    font-size: 0 !important;
}

#listsheader,
#listsfooter {
    gap: 0;
}

#listsheader .headertext {
    /* keep collapsed like other toolbar titles */
}

#listsfootertext {
    margin-right: auto;
}

#listsheader .sortheader {
    margin-left: 0;
    gap: 4px;
}

#searchtype {
    display: flex !important;
    align-items: center;
    gap: var(--crm-gap, 4px);
    height: var(--crm-control-h, 30px) !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#searchtype #searchtypeselect {
    flex: 0 0 auto;
    width: var(--crm-field-select-width) !important;
    max-width: 32%;
    min-width: 72px;
    margin: 0 !important;
    box-sizing: border-box;
}

#searchtype #filterselectdiv {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    margin: 0 4px 0 0 !important; /* clear gap before checkbox */
    padding-right: 22px; /* room for dropdown arrow */
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: inline-flex !important;
    align-items: center;
}

#searchtype #filterselect {
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#searchtype #filterselectdropdown {
    position: absolute;
    right: 0;
    top: 2px;
    bottom: 2px;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: auto;
}

#searchtype #filterall {
    flex: 0 0 auto;
    flex-shrink: 0;
    margin: 0 4px 0 0 !important;
    position: relative;
    z-index: 1;
}

/* right cluster: save, and/or, add — tight, right-aligned */
#searchtype #savefilter {
    margin-left: auto !important;
    margin-right: 0 !important;
    flex: 0 0 auto;
}

#searchtype #andor {
    float: none !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

#searchtype #addbutton {
    float: none !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

.searchrow .icbutton {
    float: none !important;
    margin: 0 !important;
}

.crm-toolbar .icbutton {
    float: none !important;
}

.crm-toolbar .sortheader {
    float: none !important;
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin-left: 0;
    min-width: 0;
}

.crm-toolbar .headerobj {
    position: static !important;
    right: auto !important;
    height: auto !important;
    display: inline-flex;
    align-items: center;
}

#sortresults,
#listsortresults {
    width: min(168px, 100%) !important;
    max-width: 100%;
    margin-top: 0 !important;
    min-width: 0;
    height: var(--crm-control-h, 30px) !important;
    box-sizing: border-box;
}

#resultsfootertext,
#listsfootertext {
    margin-right: auto;
    margin-left: 0;
    font-size: 0.8em;
    min-width: 0;
}

.crm-add-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.crm-dashbar {
    justify-content: flex-end;
}

.crm-baricons {
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.crm-baricons img {
    height: 18px;
    width: auto;
    display: block;
}

#dashboardheader {
    height: auto !important;
    min-height: var(--crm-toolbar-min-h, 34px);
}

#dbsize {
    position: absolute !important;
    top: 2px;
    right: 8px;
    width: auto !important;
    height: auto !important;
    z-index: 5;
    pointer-events: none;
}

.searchrow,
#searchtype {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    min-height: var(--crm-control-h, 30px);
    height: var(--crm-control-h, 30px) !important;
}

/* Second-line search filter boxes: even gaps */
.searchrow {
    display: flex !important;
    align-items: center;
    gap: var(--crm-gap, 4px);
    margin: 1px 0 2px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.searchrow .combolist,
.searchrow .by {
    flex: 0 0 auto;
    width: var(--crm-field-select-width) !important;
    max-width: 32%;
    min-width: 72px;
    margin: 0 !important;
    box-sizing: border-box;
}

.searchrow .operator {
    flex: 0 1 20%;
    width: auto !important;
    max-width: 28%;
    min-width: 72px;
    margin: 0 !important;
}

.searchrow .searchrow-value {
    flex: 1 1 auto;
    display: flex !important;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: auto !important;
}

.searchrow .searchvalue {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
}

.searchrow .searchvaluedropdown {
    flex: 0 1 160px;
    width: auto !important;
    max-width: 40%;
    margin: 0 !important;
}

.searchrow .icbutton {
    float: none !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

#spleft select,
#spleft .idrop,
#spleft .ibox,
#spleft .combolist,
#spleft .searchvalue,
#spleft .searchvaluedropdown,
#searchtypeselect,
#andor,
#sortresults,
#listsortresults,
#filterselectdiv,
#spright select,
#spright .dashitemcombo,
#spright .dashitemdropdown {
    height: var(--crm-control-h, 30px) !important;
    min-height: var(--crm-control-h, 30px) !important;
    line-height: calc(var(--crm-control-h, 30px) - 2px) !important;
    box-sizing: border-box;
    vertical-align: middle !important;
}

#filterselectdiv {
    display: inline-flex;
    align-items: center;
}

.by, .operator, .searchvalue, .combolist {
    max-width: 100%;
    box-sizing: border-box;
}

.resultsrow {
    content-visibility: auto;
    contain-intrinsic-size: 0 26px;
}

#sortresults,
#listsortresults {
    width: min(200px, 36vw) !important;
    max-width: 100%;
    height: var(--crm-control-h, 30px) !important;
}

.headerobj {
    max-width: 100%;
}

.crm-topstrip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 16px;
    max-height: 18px;
    margin: 0 72px 2px 0;
}

#marquee {
    height: 16px;
    width: 70%;
    overflow: hidden;
    max-width: calc(100% - 12px);
}

#searchrows,
#searchcontrols,
#resultsfooter,
#listsheader,
#listsfooter {
    flex: 0 0 auto;
}

#listsfooter {
    margin-top: 0;
}

.k-grid,
.k-scheduler,
.jsgrid {
    max-width: 100%;
}

/* crm-dash-table: reverse Table font matches densified dashboard fields */
/* .crm-dash-table IS the kendo root (kendoGrid adds .k-grid to the same div). */
#dashboard .crm-dash-table,
#spright .crm-dash-table,
#dashboard .crm-dash-table.k-grid,
#spright .crm-dash-table.k-grid,
#dashboard .crm-dash-table .k-grid-header,
#spright .crm-dash-table .k-grid-header,
#dashboard .crm-dash-table .k-grid-content,
#spright .crm-dash-table .k-grid-content,
#dashboard .crm-dash-table td,
#spright .crm-dash-table td,
#dashboard .crm-dash-table th,
#spright .crm-dash-table th,
#dashboard .crm-dash-table .k-header,
#spright .crm-dash-table .k-header {
    font-family: system-ui, -apple-system, Segoe UI, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: var(--crm-dash-fs, 13px) !important;
}
#dashboard .crm-dash-table[data-smalltext="true"],
#spright .crm-dash-table[data-smalltext="true"],
#dashboard .crm-dash-table.crm-dash-table-small,
#spright .crm-dash-table.crm-dash-table-small,
#dashboard .crm-dash-table[data-smalltext="true"] td,
#spright .crm-dash-table[data-smalltext="true"] td,
#dashboard .crm-dash-table.crm-dash-table-small td,
#spright .crm-dash-table.crm-dash-table-small td,
#dashboard .crm-dash-table[data-smalltext="true"] th,
#spright .crm-dash-table[data-smalltext="true"] th,
#dashboard .crm-dash-table.crm-dash-table-small th,
#spright .crm-dash-table.crm-dash-table-small th {
    font-size: 9.5px !important;
    line-height: 14px !important;
}
#dashboard .crm-dash-table tbody tr,
#spright .crm-dash-table tbody tr {
    height: 26px;
}
#dashboard .crm-dash-table[data-smalltext="true"] tbody tr,
#spright .crm-dash-table[data-smalltext="true"] tbody tr,
#dashboard .crm-dash-table.crm-dash-table-small tbody tr,
#spright .crm-dash-table.crm-dash-table-small tbody tr {
    height: 16px;
}
#dashboard .crm-dash-table td,
#spright .crm-dash-table td {
    padding-top: 2px;
    padding-bottom: 2px;
    line-height: 1.25;
}


/* Keep Scheduler typography aligned with the CRM shell. */
.k-scheduler,
.k-scheduler .k-scheduler-toolbar,
.k-scheduler .k-scheduler-footer,
.k-scheduler .k-scheduler-header,
.k-scheduler .k-scheduler-header-wrap,
.k-scheduler .k-scheduler-content,
.k-scheduler .k-scheduler-times,
.k-scheduler .k-scheduler-table,
.k-scheduler .k-scheduler-table td,
.k-scheduler .k-scheduler-table th,
.k-scheduler .k-event,
.k-scheduler .k-event-template,
.k-scheduler .k-task,
.k-scheduler .event-template,
.k-scheduler .k-more-events,
.k-scheduler .k-link {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Force the local calendar one more step down. Kendo's month-cell rules
   (for example .k-scheduler-monthview .k-scheduler-table td { font-size: 1.2em })
   otherwise override a smaller inherited scheduler size. */
.k-scheduler,
.k-scheduler * {
    font-size: 11px !important;
}

/* Let the dashitemline grow with the scheduler host; #dashboard scrolls. */
#dashboard .crm-scheduler-line,
#spright .crm-scheduler-line,
.dashboardcontent .crm-scheduler-line {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Month: host max-height = nlines×24; height shrinks to month content
   (toolbar+dayHeader+visibleWeeks×weekRowHeight). Scroll only when content
   exceeds max — no empty Maximum-lines frame. Day/week: fixed max viewport;
   content + times share one scrollport (times synced via scrollTop).
   Week rows use --crm-week-row-height (default 90px, min 24).
   Do NOT put a CSS height/max-height here — JS sets them inline. */
.crm-scheduler-host,
.crm-scheduler-host.k-scheduler,
.crm-scheduler-host.k-widget {
    box-sizing: border-box !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
.crm-scheduler-host .k-scheduler-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
}
/* Day/week hour gutter: same viewport as content; Kendo syncs scrollTop.
   Do not give times its own scrollbar — overflow hidden + matched height. */
.crm-scheduler-host .k-scheduler-times {
    overflow: hidden !important;
    min-height: 0 !important;
}
#spright .k-scheduler .k-scheduler-content,
.k-scheduler .k-scheduler-content {
    overflow-y: auto;
}

.k-grid-content,
.jsgrid-grid-body {
    overflow-x: auto;
}

body.is-compact #toggle {
    display: block !important;
}

@media (max-width: 900px) {
    #search {
        border-spacing: 0;
    }
    #sortresults,
    #listsortresults {
        width: min(140px, 28vw) !important;
    }
}

@media (max-width: 700px) {
    body.appbody {
        padding: 2px 4px 6px;
        height: auto;
        max-height: none;
        overflow: auto;
    }
    #search,
    #search > tbody,
    #search > tbody > tr {
        display: block;
        width: 100%;
    }
    #spleft,
    #spright,
    #crm-left-top,
    #crm-left-bottom {
        display: block;
        width: 100% !important;
        padding-bottom: 8px;
        height: auto !important;
        max-height: none !important;
        overflow: visible;
        flex: none !important;
    }
    .crm-split {
        display: none;
    }
    #tablist {
        min-height: 180px;
        max-height: 50vh;
    }
    #sortresults,
    #listsortresults {
        width: min(160px, 55vw) !important;
    }
    .sline {
        min-width: 0;
        max-width: 100%;
    }
}

/* Login modal: hide the rest of the CRM so nothing shows through. */
body.crm-login-open {
    overflow: hidden;
}

body.crm-login-open .crm-topstrip,
body.crm-login-open #search,
body.crm-login-open #dashcontainer,
body.crm-login-open #dashboardheader,
body.crm-login-open #toggle,
body.crm-login-open #dbsize,
body.crm-login-open #loginwindow {
    display: none !important;
    visibility: hidden !important;
}

body.crm-login-open .ui-widget-overlay {
    background: #1a1a1a !important;
    opacity: 1 !important;
}

body.crm-login-open .ui-dialog {
    z-index: 10000 !important;
}

button.icbutton,
.icbutton {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    padding: 4px !important;
    margin-top: 0;
    margin-bottom: 0;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    vertical-align: middle;
    background-color: #fff;
    border: 1px solid #c4ccd0;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

button.icbutton img,
.icbutton img {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    display: block;
}

button.icbutton:hover,
.icbutton:hover {
    background-color: #f4f8fa;
    border-color: #8fa0a8;
}

button.icbutton:active,
.icbutton:active {
    background-color: #e6eef2;
    box-shadow: none;
}

button.icbutton:focus-visible,
.icbutton:focus-visible {
    outline: 2px solid rgba(69, 158, 222, 0.55);
    outline-offset: 1px;
}

/* LOCAL MOCK (uncommitted): lighter Stats/dash action buttons — match denser
   Stats type (system-ui 13px, normal weight); slightly less pad; keep colors. */
#spright .dialogbutton,
#dashboard .dialogbutton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-height: 28px;
    min-width: 96px;
    padding: 0 12px;
    margin: 1px 2px 1px 0;
    box-sizing: border-box;
    background: #eef3f6;
    border: 1px solid #c4ccd0;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    color: #1f2a2e;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    font-size: 13px;
    font-weight: normal;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

/* Half/third button rows: fill the cell, drop side margins so adjacent buttons
   sit closer (panel column-gap still provides the middle gutter). */
#spright .dashitemhalfline:has(> .dialogbutton) > .dialogbutton,
#dashboard .dashitemhalfline:has(> .dialogbutton) > .dialogbutton,
#spright .dashitemthirdline:has(> .dialogbutton) > .dialogbutton,
#dashboard .dashitemthirdline:has(> .dialogbutton) > .dialogbutton {
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* Pull adjacent half/third button cells closer: 12px column-gap → ~2px. */
#spright .dashitemhalfline:has(> .dialogbutton) + .dashitemhalfline:has(> .dialogbutton),
#dashboard .dashitemhalfline:has(> .dialogbutton) + .dashitemhalfline:has(> .dialogbutton),
#spright .dashitemthirdline:has(> .dialogbutton) + .dashitemthirdline:has(> .dialogbutton),
#dashboard .dashitemthirdline:has(> .dialogbutton) + .dashitemthirdline:has(> .dialogbutton) {
    margin-left: -10px !important;
}

#spright .dashitemhalfline:has(> .dialogbutton),
#dashboard .dashitemhalfline:has(> .dialogbutton),
#spright .dashitemthirdline:has(> .dialogbutton),
#dashboard .dashitemthirdline:has(> .dialogbutton) {
    margin-bottom: 2px !important;
}

#spright .dialogbutton:hover,
#dashboard .dialogbutton:hover {
    background-color: #e2ebf0;
    border-color: #8fa0a8;
}

#spright .dialogbutton:active,
#dashboard .dialogbutton:active {
    background-color: #d5e0e6;
    box-shadow: none;
}

#spright .dialogbutton:focus-visible,
#dashboard .dialogbutton:focus-visible {
    outline: 2px solid rgba(69, 158, 222, 0.55);
    outline-offset: 1px;
}


/* Results / Lists: All-None on the left with a small left gap */
.crm-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 0;
    margin-right: auto;
    min-width: 0;
    position: relative;
}

.crm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

#selectall,
#selectallcart {
    margin: 0;
}

#searchcontrols.crm-toolbar,
#listsheader.crm-toolbar,
#resultsfooter.crm-toolbar,
#listsfooter.crm-toolbar {
    padding-left: 4px !important;
    padding-right: 4px !important;
}

/* Lists: sort icon + dropdown + refresh tight on the right */
#listsheader .crm-toolbar-right.lists-sort-cluster {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

#listsheader .lists-sort-cluster .sorticon {
    display: block;
    height: 24px;
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

#listsheader .lists-sort-cluster #listsortresults {
    width: min(168px, 36vw) !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

#listsheader #refreshlists {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
}

#listsheader #refreshlists img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Lists footer: add + remove buttons tight on the right */
#listsfooter .lists-footer-cluster {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

#listsfooter .lists-footer-cluster .crm-add-label {
    margin: 0;
    flex: 0 0 auto;
}

#listsfooter .lists-footer-cluster .icbutton {
    margin: 0;
    flex: 0 0 auto;
}

/* Results footer: action buttons tight on the right (match Lists footer) */
#resultsfooter .results-footer-cluster {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

#resultsfooter .results-footer-cluster .icbutton {
    margin: 0;
    flex: 0 0 auto;
}

/* Results toolbar: sort + dropdown + search + clear tight on the right */
#searchcontrols .crm-toolbar-right.results-sort-cluster {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

#searchcontrols .results-sort-cluster .sorticon {
    display: block;
    height: 24px;
    width: auto;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

#searchcontrols .results-sort-cluster #sortresults {
    width: min(168px, 36vw) !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

#searchcontrols .results-sort-cluster .icbutton {
    margin: 0;
    flex: 0 0 auto;
}

/* Shared top-left toolbar padding */
#searchcontrols.crm-toolbar,
#resultsfooter.crm-toolbar {
    gap: 4px;
}

/* CRM left-column: edge inset = in-between gap (4px) inside each panel */
#spleft {
    --crm-gap: 4px;
    /* Campaign module select + Name field combo: same width */
    --crm-field-select-width: min(140px, 30%);
}

#spleft #searchrows,
#spleft #results,
#spleft #tablist,
#spleft #searchcontrols,
#spleft #resultsfooter,
#spleft #listsheader,
#spleft #listsfooter {
    padding-left: var(--crm-gap) !important;
    padding-right: var(--crm-gap) !important;
    box-sizing: border-box;
}

#spleft .crm-toolbar {
    gap: var(--crm-gap);
}

#spleft .crm-toolbar-left {
    margin-left: 0 !important;
}

#spleft .crm-toolbar-right,
#spleft .results-sort-cluster,
#spleft .lists-sort-cluster,
#spleft .results-footer-cluster,
#spleft .lists-footer-cluster {
    margin-right: 0 !important;
    gap: var(--crm-gap) !important;
}

#spleft #searchtype,
#spleft .searchrow {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: var(--crm-gap) !important;
}

#spleft #searchtype #filterselectdiv,
#spleft #searchtype #filterall {
    margin-right: var(--crm-gap) !important;
}

/* Campaign General-tab charts: responsive wrap + modern doughnut (reversible) */
#spright .crm-chart-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    column-gap: 12px; /* match panel column-gap */
    row-gap: 12px;    /* stacked chart rows: same gutter as columns */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    clear: both;
    margin: 0; /* don't add extra vertical space on top of dashitem gap */
}

/* Delivery/Read (etc) datachart rows: 12px between stacked wraps = column-gap */
#spright .dashitemline:has(> .crm-chart-wrap),
#spright .dashitemhalfline:has(> .crm-chart-wrap),
#spright .dashitemthirdline:has(> .crm-chart-wrap),
#dashboard .dashitemline:has(> .crm-chart-wrap),
#dashboard .dashitemhalfline:has(> .crm-chart-wrap),
#dashboard .dashitemthirdline:has(> .crm-chart-wrap) {
    margin-bottom: 12px !important;
}

#spright .crm-chart-wrap .chartBox,
#spright .crm-chart-wrap .chartDataBox {
    float: none !important;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid #d8e0e6;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    padding: 10px 12px;
    width: auto !important;
    height: auto !important;
    min-width: 0;
}

#spright .crm-chart-wrap .chartBox {
    flex: 1 1 300px;
    min-width: min(280px, 100%);
    max-width: 100%;
    min-height: 280px;
    position: relative;
}

#spright .crm-chart-wrap .crm-chart-title {
    font: 600 13px/1.3 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #0f172a;
    margin: 0 0 8px 0;
}

#spright .crm-chart-wrap .crm-chart-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

#spright .crm-chart-wrap .chartDataBox {
    flex: 1 1 200px;
    min-width: min(200px, 100%);
    max-width: 360px;
}

#spright .crm-chart-wrap .chartBox canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: 320px;
}

#spright .crm-chart-stat-head {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8eef2;
}

#spright .crm-chart-stat-total-label {
    font: 600 11px/1.2 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#spright .crm-chart-stat-total-value {
    font: 700 22px/1.2 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #0f172a;
    margin-top: 2px;
}

#spright .crm-chart-stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#spright .crm-chart-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font: 13px/1.3 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #1e293b;
}

#spright .crm-chart-stat-row:last-child {
    border-bottom: none;
}

#spright .crm-chart-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

#spright .crm-chart-stat-name {
    flex: 1 1 auto;
    min-width: 0;
}

#spright .crm-chart-stat-nums {
    flex: 0 0 auto;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

#spright .crm-chart-stat-nums em {
    font-style: normal;
    color: #64748b;
    margin-left: 4px;
}

/* Dashboard field value alignment (format.justify). The title stays left; only
   the rendered control/value follows the saved field setting. Legacy
   format.justify=submiddle is normalized to center by dashboard.js.
   Metrics/combos/dropdowns use display:inline-flex — text-align alone does
   not move their content; justify-content does. Form controls (input /
   textarea / native select) still rely on text-align. */
#spright .dash-justify-left > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue),
#dashboard .dash-justify-left > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue) {
    text-align: left !important;
    justify-content: flex-start !important;
}
#spright .dash-justify-center > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue),
#dashboard .dash-justify-center > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue) {
    text-align: center !important;
    justify-content: center !important;
}
#spright .dash-justify-right > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue),
#dashboard .dash-justify-right > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo, .dashmetricvalue) {
    text-align: right !important;
    justify-content: flex-end !important;
}
#spright .dash-justify-left > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext),
#dashboard .dash-justify-left > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext),
#spright .dash-justify-center > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext),
#dashboard .dash-justify-center > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext),
#spright .dash-justify-right > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext),
#dashboard .dash-justify-right > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) :is(input, textarea, select, .mscomboinput, .mscomboitem, .emptytext) {
    text-align: inherit !important;
}

/* Caption ellipsis: only needed when value text would overwrite the title.
   Left-justify keeps the caption-width title column ellipsis (value sits on the left).
   Center/right park the value in mid/right of the control, so the caption can
   show fully — turn off ellipsis and let the title paint into the control's
   empty left padding. Snug titles get the same treatment. */
#spright .dash-justify-center > .dashitemtitle,
#dashboard .dash-justify-center > .dashitemtitle,
#spright .dash-justify-right > .dashitemtitle,
#dashboard .dash-justify-right > .dashitemtitle,
#spright .dash-snug.dash-justify-center > .dashitemtitle,
#dashboard .dash-snug.dash-justify-center > .dashitemtitle,
#spright .dash-snug.dash-justify-right > .dashitemtitle,
#dashboard .dash-snug.dash-justify-right > .dashitemtitle {
    overflow: visible;
    text-overflow: clip;
    /* keep one line; grow into left padding of a centered/right value */
    white-space: nowrap;
    position: relative;
    z-index: 1;
    pointer-events: none; /* don't block clicks on the control under overflow */
}


#spright .crm-chart-events {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e8eef2;
}

#spright .crm-chart-events-note,
#spright .crm-chart-event-note {
    font: 11px/1.3 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #475569;
}

/* Vertical justify (format.vjustify) and remove border (format.removeborder).
   Presets set inherited variables consumed by the row align-items rules and
   the densify control border/padding rules above. Unset format leaves the
   legacy fallbacks (dense rows center, other rows top, border on). */
#spright .dash-vjustify-top,
#dashboard .dash-vjustify-top {
    --crm-row-align: flex-start;
    --crm-valign: flex-start;
}
#spright .dash-vjustify-center,
#dashboard .dash-vjustify-center {
    --crm-row-align: center;
    --crm-valign: center;
}
#spright .dash-vjustify-bottom,
#dashboard .dash-vjustify-bottom {
    --crm-row-align: flex-end;
    --crm-valign: flex-end;
}
/* Small text is a short line inside the dense control. Shift that line box
   so Top / Center / Bottom move the value, not only the caption+control row. */
#spright .dash-vjustify-top > .dashinputitem[data-smalltext="true"],
#dashboard .dash-vjustify-top > .dashinputitem[data-smalltext="true"] {
    --crm-val-pad-top: 0px;
    --crm-val-pad-bottom: 10px;
}
#spright .dash-vjustify-center > .dashinputitem[data-smalltext="true"],
#dashboard .dash-vjustify-center > .dashinputitem[data-smalltext="true"] {
    --crm-val-pad-top: 5px;
    --crm-val-pad-bottom: 5px;
}
#spright .dash-vjustify-bottom > .dashinputitem[data-smalltext="true"],
#dashboard .dash-vjustify-bottom > .dashinputitem[data-smalltext="true"] {
    --crm-val-pad-top: 10px;
    --crm-val-pad-bottom: 0px;
}
#spright .dash-noborder,
#dashboard .dash-noborder {
    --crm-val-border: none;
}
/* Controls the densify border rule does not cover (multi-line memos, inline
   border styles). Dense single-line controls use --crm-val-border above. */
#spright .dash-noborder > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo),
#dashboard .dash-noborder > :is(.dashinputitem, .dashitemcombo, .dashitemdropdown, select.dashitemcombo) {
    border: none !important;
    box-shadow: none !important;
}
