/* GrowCRM overlay panels — required when legacy theme CSS is not loaded */

/* BS4 visibility helpers used throughout GrowCRM blades */
.hidden {
    display: none;
}

.hidden-forced {
    display: none !important;
}

.visible {
    display: block;
}

.visible-inline {
    display: inline;
}

.visible-inline-block {
    display: inline-block;
}

/* Billing popovers (tax/discount/adjustment) — Limitless-style card popovers */
.card-popover.popover {
    min-width: 320px;
    max-width: 360px;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14), 0 4px 10px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    z-index: 1080;
}

.card-popover.popover .popover-arrow::before {
    border-color: #e5e7eb;
}

.card-popover .popover-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}

.card-popover .popover-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.card-popover .popover-close .ph {
    font-size: 1rem;
}

.card-popover .popover-header {
    margin: 0;
    padding: 0.875rem 2.75rem 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
}

.card-popover .popover-body {
    padding: 1rem;
    color: #374151;
}

.card-popover .bill-popover-panel {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.card-popover .bill-popover-panel .form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.card-popover .bill-popover-panel .form-control,
.card-popover .bill-popover-panel .form-select {
    font-size: 0.875rem;
}

.card-popover .bill-popover-panel .form-check {
    text-align: left;
    margin-bottom: 0.5rem;
}

.card-popover .bill-popover-panel .form-check:last-child {
    margin-bottom: 0;
}

.card-popover .bill-popover-panel .form-check-label {
    cursor: pointer;
    font-size: 0.875rem;
}

.card-popover .bill-popover-panel .form-check-input {
    cursor: pointer;
}

.card-popover .bill-popover-note {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
}

.card-popover .bill-popover-empty {
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.card-popover .bill-popover-alert {
    margin: 0;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    border-radius: 0.375rem;
}

.card-popover .bill-popover-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.875rem;
    border-top: 1px solid #e5e7eb;
}

.card-popover .bill-popover-actions .btn {
    min-width: 5.5rem;
}

.card-popover .popover-body ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.card-popover .popover-body ul li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.card-popover .popover-body ul li:hover {
    background: #f3f4f6;
}

/* Right side panels (notifications, reminders, starred, filters) */
.right-sidebar,
.reminders-side-panel {
    position: fixed;
    top: 0;
    right: -240px;
    width: 240px;
    height: 100%;
    display: none;
    z-index: 1045;
    background: #fff;
    padding-bottom: 20px;
    box-shadow: 5px 1px 40px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease, width 0.3s ease;
}

.right-sidebar .rpanel-title,
.reminders-side-panel .rpanel-title {
    display: block;
    padding: 1rem 1.25rem 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 600;
    background: #252b36;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: none;
}

.right-sidebar .rpanel-title .x-top,
.reminders-side-panel .rpanel-title .x-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.right-sidebar .rpanel-title .x-top i,
.reminders-side-panel .rpanel-title .x-top i {
    font-size: 1.125rem;
    opacity: 0.85;
}

.right-sidebar .rpanel-title span,
.reminders-side-panel .rpanel-title span {
    float: none;
    margin-left: auto;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.right-sidebar .rpanel-title span:hover,
.reminders-side-panel .rpanel-title span:hover {
    opacity: 1;
}

.right-sidebar .rpanel-title i,
.reminders-side-panel .rpanel-title i {
    vertical-align: middle;
    padding-right: 0;
}

.right-sidebar .rpanel-title i.ti-close,
.reminders-side-panel .rpanel-title i.ti-close {
    font-size: 0.875rem;
}

.right-sidebar .r-panel-body,
.reminders-side-panel .r-panel-body {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100vh - 7rem);
    background: var(--body-bg, #fff);
}

.right-sidebar .r-panel-body ul,
.reminders-side-panel .r-panel-body ul {
    margin: 0;
    padding: 0;
}

.right-sidebar .r-panel-body ul li,
.reminders-side-panel .r-panel-body ul li {
    list-style: none;
    padding: 5px 0;
}

/* My Reminder side panel (per-resource) — Limitless layout */
.reminders-side-panel {
    right: -28rem;
    width: 28rem;
    max-width: calc(100vw - 1.5rem);
    border-left: 1px solid var(--border-color-translucent, rgba(0, 0, 0, 0.08));
    box-shadow: var(--box-shadow-lg, 0 6px 12px rgba(0, 0, 0, 0.12));
}

.reminders-side-panel .rpanel-title {
    display: block;
    padding: 1rem 1.25rem 0.875rem;
    background: var(--white, #fff);
    color: var(--body-color, #1f2937);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: none;
}

.reminders-side-panel .rpanel-title .x-top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
}

.reminders-side-panel .rpanel-title .x-top > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius, 0.375rem);
    background: rgba(191, 26, 31, 0.1);
    color: #bf1a1f;
    font-size: 1.125rem;
    flex-shrink: 0;
    opacity: 1;
}

.reminders-side-panel .rpanel-title #reminders-side-panel-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
}

