/* =====================================================================
   PSL CRM V38 - Global Compact Enterprise Polish
   ---------------------------------------------------------------------
   Purpose:
   - one visual language across every authenticated page
   - compact forms without making text hard to read
   - quiet, premium enterprise palette
   - consistent cards, tables, filters, modals and actions
   - preserve page/business behaviour; this is a presentation layer only
   ===================================================================== */

body.crm-v38 {
    --crm-ui-primary: #0a9188;
    --crm-ui-primary-rgb: 10, 145, 136;
    --crm-ui-primary-hover: #08786f;
    --crm-ui-primary-soft: #e9f7f5;
    --crm-ui-sidebar-bg: #112b40;
    --crm-ui-sidebar-bg-deep: #0b2235;
    --crm-ui-sidebar-text: rgba(255,255,255,.88);
    --crm-ui-sidebar-muted: rgba(255,255,255,.52);
    --crm-ui-sidebar-hover: rgba(255,255,255,.065);
    --crm-ui-sidebar-active: rgba(18, 170, 157, .18);
    --crm-ui-topbar-bg: #ffffff;
    --crm-ui-page-bg: #f4f7fa;
    --crm-ui-surface: #ffffff;
    --crm-ui-surface-soft: #f8fafc;
    --crm-ui-surface-muted: #f1f5f8;
    --crm-ui-text: #17283a;
    --crm-ui-text-muted: #667789;
    --crm-ui-text-faint: #8b99a8;
    --crm-ui-border: #dce4ec;
    --crm-ui-border-strong: #cbd7e2;
    --crm-ui-control-height: 31px;
    --crm-ui-button-height: 31px;
    --crm-ui-table-head-height: 32px;
    --crm-ui-table-row-height: 35px;
    --crm-ui-table-cell-y: 5px;
    --crm-ui-table-cell-x: 9px;
    --crm-ui-card-header-height: 38px;
    --crm-ui-page-gap: 9px;
    --crm-ui-form-gap-x: 10px;
    --crm-ui-form-gap-y: 8px;
    --crm-ui-content-padding-x: 12px;
    --crm-ui-radius-xs: 4px;
    --crm-ui-radius-sm: 6px;
    --crm-ui-radius-md: 8px;
    --crm-ui-radius-lg: 9px;
    --crm-ui-radius-xl: 11px;
    --crm-ui-shadow-xs: 0 1px 2px rgba(18, 39, 61, .035);
    --crm-ui-shadow-sm: 0 2px 8px rgba(18, 39, 61, .045);
    --crm-ui-shadow-md: 0 12px 28px rgba(18, 39, 61, .09);
    --crm-sidebar-width: 13.75rem;
    --crm-topbar-height: 3.05rem;
    --crm-form-control-height: 31px;
    --crm-form-label-font: 10.75px;
    --crm-form-gap-x: 10px;
    --crm-form-gap-y: 8px;
    --crm-form-body-pad: 10px;
    --crm-table-cell-y: 5px;
    --crm-table-cell-x: 9px;
    --crm-table-font-size: 11.6px;
    --crm-table-head-bg: #f5f7fa;
    --crm-table-head-text: #526476;
    --crm-table-row-hover: #f8fbfc;
    --crm-table-footer-bg: #fafcfd;

    background: var(--crm-ui-page-bg) !important;
    color: var(--crm-ui-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 12.5px;
    line-height: 1.38;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[data-bs-theme="dark"] body.crm-v38,
[data-bs-theme="dark"] .crm-v38 {
    --crm-ui-topbar-bg: #13202c;
    --crm-ui-page-bg: #0f1720;
    --crm-ui-surface: #17232f;
    --crm-ui-surface-soft: #1b2936;
    --crm-ui-surface-muted: #213140;
    --crm-ui-text: #edf3f7;
    --crm-ui-text-muted: #a9b6c3;
    --crm-ui-text-faint: #7f8f9f;
    --crm-ui-border: rgba(255,255,255,.085);
    --crm-ui-border-strong: rgba(255,255,255,.14);
    --crm-ui-primary-soft: rgba(21, 177, 164, .12);
    --crm-table-head-bg: rgba(255,255,255,.035);
    --crm-table-head-text: #b7c2cc;
    --crm-table-row-hover: rgba(255,255,255,.028);
}

/* ---------------------------------------------------------------------
   Shell: quieter topbar, denser navigation and more canvas for work
   --------------------------------------------------------------------- */
body.crm-v38 .page-wrapper {
    background: var(--crm-ui-page-bg) !important;
}

body.crm-v38 .page-body {
    padding: .52rem 0 1rem !important;
}

body.crm-v38 .page-body > .container-fluid,
body.crm-v38 .crm-breadcrumb-bar > .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

body.crm-v38 .crm-topbar {
    min-height: var(--crm-topbar-height) !important;
    height: var(--crm-topbar-height) !important;
    color: var(--crm-ui-text) !important;
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
    box-shadow: 0 1px 3px rgba(20, 42, 63, .035) !important;
    backdrop-filter: blur(12px);
}

[data-bs-theme="dark"] body.crm-v38 .crm-topbar {
    background: rgba(19,32,44,.97) !important;
}

body.crm-v38 .crm-topbar-title,
body.crm-v38 .crm-topbar .crm-product-title,
body.crm-v38 .crm-topbar .crm-user-summary,
body.crm-v38 .crm-topbar .crm-user-summary .text-secondary,
body.crm-v38 .crm-topbar a {
    color: var(--crm-ui-text) !important;
}

body.crm-v38 .crm-topbar-title {
    font-size: 13.5px !important;
    font-weight: 760 !important;
    letter-spacing: -.015em;
}

body.crm-v38 .crm-topbar-inner {
    min-height: var(--crm-topbar-height) !important;
    gap: 10px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

body.crm-v38 .crm-topbar-icon {
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
    color: #526577 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    font-size: 15px !important;
}

body.crm-v38 .crm-topbar-icon:hover,
body.crm-v38 .crm-user-trigger:hover {
    color: var(--crm-ui-primary) !important;
    background: var(--crm-ui-primary-soft) !important;
    border-color: rgba(var(--crm-ui-primary-rgb), .14) !important;
}

body.crm-v38 .crm-quick-create {
    color: #fff !important;
    background: var(--crm-ui-primary) !important;
    border-color: var(--crm-ui-primary) !important;
    box-shadow: 0 4px 10px rgba(var(--crm-ui-primary-rgb), .16);
}

body.crm-v38 .crm-quick-create:hover {
    color: #fff !important;
    background: var(--crm-ui-primary-hover) !important;
}

body.crm-v38 .crm-global-search {
    width: min(370px, 31vw) !important;
    min-height: 31px !important;
    background: #f8fafc !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] body.crm-v38 .crm-global-search {
    background: rgba(255,255,255,.035) !important;
}

body.crm-v38 .crm-global-search .form-control {
    height: 29px !important;
    min-height: 29px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 11.5px !important;
}

body.crm-v38 .crm-global-search > i {
    color: #7d8c9a !important;
    font-size: 13px !important;
}

body.crm-v38 .crm-global-search kbd {
    padding: 2px 5px !important;
    color: #7c8a98 !important;
    background: #fff !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    font-size: 8px !important;
}

body.crm-v38 .crm-v8-top-clock {
    min-height: 31px !important;
    padding: 2px 7px !important;
    background: #f8fafc !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] body.crm-v38 .crm-v8-top-clock {
    background: rgba(255,255,255,.035) !important;
}

body.crm-v38 .crm-v8-top-clock-time > span {
    color: var(--crm-ui-text) !important;
    font-size: 10.5px !important;
}

body.crm-v38 .crm-v8-top-clock-time > small {
    color: var(--crm-ui-text-muted) !important;
    font-size: 7.5px !important;
}

body.crm-v38 .crm-user-trigger {
    min-height: 33px !important;
    padding: 2px 5px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
}

body.crm-v38 .crm-user-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 7px !important;
}

body.crm-v38 .crm-user-name,
body.crm-v38 .crm-user-name-text {
    color: var(--crm-ui-text) !important;
    font-size: 10.5px !important;
    font-weight: 720 !important;
}

body.crm-v38 .crm-user-meta,
body.crm-v38 .crm-user-company {
    color: var(--crm-ui-text-muted) !important;
    font-size: 8px !important;
}

/* Sidebar: dark navy with a calm teal focus state. */
body.crm-v38 .crm-sidebar {
    width: var(--crm-sidebar-width) !important;
    background: linear-gradient(180deg, #112d43 0%, #0c263b 54%, #0a2235 100%) !important;
    border-right: 1px solid rgba(255,255,255,.055) !important;
    box-shadow: 4px 0 22px rgba(9, 31, 48, .05) !important;
}

body.crm-v38 .crm-sidebar-brand {
    min-height: var(--crm-topbar-height) !important;
    height: var(--crm-topbar-height) !important;
    padding: 5px 9px !important;
    border-bottom-color: rgba(255,255,255,.065) !important;
}

body.crm-v38 .crm-sidebar-logo {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px !important;
    padding: 3px !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 9px rgba(0,0,0,.14) !important;
}

body.crm-v38 .crm-logo-text {
    font-size: 13px !important;
    font-weight: 790 !important;
}

body.crm-v38 .crm-brand-subtitle {
    margin-top: 2px !important;
    font-size: 8px !important;
}

body.crm-v38 .crm-sidebar-scroll {
    padding: 4px 5px 9px !important;
}

body.crm-v38 .crm-sidebar-section-label {
    margin-top: 10px !important;
    margin-bottom: 4px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    color: rgba(255,255,255,.40) !important;
    font-size: 7.6px !important;
    font-weight: 760 !important;
    letter-spacing: .09em !important;
}

body.crm-v38 .crm-nav-list > .nav-item {
    margin-bottom: 1px !important;
    padding-bottom: 1px !important;
}

body.crm-v38 .crm-nav-list > .nav-item::after,
body.crm-v38 .crm-submenu > .nav-item:not(:last-child) {
    border: 0 !important;
    background: transparent !important;
}

body.crm-v38 .crm-nav-list > .nav-item > .nav-link,
body.crm-v38 .crm-nav-link {
    min-height: 33px !important;
    margin: 0 3px !important;
    padding: 5px 7px !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: background .14s ease, border-color .14s ease, color .14s ease !important;
}

body.crm-v38 .crm-nav-list .nav-link-title,
body.crm-v38 .crm-nav-link .nav-link-title {
    color: rgba(255,255,255,.82) !important;
    font-size: 10.8px !important;
    font-weight: 570 !important;
}

body.crm-v38 .crm-nav-list .nav-link-icon,
body.crm-v38 .crm-nav-link .nav-link-icon {
    width: 21px !important;
    min-width: 21px !important;
    margin-right: 3px !important;
    color: rgba(255,255,255,.67) !important;
    font-size: 13px !important;
}

body.crm-v38 .crm-nav-list .nav-link:hover,
body.crm-v38 .crm-nav-link:hover {
    background: rgba(255,255,255,.055) !important;
    border-color: rgba(255,255,255,.035) !important;
}

body.crm-v38 .crm-nav-list .nav-link.active,
body.crm-v38 .crm-nav-link.active {
    position: relative;
    color: #fff !important;
    background: rgba(14, 157, 145, .19) !important;
    border-color: rgba(36, 201, 187, .22) !important;
    box-shadow: inset 2px 0 0 #25b8aa !important;
}

body.crm-v38 .crm-nav-list .nav-link.active .nav-link-title,
body.crm-v38 .crm-nav-list .nav-link.active .nav-link-icon,
body.crm-v38 .crm-nav-link.active .nav-link-title,
body.crm-v38 .crm-nav-link.active .nav-link-icon {
    color: #f4fffd !important;
}

body.crm-v38 .crm-submenu .nav-link {
    min-height: 30px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

body.crm-v38 .crm-submenu .nav-link-title {
    font-size: 10.2px !important;
    font-weight: 520 !important;
}

/* ---------------------------------------------------------------------
   Breadcrumb + page headings
   --------------------------------------------------------------------- */
body.crm-v38 .crm-breadcrumb-bar {
    min-height: 29px !important;
    height: 29px !important;
    background: rgba(255,255,255,.82) !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] body.crm-v38 .crm-breadcrumb-bar {
    background: rgba(23,35,47,.88) !important;
}

body.crm-v38 .crm-breadcrumb-bar .breadcrumb {
    min-height: 29px !important;
    font-size: 9.8px !important;
}

body.crm-v38 .page-header.crm-page-header,
body.crm-v38 .crm-page-heading,
body.crm-v38 .crm-form-page-head,
body.crm-v38 .crm-v6-page-head,
body.crm-v38 .crm-admin-list-header {
    min-height: 0 !important;
    margin: 0 0 7px !important;
    padding: 2px 0 7px !important;
    border-bottom: 1px solid var(--crm-ui-border);
    background: transparent !important;
}

body.crm-v38 .crm-form-page-head {
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    gap: 10px;
}

body.crm-v38 .page-title,
body.crm-v38 .crm-form-page-title,
body.crm-v38 .crm-v6-page-head h1,
body.crm-v38 .crm-v6-page-head h2,
body.crm-v38 .crm-page-heading h2,
body.crm-v38 .crm-admin-list-header .page-title {
    margin: 0 !important;
    color: var(--crm-ui-text) !important;
    font-size: 15px !important;
    font-weight: 770 !important;
    line-height: 1.25 !important;
    letter-spacing: -.018em !important;
}

body.crm-v38 .crm-form-eyebrow,
body.crm-v38 .crm-v6-eyebrow,
body.crm-v38 .crm-page-heading .text-uppercase,
body.crm-v38 .crm-admin-list-header .text-uppercase {
    margin-bottom: 2px !important;
    color: var(--crm-ui-primary) !important;
    font-size: 7.8px !important;
    font-weight: 800 !important;
    letter-spacing: .075em !important;
}

body.crm-v38 .crm-form-page-subtitle,
body.crm-v38 .crm-v6-subtitle,
body.crm-v38 .crm-page-heading > div > .text-secondary,
body.crm-v38 .crm-admin-list-header .text-secondary {
    margin-top: 1px !important;
    color: var(--crm-ui-text-muted) !important;
    font-size: 9.5px !important;
    line-height: 1.35 !important;
}

body.crm-v38 .crm-page-icon {
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
}

/* ---------------------------------------------------------------------
   Cards and sections
   --------------------------------------------------------------------- */
body.crm-v38 .card,
body.crm-v38 .crm-form-card,
body.crm-v38 .crm-reference-card,
body.crm-v38 .crm-master-card,
body.crm-v38 .crm-ref-card,
body.crm-v38 .crm-v8-compact-card {
    background: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(19, 42, 63, .025) !important;
}

body.crm-v38 .card.mb-4,
body.crm-v38 .crm-form-card.mb-4 {
    margin-bottom: 9px !important;
}

body.crm-v38 .card.mb-3,
body.crm-v38 .crm-form-card.mb-3 {
    margin-bottom: 8px !important;
}

body.crm-v38 .card-header,
body.crm-v38 .crm-form-card-header,
body.crm-v38 .crm-ref-card-head {
    min-height: 37px !important;
    padding: 7px 9px !important;
    background: #fbfcfd !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
    border-radius: 8px 8px 0 0 !important;
}

[data-bs-theme="dark"] body.crm-v38 .card-header,
[data-bs-theme="dark"] body.crm-v38 .crm-form-card-header,
[data-bs-theme="dark"] body.crm-v38 .crm-ref-card-head {
    background: rgba(255,255,255,.018) !important;
}

body.crm-v38 .card-title,
body.crm-v38 .crm-ref-card-title,
body.crm-v38 .crm-v6-section-title,
body.crm-v38 .crm-report-band-title {
    color: var(--crm-ui-text) !important;
    font-size: 11.9px !important;
    font-weight: 750 !important;
    line-height: 1.25 !important;
    letter-spacing: -.008em;
}

body.crm-v38 .card-header .text-secondary,
body.crm-v38 .crm-form-card-header .text-secondary,
body.crm-v38 .crm-section-heading .text-secondary {
    margin-top: 2px !important;
    font-size: 8.9px !important;
    line-height: 1.32 !important;
}

body.crm-v38 .card-body {
    padding: 9px !important;
}

body.crm-v38 .card-footer {
    padding: 8px 9px !important;
    background: #fbfcfd !important;
    border-top: 1px solid var(--crm-ui-border) !important;
}

[data-bs-theme="dark"] body.crm-v38 .card-footer {
    background: rgba(255,255,255,.018) !important;
}

body.crm-v38 .crm-section-heading {
    gap: 7px !important;
}

body.crm-v38 .crm-section-icon,
body.crm-v38 .crm-v6-section-icon {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    color: var(--crm-ui-primary) !important;
    background: var(--crm-ui-primary-soft) !important;
    border: 1px solid rgba(var(--crm-ui-primary-rgb), .12) !important;
    border-radius: 6px !important;
    font-size: 12px !important;
}

/* ---------------------------------------------------------------------
   Forms: dense, aligned, readable
   --------------------------------------------------------------------- */
body.crm-v38 .crm-entry-form,
body.crm-v38 .crm-modal-form {
    --tblr-gutter-x: 10px;
    --tblr-gutter-y: 8px;
}

body.crm-v38 .crm-entry-form .row.g-3,
body.crm-v38 .crm-modal-form .row.g-3,
body.crm-v38 .card-body.row.g-3 {
    --tblr-gutter-x: 10px !important;
    --tblr-gutter-y: 8px !important;
}

body.crm-v38 .crm-entry-form .row.g-2,
body.crm-v38 .crm-modal-form .row.g-2 {
    --tblr-gutter-x: 8px !important;
    --tblr-gutter-y: 6px !important;
}

body.crm-v38 .form-label {
    margin-bottom: 3px !important;
    color: #4a5d70 !important;
    font-size: 10.2px !important;
    font-weight: 680 !important;
    line-height: 1.2 !important;
}

[data-bs-theme="dark"] body.crm-v38 .form-label {
    color: #b8c4ce !important;
}

body.crm-v38 .form-label.required::after,
body.crm-v38 .required.form-label::after {
    color: #d94a59 !important;
}

body.crm-v38 .form-control,
body.crm-v38 .form-select,
body.crm-v38 .input-group-text,
body.crm-v38 .choices__inner {
    min-height: 31px !important;
    height: 31px;
    padding: 5px 8px !important;
    color: var(--crm-ui-text) !important;
    background-color: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border-strong) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    transition: border-color .13s ease, box-shadow .13s ease, background .13s ease !important;
}

body.crm-v38 .form-control-sm,
body.crm-v38 .form-select-sm {
    min-height: 27px !important;
    height: 27px !important;
    padding: 3px 7px !important;
    font-size: 10.7px !important;
}

body.crm-v38 textarea.form-control {
    height: auto !important;
    min-height: 64px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    line-height: 1.38 !important;
    resize: vertical;
}

body.crm-v38 textarea.crm-textarea-sm {
    min-height: 54px !important;
}

body.crm-v38 textarea.crm-textarea-md {
    min-height: 76px !important;
}

body.crm-v38 .form-control:focus,
body.crm-v38 .form-select:focus,
body.crm-v38 .choices.is-focused .choices__inner,
body.crm-v38 .choices.is-open .choices__inner {
    border-color: rgba(var(--crm-ui-primary-rgb), .62) !important;
    box-shadow: 0 0 0 2px rgba(var(--crm-ui-primary-rgb), .09) !important;
}

body.crm-v38 .form-control::placeholder {
    color: #9aa6b2 !important;
    opacity: 1;
}

body.crm-v38 .form-control[readonly],
body.crm-v38 .form-control:disabled,
body.crm-v38 .form-select:disabled,
body.crm-v38 .crm-readonly-field {
    color: #607285 !important;
    background: #f4f7f9 !important;
    border-color: #e1e7ed !important;
}

[data-bs-theme="dark"] body.crm-v38 .form-control[readonly],
[data-bs-theme="dark"] body.crm-v38 .form-control:disabled,
[data-bs-theme="dark"] body.crm-v38 .form-select:disabled,
[data-bs-theme="dark"] body.crm-v38 .crm-readonly-field {
    color: #aebbc7 !important;
    background: rgba(255,255,255,.035) !important;
}

body.crm-v38 .form-hint,
body.crm-v38 .form-text {
    margin-top: 3px !important;
    color: var(--crm-ui-text-muted) !important;
    font-size: 8.7px !important;
    line-height: 1.3 !important;
}

body.crm-v38 .form-check {
    min-height: 18px !important;
}

body.crm-v38 .form-check-input {
    width: 14px;
    height: 14px;
    margin-top: .12rem;
    border-color: #b9c7d3;
    box-shadow: none !important;
}

body.crm-v38 .form-switch .form-check-input {
    width: 27px !important;
    height: 15px !important;
}

body.crm-v38 .form-check-input:checked {
    background-color: var(--crm-ui-primary) !important;
    border-color: var(--crm-ui-primary) !important;
}

body.crm-v38 .form-check-label {
    font-size: 10.5px !important;
}

body.crm-v38 .input-icon-addon {
    min-width: 30px !important;
    color: #8392a0 !important;
    font-size: 12px !important;
}

body.crm-v38 .input-icon .form-control {
    padding-left: 30px !important;
}

body.crm-v38 .crm-password-toggle {
    width: 29px !important;
    height: 29px !important;
}

/* Choices.js/searchable select: same height as native controls. */
body.crm-v38 .choices {
    margin-bottom: 0 !important;
}

body.crm-v38 .choices__inner {
    display: flex !important;
    align-items: center !important;
    padding-right: 26px !important;
}

body.crm-v38 .choices__list--single {
    padding: 0 !important;
}

body.crm-v38 .choices__list--single .choices__item {
    font-size: 11.3px !important;
}

body.crm-v38 .choices__list--dropdown,
body.crm-v38 .choices__list[aria-expanded] {
    z-index: 2105 !important;
    margin-top: 3px !important;
    background: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border-strong) !important;
    border-radius: 7px !important;
    box-shadow: 0 12px 28px rgba(18, 39, 61, .14) !important;
    overflow: hidden !important;
}

body.crm-v38 .choices__list--dropdown .choices__item,
body.crm-v38 .choices__list[aria-expanded] .choices__item {
    min-height: 29px !important;
    padding: 6px 8px !important;
    font-size: 10.8px !important;
}

body.crm-v38 .choices__list--dropdown .choices__item--selectable.is-highlighted {
    color: var(--crm-ui-primary-hover) !important;
    background: var(--crm-ui-primary-soft) !important;
}

/* ---------------------------------------------------------------------
   Buttons / actions
   --------------------------------------------------------------------- */
body.crm-v38 .btn {
    min-height: 31px !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 10.8px !important;
    font-weight: 670 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

body.crm-v38 .btn-sm {
    min-height: 27px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
}

body.crm-v38 .btn-icon {
    width: 31px !important;
    min-width: 31px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.crm-v38 .btn-sm.btn-icon {
    width: 27px !important;
    min-width: 27px !important;
}

body.crm-v38 .btn-primary {
    color: #fff !important;
    background: var(--crm-ui-primary) !important;
    border-color: var(--crm-ui-primary) !important;
}

body.crm-v38 .btn-primary:hover,
body.crm-v38 .btn-primary:focus {
    background: var(--crm-ui-primary-hover) !important;
    border-color: var(--crm-ui-primary-hover) !important;
}

body.crm-v38 .btn-outline-primary {
    color: var(--crm-ui-primary-hover) !important;
    background: #fff !important;
    border-color: rgba(var(--crm-ui-primary-rgb), .45) !important;
}

[data-bs-theme="dark"] body.crm-v38 .btn-outline-primary {
    background: transparent !important;
}

body.crm-v38 .btn-outline-primary:hover {
    color: #fff !important;
    background: var(--crm-ui-primary) !important;
    border-color: var(--crm-ui-primary) !important;
}

body.crm-v38 .btn-outline-secondary {
    color: #5b6d7e !important;
    background: var(--crm-ui-surface) !important;
    border-color: var(--crm-ui-border-strong) !important;
}

body.crm-v38 .btn-outline-secondary:hover {
    color: var(--crm-ui-text) !important;
    background: var(--crm-ui-surface-muted) !important;
    border-color: #b7c5d1 !important;
}

body.crm-v38 .btn-link {
    min-height: 0 !important;
    padding: 4px 6px !important;
}

/* ---------------------------------------------------------------------
   Tables and grids
   --------------------------------------------------------------------- */
body.crm-v38 .table-responsive,
body.crm-v38 .crm-grid-scroll {
    border-radius: 0 0 8px 8px;
}

body.crm-v38 .table {
    margin-bottom: 0 !important;
    color: var(--crm-ui-text) !important;
    font-size: 11.2px !important;
    line-height: 1.28 !important;
}

body.crm-v38 .table > :not(caption) > * > * {
    padding: 5px 8px !important;
    border-bottom-color: #e7ecf1 !important;
    vertical-align: middle !important;
}

[data-bs-theme="dark"] body.crm-v38 .table > :not(caption) > * > * {
    border-bottom-color: rgba(255,255,255,.065) !important;
}

body.crm-v38 .table thead th,
body.crm-v38 .crm-grid-table thead th,
body.crm-v38 .crm-data-table thead th {
    min-height: 31px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    color: #5b6d7e !important;
    background: #f5f7f9 !important;
    border-bottom: 1px solid #dbe3ea !important;
    font-size: 9px !important;
    font-weight: 780 !important;
    letter-spacing: .025em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
}

[data-bs-theme="dark"] body.crm-v38 .table thead th,
[data-bs-theme="dark"] body.crm-v38 .crm-grid-table thead th {
    color: #aebbc7 !important;
    background: rgba(255,255,255,.035) !important;
}

body.crm-v38 .table tbody tr {
    transition: background-color .12s ease !important;
}

body.crm-v38 .table tbody tr:hover > td {
    background: #f8fbfc !important;
}

[data-bs-theme="dark"] body.crm-v38 .table tbody tr:hover > td {
    background: rgba(255,255,255,.025) !important;
}

body.crm-v38 .table .fw-semibold,
body.crm-v38 .crm-grid-table .fw-semibold {
    font-weight: 650 !important;
}

body.crm-v38 .crm-actions-column {
    width: 1% !important;
    white-space: nowrap !important;
}

body.crm-v38 .crm-code-pill {
    padding: 3px 6px !important;
    color: #35566f !important;
    background: #f1f6f9 !important;
    border: 1px solid #dde8ee !important;
    border-radius: 5px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9.6px !important;
    font-weight: 570 !important;
}

body.crm-v38 .crm-grid-toolbar,
body.crm-v38 .crm-admin-list-toolbar {
    min-height: 43px !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    background: #fbfcfd !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
}

[data-bs-theme="dark"] body.crm-v38 .crm-grid-toolbar,
[data-bs-theme="dark"] body.crm-v38 .crm-admin-list-toolbar {
    background: rgba(255,255,255,.018) !important;
}

body.crm-v38 .crm-grid-toolbar-main,
body.crm-v38 .crm-admin-filter-form,
body.crm-v38 .crm-grid-toolbar-actions,
body.crm-v38 .crm-admin-toolbar-actions {
    gap: 5px !important;
}

body.crm-v38 .crm-grid-search {
    min-width: 220px !important;
    max-width: 360px !important;
}

/* ---------------------------------------------------------------------
   Badges, status chips, alerts and small metadata
   --------------------------------------------------------------------- */
body.crm-v38 .badge,
body.crm-v38 .crm-v6-status-chip,
body.crm-v38 .crm-pa-state-chip {
    min-height: 18px;
    padding: 3px 6px !important;
    border-radius: 999px !important;
    font-size: 8.6px !important;
    font-weight: 710 !important;
    line-height: 1.15 !important;
    letter-spacing: .005em;
}

body.crm-v38 .bg-azure-lt,
body.crm-v38 .bg-blue-lt,
body.crm-v38 .bg-teal-lt {
    color: #087970 !important;
    background: #eaf7f5 !important;
}

body.crm-v38 .alert {
    margin-bottom: 8px !important;
    padding: 7px 9px !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
}

body.crm-v38 hr {
    margin: 8px 0 !important;
    border-color: var(--crm-ui-border) !important;
    opacity: 1;
}

body.crm-v38 .text-secondary {
    color: var(--crm-ui-text-muted) !important;
}

/* ---------------------------------------------------------------------
   Dropdown menus / pagination
   --------------------------------------------------------------------- */
body.crm-v38 .dropdown-menu {
    padding: 5px !important;
    background: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 30px rgba(20, 42, 63, .13) !important;
}

body.crm-v38 .dropdown-item {
    min-height: 30px !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    font-size: 10.8px !important;
}

body.crm-v38 .dropdown-item:hover,
body.crm-v38 .dropdown-item:focus {
    color: var(--crm-ui-primary-hover) !important;
    background: var(--crm-ui-primary-soft) !important;
}

body.crm-v38 .pagination {
    gap: 3px !important;
}

body.crm-v38 .page-link {
    min-width: 28px !important;
    height: 28px !important;
    padding: 5px 7px !important;
    color: #586a7c !important;
    background: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 6px !important;
    font-size: 9.7px !important;
    box-shadow: none !important;
}

body.crm-v38 .page-item.active .page-link {
    color: #fff !important;
    background: var(--crm-ui-primary) !important;
    border-color: var(--crm-ui-primary) !important;
}

/* ---------------------------------------------------------------------
   Modals: fixed header/footer, compact body, reliable dropdown layering
   --------------------------------------------------------------------- */
body.crm-v38 .modal {
    --bs-modal-zindex: 2050;
}

body.crm-v38 .modal-backdrop {
    --bs-backdrop-zindex: 2040;
    --bs-backdrop-opacity: .34;
}

body.crm-v38 .modal-dialog {
    margin-top: max(1rem, 4vh) !important;
    margin-bottom: max(1rem, 4vh) !important;
}

body.crm-v38 .modal-content {
    max-height: 88vh !important;
    overflow: visible !important;
    background: var(--crm-ui-surface) !important;
    border: 1px solid rgba(76, 98, 119, .16) !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 52px rgba(16, 38, 58, .18) !important;
}

body.crm-v38 .modal-header {
    min-height: 42px !important;
    padding: 8px 10px !important;
    background: #fbfcfd !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
    border-radius: 10px 10px 0 0 !important;
}

body.crm-v38 .modal-title {
    color: var(--crm-ui-text) !important;
    font-size: 12.5px !important;
    font-weight: 760 !important;
}

body.crm-v38 .modal-body {
    overflow: auto !important;
    padding: 10px !important;
}

body.crm-v38 .modal-footer {
    min-height: 45px !important;
    padding: 7px 10px !important;
    background: #fbfcfd !important;
    border-top: 1px solid var(--crm-ui-border) !important;
    border-radius: 0 0 10px 10px !important;
    gap: 5px !important;
}

[data-bs-theme="dark"] body.crm-v38 .modal-header,
[data-bs-theme="dark"] body.crm-v38 .modal-footer {
    background: rgba(255,255,255,.018) !important;
}

body.crm-v38 .modal-body .choices,
body.crm-v38 .modal-body .dropdown,
body.crm-v38 .modal-body .form-select {
    position: relative;
    z-index: auto;
}

/* ---------------------------------------------------------------------
   Work Order: compact sales workspace
   --------------------------------------------------------------------- */
body.crm-v38 .crm-wo-stepbar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 8px !important;
    padding: 5px !important;
    background: #eef3f6 !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 8px !important;
}

body.crm-v38 .crm-wo-step {
    min-height: 37px !important;
    padding: 5px 7px !important;
    background: rgba(255,255,255,.7) !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

body.crm-v38 .crm-wo-step.is-active {
    background: #fff !important;
    border-color: rgba(var(--crm-ui-primary-rgb), .24) !important;
    box-shadow: 0 1px 2px rgba(20, 42, 63, .04) !important;
}

body.crm-v38 .crm-wo-step > span {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    color: #fff !important;
    background: #8a9aa8 !important;
    border-radius: 6px !important;
    font-size: 8.5px !important;
}

body.crm-v38 .crm-wo-step.is-active > span {
    background: var(--crm-ui-primary) !important;
}

body.crm-v38 .crm-wo-step strong {
    font-size: 9.6px !important;
}

body.crm-v38 .crm-wo-step small {
    margin-top: 1px !important;
    font-size: 7.8px !important;
}

body.crm-v38 .crm-workorder-pricing-scroll {
    max-height: 315px !important;
}

body.crm-v38 .crm-workorder-pricing-table tbody tr.is-selected > td {
    background: #f0faf8 !important;
}

body.crm-v38 .crm-workorder-pricing-table tbody tr.is-selected > td:first-child {
    box-shadow: inset 2px 0 0 var(--crm-ui-primary);
}

body.crm-v38 .crm-workorder-price-summary > div > div {
    padding: 6px !important;
    background: #fff !important;
    border-color: var(--crm-ui-border) !important;
    border-radius: 6px !important;
}

body.crm-v38 .crm-workorder-price-summary .small {
    font-size: 8px !important;
}

body.crm-v38 .crm-workorder-price-summary strong {
    color: var(--crm-ui-text) !important;
    font-size: 11.5px !important;
}

/* ---------------------------------------------------------------------
   Project: scope and initial team are visibly part of the same form
   --------------------------------------------------------------------- */
body.crm-v38 .crm-project-identity-card .card-header,
body.crm-v38 .crm-project-create-team-card .card-header,
body.crm-v38 .crm-project-scope-card .card-header {
    background: #fbfcfd !important;
}

body.crm-v38 .crm-project-scope-toolbar {
    min-height: 42px !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
}

body.crm-v38 .crm-project-scope-toolbar .input-icon {
    width: min(430px, 70%) !important;
}

body.crm-v38 .crm-project-scope-tree {
    max-height: 410px !important;
    background: #fbfcfd !important;
}

body.crm-v38 .crm-initial-team-row {
    margin-bottom: 5px !important;
    padding: 6px !important;
    background: #f8fafb;
    border: 1px solid var(--crm-ui-border);
    border-radius: 7px;
}

/* ---------------------------------------------------------------------
   KPI/dashboard/report cards: retain emphasis without oversized blocks
   --------------------------------------------------------------------- */
body.crm-v38 .crm-kpi-card,
body.crm-v38 .crm-stat-card,
body.crm-v38 .crm-v6-kpi,
body.crm-v38 .crm-compact-stat,
body.crm-v38 .crm-tm-kpi,
body.crm-v38 .crm-pa-kpi,
body.crm-v38 .crm-project-kpi,
body.crm-v38 .crm-owh-kpi {
    min-height: 68px !important;
    padding: 8px 9px !important;
    background: var(--crm-ui-surface) !important;
    border: 1px solid var(--crm-ui-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(20,42,63,.025) !important;
}

body.crm-v38 .crm-kpi-icon,
body.crm-v38 .crm-v6-kpi-icon,
body.crm-v38 .crm-compact-stat-icon,
body.crm-v38 .crm-project-kpi-icon,
body.crm-v38 .crm-owh-kpi-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
}

body.crm-v38 .crm-kpi-value,
body.crm-v38 .crm-v6-kpi-value,
body.crm-v38 .crm-compact-stat-value {
    font-size: 16px !important;
    font-weight: 780 !important;
    letter-spacing: -.02em;
}

body.crm-v38 .crm-kpi-label,
body.crm-v38 .crm-v6-kpi-label,
body.crm-v38 .crm-compact-stat-label {
    font-size: 9.2px !important;
    font-weight: 620 !important;
}

/* ---------------------------------------------------------------------
   Tabs / accordions / timeline content
   --------------------------------------------------------------------- */
body.crm-v38 .nav-tabs {
    gap: 3px !important;
    border-bottom-color: var(--crm-ui-border) !important;
}

body.crm-v38 .nav-tabs .nav-link {
    min-height: 30px !important;
    padding: 5px 8px !important;
    color: #607285 !important;
    border-radius: 6px 6px 0 0 !important;
    font-size: 10.4px !important;
    font-weight: 650 !important;
}

body.crm-v38 .nav-tabs .nav-link.active {
    color: var(--crm-ui-primary-hover) !important;
    background: #fff !important;
    border-color: var(--crm-ui-border) var(--crm-ui-border) #fff !important;
}

body.crm-v38 .accordion-item {
    border-color: var(--crm-ui-border) !important;
}

body.crm-v38 .accordion-button {
    min-height: 36px !important;
    padding: 7px 9px !important;
    font-size: 10.8px !important;
    font-weight: 680 !important;
    box-shadow: none !important;
}

body.crm-v38 .accordion-body {
    padding: 8px !important;
}

/* ---------------------------------------------------------------------
   Responsive: compact, but never cramped
   --------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
    body.crm-v38 {
        --crm-sidebar-width: 13.25rem;
    }

    body.crm-v38 .crm-global-search {
        width: min(315px, 29vw) !important;
    }
}

@media (max-width: 1199.98px) {
    body.crm-v38 .crm-global-search {
        width: min(280px, 30vw) !important;
    }

    body.crm-v38 .crm-workorder-pricing-scroll {
        max-height: 360px !important;
    }
}

@media (max-width: 991.98px) {
    body.crm-v38 .page-body > .container-fluid,
    body.crm-v38 .crm-breadcrumb-bar > .container-fluid {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    body.crm-v38 .crm-topbar-inner {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.crm-v38 .crm-global-search {
        width: min(300px, 40vw) !important;
    }

    body.crm-v38 .crm-form-page-head,
    body.crm-v38 .crm-page-heading {
        align-items: flex-start !important;
    }

    body.crm-v38 .crm-wo-stepbar {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767.98px) {
    body.crm-v38 {
        font-size: 12px;
    }

    body.crm-v38 .page-body {
        padding-top: .42rem !important;
    }

    body.crm-v38 .crm-global-search {
        display: none !important;
    }

    body.crm-v38 .crm-form-page-head,
    body.crm-v38 .crm-page-heading,
    body.crm-v38 .page-header.crm-page-header {
        flex-direction: column !important;
        gap: 6px !important;
    }

    body.crm-v38 .crm-form-page-head > .d-flex,
    body.crm-v38 .crm-page-heading > .d-flex {
        width: 100%;
    }

    body.crm-v38 .crm-form-page-head .btn,
    body.crm-v38 .crm-page-heading .btn {
        flex: 1 1 auto;
    }

    body.crm-v38 .crm-grid-toolbar,
    body.crm-v38 .crm-admin-list-toolbar {
        align-items: stretch !important;
    }

    body.crm-v38 .crm-grid-toolbar-main,
    body.crm-v38 .crm-admin-filter-form {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    body.crm-v38 .crm-grid-search {
        grid-column: 1 / -1;
        min-width: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    body.crm-v38 .crm-wo-stepbar {
        grid-template-columns: 1fr 1fr !important;
    }

    body.crm-v38 .crm-project-scope-toolbar .input-icon {
        width: 100% !important;
    }

    body.crm-v38 .modal-dialog {
        margin: 7px !important;
    }

    body.crm-v38 .modal-content {
        max-height: calc(100vh - 14px) !important;
    }
}

@media (max-width: 479.98px) {
    body.crm-v38 .crm-wo-stepbar {
        grid-template-columns: 1fr !important;
    }

    body.crm-v38 .crm-grid-toolbar-main,
    body.crm-v38 .crm-admin-filter-form {
        grid-template-columns: 1fr !important;
    }
}

/* ---------------------------------------------------------------------
   Auth / first impression: reuse the same brand language.
   !important is intentional because Login.cshtml contains legacy inline CSS.
   --------------------------------------------------------------------- */
body.crm-auth-v38,
body.crm-auth-v38.crm-auth-body {
    background: #edf3f6 !important;
}

body.crm-auth-v38 .psl-auth-page {
    grid-template-columns: minmax(0, 1fr) clamp(370px, 25vw, 410px) !important;
    background: #eef3f6 !important;
}

body.crm-auth-v38 .psl-brand-panel {
    background:
        radial-gradient(circle at 12% 10%, rgba(48, 194, 181, .15), transparent 25%),
        radial-gradient(circle at 92% 88%, rgba(79, 147, 192, .18), transparent 31%),
        linear-gradient(135deg, #102d44 0%, #143a53 48%, #0b796f 130%) !important;
}

body.crm-auth-v38 .psl-login-panel {
    padding: 24px !important;
    background: linear-gradient(160deg, #f2f6f8 0%, #f8fafb 55%, #edf3f6 100%) !important;
}

body.crm-auth-v38 .psl-login-card {
    max-width: 370px !important;
    padding: 22px 22px 19px !important;
    border: 1px solid #dbe4ea !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 42px rgba(23, 48, 68, .10) !important;
}

body.crm-auth-v38 .psl-logo-surface {
    min-height: 76px !important;
    padding: 7px 12px !important;
    border-radius: 12px !important;
}

body.crm-auth-v38 .psl-process-card {
    border-radius: 14px !important;
    background: rgba(5, 34, 52, .24) !important;
    box-shadow: none !important;
}

body.crm-auth-v38 .psl-step {
    min-height: 102px !important;
    border-radius: 10px !important;
}

body.crm-auth-v38 .psl-login-card .form-control {
    min-height: 34px !important;
    height: 34px !important;
}

/* Print must stay clean and neutral. */
@media print {
    body.crm-v38 {
        background: #fff !important;
        color: #000 !important;
    }

    body.crm-v38 .card,
    body.crm-v38 .crm-form-card,
    body.crm-v38 .crm-master-card {
        box-shadow: none !important;
        border-color: #d0d0d0 !important;
    }
}

/* Legacy form/header fallbacks: pages that have not yet adopted the newer helper classes. */
body.crm-v38 .crm-main-container > .page-header:not(.crm-page-header),
body.crm-v38 .crm-entry-form > .d-flex.justify-content-between.align-items-center:first-of-type,
body.crm-v38 .crm-entry-form > .d-flex.justify-content-between.align-items-start:first-of-type {
    min-height: 0 !important;
    margin: 0 0 7px !important;
    padding: 2px 0 7px !important;
    border-bottom: 1px solid var(--crm-ui-border) !important;
}

body.crm-v38 .crm-main-container > .page-header:not(.crm-page-header) .page-title,
body.crm-v38 .crm-entry-form > .d-flex.justify-content-between:first-of-type h1,
body.crm-v38 .crm-entry-form > .d-flex.justify-content-between:first-of-type h2 {
    margin: 0 !important;
    color: var(--crm-ui-text) !important;
    font-size: 15px !important;
    font-weight: 770 !important;
    line-height: 1.25 !important;
    letter-spacing: -.018em !important;
}

body.crm-v38 .crm-entry-form > .d-flex.justify-content-between:first-of-type .text-secondary {
    margin-top: 2px !important;
    font-size: 9.4px !important;
    line-height: 1.32 !important;
}

/* Report-specific normalization: remove legacy saturated table chrome while keeping report semantics. */
body.crm-v38 .crm-followup-data-table thead th,
body.crm-v38 .crm-report-table thead th,
body.crm-v38 .crm-project-status-table thead th,
body.crm-v38 .crm-task-master-table thead th {
    color: #506476 !important;
    background: #edf5f4 !important;
    border-bottom-color: #d4e5e2 !important;
}

body.crm-v38 .crm-followup-data-table tbody tr:hover td,
body.crm-v38 .crm-report-table tbody tr:hover td,
body.crm-v38 .crm-project-status-table tbody tr:hover td,
body.crm-v38 .crm-task-master-table tbody tr:hover td {
    background: #f5faf9 !important;
}

/* Master-data and admin screens: compact title/tool/action composition. */
body.crm-v38 .crm-admin-list-card,
body.crm-v38 .crm-master-card {
    overflow: visible !important;
}

body.crm-v38 .crm-admin-table .btn.btn-sm,
body.crm-v38 .crm-grid-table .btn.btn-sm {
    min-height: 25px !important;
    padding: 3px 6px !important;
}

/* Empty states should be informative without consuming half a screen. */
body.crm-v38 .crm-dashboard-empty,
body.crm-v38 .crm-v6-empty,
body.crm-v38 .crm-structure-empty,
body.crm-v38 .empty,
body.crm-v38 .empty-state {
    min-height: 88px !important;
    padding: 14px !important;
}

body.crm-v38 .crm-dashboard-empty i,
body.crm-v38 .crm-v6-empty i,
body.crm-v38 .crm-structure-empty-icon {
    font-size: 20px !important;
}

/* Keep content cards visually connected on form pages. */
body.crm-v38 .crm-entry-form > .row,
body.crm-v38 .crm-premium-form > .row {
    --tblr-gutter-x: 10px !important;
    --tblr-gutter-y: 8px !important;
}

body.crm-v38 .crm-form-side-sticky {
    top: calc(var(--crm-topbar-height) + 38px) !important;
}

/* File inputs are otherwise visibly taller than the rest of the form. */
body.crm-v38 input.form-control[type="file"] {
    padding: 3px 6px !important;
    font-size: 10px !important;
}

body.crm-v38 input.form-control[type="file"]::file-selector-button {
    height: 23px;
    margin: -1px 7px -1px -4px;
    padding: 3px 7px;
    color: #536779;
    background: #f2f6f8;
    border: 0;
    border-right: 1px solid var(--crm-ui-border);
    font-size: 9.5px;
    font-weight: 650;
}

/* A subtle focus outline for keyboard users without noisy blue rings. */
body.crm-v38 a:focus-visible,
body.crm-v38 button:focus-visible,
body.crm-v38 [tabindex]:focus-visible {
    outline: 2px solid rgba(var(--crm-ui-primary-rgb), .42) !important;
    outline-offset: 2px;
}
