/* CRM V27.17 central appearance runtime — semantic components, never raw <button> */
.crm-theme-runtime{background:var(--crm-page-bg)!important;color:var(--crm-text)}
.crm-theme-runtime .crm-main,.crm-theme-runtime .page{background:var(--crm-page-bg)}
.crm-theme-runtime .sidebar{background:var(--crm-sidebar-bg)!important}.crm-theme-runtime .sidebar .nav-item.active{background:var(--crm-sidebar-active-gradient)!important;color:#fff!important}
.crm-theme-runtime :where(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea){border-color:var(--crm-border)!important;border-radius:var(--crm-input-radius)!important;color:var(--crm-text);background:var(--crm-surface)}
.crm-theme-runtime :where(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea):focus{border-color:var(--crm-primary)!important;box-shadow:var(--crm-focus)!important;outline:none!important}
/* primary actions only */
.crm-theme-runtime :where(.btn.primary,.btn-primary,.pm-btn-primary,.ex-gradient-btn,.db20-btn.primary,.rp-btn.primary,.bk2521-filter-btn,.col14-btn-primary,.col-btn-primary,.ll-btn-primary,.si-btn-primary,.ca-btn-primary,.ac-primary,.pex-primary,.ua-primary,.ca-save,[data-crm-action="primary"],button[type="submit"]:not(.profile-logout):not(.danger):not(.btn-danger):not(.ca-reset)){background:var(--crm-gradient)!important;background-image:var(--crm-gradient)!important;color:#fff!important;border-color:transparent!important;border-radius:var(--crm-button-radius)!important;box-shadow:0 4px 12px color-mix(in srgb,var(--crm-primary) 16%,transparent)!important}
/* secondary actions: very light primary */
.crm-theme-runtime :where(.ghost,.btn-ghost,.pm-btn-ghost,.pm-btn-soft,.ex-secondary-btn,.ca-btn-light,.ca-reset,[data-crm-action="secondary"]){background:var(--crm-secondary-soft)!important;background-image:none!important;color:var(--crm-primary)!important;border-color:var(--crm-primary-soft-border)!important}
/* danger: very light red */
.crm-theme-runtime :where(.danger,.btn-danger,.pm-btn-danger,.ua-danger-btn,.danger-ghost,.delete-btn,.remove-btn,.cancel-btn,[data-danger],[data-action="delete"],[data-action="remove"]){background:var(--crm-danger-soft)!important;background-image:none!important;color:#dc2626!important;border-color:color-mix(in srgb,#dc2626 18%,white)!important;box-shadow:none!important}
/* row actions */
.crm-theme-runtime :where(.row-action,.table-action,.si-link-btn,.col14-invoice-button,[data-row-action]){background:var(--crm-row-soft)!important;background-image:none!important;color:var(--crm-primary)!important;border-color:transparent!important;box-shadow:none!important}
/* icon-only controls: no box/background */
.crm-theme-runtime :where(.icon-button,.top-icon,.menu-btn,.collapse-btn,.edit-icon,.pencil-btn,.eye-btn,.three-dot,.more-btn,[data-icon-action]){background:transparent!important;background-image:none!important;border-color:transparent!important;box-shadow:none!important;color:var(--crm-muted)!important}
.crm-theme-runtime :where(.icon-button,.top-icon,.menu-btn,.collapse-btn,.edit-icon,.pencil-btn,.eye-btn,.three-dot,.more-btn,[data-icon-action]):hover{background:transparent!important;color:var(--crm-primary)!important;transform:none!important}
/* toggles */
.crm-theme-runtime :where(.toggle-btn,.filter-toggle,[role=tab],[data-toggle-choice]){background:#fff!important;background-image:none!important;color:var(--crm-text)!important;border-color:var(--crm-border)!important;box-shadow:none!important}
.crm-theme-runtime :where(.toggle-btn,.filter-toggle,[role=tab],[data-toggle-choice]).active,.crm-theme-runtime :where([role=tab][aria-selected=true],[data-toggle-choice][aria-pressed=true]){background:var(--crm-toggle-soft)!important;color:var(--crm-primary)!important;border-color:var(--crm-primary-soft-border)!important}
/* native selects are progressively enhanced by crm-select-runtime-v1.js */
.crm-native-select{position:relative;display:inline-block;min-width:0;width:100%}.crm-native-select>select.crm-select-source{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;pointer-events:none!important}.crm-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:var(--crm-control-height);padding:0 11px;border:1px solid var(--crm-border);border-radius:var(--crm-input-radius);background:var(--crm-surface);color:var(--crm-text);font:600 13px Inter,sans-serif;cursor:pointer;text-align:left}.crm-select-trigger:focus,.crm-native-select.is-open .crm-select-trigger{outline:none;border-color:var(--crm-primary);box-shadow:var(--crm-focus)}
.crm-select-chevron{width:7px;height:7px;flex:0 0 7px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg);margin-top:-4px;transition:.16s}.crm-native-select.is-open .crm-select-chevron{transform:rotate(225deg);margin-top:4px}.crm-select-menu{position:fixed;z-index:99999;display:none;max-height:300px;overflow:auto;padding:5px;border:1px solid var(--crm-border);border-radius:10px;background:var(--crm-surface);box-shadow:0 18px 42px rgba(15,23,42,.15)}.crm-select-menu.is-open{display:block}.crm-select-option{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:6px 9px;border:0;border-radius:7px;background:transparent!important;background-image:none!important;color:var(--crm-text)!important;box-shadow:none!important;text-align:left;cursor:pointer}.crm-select-option:hover{background:var(--crm-primary-soft)!important;color:var(--crm-primary)!important}.crm-select-option.is-selected{background:var(--crm-primary-soft)!important;color:var(--crm-primary)!important}.crm-select-dot{width:7px;height:7px;border-radius:50%;background:var(--option-color,var(--crm-primary));flex:0 0 7px}.crm-theme-runtime[data-crm-option-style="plain"] .crm-select-dot{display:none}.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-option-label{padding:2px 7px;border-radius:999px;background:color-mix(in srgb,var(--option-color,var(--crm-primary)) 8%,white)}.crm-theme-runtime[data-crm-dropdown-style="minimal"] .crm-select-trigger{border-width:0 0 1px;border-radius:0;padding-inline:2px}.crm-theme-runtime[data-crm-dropdown-style="compact"] .crm-select-trigger{min-height:32px;padding-inline:8px}.crm-theme-runtime[data-crm-dropdown-style="modern"] .crm-select-trigger{background:#f8fafc}
/* existing custom dropdown families share same palette */
.crm-theme-runtime :where(.lc-select-trigger,.ex-select-trigger,.db-field,.ca-dropdown-trigger){border-color:var(--crm-border)!important;border-radius:var(--crm-input-radius)!important;background:var(--crm-surface)!important;background-image:none!important;color:var(--crm-text)!important;box-shadow:none!important}.crm-theme-runtime :where(.lc-select.is-open .lc-select-trigger,.ex-select.is-open .ex-select-trigger,.db-field.is-select-open,.ca-dropdown.open .ca-dropdown-trigger){border-color:var(--crm-primary)!important;box-shadow:var(--crm-focus)!important}.crm-theme-runtime :where(.lc-select-menu,.ex-select-menu,.db-select-menu,.ca-dropdown-menu){background:var(--crm-surface)!important;border-color:var(--crm-border)!important;border-radius:10px!important;box-shadow:0 18px 42px rgba(15,23,42,.14)!important}.crm-theme-runtime :where(.lc-select-option,.ex-select-option,.db-select-menu button,.ca-dropdown-option){background:transparent!important;background-image:none!important;box-shadow:none!important;color:var(--crm-text)!important}.crm-theme-runtime :where(.lc-select-option,.ex-select-option,.db-select-menu button,.ca-dropdown-option):hover{background:var(--crm-primary-soft)!important;color:var(--crm-primary)!important}
/* pagination: all families one look */
.crm-theme-runtime :where(.pagination,.ll-pagination,.bk2521-pagination,.col14-pagination,.ex-pagination,.pm-pagination,.ua-pager) :where(a,button,span){background:#fff!important;background-image:none!important;color:var(--crm-muted)!important;border-color:var(--crm-border)!important;border-radius:7px!important;box-shadow:none!important}.crm-theme-runtime :where(.pagination,.ll-pagination,.bk2521-pagination,.col14-pagination,.ex-pagination,.pm-pagination,.ua-pager) :where(.active,[aria-current=page],.on){background:var(--crm-gradient)!important;background-image:var(--crm-gradient)!important;color:#fff!important;border-color:transparent!important}.crm-theme-runtime :where(.pagination,.ll-pagination,.bk2521-pagination,.col14-pagination,.ex-pagination,.pm-pagination,.ua-pager) :where(a,button):hover{color:var(--crm-primary)!important;border-color:var(--crm-primary-soft-border)!important;background:var(--crm-primary-soft)!important}
/* date picker */
.crm-theme-runtime :where(.crm-date-picker,.crm-datetime-picker,.crm-dtp){--blue:var(--crm-primary);--purple:var(--crm-secondary);border-radius:var(--crm-card-radius)!important}.crm-theme-runtime :where(.crm-date-picker,.crm-datetime-picker,.crm-dtp) button{background:transparent!important;background-image:none!important;color:inherit!important;box-shadow:none!important}.crm-theme-runtime :where(.crm-date-picker,.crm-datetime-picker,.crm-dtp) :where(.selected,.is-selected,[aria-selected=true]){background:var(--crm-gradient)!important;background-image:var(--crm-gradient)!important;color:#fff!important}
.crm-theme-runtime :where(.card,.panel,.widget,[class*="-card"],[class*="-panel"]){border-radius:var(--crm-card-radius)}.crm-theme-runtime[data-crm-table-density="compact"] table :where(th,td){padding-top:7px!important;padding-bottom:7px!important}
.crm-pagination{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.crm-pagination>a,.crm-pagination>span{display:grid;place-items:center;min-width:30px;height:30px;padding:0 7px;text-decoration:none;border:1px solid var(--crm-border);border-radius:7px;background:#fff;color:var(--crm-muted);font-size:12px;font-weight:700}.crm-pagination>.active{background:var(--crm-gradient)!important;color:#fff!important;border-color:transparent!important}.crm-pagination>.crm-page-gap{border-color:transparent!important;background:transparent!important}.crm-pagination>.disabled{opacity:.45}.crm-chev{display:block;width:6px;height:6px;border-bottom:1.5px solid currentColor}.crm-chev.left{border-left:1.5px solid currentColor;transform:rotate(45deg)}.crm-chev.right{border-right:1.5px solid currentColor;transform:rotate(-45deg)}
.crm-theme-runtime[data-crm-pagination-style="modern"] .crm-pagination>a,.crm-theme-runtime[data-crm-pagination-style="modern"] .crm-pagination>span{border-radius:999px}.crm-theme-runtime[data-crm-pagination-style="compact"] .crm-pagination{gap:2px}.crm-theme-runtime[data-crm-pagination-style="compact"] .crm-pagination>a,.crm-theme-runtime[data-crm-pagination-style="compact"] .crm-pagination>span{min-width:26px;height:26px;padding:0 5px}
/* Appearance live variants */
.ca-page[data-button-style="solid"] .pv-primary{background:var(--p)!important;background-image:none!important}.ca-page[data-dropdown-style="modern"] .pv-trigger{background:#f8fafc!important}.ca-page[data-dropdown-style="minimal"] .pv-trigger{border-width:0 0 1px!important;border-radius:0!important;padding-inline:2px!important}.ca-page[data-dropdown-style="compact"] .pv-trigger{height:32px!important}.ca-page[data-pagination-style="modern"] .pv-pages button{border-radius:999px!important}.ca-page[data-pagination-style="compact"] .pv-pages{gap:2px}.ca-page[data-pagination-style="compact"] .pv-pages button,.ca-page[data-pagination-style="compact"] .pv-pages span{min-width:22px!important;height:22px!important}

/* V27.17.3 — GLOBAL DROPDOWN OPTION STYLE */

/* Plain */
.crm-theme-runtime[data-crm-option-style="plain"] .crm-select-dot{
    display:none !important;
}

.crm-theme-runtime[data-crm-option-style="plain"] .crm-select-option-label{
    padding:0 !important;
    border-radius:0 !important;
    background:transparent !important;
}

/* Color Dot */
.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-dot{
    display:inline-block !important;
}

.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-option-label{
    padding:0 !important;
    border-radius:0 !important;
    background:transparent !important;
}

/* Color Pill */
.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-dot{
    display:none !important;
}

.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-option-label{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    padding:3px 8px !important;
    border-radius:999px !important;
    background:color-mix(
        in srgb,
        var(--option-color,var(--crm-primary)) 9%,
        white
    ) !important;
    color:var(--option-color,var(--crm-primary)) !important;
}

/* V27.17.11 — Global dropdown menu scrolling only */

body > .crm-select-menu{
    max-height:min(320px, calc(100vh - 24px)) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    pointer-events:auto !important;
}

/* Options must not create their own scroll/overflow layer */
body > .crm-select-menu .crm-select-option{
    flex:0 0 auto !important;
}

/* Keep menu above normal CRM content */
body > .crm-select-menu.is-open{
    z-index:10000 !important;
}

/* CRM global semantic select styles */
.crm-select-value.has-color{
    display:flex;
    align-items:center;
    gap:7px;
    min-width:0;
}
.crm-select-value-dot{
    width:7px;
    height:7px;
    flex:0 0 7px;
    border-radius:50%;
    background:var(--option-color,var(--crm-primary));
}
.crm-select-value-label{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* Plain */
.crm-theme-runtime[data-crm-option-style="plain"] .crm-select-dot,
.crm-theme-runtime[data-crm-option-style="plain"] .crm-select-value-dot{
    display:none!important;
}

/* Color Dot */
.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-dot,
.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-value-dot{
    display:block!important;
}
.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-option-label,
.crm-theme-runtime[data-crm-option-style="color-dot"] .crm-select-value-label{
    padding:0!important;
    background:transparent!important;
}

/* Color Pill */
.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-dot,
.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-value-dot{
    display:none!important;
}
.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-option-label,
.crm-theme-runtime[data-crm-option-style="color-pill"] .crm-select-value-label{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    padding:3px 8px!important;
    border-radius:999px;
    background:color-mix(
        in srgb,
        var(--option-color,var(--crm-primary)) 12%,
        white
    )!important;
    color:var(--option-color,var(--crm-primary))!important;
}

/* CRM searchable project filter v1 */
body > .crm-select-menu.crm-select-menu-searchable{
    max-height:none !important;
    overflow:hidden !important;
    padding:5px !important;
}

body > .crm-select-menu.crm-select-menu-searchable .crm-select-search-wrap{
    position:sticky;
    top:0;
    z-index:2;
    padding:3px 3px 6px;
    background:var(--crm-surface);
}

body > .crm-select-menu.crm-select-menu-searchable .crm-select-search{
    display:block;
    width:100%;
    height:34px;
    padding:0 10px;
    border:1px solid var(--crm-border);
    border-radius:8px;
    background:var(--crm-surface);
    color:var(--crm-text);
    font:600 12px Inter,sans-serif;
    outline:none;
}

body > .crm-select-menu.crm-select-menu-searchable .crm-select-search:focus{
    border-color:var(--crm-primary);
    box-shadow:var(--crm-focus);
}

body > .crm-select-menu.crm-select-menu-searchable{
    max-height:246px !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
}

body > .crm-select-menu.crm-select-menu-searchable .crm-select-option{
    min-height:32px !important;
}

body > .crm-select-menu.crm-select-menu-searchable .crm-select-empty{
    padding:14px 10px;
    text-align:center;
    color:var(--crm-muted);
    font-size:12px;
    font-weight:600;
}

@media(max-width:520px){
    body > .crm-select-menu.crm-select-menu-searchable{
        max-height:246px !important;
        max-width:calc(100vw - 20px);
    }
}

/* crm-searchable-project-premium-v1 */
body > .crm-select-menu.crm-select-menu-searchable{
 padding:7px!important;
 border:1px solid #dce5f1!important;
 border-radius:12px!important;
 background:rgba(255,255,255,.98)!important;
 box-shadow:0 18px 45px rgba(15,42,67,.20)!important;
 backdrop-filter:blur(12px);
 max-height:min(300px,45vh)!important;
 scrollbar-width:thin;
 scrollbar-color:#8aa9ef #edf3fb;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-search-wrap{
 position:sticky!important;
 top:-7px!important;
 z-index:5!important;
 padding:0 0 5px!important;
 margin:0!important;
 background:rgba(255,255,255,.98)!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-search{
 display:block!important;
 width:100%!important;
 height:42px!important;
 min-height:42px!important;
 margin:0!important;
 padding:0 12px 0 38px!important;
 border:1px solid #dce5f1!important;
 border-radius:9px!important;
 outline:0!important;
 color:#263b52!important;
 font:600 13px Manrope,sans-serif!important;
 line-height:42px!important;
 box-sizing:border-box!important;
 box-shadow:0 2px 8px rgba(15,42,67,.05)!important;

 background-color:#fff!important;
 background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7f95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")!important;
 background-repeat:no-repeat!important;
 background-position:12px center!important;
 background-size:16px 16px!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-search::placeholder{
 color:#8a9aab!important;
 opacity:1!important;
 font-weight:550!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-search:focus{
 border-color:var(--crm-primary)!important;
 box-shadow:0 0 0 3px rgba(37,99,235,.10)!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-option{
 display:flex!important;
 align-items:center!important;
 justify-content:space-between!important;
 gap:10px!important;
 width:100%!important;
 min-height:39px!important;
 padding:10px 11px!important;
 border:0!important;
 border-radius:8px!important;
 background:transparent!important;
 color:#263b52!important;
 font:650 12px Manrope,sans-serif!important;
 text-align:left!important;
 cursor:pointer!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-option:hover{
 background:linear-gradient(
  90deg,
  #edf5ff,
  #f5efff
 )!important;
 color:var(--crm-primary)!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-option.is-selected{
 background:#eaf2ff!important;
 color:var(--crm-primary)!important;
 font-weight:800!important;
}

body > .crm-select-menu.crm-select-menu-searchable
.crm-select-empty{
 width:100%!important;
 padding:18px 12px!important;
 border-radius:8px!important;
 color:#8493a5!important;
 font:650 12px Manrope,sans-serif!important;
 text-align:center!important;
 box-sizing:border-box!important;
}

body > .crm-select-menu.crm-select-menu-searchable::-webkit-scrollbar{
 width:7px;
}

body > .crm-select-menu.crm-select-menu-searchable::-webkit-scrollbar-track{
 background:#edf3fb;
 border-radius:9px;
}

body > .crm-select-menu.crm-select-menu-searchable::-webkit-scrollbar-thumb{
 background:linear-gradient(
  var(--crm-primary),
  var(--crm-secondary)
 );
 border-radius:9px;
}

@media(max-width:700px){
 body > .crm-select-menu.crm-select-menu-searchable
 .crm-select-search{
  height:44px!important;
  min-height:44px!important;
  line-height:44px!important;
  font-size:16px!important;
 }

 body > .crm-select-menu.crm-select-menu-searchable{
  max-height:min(320px,48vh)!important;
 }
}

/* crm-dropdown-modal-layer-v1
   Global select menus are portalled directly under <body>.
   Keep them above CRM modals/backdrops. */
body > .crm-select-menu.is-open{
    z-index:1000000 !important;
}



/* Global User Dropdown Avatar V1 */
body > .crm-select-menu .crm-select-user-avatar{
    width:22px;
    height:22px;
    min-width:22px;
    flex:0 0 22px;
    border-radius:50%;
    overflow:hidden;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:9px;
    font-weight:800;
    line-height:1;
    background:var(--crm-primary-soft);
    color:var(--crm-primary);
}
body > .crm-select-menu .crm-select-user-avatar img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
}
body > .crm-select-menu .crm-select-user-avatar + .crm-select-option-label{
    flex:1;
    min-width:0;
}


/* Global Employee Avatar V2 */
body > .crm-select-menu .crm-select-user-avatar{
    width:22px;
    height:22px;
    min-width:22px;
    flex:0 0 22px;
    border-radius:50%;
    overflow:hidden;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:9px;
    line-height:1;
    font-weight:800;
    background:var(--crm-primary-soft,#eef2ff);
    color:var(--crm-primary,#4f46e5);
}
body > .crm-select-menu .crm-select-user-avatar img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:inherit;
}
body > .crm-select-menu .crm-select-user-avatar + .crm-select-option-label{
    min-width:0;
    flex:1;
}


/* GLOBAL EMPLOYEE AVATAR SIZE LOCK V1 */
.crm-select-user-avatar{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    min-height:22px !important;
    max-width:22px !important;
    max-height:22px !important;
    flex:0 0 22px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    overflow:hidden !important;
    border-radius:50% !important;

    font-size:10px !important;
    font-weight:800 !important;
    line-height:22px !important;

    vertical-align:middle !important;
}

.crm-select-user-avatar img{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    min-height:22px !important;
    max-width:22px !important;
    max-height:22px !important;

    display:block !important;
    object-fit:cover !important;
    border-radius:50% !important;
}

.crm-select-option{
    min-height:34px;
}

.crm-select-option .crm-select-user-avatar{
    margin:0 !important;
}

/* =========================================================
   GLOBAL DATE PICKER THEME
   100% CRM FRONTEND THEME CONTROLLED
========================================================= */

/* Selected Date */
.crm-theme-runtime .crm-dtp .crm-dtp-days button.selected,
.crm-theme-runtime .crm-dtp .crm-dtp-days button.today.selected,
.crm-theme-runtime .crm-dtp .crm-dtp-days button.selected:hover{
    background:var(--crm-primary-soft) !important;
    background-image:none !important;
    border-color:var(--crm-primary) !important;
    color:var(--crm-primary) !important;
    box-shadow:inset 0 0 0 1px var(--crm-primary) !important;
    font-weight:800 !important;
}

/* Apply */
.crm-theme-runtime .crm-dtp .crm-dtp-actions button[data-apply],
.crm-theme-runtime .crm-dtp .crm-dtp-actions button[data-apply]:hover{
    background:var(--crm-primary-soft) !important;
    background-image:none !important;
    border:1px solid var(--crm-primary) !important;
    color:var(--crm-primary) !important;
    box-shadow:none !important;
    font-weight:800 !important;
}

/* Today */
.crm-theme-runtime .crm-dtp .crm-dtp-days button.today:not(.selected){
    background:var(--crm-surface) !important;
    background-image:none !important;
    border:1px solid var(--crm-primary) !important;
    color:var(--crm-primary) !important;
}

/* Hover */
.crm-theme-runtime .crm-dtp .crm-dtp-days button:not(.selected):hover,
.crm-theme-runtime .crm-dtp .crm-dtp-quick button:hover{
    background:var(--crm-primary-soft) !important;
    background-image:none !important;
    color:var(--crm-primary) !important;
}

/* Cancel */
.crm-theme-runtime .crm-dtp .crm-dtp-actions button[data-cancel]{
    background:var(--crm-surface) !important;
    background-image:none !important;
    border-color:var(--crm-border) !important;
    color:var(--crm-text) !important;
}


/* =========================================================
   CRM GLOBAL NUMBER INPUT — HIDE SPINNER
   Keeps type=number behavior, removes browser +/- arrows
========================================================= */

/* Chrome / Edge / Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{
    -webkit-appearance:none;
    margin:0;
}

/* Firefox */
input[type="number"]{
    -moz-appearance:textfield;
    appearance:textfield;
}



/* =========================================================
   CRM TOPBAR RIGHT ACTIONS V1
   Notification + User Profile stay on right
========================================================= */

.topbar{
    width:100%;
    min-width:0;
}

/* Bell wrapper starts the right-side action group */
.topbar .crm-notification-wrap{
    margin-left:auto !important;
    flex:0 0 auto;
}

/* Old button-level auto margin is no longer needed */
.topbar .crm-notification-btn,
.topbar .top-icon{
    margin-left:0 !important;
    flex:0 0 auto;
}

/* Profile stays directly after notification */
.topbar .user-profile-dropdown{
    margin-left:0 !important;
    flex:0 0 auto;
}

/* Prevent profile itself stretching */
.topbar .user-profile-dropdown > summary{
    flex:0 0 auto;
}


/* TABLET */
@media (min-width:761px) and (max-width:1100px){

    .topbar{
        gap:10px !important;
        padding-left:18px !important;
        padding-right:18px !important;
    }

    .topbar .global-search{
        min-width:0;
        flex:1 1 280px;
        width:auto;
        max-width:440px;
    }

    .topbar .crm-daily-caption{
        flex:0 1 auto;
        min-width:0;
    }

}


/* MOBILE */
@media (max-width:760px){

    .topbar{
        width:100%;
        gap:9px !important;
        padding-left:14px !important;
        padding-right:14px !important;
    }

    .topbar .crm-notification-wrap{
        margin-left:auto !important;
    }

    .topbar .user-profile-dropdown{
        flex:0 0 auto;
    }

}

/* === CRM Global Sticky Topbar === */
.crm-main > .topbar{
    position:sticky !important;
    top:0 !important;
    z-index:1000 !important;
    flex-shrink:0;
}

/* =========================================================
   MOBILE TOPBAR — SEARCH + INTERNAL CHAT
   ========================================================= */

.crm-mobile-top-actions{
    display:none;
}

@media(max-width:760px){

    .topbar{
        gap:7px !important;
        padding-left:10px !important;
        padding-right:10px !important;
    }

    .topbar .global-search{
        position:absolute !important;
        left:8px !important;
        right:8px !important;
        top:calc(100% + 7px) !important;
        width:auto !important;
        max-width:none !important;
        z-index:10030 !important;

        opacity:0;
        visibility:hidden;
        pointer-events:none;
        transform:translateY(-5px);

        transition:
            opacity .16s ease,
            transform .16s ease,
            visibility .16s ease;
    }

    .topbar .global-search.crm-mobile-search-open{
        opacity:1;
        visibility:visible;
        pointer-events:auto;
        transform:translateY(0);
    }

    .topbar .global-search input{
        width:100% !important;
        min-width:0 !important;
        font-size:16px !important;
    }

    .topbar .global-search kbd{
        display:none !important;
    }

    .crm-mobile-top-actions{
        display:flex;
        align-items:center;
        gap:4px;
        margin-left:auto;
        flex:0 0 auto;
    }

    .crm-mobile-action{
        position:relative;
        width:38px;
        height:38px;
        min-width:38px;
        padding:0;
        border:0;
        border-radius:11px;

        display:grid;
        place-items:center;

        background:transparent;
        color:var(--crm-text,#172033);

        cursor:pointer;
        -webkit-tap-highlight-color:transparent;
        transition:
            background .16s ease,
            transform .12s ease;
    }

    .crm-mobile-action:active{
        transform:scale(.94);
        background:rgba(127,127,127,.10);
    }

    .crm-mobile-action svg{
        width:21px;
        height:21px;
        display:block;

        fill:none;
        stroke:currentColor;
        stroke-width:1.9;
        stroke-linecap:round;
        stroke-linejoin:round;
    }

    .crm-mobile-chat-btn svg{
        width:22px;
        height:22px;
    }

    .crm-mobile-chat-count{
        position:absolute;
        top:1px;
        right:0;

        min-width:17px;
        height:17px;
        padding:0 4px;

        border:2px solid var(--crm-surface,#fff);
        border-radius:999px;

        display:grid;
        place-items:center;

        background:#ef4444;
        color:#fff;

        font-size:9px;
        line-height:1;
        font-weight:800;
    }

    .crm-mobile-chat-count[hidden]{
        display:none !important;
    }

    /* notification no longer needs to push itself right */
    .topbar .crm-notification-wrap{
        margin-left:0 !important;
    }

    /* daily thought does not compete for mobile topbar space */
    .topbar .crm-daily-caption{
        display:none !important;
    }
}

/* =========================================================
   MOBILE TOPBAR V2
   Real Global Search Field + Clean Chat Action
   ========================================================= */
@media(max-width:760px){

    .topbar{
        gap:6px !important;
        padding-left:8px !important;
        padding-right:8px !important;
    }

    /* Hide separate mobile search icon */
    .crm-mobile-search-btn{
        display:none !important;
    }

    /* Action wrapper should not consume auto space */
    .crm-mobile-top-actions{
        margin-left:0 !important;
        gap:4px !important;
        order:3;
    }

    /* REAL EXISTING GLOBAL SEARCH */
    .topbar .global-search{
        position:relative !important;

        left:auto !important;
        right:auto !important;
        top:auto !important;
        bottom:auto !important;

        order:2;

        display:flex !important;
        flex:1 1 auto !important;

        width:auto !important;
        min-width:0 !important;
        max-width:none !important;

        height:38px !important;
        margin:0 !important;

        opacity:1 !important;
        visibility:visible !important;
        pointer-events:auto !important;
        transform:none !important;

        z-index:10010 !important;
    }

    .topbar .global-search > span{
        flex:0 0 auto !important;
    }

    .topbar .global-search input{
        display:block !important;
        flex:1 1 auto !important;

        width:100% !important;
        min-width:0 !important;

        height:100% !important;
        padding-right:8px !important;

        font-size:13px !important;
        line-height:normal !important;
    }

    .topbar .global-search input::placeholder{
        font-size:12px !important;
    }

    .topbar .global-search kbd{
        display:none !important;
    }

    /* AJAX RESULT PANEL BELOW FIELD */
    .topbar .crm-global-search-panel{
        position:absolute !important;

        top:calc(100% + 7px) !important;
        left:0 !important;
        right:0 !important;

        width:min(340px,calc(100vw - 16px)) !important;
        min-width:min(300px,calc(100vw - 16px)) !important;
        max-width:calc(100vw - 16px) !important;

        max-height:60dvh !important;
        overflow-y:auto !important;

        z-index:10050 !important;
    }

    /* Menu remains first */
    .topbar .menu-btn{
        order:1;
        flex:0 0 auto !important;
    }

    /* CLEAN CHAT BUTTON */
    .crm-mobile-chat-btn{
        order:1;

        width:38px !important;
        height:38px !important;
        min-width:38px !important;

        border:1px solid rgba(100,116,139,.14) !important;
        border-radius:12px !important;

        background:rgba(248,250,252,.85) !important;
        color:var(--crm-text,#172033) !important;

        box-shadow:0 2px 7px rgba(15,23,42,.05);
    }

    .crm-mobile-chat-btn svg{
        width:21px !important;
        height:21px !important;

        fill:none !important;
        stroke:currentColor !important;
        stroke-width:1.8 !important;
        stroke-linecap:round !important;
        stroke-linejoin:round !important;
    }

    .crm-mobile-chat-btn:active{
        background:rgba(226,232,240,.8) !important;
        transform:scale(.95);
    }

    .crm-mobile-chat-count{
        top:-5px !important;
        right:-5px !important;
    }

    /* Bell */
    .topbar .crm-notification-wrap{
        order:4;
        margin-left:0 !important;
        flex:0 0 auto !important;
    }

    /* Profile */
    .topbar .user-profile-dropdown{
        order:5;
        flex:0 0 auto !important;
    }

    /* no thought on mobile */
    .topbar .crm-daily-caption{
        display:none !important;
    }
}

/* Extra narrow phones */
@media(max-width:380px){

    .topbar{
        gap:4px !important;
        padding-left:6px !important;
        padding-right:6px !important;
    }

    .topbar .global-search{
        height:36px !important;
    }

    .topbar .global-search input{
        font-size:12px !important;
    }

    .topbar .global-search input::placeholder{
        font-size:11px !important;
    }

    .crm-mobile-chat-btn{
        width:36px !important;
        height:36px !important;
        min-width:36px !important;
    }
}

/* =========================================================
   CRM CHAT BUTTON — CONSISTENT RESPONSIVE SIZE
   ========================================================= */

.crm-mobile-chat-btn{
    position:relative !important;

    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    min-height:40px !important;
    flex:0 0 40px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    padding:0 !important;

    border:1px solid rgba(100,116,139,.16) !important;
    border-radius:12px !important;

    background:#f8fafc !important;
    color:var(--crm-text,#172033) !important;

    box-shadow:0 2px 8px rgba(15,23,42,.06) !important;

    cursor:pointer !important;
    overflow:visible !important;

    transition:
        background .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease !important;
}

.crm-mobile-chat-btn svg{
    display:block !important;

    width:23px !important;
    height:23px !important;

    flex:0 0 23px !important;

    fill:none !important;
    stroke:currentColor !important;
    stroke-width:2.15 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;

    overflow:visible !important;
}

.crm-mobile-chat-btn:hover{
    background:#fff !important;
    border-color:rgba(37,99,235,.28) !important;
    color:var(--crm-primary,#2563eb) !important;
    box-shadow:0 5px 14px rgba(15,23,42,.10) !important;
}

.crm-mobile-chat-btn:active{
    transform:scale(.96) !important;
}

.crm-mobile-chat-count{
    position:absolute !important;

    top:-5px !important;
    right:-5px !important;

    min-width:18px !important;
    height:18px !important;
    padding:0 4px !important;

    display:grid;
    place-items:center;

    border:2px solid var(--crm-surface,#fff) !important;
    border-radius:999px !important;

    background:#ef4444 !important;
    color:#fff !important;

    font-size:9px !important;
    line-height:1 !important;
    font-weight:800 !important;

    box-sizing:border-box !important;
}


/* Tablet + mobile — never shrink chat icon */
@media(max-width:1100px){

    .crm-mobile-chat-btn{
        width:40px !important;
        height:40px !important;
        min-width:40px !important;
        min-height:40px !important;
        flex:0 0 40px !important;
    }

    .crm-mobile-chat-btn svg{
        width:23px !important;
        height:23px !important;
        flex-basis:23px !important;
    }
}


/* Very small phones */
@media(max-width:390px){

    .crm-mobile-chat-btn{
        width:38px !important;
        height:38px !important;
        min-width:38px !important;
        min-height:38px !important;
        flex:0 0 38px !important;
    }

    .crm-mobile-chat-btn svg{
        width:22px !important;
        height:22px !important;
        flex-basis:22px !important;
    }
}


/* MODERN INTERNAL CHAT ICON */
.crm-mobile-chat-btn .crm-chat-modern-icon{
    width:24px !important;
    height:24px !important;
    flex:0 0 24px !important;
    overflow:visible !important;
}

.crm-mobile-chat-btn .crm-chat-modern-icon > path{
    fill:currentColor !important;
    stroke:none !important;
}

.crm-mobile-chat-btn .crm-chat-modern-icon > circle{
    fill:#fff !important;
    stroke:none !important;
}

/* =========================================================
   PRS GLOBAL DROPDOWN V2 — ADAPTIVE WIDTH
   Field may be narrow; menu remains readable.
   ========================================================= */

body > .crm-select-menu{
    box-sizing:border-box !important;
    width:auto;
    min-width:0;
    max-width:calc(100vw - 16px) !important;
    max-height:var(--prs-floating-max-height,320px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
}

body > .crm-select-menu.crm-select-menu-searchable{
    max-height:var(--prs-floating-max-height,320px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
}

body > .crm-select-menu .crm-select-option{
    width:100% !important;
    min-width:0 !important;
    white-space:nowrap !important;
}

body > .crm-select-menu .crm-select-option-label{
    display:block;
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

/* Selected value inside narrow filter/field must also stay compact */
.crm-select-trigger{
    min-width:0 !important;
}

.crm-select-trigger .crm-select-value{
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

.crm-select-trigger .crm-select-value-label{
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

@media(max-width:760px){
    body > .crm-select-menu{
        max-width:calc(100vw - 16px) !important;
    }
}
/* /PRS GLOBAL DROPDOWN V2 — ADAPTIVE WIDTH */

/* =========================================================
   PRS GLOBAL DROPDOWN V3 — READABLE ATTACHED
   ========================================================= */

body > .crm-select-menu{
    box-sizing:border-box !important;
    max-width:calc(100vw - 16px) !important;
    max-height:var(--prs-floating-max-height,320px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
}

body > .crm-select-menu.crm-select-menu-searchable{
    max-height:var(--prs-floating-max-height,320px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
}

body > .crm-select-menu .crm-select-option{
    width:100% !important;
    min-width:0 !important;
    flex:0 0 auto !important;
    white-space:nowrap !important;
}

body > .crm-select-menu .crm-select-option-label{
    display:block !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

.crm-select-trigger{
    min-width:0 !important;
}

.crm-select-trigger .crm-select-value{
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

.crm-select-trigger .crm-select-value-label{
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

/* /PRS GLOBAL DROPDOWN V3 — READABLE ATTACHED */