.reminders-side-panel .rpanel-title .x-top > span:last-child {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--border-radius, 0.375rem);
    opacity: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.reminders-side-panel .rpanel-title .x-top > span:last-child:hover {
    background: var(--gray-100, #f3f4f6);
}

.reminders-side-panel .rpanel-title .x-top > span:last-child i {
    pointer-events: none;
    font-size: 1rem;
    color: var(--body-color, #374151);
}

.reminders-side-panel .r-panel-body {
    padding: 0;
    max-height: calc(100vh - 4.5rem);
    background: var(--white, #fff);
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing,
.reminders-side-panel .reminders-side-panel-body .reminders-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.25rem 1.5rem;
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-image,
.reminders-side-panel .reminders-side-panel-body .reminders-error .x-image {
    padding-top: 0;
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-image img,
.reminders-side-panel .reminders-side-panel-body .reminders-error .x-image img {
    width: 140px;
    max-width: 100%;
    height: auto;
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-text,
.reminders-side-panel .reminders-side-panel-body .reminders-error .x-text {
    padding: 1.25rem 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--body-color, #374151);
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-button {
    padding-bottom: 0;
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-button .btn-primary,
.reminders-side-panel .reminders-side-panel-body #reminders-existing-new .buttons-block .btn-primary {
    background-color: #bf1a1f;
    border-color: #bf1a1f;
    color: #fff;
}

.reminders-side-panel .reminders-side-panel-body .reminders-none-existing .x-button .btn-primary:hover,
.reminders-side-panel .reminders-side-panel-body #reminders-existing-new .buttons-block .btn-primary:hover {
    background-color: #a0161a;
    border-color: #a0161a;
    color: #fff;
}

.reminders-side-panel .reminders-side-panel-body #reminders-existing-new {
    padding: 1rem 1.25rem 1.25rem;
}

.reminders-side-panel .reminders-side-panel-body #reminders-existing-new .buttons-block {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.shw-rside {
    right: 0;
    width: 400px;
    display: block;
}

.shw-rside.sidebar-md {
    width: 480px;
}

.shw-rside.sidebar-lg {
    width: 580px;
}

.shw-rside.sidebar-xl {
    width: 850px;
}

.shw-rside.sidebar-xxl {
    width: 1200px;
}

.shw-rside.sidebar-full-width {
    width: 100%;
    max-width: 1300px;
}

.reminders-side-panel.shw-rside {
    width: 28rem;
    max-width: calc(100vw - 1.5rem);
    right: 0;
}

.right-sidepanel-with-menu .rpanel-title {
    padding-bottom: 0.75rem;
    padding-top: 1rem;
}

.right-sidepanel-with-menu .rpanel-title .x-top-nav {
    text-align: left;
    padding-top: 0.625rem;
    margin-top: 0.625rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.right-sidepanel-with-menu .rpanel-title .x-top-nav a {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75) !important;
    text-decoration: none;
}

.right-sidepanel-with-menu .rpanel-title .x-top-nav a:hover {
    color: #fff !important;
}

.right-sidepanel-with-menu .rpanel-title .x-top-nav a.active {
    font-weight: 600;
    color: #fff !important;
    text-decoration: none;
}

.right-sidepanel-with-menu .rpanel-title .x-top-nav .x-spacer {
    color: rgba(255, 255, 255, 0.35);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.right-sidepanel-with-menu .sidepanel-notifications-mark-all-read {
    text-align: right;
    margin: 0;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--gray-100, #f9fafb);
}

.right-sidepanel-with-menu .sidepanel-notifications-mark-all-read a {
    font-size: 0.75rem;
    color: var(--primary, #0c83ff) !important;
    text-decoration: none;
}

.right-sidepanel-with-menu .sidepanel-notifications-mark-all-read a:hover {
    text-decoration: underline;
}

.page-wrapper-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: #000;
    opacity: 0.1;
}

.page-wrapper-overlay.hidden {
    display: none !important;
}

/* GrowCRM modals use BS4 markup; keep hidden until opened */
.modal:not(.show) {
    display: none;
}

/* ---- GrowCRM layout helpers (used in panel AJAX content) ---- */
html body .display-flex {
    display: flex !important;
}

html body .flex-row {
    flex-direction: row !important;
}

.pull-right {
    float: right;
}

.pull-left {
    float: left;
}

.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

.img-circle {
    border-radius: 50%;
}

.topevent-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
}

.topevent-avatar-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.topevent-avatar-fallback {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb, 12, 131, 255), 0.12);
    color: var(--primary, #0c83ff);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
}

.avatar {
    width: 35px;
    height: 35px;
    object-fit: cover;
}

.muted,
.topevent .x-content .x-time {
    color: var(--gray-600, #6b7280) !important;
    opacity: 1 !important;
}

.bg-contrast {
    background-color: var(--gray-100, #f3f4f6);
}

.border-radius-5 {
    border-radius: 0.3125rem !important;
}

.border-radius-8 {
    border-radius: 0.5rem !important;
}

/* ---- Notifications panel content ---- */
#sidepanel-notifications-events,
#sidepanel-notifications-body #events-panel-loadmore-button-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

#events-panel-loadmore-button-container {
    padding-top: 1rem;
    padding-bottom: 1.25rem;
    text-align: center;
}

.top-nav-no-evenets {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--gray-600, #6b7280);
}

.top-nav-no-evenets img {
    width: 160px;
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.top-nav-no-evenets .x-message {
    font-size: 0.9375rem;
}

.topevent {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.topevent:last-child {
    border-bottom: 0;
}

.topevent > div:first-child {
    flex-shrink: 0;
}

.topevent .x-content {
    flex: 1;
    min-width: 0;
    padding: 0;
    font-size: 0.875rem;
    color: var(--body-color, #1f2937);
}

.topevent .x-content a {
    display: inline !important;
    padding: 0 !important;
    color: var(--primary, #0c83ff) !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
}

.topevent .x-content a:hover {
    color: var(--link-hover-color, #0a6fd4) !important;
    text-decoration: underline !important;
    background: transparent !important;
}

.topevent .x-content .x-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--body-color, #1f2937);
    margin-bottom: 0.25rem;
}

.topevent .x-content .x-name::after {
    content: "";
    display: block;
    clear: both;
}

.topevent .x-content .x-name .x-time {
    float: right;
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: 0.5rem;
}

.topevent .x-content .x-name .js-notification-mark-read-single {
    float: right;
    margin-left: 0.375rem;
}

.topevent .x-content .x-name .js-notification-mark-read-single [type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.topevent .x-content .x-name .js-notification-mark-read-single label {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0 !important;
    border: 2px solid var(--gray-400, #d1d5db);
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
}

.topevent .x-content .x-name .js-notification-mark-read-single label::before,
.topevent .x-content .x-name .js-notification-mark-read-single label::after {
    display: none !important;
}

.topevent .x-content .x-name .js-notification-mark-read-single [type=radio]:checked + label {
    border-color: var(--primary, #0c83ff);
    background-color: var(--primary, #0c83ff);
    box-shadow: inset 0 0 0 2px #fff;
}

.topevent .x-content .x-title {
    font-size: 0.8125rem;
    color: var(--gray-700, #374151);
    margin-bottom: 0.125rem;
}

.topevent .x-content .x-ref-title,
.topevent .x-content .x-reference {
    font-size: 0.75rem;
    color: var(--gray-600, #6b7280);
    margin-bottom: 0.25rem;
}

.topevent .x-content .x-description {
    font-size: 0.8125rem;
    background-color: var(--gray-100, #f3f4f6);
    border-radius: 0.375rem;
    padding: 0.5rem 0.625rem;
    margin-top: 0.375rem;
    color: var(--body-color, #1f2937);
}

.topevent .x-content .x-description p:first-child,
.topevent .x-content .x-description p:last-child {
    margin-bottom: 0;
}

#sidepanel-notifications-events .x-description img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* ---- Reminders / starred panel content ---- */
.topnav-reminders-container {
    padding: 1rem 1.25rem 1.25rem;
}

.topnav-reminders-container .topnav-reminder {
    background-color: var(--gray-100, #f3f4f6);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    padding: 0.875rem;
    margin-bottom: 1rem;
    color: var(--body-color, #1f2937);
}

.topnav-reminders-container .topnav-reminder .x-icon {
    font-size: 1.25rem;
    float: left;
    color: var(--gray-600, #6b7280);
    padding-left: 0.25rem;
}

.topnav-reminders-container .topnav-reminder .x-content {
    margin-left: 2.75rem;
}

.topnav-reminders-container .topnav-reminder .x-title {
    margin-top: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.topnav-reminders-container .topnav-reminder .x-link {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
}

.topnav-reminders-container .topnav-reminder .x-link a {
    color: var(--primary, #0c83ff) !important;
    text-decoration: none;
    padding: 0;
}

.topnav-reminders-container .topnav-reminder .x-link a:hover {
    text-decoration: underline;
    background: transparent;
}

#sidepanel-starred-container .starred-feed-item,
#sidepanel-starred-container .card {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

#sidepanel-starred-container .starred-feed-item a {
    color: var(--primary, #0c83ff);
    text-decoration: none;
}

/* ---- Search modal (GrowCRM global search) ---- */
.search-modal .modal-dialog.modal-xxl {
    max-width: min(960px, 92vw);
}

.search-modal .modal-header {
    background: var(--body-bg, #fff);
    padding: 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    align-items: center;
}

.search-modal .modal-header .x-search-field {
    width: 100%;
    margin-right: 0;
}

.search-modal .modal-header .x-search-field .form-group {
    margin-bottom: 0;
}

.search-modal .modal-header .x-search-field .x-search-field-container {
    position: relative;
}

.search-modal .modal-header .x-search-field i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    opacity: 0.55;
    z-index: 2;
}

.search-modal .modal-header .x-search-field .form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    height: auto;
    border: 0;
    font-size: 1rem;
    background: transparent;
    box-shadow: none;
}

.search-modal .modal-header .close {
    margin: 0 1rem;
    padding: 0.5rem;
    border: 0;
    background: transparent;
    opacity: 0.6;
}

.search-modal .search-modal-container .search-modal-message .x-holder-start {
    text-align: center;
    padding: 3rem 1.5rem;
}

.search-modal .search-modal-container .search-modal-message .x-holder-start img {
    max-width: 140px;
    height: auto;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.search-modal .search-modal-container .search-modal-message .x-holder-start h5 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--body-color, #1f2937);
}

.search-modal .search-modal-container .search-modal-message .x-holder-start h6 {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--gray-600, #6b7280);
}

.search-modal .search-modal-container .search-categories .x-each-category {
    display: inline-block;
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 0.25rem 0.875rem;
    margin: 0 0.5rem 0.75rem 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8125rem;
}

.search-modal .search-modal-container .search-categories .x-each-category.active {
    background: var(--primary, #0c83ff);
    border-color: var(--primary, #0c83ff);
    color: #fff;
}

.search-modal .search-modal-container .search-results-container {
    padding: 0 1.25rem;
}

.search-modal .search-modal-container .search-results-container .x-each-category {
    padding-bottom: 0.25rem;
}

.search-modal .search-modal-container .search-results-container .x-each-category.all {
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 1.5rem;
}

.search-modal .search-modal-container .search-results-container .x-each-category .x-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.625rem;
}

.search-modal .search-modal-container .search-results-container .x-each-category .x-heading .x-title {
    font-weight: 500;
    color: var(--gray-600, #6b7280);
}

.search-modal .search-modal-container .search-results-container .x-each-category .x-heading .x-count {
    font-size: 0.8125rem;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul {
    padding-left: 0.75rem;
    margin-bottom: 0;
    list-style: none;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li {
    display: block;
    padding: 0.5rem 0;
    list-style: none;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li > a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    color: inherit;
    text-decoration: none;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li > a:hover {
    color: var(--primary, #0c83ff);
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span {
    display: inline-block;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span.x-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5625rem;
    height: 1.5625rem;
    border-radius: 50%;
    background: rgba(var(--primary-rgb, 12, 131, 255), 0.12);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span.x-title a {
    color: var(--body-color, #1f2937);
    text-decoration: none;
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span.x-title a:hover {
    color: var(--primary, #0c83ff);
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span.x-tag-match {
    font-size: 0.625rem;
    color: var(--warning, #f79009);
}

.search-modal .search-modal-container .search-results-container .x-each-category ul li span.x-meta {
    font-size: 0.75rem;
    color: var(--gray-500, #9ca3af);
}

/* ---- Table config side panels (column visibility) ---- */
.right-sidebar[id^="table-config-"] {
    right: -20rem;
    width: 20rem;
    max-width: calc(100vw - 1rem);
    border-left: 1px solid var(--border-color-translucent, rgba(0, 0, 0, 0.08));
    box-shadow: var(--box-shadow-lg, 0 6px 12px rgba(0, 0, 0, 0.12));
}

.right-sidebar[id^="table-config-"].shw-rside {
    width: 20rem;
    right: 0;
}

.right-sidebar[id^="table-config-"] .rpanel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1rem 0.875rem;
    background: var(--white, #fff);
    color: var(--body-color, #1f2937);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
}

.right-sidebar[id^="table-config-"] .rpanel-title > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius, 0.375rem);
    background: rgba(var(--primary-rgb, 12, 131, 255), 0.1);
    color: var(--primary, #0c83ff);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.right-sidebar[id^="table-config-"] .rpanel-title span {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--border-radius, 0.375rem);
    opacity: 1;
    cursor: pointer;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.right-sidebar[id^="table-config-"] .rpanel-title span i {
    pointer-events: none;
}

.right-sidebar[id^="table-config-"] .rpanel-title span:hover {
    background: var(--gray-100, #f3f4f6);
}

.right-sidebar[id^="table-config-"] .r-panel-body {
    padding: 0.5rem 0.75rem 1rem;
    max-height: calc(100vh - 9rem);
    background: var(--white, #fff);
}

.right-sidebar[id^="table-config-"] .p-b-5 {
    padding: 0 !important;
    margin: 0;
}

.right-sidebar[id^="table-config-"] .table-config-checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    margin: 0;
    border-radius: var(--border-radius, 0.375rem);
    cursor: pointer;
    transition: background-color 0.15s ease;
    /* Reset Bootstrap's form-check padding (it assumes indicator is in padding area) */
    padding-left: 0.625rem;
    min-height: auto;
}

.right-sidebar[id^="table-config-"] .table-config-checkbox-container:hover {
    background: var(--gray-100, #f3f4f6);
}

/* Table-config drawer: Bootstrap 5 form-check-input styled checkbox */
.right-sidebar[id^="table-config-"] .form-check-input {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    margin: 0;
    cursor: pointer;
    border-radius: 0.25rem;
    border: calc(var(--border-width, 1px) * 2) solid var(--gray-400, #d1d5db);
    background-color: var(--white, #fff);
    appearance: auto;
    -webkit-appearance: auto;
}

.right-sidebar[id^="table-config-"] .form-check-input:checked {
    background-color: var(--primary, #0c83ff);
    border-color: var(--primary, #0c83ff);
}

.right-sidebar[id^="table-config-"] .form-check-input:focus {
    box-shadow: 0 0 0 0.125rem rgba(var(--primary-rgb, 12, 131, 255), 0.2);
}

.right-sidebar[id^="table-config-"] .form-check-label {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--body-color, #374151);
    line-height: 1.35;
    padding: 0;
    cursor: pointer;
    margin: 0;
}

.right-sidebar[id^="table-config-"] .buttons-block {
    display: flex;
    justify-content: stretch;
    gap: 0.5rem;
    padding: 0.75rem 0 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.right-sidebar[id^="table-config-"] .buttons-block .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--border-radius, 0.375rem);
}

/* Export side panels (clients, invoices, etc.) */
.right-sidebar.right-sidebar-export.shw-rside {
    width: 28rem;
    max-width: calc(100vw - 1.5rem);
    right: 0;
}

.right-sidebar.right-sidebar-export .rpanel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1rem 0.875rem;
    background: var(--white, #fff);
    color: var(--body-color, #1f2937);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
}

.right-sidebar.right-sidebar-export .rpanel-title > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius, 0.375rem);
    background: rgba(var(--primary-rgb, 12, 131, 255), 0.1);
    color: var(--primary, #0c83ff);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.right-sidebar.right-sidebar-export .rpanel-title span {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--border-radius, 0.375rem);
    opacity: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.right-sidebar.right-sidebar-export .rpanel-title span:hover {
    background: var(--gray-100, #f3f4f6);
}

.right-sidebar.right-sidebar-export .rpanel-title span i {
    pointer-events: none;
    font-size: 1rem;
    color: var(--body-color, #374151);
}

.right-sidebar.right-sidebar-export .crm-export-panel-body {
    padding: 1rem 1rem 1.25rem;
    max-height: calc(100vh - 4.5rem);
    background: var(--white, #fff);
}

.right-sidebar.right-sidebar-export .crm-export-section + .crm-export-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.right-sidebar.right-sidebar-export .crm-export-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-600, #6b7280);
}

.right-sidebar.right-sidebar-export .crm-export-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.75rem;
}

@media (max-width: 575.98px) {
    .right-sidebar.right-sidebar-export .crm-export-field-grid {
        grid-template-columns: 1fr;
    }
}

.right-sidebar.right-sidebar-export .crm-export-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    margin: 0;
    border-radius: var(--border-radius, 0.375rem);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.right-sidebar.right-sidebar-export .crm-export-checkbox:hover {
    background: var(--gray-100, #f3f4f6);
}

.right-sidebar.right-sidebar-export .custom-control-indicator {
    display: none !important;
}

.right-sidebar.right-sidebar-export .custom-control-input {
    position: static;
    z-index: 1;
    float: none;
    opacity: 1;
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.25rem;
    border-color: var(--border-color, #d1d5db);
}

.right-sidebar.right-sidebar-export .custom-control-input:checked {
    background-color: var(--primary, #0c83ff);
    border-color: var(--primary, #0c83ff);
}

.right-sidebar.right-sidebar-export .custom-control-input:focus {
    box-shadow: 0 0 0 0.125rem rgba(var(--primary-rgb, 12, 131, 255), 0.2);
}

.right-sidebar.right-sidebar-export .custom-control-description {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--body-color, #374151);
    line-height: 1.35;
    padding: 0;
}

.right-sidebar.right-sidebar-export .buttons-block {
    display: flex;
    justify-content: stretch;
    gap: 0.5rem;
    padding: 1rem 0 0;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.right-sidebar.right-sidebar-export .buttons-block .btn {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5625rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--border-radius, 0.375rem);
}

/* Filter side panels (clients, invoices, etc.) */
.right-sidebar.right-sidebar-filter {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    height: 100%;
}

.right-sidebar.right-sidebar-filter.shw-rside {
    width: 22rem;
    max-width: calc(100vw - 1.5rem);
    right: 0;
    display: flex;
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-form,
.right-sidebar.right-sidebar-filter .crm-filter-panel-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem 1rem;
    background: var(--white, #fff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-footer .crm-filter-remember {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-footer .buttons-block {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color-translucent, rgba(0, 0, 0, 0.06));
}

.right-sidebar.right-sidebar-filter .rpanel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1rem 0.875rem;
    background: var(--white, #fff);
    color: var(--body-color, #1f2937);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
}

.right-sidebar.right-sidebar-filter .rpanel-title > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius, 0.375rem);
    background: rgba(var(--primary-rgb, 12, 131, 255), 0.1);
    color: var(--primary, #0c83ff);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.right-sidebar.right-sidebar-filter .rpanel-title span {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--border-radius, 0.375rem);
    opacity: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.right-sidebar.right-sidebar-filter .rpanel-title span:hover {
    background: var(--gray-100, #f3f4f6);
}

.right-sidebar.right-sidebar-filter .rpanel-title span i {
    pointer-events: none;
    font-size: 1rem;
    color: var(--body-color, #374151);
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-body {
    padding: 0.875rem 1rem 1rem;
    background: var(--white, #fff);
}

.right-sidebar.right-sidebar-filter .r-panel-body {
    max-height: none !important;
    overflow: visible;
}

.right-sidebar.right-sidebar-filter .crm-filter-panel-scroll.crm-filter-panel-body {
    overflow-x: hidden;
    overflow-y: auto;
}

.right-sidebar.right-sidebar-filter .crm-filter-block {
    margin-bottom: 0.875rem;
}

.right-sidebar.right-sidebar-filter .crm-filter-block:last-of-type {
    margin-bottom: 0;
}

.right-sidebar.right-sidebar-filter .crm-filter-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--body-color, #374151);
    line-height: 1.3;
}

.right-sidebar.right-sidebar-filter .crm-filter-field {
    width: 100%;
}

.right-sidebar.right-sidebar-filter .crm-filter-field .form-control,
.right-sidebar.right-sidebar-filter .crm-filter-field .select2-container {
    width: 100% !important;
}

.right-sidebar.right-sidebar-filter .crm-filter-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.right-sidebar.right-sidebar-filter .crm-filter-field .input-group,
.right-sidebar.right-sidebar-filter .crm-filter-input-group {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    width: 100%;
}

.right-sidebar.right-sidebar-filter .crm-filter-amount-input {
    -moz-appearance: textfield;
}

.right-sidebar.right-sidebar-filter .crm-filter-amount-input::-webkit-outer-spin-button,
.right-sidebar.right-sidebar-filter .crm-filter-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.right-sidebar.right-sidebar-filter .crm-filter-field .input-group-addon,
.right-sidebar.right-sidebar-filter .crm-filter-field .input-group-text {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--body-color, #374151);
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--border-radius, 0.375rem) 0 0 var(--border-radius, 0.375rem);
}

.right-sidebar.right-sidebar-filter .crm-filter-field .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.right-sidebar.right-sidebar-filter .crm-filter-field .input-group-sm > .input-group-text,
.right-sidebar.right-sidebar-filter .crm-filter-field .input-group-sm > .input-group-addon {
    padding: 0.3125rem 0.5rem;
    font-size: 0.8125rem;
}

.right-sidebar.right-sidebar-filter .filter-block {
    margin-bottom: 1rem;
}

.right-sidebar.right-sidebar-filter .filter-block .title {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--body-color, #374151);
}

.right-sidebar.right-sidebar-filter .filter-block .fields .row {
    margin-left: 0;
    margin-right: 0;
}

.right-sidebar.right-sidebar-filter .filter-block .fields .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

.right-sidebar.right-sidebar-filter .filter-block .fields .form-control,
.right-sidebar.right-sidebar-filter .filter-block .fields .select2-container {
    width: 100% !important;
}

.right-sidebar.right-sidebar-filter .crm-filter-remember {
    margin-top: 1rem;
    padding-top: 0;
    border-top: 0;
}

.right-sidebar.right-sidebar-filter .crm-sidepanel-close {
    margin-left: auto;
}

.right-sidebar.right-sidebar-filter .crm-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    margin: 0;
    border-radius: var(--border-radius, 0.375rem);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.right-sidebar.right-sidebar-filter .crm-filter-checkbox:hover {
    background: var(--gray-100, #f3f4f6);
}

.right-sidebar.right-sidebar-filter .custom-control-indicator {
    display: none !important;
}

.right-sidebar.right-sidebar-filter .custom-control-input {
    position: static;
    z-index: 1;
    float: none;
    opacity: 1;
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.25rem;
    border-color: var(--border-color, #d1d5db);
}

.right-sidebar.right-sidebar-filter .custom-control-input:checked {
    background-color: var(--primary, #0c83ff);
    border-color: var(--primary, #0c83ff);
}

.right-sidebar.right-sidebar-filter .custom-control-input:focus {
    box-shadow: 0 0 0 0.125rem rgba(var(--primary-rgb, 12, 131, 255), 0.2);
}

.right-sidebar.right-sidebar-filter .custom-control-description {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--body-color, #374151);
    line-height: 1.35;
    padding: 0;
}

.right-sidebar.right-sidebar-filter .form-group.form-group-checkbox input[type="checkbox"].filled-in + label {
    display: inline-flex !important;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--body-color, #374151);
}

.right-sidebar.right-sidebar-filter .buttons-block {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0;
    margin-top: 0;
    border-top: 0;
}

.right-sidebar.right-sidebar-filter .buttons-block .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5625rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--border-radius, 0.375rem);
}

.right-sidebar.right-sidebar-filter .modal-selector {
    padding: 0 !important;
    margin: 0 !important;
}

/* Select2 single — all filter side panels */
.right-sidebar.right-sidebar-filter .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.right-sidebar.right-sidebar-filter .select2-container .select2-selection--single {
    height: 2.125rem;
    min-height: 2.125rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--border-radius, 0.375rem);
    background: var(--white, #fff);
}

.right-sidebar.right-sidebar-filter .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 2rem;
    padding-left: 0.625rem;
    padding-right: 1.75rem;
    color: var(--body-color, #374151);
}

.right-sidebar.right-sidebar-filter .select2-container .select2-selection--single .select2-selection__placeholder {
    color: var(--gray-500, #9ca3af);
}

.right-sidebar.right-sidebar-filter .select2-container .select2-selection--single .select2-selection__arrow {
    top: 50%;
    right: 0.75rem;
    width: 1em;
    height: 1em;
    transform: translateY(-50%);
}

.right-sidebar.right-sidebar-filter .select2-container--focus .select2-selection--single,
.right-sidebar.right-sidebar-filter .select2-container--open .select2-selection--single {
    border-color: var(--primary, #0c83ff);
    box-shadow: 0 0 0 0.125rem rgba(var(--primary-rgb, 12, 131, 255), 0.2);
}

/* Select2 inside filter / side panels */
.right-sidebar .select2-container .select2-selection--multiple,
.reminders-side-panel .select2-container .select2-selection--multiple {
    min-height: 2.125rem;
    border: 1px solid var(--gray-400, #d1d5db);
    border-radius: var(--border-radius, 0.375rem);
    padding: 0.1875rem 0.375rem;
    background: var(--white, #fff);
    cursor: pointer;
}

.right-sidebar .select2-container .select2-selection--multiple .select2-selection__rendered,
.reminders-side-panel .select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.right-sidebar .select2-container--focus .select2-selection--multiple,
.right-sidebar .select2-container--open .select2-selection--multiple,
.reminders-side-panel .select2-container--focus .select2-selection--multiple,
.reminders-side-panel .select2-container--open .select2-selection--multiple {
    border-color: var(--primary, #0c83ff);
    box-shadow: 0 0 0 0.125rem rgba(var(--primary-rgb, 12, 131, 255), 0.25);
}

.right-sidebar .select2-dropdown,
.right-sidebar .select2-container--open .select2-dropdown,
.reminders-side-panel .select2-dropdown,
.reminders-side-panel .select2-container--open .select2-dropdown {
    z-index: 1060 !important;
    border: 1px solid var(--border-color-translucent, rgba(0, 0, 0, 0.08));
    border-radius: var(--border-radius, 0.375rem);
    box-shadow: var(--box-shadow-lg, 0 6px 12px rgba(0, 0, 0, 0.15));
}

body > .select2-container.select2-container--open {
    z-index: 1060 !important;
}

/* GrowCRM action modals — legacy .close only; do not strip .btn-close SVG background */
.modal .modal-header .close:not(.crm-limitless-modal-close):not(.btn-close) {
    border: 0;
    background: transparent;
}

/* Modal visibility handled in limitless-crm-forms.css */
