:root {
    --crm-sidebar-width: 18.5rem;
    --crm-sidebar-collapsed-width: 5rem;
    --crm-topbar-height: 4rem;
    --crm-content-max: 100%;
    --crm-sidebar-bg: #182433;
    --crm-sidebar-border: rgba(255,255,255,.07);
    --crm-sidebar-text: rgba(255,255,255,.78);
    --crm-sidebar-muted: rgba(255,255,255,.46);
    --crm-sidebar-hover: rgba(255,255,255,.07);
    --crm-sidebar-active: rgba(32,107,196,.24);
}

html, body {
    min-height: 100%;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    background: #f7f9fc;
    overflow-x: hidden;
}

.page {
    min-height: 100vh;
    width: 100%;
}

.page-wrapper {
    min-height: 100vh;
    min-width: 0;
    width: 100%;
    transition: margin-left .22s ease, width .22s ease;
}

.page-body {
    padding: 1.25rem 0 1.75rem;
}

    .page-body > .container-xl {
        max-width: var(--crm-content-max);
    }

.card {
    box-shadow: 0 1px 3px rgba(24,36,51,.05);
    border-color: #e5eaf0;
}

/* Top bar */
.crm-topbar {
    height: var(--crm-topbar-height);
    min-height: var(--crm-topbar-height);
    width: 100%;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid #e5eaf0;
    box-shadow: 0 1px 2px rgba(24,36,51,.025);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

    .crm-topbar .container-fluid {
        height: 100%;
        min-width: 0;
    }

.crm-product-title {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.01em;
    color: #182433;
    white-space: nowrap;
}

.crm-sidebar-toggle {
    border-radius: .65rem;
    flex: 0 0 auto;
}

.crm-user-trigger {
    padding: .35rem .45rem;
    border-radius: .7rem;
    transition: background .15s ease;
    max-width: 18rem;
}

    .crm-user-trigger:hover {
        background: #f1f5f9;
    }

.crm-user-summary {
    min-width: 0;
    max-width: 12rem;
    line-height: 1.15;
}

.crm-user-avatar {
    overflow: hidden;
    background: #e9f2ff;
    flex: 0 0 auto;
}

    .crm-user-avatar img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.crm-user-menu {
    width: min(22rem, calc(100vw - 2rem));
    padding-top: 0;
    overflow: hidden;
}

.crm-notification-menu {
    width: min(23rem, calc(100vw - 2rem));
}

.crm-empty-notifications {
    max-width: 20rem;
    margin-inline: auto;
}

.badge-notification {
    position: absolute;
    top: .1rem;
    right: -.1rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: .15rem .3rem;
    border: 2px solid #fff;
}

/* Sidebar */
.crm-sidebar {
    width: var(--crm-sidebar-width);
    min-width: var(--crm-sidebar-width);
    height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1035;
    background: var(--crm-sidebar-bg);
    border-right: 1px solid var(--crm-sidebar-border);
    transition: width .22s ease, min-width .22s ease, transform .22s ease;
    overflow: hidden;
}

    .crm-sidebar > .container-fluid {
        height: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

.crm-sidebar-brand {
    height: var(--crm-topbar-height);
    min-height: var(--crm-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--crm-sidebar-border);
    flex: 0 0 auto;
}

.crm-logo-mark {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: linear-gradient(145deg, #206bc4, #4299ff);
    box-shadow: 0 .35rem 1rem rgba(32,107,196,.25);
    flex: 0 0 auto;
}

.crm-logo-text {
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.crm-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .75rem .7rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}

.crm-nav-list, .crm-submenu {
    gap: .15rem;
}

.crm-nav-link {
    min-height: 2.65rem;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: .6rem;
    padding: .58rem .7rem;
    color: var(--crm-sidebar-text) !important;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    cursor: pointer;
}

    .crm-nav-link:hover {
        background: var(--crm-sidebar-hover);
        color: #fff !important;
    }

    .crm-nav-link.active, .crm-nav-parent.active > .crm-nav-toggle {
        background: var(--crm-sidebar-active);
        color: #fff !important;
    }

        .crm-nav-link.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            width: 3px;
            height: 1.6rem;
            transform: translateY(-50%);
            border-radius: 0 3px 3px 0;
            background: #4299ff;
        }

    .crm-nav-link .nav-link-icon {
        width: 1.8rem;
        min-width: 1.8rem;
        margin: 0 .35rem 0 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
    }

    .crm-nav-link .nav-link-title {
        min-width: 0;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.crm-nav-chevron {
    margin-left: auto;
    transition: transform .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crm-nav-toggle[aria-expanded="true"] .crm-nav-chevron {
    transform: rotate(90deg);
}

.crm-submenu {
    margin: .2rem 0 .35rem 1.12rem;
    padding-left: .55rem;
    border-left: 1px solid rgba(255,255,255,.09);
}

    .crm-submenu .crm-nav-link {
        min-height: 2.35rem;
        font-size: .925rem;
    }

.crm-nav-placeholder {
    cursor: default;
    color: var(--crm-sidebar-muted) !important;
}

    .crm-nav-placeholder:hover {
        background: transparent;
        color: var(--crm-sidebar-muted) !important;
    }

.crm-soon-badge {
    margin-left: auto;
    font-size: .62rem;
    opacity: .85;
}

.crm-sidebar-footer {
    min-height: 3rem;
    display: flex;
    align-items: center;
    padding: .65rem 1rem;
    border-top: 1px solid var(--crm-sidebar-border);
    flex: 0 0 auto;
}

.crm-sidebar-footer-text {
    color: var(--crm-sidebar-muted) !important;
    white-space: nowrap;
}

.crm-sidebar-backdrop {
    display: none;
}

/* Master/list pages */
.crm-page-header {
    margin-bottom: 1rem;
}

    .crm-page-header .page-title {
        margin-bottom: .2rem;
    }

.crm-master-card {
    overflow: hidden;
}

    .crm-master-card .table {
        margin-bottom: 0;
    }

        .crm-master-card .table > :not(caption) > * > * {
            vertical-align: middle;
        }

.crm-master-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.crm-modal .modal-content {
    border: 0;
    box-shadow: 0 1.25rem 3.5rem rgba(24,36,51,.18);
}

.crm-modal .modal-header {
    padding: 1rem 1.25rem;
    border-bottom-color: #edf0f4;
}

.crm-modal .modal-body {
    padding: 1.25rem;
}

.crm-modal .modal-footer {
    padding: .9rem 1.25rem;
    background: #fafbfd;
    border-top-color: #edf0f4;
}

.crm-modal .form-label {
    font-weight: 600;
}

.crm-route-fields {
    background: #f8fafc;
    border: 1px solid #edf0f4;
    border-radius: .65rem;
    padding: 1rem;
}

/* Desktop */
@media (min-width: 992px) {
    /* Override Tabler's .navbar-vertical ~ .page-wrapper desktop offset. */
    body .page > .page-wrapper {
        margin-left: var(--crm-sidebar-width) !important;
        width: calc(100% - var(--crm-sidebar-width)) !important;
        max-width: none;
    }

    body.crm-sidebar-collapsed .crm-sidebar {
        width: var(--crm-sidebar-collapsed-width);
        min-width: var(--crm-sidebar-collapsed-width);
    }

    body.crm-sidebar-collapsed .page > .page-wrapper {
        margin-left: var(--crm-sidebar-collapsed-width) !important;
        width: calc(100% - var(--crm-sidebar-collapsed-width)) !important;
    }

    body.crm-sidebar-collapsed .crm-logo-text,
    body.crm-sidebar-collapsed .crm-sidebar-footer-text,
    body.crm-sidebar-collapsed .crm-nav-link .nav-link-title,
    body.crm-sidebar-collapsed .crm-nav-chevron,
    body.crm-sidebar-collapsed .crm-soon-badge {
        display: none;
    }

    body.crm-sidebar-collapsed .crm-sidebar-brand {
        justify-content: center;
        padding-inline: .5rem;
    }

    body.crm-sidebar-collapsed .crm-nav-link {
        justify-content: center;
        padding-inline: .45rem;
    }

        body.crm-sidebar-collapsed .crm-nav-link .nav-link-icon {
            margin: 0;
            width: 2rem;
            min-width: 2rem;
        }

    body.crm-sidebar-collapsed .crm-submenu {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    body.crm-sidebar-collapsed .crm-sidebar-scroll {
        padding-inline: .55rem;
    }

    body.crm-sidebar-collapsed .crm-topbar,
    body.crm-sidebar-collapsed .page-body {
        width: 100%;
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 991.98px) {
    .crm-sidebar {
        width: var(--crm-sidebar-width);
        min-width: var(--crm-sidebar-width);
        transform: translateX(-100%);
        box-shadow: 0 0 2rem rgba(24,36,51,.24);
    }

    body.crm-sidebar-mobile-open .crm-sidebar {
        transform: translateX(0);
    }

    body .page > .page-wrapper,
    body.crm-sidebar-collapsed .page > .page-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .crm-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(24,36,51,.4);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    body.crm-sidebar-mobile-open .crm-sidebar-backdrop {
        display: block;
    }

    body.crm-sidebar-mobile-open {
        overflow: hidden;
    }

    .crm-product-title {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .page-body {
        padding-top: .75rem;
    }

    .crm-topbar .container-fluid {
        padding-inline: .65rem !important;
    }

    .crm-user-trigger {
        padding-right: .15rem;
    }

    .crm-user-summary {
        display: none;
    }

    .crm-page-header .btn {
        width: 100%;
    }

    .crm-page-header .col-auto {
        width: 100%;
    }
}

/* Login */
.crm-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
}

.crm-login-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    background: linear-gradient(145deg, #182433 0%, #1f5fbf 100%);
    overflow: hidden;
}

    .crm-login-brand::after {
        content: "";
        position: absolute;
        width: 32rem;
        height: 32rem;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 50%;
        right: -10rem;
        bottom: -13rem;
    }

.crm-login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

.crm-brand-mark {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
}

.crm-brand-mark-mobile {
    color: var(--tblr-primary);
    background: var(--tblr-primary-lt);
    border-color: transparent;
}

.crm-login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--tblr-bg-surface);
}

.crm-login-card {
    width: 100%;
    max-width: 28rem;
}

@media (max-width: 991.98px) {
    .crm-login-shell {
        display: block;
    }

    .crm-login-form-panel {
        min-height: 100vh;
        padding: 1.5rem;
    }
}

/* =========================================================
   Global navigation & visual polish
   ========================================================= */
.crm-breadcrumb-wrap {
    margin: -.15rem 0 1rem;
    padding: .5rem .8rem;
    background: rgba(255,255,255,.72);
    border: 1px solid #e7ecf2;
    box-shadow: 0 1px 2px rgba(24,36,51,.025);
}

.crm-breadcrumb {
    --tblr-breadcrumb-divider-color: #a0aaba;
    align-items: center;
    font-size: .84rem;
}

    .crm-breadcrumb .breadcrumb-item,
    .crm-breadcrumb .breadcrumb-item a {
        color: #66758a;
        text-decoration: none;
    }

        .crm-breadcrumb .breadcrumb-item a:hover {
            color: var(--tblr-primary);
        }

        .crm-breadcrumb .breadcrumb-item.active {
            color: #182433;
            font-weight: 600;
        }

.crm-breadcrumb-home {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

    .crm-breadcrumb-home i {
        font-size: .95rem;
    }

.crm-page-header {
    padding: .2rem 0;
    margin-bottom: 1rem;
}

.crm-page-header-rich {
    padding: .35rem 0 .15rem;
}

.crm-page-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.crm-master-card,
.crm-permission-shell,
.crm-stat-card {
    border-radius: .85rem;
    border-color: #e4eaf1;
    box-shadow: 0 .15rem .8rem rgba(24,36,51,.045);
}

.crm-master-card {
    overflow: hidden;
}

.crm-filter-bar {
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.crm-data-table thead th,
.crm-master-card thead th {
    padding-top: .8rem;
    padding-bottom: .8rem;
    background: #f8fafc;
    color: #69778a;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    border-bottom-color: #e7ecf2;
}

.crm-data-table tbody td,
.crm-master-card tbody td {
    padding-top: .85rem;
    padding-bottom: .85rem;
    border-bottom-color: #edf1f5;
}

.crm-data-table tbody tr:hover,
.crm-master-card tbody tr:hover {
    background: #fbfdff;
}

.crm-description-cell {
    min-width: 16rem;
    max-width: 32rem;
}

.crm-code-pill {
    display: inline-flex;
    align-items: center;
    padding: .28rem .5rem;
    border: 1px solid #dfe8f4;
    border-radius: .5rem;
    color: #245a94;
    background: #f6faff;
    font-family: var(--tblr-font-monospace);
    font-size: .8rem;
    white-space: nowrap;
}

.crm-stat-card .card-body {
    padding: 1rem 1.1rem;
}

/* Permission assignment */
.crm-callout {
    border: 1px solid rgba(32,107,196,.18);
    border-radius: .8rem;
}

.crm-callout-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32,107,196,.1);
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.crm-permission-shell {
    overflow: hidden;
}

.crm-permission-toolbar {
    border-bottom: 1px solid #e8edf3;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.crm-count-badge {
    padding: .48rem .65rem;
    font-size: .78rem;
}

.crm-permission-module {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(24,36,51,.025);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    .crm-permission-module:hover {
        border-color: #cfdaea;
        box-shadow: 0 .35rem 1.1rem rgba(24,36,51,.055);
        transform: translateY(-1px);
    }

.crm-permission-module-header {
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .9rem;
    border-bottom: 1px solid #e8edf3;
    background: #f8fafc;
}

.crm-module-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #206bc4;
    background: #eaf3ff;
    flex: 0 0 auto;
}

.crm-permission-items {
    padding: .45rem;
}

.crm-permission-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0;
    padding: .72rem .65rem;
    border-radius: .6rem;
    cursor: pointer;
    transition: background .12s ease;
}

    .crm-permission-item:hover {
        background: #f7faff;
    }

    .crm-permission-item + .crm-permission-item {
        border-top: 1px dashed #edf1f5;
    }

    .crm-permission-item .form-check-input {
        margin: .18rem 0 0;
        flex: 0 0 auto;
    }

.crm-permission-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.crm-permission-name {
    font-weight: 650;
    color: #243449;
    line-height: 1.25;
    word-break: break-word;
}

.crm-permission-description {
    margin-top: .18rem;
    color: #748196;
    font-size: .78rem;
    line-height: 1.35;
}

.crm-permission-savebar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top-color: #e3e9f0;
}

.min-w-0 {
    min-width: 0 !important;
}

/* Consistent buttons/forms for master development */
.btn {
    border-radius: .55rem;
}

.form-control, .form-select {
    border-radius: .55rem;
    border-color: #dce4ee;
}

    .form-control:focus, .form-select:focus {
        border-color: rgba(32,107,196,.55);
        box-shadow: 0 0 0 .2rem rgba(32,107,196,.1);
    }

.modal-content {
    border-radius: .9rem;
}

@media (max-width: 767.98px) {
    .crm-breadcrumb-wrap {
        margin-bottom: .75rem;
    }

    .crm-breadcrumb-home span {
        display: none;
    }

    .crm-permission-toolbar .btn-list {
        width: 100%;
    }

        .crm-permission-toolbar .btn-list .btn {
            flex: 1 1 auto;
        }

    .crm-description-cell {
        min-width: 14rem;
    }
}

/* =========================================================
   APPEARANCE / DARK MODE
   ========================================================= */
.crm-theme-menu {
    min-width: 12rem;
}

    .crm-theme-menu .dropdown-item.active {
        background: var(--tblr-primary-lt);
        color: var(--tblr-primary);
    }

.crm-theme-check {
    transition: opacity .12s ease;
}

.crm-auth-theme-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

.crm-auth-body {
    background: var(--tblr-bg-surface);
}

[data-bs-theme="dark"] body {
    background: #0f1722;
}

[data-bs-theme="dark"] .crm-topbar {
    background: rgba(20, 29, 41, .96);
    border-bottom-color: rgba(255,255,255,.08);
}

[data-bs-theme="dark"] .crm-product-title {
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .crm-user-trigger:hover {
    background: rgba(255,255,255,.06);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .crm-master-card,
[data-bs-theme="dark"] .crm-permission-module {
    border-color: rgba(255,255,255,.09);
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

[data-bs-theme="dark"] .crm-permission-toolbar,
[data-bs-theme="dark"] .crm-permission-module-header {
    background: rgba(255,255,255,.025);
    border-color: rgba(255,255,255,.08);
}

[data-bs-theme="dark"] .crm-permission-module {
    background: var(--tblr-bg-surface);
}

    [data-bs-theme="dark"] .crm-permission-module:hover {
        border-color: rgba(96,165,250,.28);
    }

[data-bs-theme="dark"] .crm-permission-item:hover {
    background: rgba(255,255,255,.04);
}

[data-bs-theme="dark"] .crm-permission-item + .crm-permission-item {
    border-top-color: rgba(255,255,255,.07);
}

[data-bs-theme="dark"] .crm-permission-name {
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .crm-permission-description {
    color: var(--tblr-secondary-color);
}

[data-bs-theme="dark"] .crm-permission-savebar {
    background: rgba(20, 29, 41, .96);
    border-top-color: rgba(255,255,255,.08);
}

[data-bs-theme="dark"] .crm-code-pill {
    color: #9ecbff;
    background: rgba(32,107,196,.12);
    border-color: rgba(96,165,250,.2);
}

[data-bs-theme="dark"] .crm-data-table tbody tr:hover,
[data-bs-theme="dark"] .crm-master-card tbody tr:hover {
    background: rgba(255,255,255,.025);
}

[data-bs-theme="dark"] .crm-login-form-panel {
    background: var(--tblr-bg-surface);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    border-color: rgba(255,255,255,.12);
}
/* =========================================================
   FINAL COMPACT BREADCRUMB FIX
   ========================================================= */

.crm-breadcrumb-bar {
    position: sticky;
    top: var(--crm-topbar-height);
    z-index: 1015;
    width: 100%;
    height: 2.25rem;
    min-height: 2.25rem;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid #e5eaf0;
    box-shadow: 0 1px 2px rgba(24,36,51,.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


    /* IMPORTANT:
   Remove old breadcrumb wrapper spacing inside sticky bar
*/
    .crm-breadcrumb-bar .crm-breadcrumb-wrap {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }


    .crm-breadcrumb-bar > .container-fluid {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }


    .crm-breadcrumb-bar .breadcrumb {
        height: 2.25rem;
        min-height: 2.25rem;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        font-size: .82rem;
        line-height: 1;
    }


    .crm-breadcrumb-bar .breadcrumb-item {
        display: inline-flex;
        align-items: center;
    }


        .crm-breadcrumb-bar .breadcrumb-item a {
            text-decoration: none;
        }


        .crm-breadcrumb-bar .breadcrumb-item.active {
            font-weight: 600;
        }


/* Give more usable space to main content */
.page-body {
    padding-top: .75rem !important;
}


/* Dark mode */
[data-bs-theme="dark"] .crm-breadcrumb-bar {
    background: rgba(24,36,51,.97);
    border-bottom-color: rgba(255,255,255,.08);
}


/* Mobile */
@media (max-width: 991.98px) {

    .crm-breadcrumb-bar {
        height: 2.15rem;
        min-height: 2.15rem;
    }

        .crm-breadcrumb-bar .breadcrumb {
            height: 2.15rem;
            min-height: 2.15rem;
            font-size: .78rem;
        }

        .crm-breadcrumb-bar > .container-fluid {
            padding-left: .75rem !important;
            padding-right: .75rem !important;
        }

    .page-body {
        padding-top: .65rem !important;
    }
}
/* =========================================================
   PREMIUM APPLICATION SHELL + APP LOCK
   ========================================================= */

:root {
    --crm-premium-radius: .9rem;
    --crm-premium-shadow: 0 .35rem 1.5rem rgba(24, 36, 51, .055);
    --crm-lock-accent: #206bc4;
}

/* Refined, low-noise premium surface treatment */
.page-body {
    background: radial-gradient(circle at 85% 4%, rgba(32,107,196,.045), transparent 28rem), linear-gradient(180deg, rgba(255,255,255,.18), transparent 13rem);
}

.card,
.crm-master-card,
.crm-permission-shell,
.crm-stat-card {
    border-radius: var(--crm-premium-radius);
}

.crm-master-card,
.crm-permission-shell {
    box-shadow: var(--crm-premium-shadow);
}

.crm-topbar {
    box-shadow: 0 1px 0 rgba(24,36,51,.04), 0 .25rem 1.25rem rgba(24,36,51,.025);
}

.crm-user-trigger {
    border: 1px solid transparent;
}

    .crm-user-trigger:hover {
        border-color: #e6ebf2;
    }

[data-bs-theme="dark"] .page-body {
    background: radial-gradient(circle at 85% 4%, rgba(55,125,255,.07), transparent 28rem), linear-gradient(180deg, rgba(255,255,255,.01), transparent 13rem);
}

[data-bs-theme="dark"] .crm-user-trigger:hover {
    border-color: rgba(255,255,255,.08);
}

/* Full-screen application lock. The authenticated page remains in place behind it. */
.crm-app-lock {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

    .crm-app-lock[hidden] {
        display: none !important;
    }

.crm-lock-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, rgba(44,116,210,.18), transparent 35rem), rgba(11, 18, 29, .73);
    backdrop-filter: blur(18px) saturate(.85);
    -webkit-backdrop-filter: blur(18px) saturate(.85);
}

.crm-lock-stage {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.crm-lock-card {
    width: min(29rem, 100%);
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 1.35rem;
    background: rgba(255,255,255,.94);
    box-shadow: 0 2rem 5rem rgba(0,0,0,.25);
}

.crm-lock-card-page {
    margin: auto;
}

.crm-lock-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: radial-gradient(circle at 20% 20%, rgba(32,107,196,.14), transparent 30rem), radial-gradient(circle at 85% 80%, rgba(66,153,255,.10), transparent 28rem), var(--tblr-bg-surface-secondary, #f5f7fb);
}

.crm-lock-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: #516277;
}

.crm-lock-brand-mark {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border-radius: .62rem;
    color: #fff;
    background: linear-gradient(145deg, #206bc4, #4299ff);
    box-shadow: 0 .45rem 1.1rem rgba(32,107,196,.25);
}

.crm-lock-avatar-wrap {
    position: relative;
    width: fit-content;
    margin-inline: auto;
}

.crm-lock-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border: .3rem solid rgba(32,107,196,.10);
    box-shadow: 0 .85rem 2rem rgba(24,36,51,.14);
}

.crm-lock-status {
    position: absolute;
    right: -.1rem;
    bottom: .05rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: var(--crm-lock-accent);
}

.crm-lock-title {
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.crm-lock-unlock-btn {
    min-height: 3.1rem;
    box-shadow: 0 .5rem 1.25rem rgba(32,107,196,.18);
}

body.crm-app-locked {
    overflow: hidden !important;
}

    body.crm-app-locked .crm-topbar,
    body.crm-app-locked .crm-sidebar,
    body.crm-app-locked .page-body {
        user-select: none;
    }

[data-bs-theme="dark"] .crm-lock-card {
    border-color: rgba(255,255,255,.10);
    background: rgba(20,29,41,.96);
    box-shadow: 0 2rem 5rem rgba(0,0,0,.48);
}

[data-bs-theme="dark"] .crm-lock-brand {
    color: #9ba9ba;
}

[data-bs-theme="dark"] .crm-lock-status {
    border-color: #141d29;
}

@media (max-width: 575.98px) {
    .crm-lock-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
}

/* =========================================================
   REUSABLE PREMIUM DATA GRID
   ========================================================= */
.crm-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #e7ecf2;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,251,253,.98));
}

.crm-grid-toolbar-main,
.crm-grid-toolbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.crm-grid-toolbar-main {
    flex: 1 1 28rem;
}

.crm-grid-search {
    flex: 1 1 20rem;
    max-width: 38rem;
}

.crm-grid-table thead th {
    position: sticky;
    top: calc(var(--crm-topbar-height) + 2.25rem);
    z-index: 3;
    background: var(--tblr-bg-surface-secondary, #f8fafc);
}

.crm-grid-table tbody tr {
    transition: background .12s ease, box-shadow .12s ease;
}

    .crm-grid-table tbody tr:hover {
        background: rgba(32,107,196,.035);
    }

.crm-grid-table td,
.crm-grid-table th {
    vertical-align: middle;
}

.crm-grid-column-menu {
    max-height: 22rem;
    min-width: 15rem;
    overflow-y: auto;
}

[data-bs-theme="dark"] .crm-grid-toolbar {
    border-bottom-color: rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.012));
}

@media (max-width: 767.98px) {
    .crm-grid-toolbar,
    .crm-grid-toolbar-actions {
        align-items: stretch;
    }

    .crm-grid-toolbar {
        flex-direction: column;
    }

    .crm-grid-toolbar-actions .btn,
    .crm-grid-toolbar-actions .dropdown {
        flex: 1 1 auto;
    }
}

/* =========================================================
   FINAL PREMIUM GRID TOOLBAR + HEADER FIX
   Export/columns left, search/filter right.
   Keep table headers in normal document flow to prevent row overlap.
   ========================================================= */
.crm-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .875rem;
    padding: .7rem 1rem;
    min-height: 3.65rem;
    border-bottom: 1px solid #e7ecf2;
    background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(249,251,253,.99));
}

.crm-grid-toolbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
    order: 1;
}

.crm-grid-toolbar-main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    order: 2;
}

.crm-grid-search {
    flex: 0 1 34rem;
    width: min(34rem, 42vw);
    min-width: 15rem;
    max-width: 34rem;
}

.crm-grid-toolbar-main .form-select {
    flex: 0 1 14rem;
    width: 14rem;
    max-width: 14rem !important;
}

.crm-grid-toolbar .btn {
    white-space: nowrap;
}

/* Fix the broken/overlapping header seen with sticky TH inside .table-responsive. */
.crm-grid-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    .crm-grid-table thead {
        display: table-header-group !important;
    }

        .crm-grid-table thead tr {
            display: table-row !important;
        }

        .crm-grid-table thead th {
            position: static !important;
            top: auto !important;
            z-index: auto !important;
            height: 2.9rem;
            padding-top: .72rem !important;
            padding-bottom: .72rem !important;
            vertical-align: middle !important;
            background: #f5f8fc !important;
            border-top: 0;
            border-bottom: 1px solid #dde5ef !important;
            color: #607086;
            font-size: .72rem;
            font-weight: 750;
            letter-spacing: .045em;
            text-transform: uppercase;
            white-space: nowrap;
        }

    .crm-grid-table tbody tr:first-child td {
        border-top: 0;
    }

    .crm-grid-table tbody td {
        position: static;
        padding-top: .8rem;
        padding-bottom: .8rem;
    }

.crm-master-card > .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

[data-bs-theme="dark"] .crm-grid-toolbar {
    border-bottom-color: rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.014));
}

[data-bs-theme="dark"] .crm-grid-table thead th {
    background: #182231 !important;
    color: #aab6c5;
    border-bottom-color: rgba(255,255,255,.09) !important;
}

@media (max-width: 991.98px) {
    .crm-grid-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-grid-toolbar-actions,
    .crm-grid-toolbar-main {
        width: 100%;
        margin-left: 0;
    }

    .crm-grid-toolbar-actions {
        order: 1;
    }

    .crm-grid-toolbar-main {
        order: 2;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .crm-grid-search {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .crm-grid-toolbar-main .form-select {
        flex: 1 1 12rem;
        width: auto;
        max-width: none !important;
    }
}

@media (max-width: 575.98px) {
    .crm-grid-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

        .crm-grid-toolbar-actions .dropdown,
        .crm-grid-toolbar-actions .btn,
        .crm-grid-toolbar-actions .dropdown > .btn {
            width: 100%;
        }

    .crm-grid-toolbar-main {
        display: grid;
        grid-template-columns: 1fr auto auto;
    }

        .crm-grid-search,
        .crm-grid-toolbar-main .form-select {
            grid-column: 1 / -1;
            width: 100%;
        }
}

/* =========================================================
   FINAL COMPACT REUSABLE DATA GRID
   Add data-crm-paginate + data-crm-scroll to any data-crm-grid table.
   JS creates pagination/footer automatically.
   ========================================================= */
.crm-page-header.crm-page-header-rich {
    margin-bottom: .55rem;
    padding: 0;
}

.crm-page-header-rich .crm-page-icon {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: .7rem;
    font-size: 1.1rem;
}

.crm-page-header-rich .page-title {
    font-size: 1.2rem;
    line-height: 1.2;
    margin-bottom: .1rem !important;
}

.crm-page-header-rich .text-secondary {
    font-size: .82rem;
}

.crm-grid-toolbar {
    min-height: 2.85rem;
    padding: .38rem .65rem;
    gap: .5rem;
}

.crm-grid-toolbar-actions,
.crm-grid-toolbar-main {
    gap: .35rem;
}

.crm-grid-toolbar .btn,
.crm-grid-toolbar .form-control,
.crm-grid-toolbar .form-select {
    min-height: 2.1rem;
    height: 2.1rem;
    font-size: .8rem;
    border-radius: .45rem;
}

.crm-grid-toolbar .btn {
    padding: .3rem .58rem;
}

.crm-grid-toolbar .btn-icon {
    width: 2.1rem;
    min-width: 2.1rem;
    padding: 0;
}

.crm-grid-toolbar .input-icon-addon {
    font-size: .9rem;
}

.crm-grid-search {
    flex-basis: 26rem;
    width: min(26rem, 34vw);
    max-width: 26rem;
}

.crm-grid-table thead th {
    height: 2.2rem !important;
    padding: .42rem .65rem !important;
    font-size: .665rem !important;
    line-height: 1.05;
}

.crm-grid-table tbody td {
    padding: .43rem .65rem !important;
    line-height: 1.18;
    font-size: .82rem;
}

    .crm-grid-table tbody td .fw-semibold {
        line-height: 1.15;
    }

    .crm-grid-table tbody td .small {
        margin-top: .08rem;
        font-size: .7rem !important;
        line-height: 1.15;
    }

.crm-grid-table .badge {
    padding: .18rem .38rem;
    font-size: .66rem;
}

.crm-grid-table .crm-master-actions {
    gap: .25rem;
}

    .crm-grid-table .crm-master-actions .btn {
        min-height: 1.75rem;
        padding: .2rem .42rem;
        font-size: .72rem;
        border-radius: .4rem;
    }

/* Scroll only the data area; the header remains visible inside the grid. */
.crm-master-card > .crm-grid-scroll,
.crm-grid-scroll {
    --crm-grid-scroll-height: min(58vh, 34rem);
    max-height: var(--crm-grid-scroll-height);
    overflow: auto !important;
    scrollbar-width: thin;
}

    .crm-grid-scroll .crm-grid-table thead th {
        position: sticky !important;
        top: 0 !important;
        z-index: 4 !important;
        box-shadow: inset 0 -1px 0 #dde5ef;
    }

/* Auto-created pagination footer */
.crm-grid-footer {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .38rem .65rem;
    border-top: 1px solid #e7ecf2;
    background: #fff;
    font-size: .76rem;
}

.crm-grid-footer-summary,
.crm-grid-pagination,
.crm-grid-page-size-label {
    display: flex;
    align-items: center;
}

.crm-grid-footer-summary {
    gap: .28rem;
    min-width: 0;
}

.crm-grid-page-size-label {
    gap: .35rem;
    margin-left: .65rem;
}

.crm-grid-page-size {
    width: 4rem;
    height: 1.9rem;
    min-height: 1.9rem;
    padding-top: .15rem;
    padding-bottom: .15rem;
    font-size: .75rem;
}

.crm-grid-pagination {
    gap: .28rem;
}

    .crm-grid-pagination .btn {
        width: 1.9rem;
        min-width: 1.9rem;
        height: 1.9rem;
        min-height: 1.9rem;
        padding: 0;
        border-radius: .4rem;
    }

.crm-grid-page-status {
    min-width: 6.5rem;
    text-align: center;
    color: #66758a;
    font-weight: 600;
}

[data-bs-theme="dark"] .crm-grid-footer {
    background: var(--tblr-bg-surface);
    border-top-color: rgba(255,255,255,.08);
}

[data-bs-theme="dark"] .crm-grid-scroll .crm-grid-table thead th {
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.09);
}

[data-bs-theme="dark"] .crm-grid-page-status {
    color: var(--tblr-secondary-color);
}

@media (max-width: 991.98px) {
    .crm-grid-toolbar {
        padding: .45rem .55rem;
    }

    .crm-grid-search {
        width: 100%;
        max-width: none;
    }

    .crm-grid-scroll {
        --crm-grid-scroll-height: min(56vh, 30rem);
    }
}

@media (max-width: 575.98px) {
    .crm-grid-footer {
        align-items: stretch;
        flex-direction: column;
        padding: .5rem .55rem;
    }

    .crm-grid-footer-summary,
    .crm-grid-pagination {
        justify-content: space-between;
        width: 100%;
    }

    .crm-grid-page-size-label {
        margin-left: auto;
    }

    .crm-grid-page-status {
        flex: 1 1 auto;
    }
}

/* =========================================================
   FINAL GLOBAL COMPACT PAGE SHELL
   Reusable across all CRM pages.
   ========================================================= */

/* Use more of the viewport for actual page content. */
.page-body {
    padding: .45rem 0 1rem !important;
}

    .page-body > .container-fluid {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

/* Compact every CRM page header consistently. */
.crm-page-header,
.crm-page-header.crm-page-header-rich {
    margin: 0 0 .38rem !important;
    padding: .12rem 0 !important;
    min-height: 0 !important;
}

    .crm-page-header > .row,
    .crm-page-header.crm-page-header-rich > .row {
        --tblr-gutter-y: 0;
        --tblr-gutter-x: .65rem;
        min-height: 2.55rem;
        align-items: center !important;
    }

    .crm-page-header .d-flex.align-items-center,
    .crm-page-header-rich .d-flex.align-items-center {
        gap: .55rem !important;
    }

    /* Small premium icon instead of a large visual block. */
    .crm-page-header .crm-page-icon,
    .crm-page-header-rich .crm-page-icon {
        width: 2rem !important;
        height: 2rem !important;
        min-width: 2rem !important;
        border-radius: .55rem !important;
        font-size: .95rem !important;
    }

/* The breadcrumb already communicates hierarchy, so remove the repeated eyebrow label. */
.crm-page-header-rich .text-uppercase.text-secondary.small.fw-semibold {
    display: none !important;
}

.crm-page-header .page-title,
.crm-page-header-rich .page-title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;
}

.crm-page-header .text-secondary,
.crm-page-header-rich .text-secondary {
    margin-top: .12rem !important;
    font-size: .74rem !important;
    line-height: 1.15 !important;
}

.crm-page-header .col-auto .btn,
.crm-page-header-rich .col-auto .btn {
    min-height: 2rem;
    height: 2rem;
    padding: .28rem .62rem;
    font-size: .76rem;
    border-radius: .45rem;
}

/* Keep the list/card visually attached to the page header. */
.crm-page-header + .card,
.crm-page-header + .crm-master-card,
.crm-page-header-rich + .card,
.crm-page-header-rich + .crm-master-card {
    margin-top: 0 !important;
}

/* Slightly denser master card without making rows cramped. */
.crm-master-card {
    border-radius: .68rem !important;
}

.crm-grid-toolbar {
    min-height: 2.55rem !important;
    padding: .28rem .52rem !important;
}

    .crm-grid-toolbar .btn,
    .crm-grid-toolbar .form-control,
    .crm-grid-toolbar .form-select {
        height: 1.95rem !important;
        min-height: 1.95rem !important;
        font-size: .76rem !important;
    }

    .crm-grid-toolbar .btn {
        padding: .24rem .52rem !important;
    }

.crm-grid-search {
    flex-basis: 23rem !important;
    width: min(23rem, 31vw) !important;
    max-width: 23rem !important;
}

.crm-grid-table thead th {
    height: 1.95rem !important;
    padding: .32rem .55rem !important;
    font-size: .64rem !important;
}

.crm-grid-table tbody td {
    padding: .33rem .55rem !important;
    font-size: .78rem !important;
    line-height: 1.12 !important;
}

    .crm-grid-table tbody td .small {
        margin-top: .04rem !important;
        font-size: .66rem !important;
        line-height: 1.08 !important;
    }

.crm-grid-table .crm-master-actions .btn {
    min-height: 1.6rem !important;
    height: 1.6rem !important;
    padding: .14rem .36rem !important;
    font-size: .68rem !important;
}

.crm-grid-footer {
    min-height: 2.25rem !important;
    padding: .25rem .52rem !important;
    font-size: .72rem !important;
}

.crm-grid-page-size {
    height: 1.7rem !important;
    min-height: 1.7rem !important;
}

.crm-grid-pagination .btn {
    width: 1.7rem !important;
    min-width: 1.7rem !important;
    height: 1.7rem !important;
    min-height: 1.7rem !important;
}

/* Avoid large vertical gaps after global alerts when there are none. */
.page-body .alert:empty {
    display: none;
}

@media (max-width: 991.98px) {
    .page-body {
        padding-top: .35rem !important;
    }

        .page-body > .container-fluid {
            padding-left: .65rem !important;
            padding-right: .65rem !important;
        }

    .crm-page-header,
    .crm-page-header.crm-page-header-rich {
        margin-bottom: .35rem !important;
    }

    .crm-grid-search {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 575.98px) {
    .crm-page-header > .row,
    .crm-page-header.crm-page-header-rich > .row {
        row-gap: .35rem !important;
    }

    .crm-page-header .col-auto,
    .crm-page-header-rich .col-auto {
        width: auto !important;
    }

        .crm-page-header .col-auto .btn,
        .crm-page-header-rich .col-auto .btn {
            width: auto !important;
        }
}

/* =========================================================
   PERMANENT MASTER MODAL CRUD LAYOUT
   Keeps header/footer visible and scrolls only modal body.
   ========================================================= */
.crm-modal .modal-dialog {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.crm-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    border-radius: .9rem;
}

.crm-modal .crm-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 2rem);
    width: 100%;
}

    .crm-modal .crm-modal-form .modal-header,
    .crm-modal .crm-modal-form .modal-footer {
        flex: 0 0 auto;
    }

    .crm-modal .crm-modal-form .modal-header {
        padding: .8rem 1rem;
    }

    .crm-modal .crm-modal-form .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: .85rem 1rem;
    }

    .crm-modal .crm-modal-form .modal-footer {
        position: relative;
        z-index: 2;
        min-height: 3.25rem;
        padding: .55rem 1rem;
        background: var(--tblr-bg-surface, #fff);
        border-top: 1px solid var(--tblr-border-color, #e5e7eb);
        box-shadow: 0 -.35rem 1rem rgba(24,36,51,.035);
    }

    .crm-modal .crm-modal-form .row.g-3 {
        --tblr-gutter-y: .7rem;
    }

    .crm-modal .crm-modal-form .form-label {
        margin-bottom: .3rem;
        font-size: .78rem;
        font-weight: 650;
    }

    .crm-modal .crm-modal-form .form-control,
    .crm-modal .crm-modal-form .form-select {
        min-height: 2.25rem;
    }

.crm-modal .crm-modal-errors {
    margin-bottom: .75rem;
    padding: .55rem .7rem;
    font-size: .78rem;
}

.crm-toast-host {
    z-index: 2000;
}

[data-bs-theme="dark"] .crm-modal .crm-modal-form .modal-footer {
    background: var(--tblr-bg-surface);
    border-top-color: rgba(255,255,255,.08);
    box-shadow: 0 -.35rem 1rem rgba(0,0,0,.12);
}

@media (max-width: 575.98px) {
    .crm-modal .modal-dialog {
        margin: .5rem;
    }

    .crm-modal .modal-content,
    .crm-modal .crm-modal-form {
        max-height: calc(100vh - 1rem);
    }
}

/* Task lifecycle */
.crm-lifecycle-modal .modal-body {
    background: var(--tblr-bg-surface-secondary,#f6f8fb)
}

.crm-life-stat {
    height: 100%;
    border: 1px solid var(--tblr-border-color);
    border-radius: .65rem;
    background: var(--tblr-bg-surface);
    padding: .65rem .8rem
}

    .crm-life-stat span {
        display: block;
        font-size: .72rem;
        color: var(--tblr-secondary);
        text-transform: uppercase;
        letter-spacing: .04em
    }

    .crm-life-stat strong {
        display: block;
        margin-top: .15rem
    }

.crm-life-timeline {
    position: relative
}

    .crm-life-timeline:before {
        content: "";
        position: absolute;
        left: 18px;
        top: 12px;
        bottom: 12px;
        width: 2px;
        background: var(--tblr-border-color)
    }

.crm-life-event {
    position: relative;
    display: flex;
    gap: .85rem;
    padding: 0 0 1rem
}

    .crm-life-event:last-child {
        padding-bottom: 0
    }

.crm-life-dot {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--tblr-bg-surface)
}

.crm-life-content {
    flex: 1;
    min-width: 0;
    padding: .35rem .2rem .45rem
}

.crm-life-detail {
    white-space: pre-wrap;
    word-break: break-word
}


/* =========================================================
   RC9 DESIGN TOKENS - edit these variables to reskin the CRM
   ========================================================= */
:root {
    --crm-primary: #047d7d;
    --crm-primary-hover: #1d68b2;
    --crm-primary-rgb: 36, 120, 201;
    --crm-topbar-bg: var(--crm-primary);
    --crm-topbar-text: #ffffff;
    --crm-topbar-muted: rgba(255,255,255,.82);
    --crm-topbar-border: rgba(0,0,0,.08);
    --crm-topbar-icon-hover: rgba(255,255,255,.14);
    --crm-surface: #ffffff;
    --crm-page-bg: #f5f7fb;
    --crm-border: #dfe6ef;
    --crm-text: #1f2937;
    --crm-muted: #6b778c;
    --crm-sidebar-bg: #162638;
    --crm-sidebar-text: rgba(255,255,255,.88);
    --crm-sidebar-muted: rgba(255,255,255,.52);
    --crm-sidebar-hover: rgba(255,255,255,.08);
    --crm-sidebar-active: rgba(var(--crm-primary-rgb),.34);
    --crm-sidebar-active-line: #55a9ff;
    --crm-radius: .55rem;
    --crm-topbar-height: 3.65rem;
}

[data-bs-theme="dark"] {
    --crm-surface: #17212f;
    --crm-page-bg: #0f1722;
    --crm-border: rgba(255,255,255,.09);
    --crm-text: #e5edf7;
    --crm-muted: #9ba9bb;
}

body {
    background: var(--crm-page-bg);
    color: var(--crm-text);
}

.crm-topbar {
    height: var(--crm-topbar-height);
    min-height: var(--crm-topbar-height);
    background: var(--crm-topbar-bg) !important;
    color: var(--crm-topbar-text);
    border-bottom: 1px solid var(--crm-topbar-border);
    box-shadow: 0 1px 3px rgba(17,24,39,.16);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.crm-topbar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 .8rem;
}

.crm-topbar-left, .crm-topbar-actions {
    display: flex;
    align-items: center;
    min-width: 0;
}

.crm-topbar-left {
    gap: .35rem;
}

.crm-topbar-actions {
    gap: .2rem;
    margin-left: auto;
}

.crm-topbar-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--crm-radius);
    background: transparent;
    color: var(--crm-topbar-text);
    font-size: 1.25rem;
    cursor: pointer;
}

    .crm-topbar-icon:hover, .crm-topbar-icon:focus {
        background: var(--crm-topbar-icon-hover);
        color: var(--crm-topbar-text);
        outline: 0;
    }

.crm-back-button {
    border-left: 1px solid rgba(255,255,255,.2);
    border-radius: 0;
    margin-left: .1rem;
    padding-left: .65rem;
    width: 2.65rem;
}

.crm-topbar-title {
    margin-left: .25rem;
    font-size: 1.08rem;
    font-weight: 650;
    color: var(--crm-topbar-text);
    max-width: 28rem;
}

.crm-user-trigger {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 0;
    border-radius: var(--crm-radius);
    background: transparent;
    color: var(--crm-topbar-text);
    padding: .25rem .35rem .25rem .65rem;
    cursor: pointer;
    max-width: 25rem;
}

    .crm-user-trigger:hover, .crm-user-trigger:focus {
        background: var(--crm-topbar-icon-hover);
    }

.crm-user-copy {
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.12;
    min-width: 0;
    max-width: 18rem;
}

.crm-user-name {
    color: var(--crm-topbar-text);
    font-weight: 650;
    font-size: .86rem;
    max-width: 18rem;
}

.crm-user-company {
    color: var(--crm-topbar-muted);
    font-size: .72rem;
    margin-top: .15rem;
    max-width: 18rem;
}

.crm-user-trigger .crm-user-avatar {
    width: 2.45rem;
    height: 2.45rem;
    border: 2px solid rgba(255,255,255,.75);
    background: var(--crm-surface);
}

.crm-user-chevron {
    color: var(--crm-topbar-muted);
}

.crm-dropdown {
    position: relative;
}

    .crm-dropdown > .dropdown-menu {
        position: absolute;
        top: calc(100% + .45rem);
        right: 0;
        left: auto;
        z-index: 1060;
    }

.crm-notification-count {
    position: absolute;
    top: .12rem;
    right: .08rem;
    min-width: 1.05rem;
    height: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 .25rem;
    background: #d63939;
    color: #fff;
    font-size: .65rem;
    line-height: 1;
    border: 2px solid var(--crm-topbar-bg);
}

    .crm-notification-count.d-none {
        display: none !important;
    }

.crm-sidebar {
    background: var(--crm-sidebar-bg);
}

.crm-nav-link {
    color: var(--crm-sidebar-text) !important;
}

    .crm-nav-link:hover {
        background: var(--crm-sidebar-hover);
    }

    .crm-nav-link.active, .crm-nav-parent.active > .crm-nav-toggle {
        background: var(--crm-sidebar-active);
    }

        .crm-nav-link.active::before {
            background: var(--crm-sidebar-active-line);
        }

.crm-logo-mark {
    background: var(--crm-primary);
    box-shadow: 0 .35rem 1rem rgba(var(--crm-primary-rgb),.25);
}

body.crm-sidebar-collapsed .crm-nav-parent > .collapse:not(.show) {
    display: none;
}

body.crm-sidebar-collapsed .crm-nav-parent > .collapse.show {
    display: block;
}

[data-bs-theme="dark"] .crm-topbar {
    background: var(--crm-topbar-bg) !important;
    border-bottom-color: var(--crm-topbar-border);
}

[data-bs-theme="dark"] .crm-dropdown > .dropdown-menu {
    background: var(--crm-surface);
    border-color: var(--crm-border);
}

@media (max-width: 767.98px) {
    .crm-topbar-inner {
        padding: 0 .45rem;
    }

    .crm-topbar-title {
        font-size: .98rem;
        max-width: 11rem;
    }

    .crm-user-trigger {
        padding: .15rem;
    }
}

/* =========================================================
   PROFESSIONAL SIDEBAR + APPLICATION SHELL POLISH
   Wider desktop sidebar, cleaner hierarchy and premium states.
   ========================================================= */
:root {
    --crm-sidebar-width: 18.5rem;
    --crm-sidebar-collapsed-width: 5rem;
    /* Keep the teal brand system internally consistent. */
    --crm-primary: #078783;
    --crm-primary-hover: #066f6c;
    --crm-primary-rgb: 7, 135, 131;
    --crm-sidebar-bg: radial-gradient(circle at 12% 0%, rgba(18, 175, 168, .13), transparent 18rem), linear-gradient(180deg, #182d42 0%, #14283c 52%, #102337 100%);
    --crm-sidebar-border: rgba(255, 255, 255, .085);
    --crm-sidebar-text: rgba(244, 248, 252, .9);
    --crm-sidebar-muted: rgba(219, 230, 241, .56);
    --crm-sidebar-hover: rgba(255, 255, 255, .07);
    --crm-sidebar-active: linear-gradient(90deg, rgba(12, 159, 153, .34), rgba(32, 107, 196, .22));
    --crm-sidebar-active-line: #35c8c1;
    --crm-sidebar-shadow: .75rem 0 2rem rgba(8, 20, 33, .14);
}

/* Sidebar frame */
.crm-sidebar {
    isolation: isolate;
    background: var(--crm-sidebar-bg) !important;
    border-right: 1px solid var(--crm-sidebar-border);
    box-shadow: var(--crm-sidebar-shadow);
}

    .crm-sidebar::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 28%), radial-gradient(circle at 100% 82%, rgba(54, 137, 220, .08), transparent 18rem);
    }

    .crm-sidebar > .container-fluid {
        position: relative;
        z-index: 1;
    }

/* Brand area */
.crm-sidebar-brand {
    position: relative;
    height: auto;
    min-height: 5.25rem;
    padding: .9rem 1.15rem;
    background: rgba(7, 20, 34, .13);
    border-bottom-color: rgba(255, 255, 255, .08);
}

    .crm-sidebar-brand::after {
        content: "";
        position: absolute;
        right: 1rem;
        bottom: -1px;
        left: 1rem;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .11), transparent);
    }

.crm-logo-mark {
    width: 2.65rem;
    height: 2.65rem;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: .82rem;
    background: linear-gradient(145deg, #0aa09a, #057b78) !important;
    box-shadow: 0 .55rem 1.25rem rgba(3, 105, 102, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.crm-logo-text {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 760;
    letter-spacing: -.025em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.crm-sidebar-brand small,
.crm-sidebar-brand .small,
.crm-sidebar-brand .text-secondary {
    color: var(--crm-sidebar-muted) !important;
}

/* Scroll area */
.crm-sidebar-scroll {
    padding: .9rem .75rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

    .crm-sidebar-scroll::-webkit-scrollbar {
        width: .34rem;
    }

    .crm-sidebar-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .crm-sidebar-scroll::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(255, 255, 255, .18);
    }

        .crm-sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, .28);
        }

/* Primary navigation */
.crm-nav-list {
    gap: .3rem;
}

.crm-nav-link {
    min-height: 3rem;
    gap: .1rem;
    padding: .67rem .78rem;
    border: 1px solid transparent;
    border-radius: .72rem;
    font-size: .93rem;
    color: var(--crm-sidebar-text) !important;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

    .crm-nav-link:hover {
        color: #fff !important;
        background: var(--crm-sidebar-hover);
        border-color: rgba(255, 255, 255, .055);
        transform: translateX(2px);
    }

    .crm-nav-link:focus-visible {
        outline: 2px solid rgba(53, 200, 193, .72);
        outline-offset: 2px;
    }

    .crm-nav-link.active,
    .crm-nav-parent.active > .crm-nav-toggle {
        color: #fff !important;
        background: var(--crm-sidebar-active) !important;
        border-color: rgba(66, 214, 207, .16);
        box-shadow: 0 .45rem 1.15rem rgba(5, 22, 38, .16), inset 0 1px 0 rgba(255, 255, 255, .055);
    }

        .crm-nav-link.active::before {
            left: 0;
            width: 3px;
            height: 1.75rem;
            border-radius: 0 999px 999px 0;
            background: var(--crm-sidebar-active-line);
            box-shadow: 0 0 .8rem rgba(53, 200, 193, .42);
        }

    .crm-nav-link .nav-link-icon {
        width: 2rem;
        min-width: 2rem;
        margin-right: .42rem;
        color: rgba(233, 241, 249, .78);
        font-size: 1.17rem;
        transition: color .16s ease, transform .16s ease;
    }

    .crm-nav-link:hover .nav-link-icon,
    .crm-nav-link.active .nav-link-icon,
    .crm-nav-parent.active > .crm-nav-toggle .nav-link-icon {
        color: #fff;
    }

    .crm-nav-link:hover .nav-link-icon {
        transform: scale(1.035);
    }

    .crm-nav-link .nav-link-title {
        font-weight: 590;
        letter-spacing: -.006em;
    }

.crm-nav-chevron {
    color: rgba(255, 255, 255, .58);
    opacity: .9;
}

.crm-nav-toggle[aria-expanded="true"] .crm-nav-chevron {
    color: rgba(255, 255, 255, .88);
}

/* Nested navigation */
.crm-submenu {
    gap: .18rem;
    margin: .3rem 0 .45rem 1.42rem;
    padding-left: .72rem;
    border-left-color: rgba(255, 255, 255, .11);
}

    .crm-submenu .crm-nav-link {
        min-height: 2.42rem;
        padding: .48rem .62rem;
        border-radius: .58rem;
        font-size: .855rem;
        color: rgba(232, 239, 247, .72) !important;
    }

        .crm-submenu .crm-nav-link:hover,
        .crm-submenu .crm-nav-link.active {
            color: #fff !important;
        }

            .crm-submenu .crm-nav-link.active::before {
                left: -.73rem;
                width: 2px;
                height: 1.25rem;
            }

.crm-nav-placeholder,
.crm-nav-placeholder:hover {
    color: var(--crm-sidebar-muted) !important;
    transform: none;
}

.crm-soon-badge {
    padding: .18rem .38rem;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 999px;
    background: rgba(255, 255, 255, .055);
    color: rgba(255, 255, 255, .68);
    font-weight: 650;
    letter-spacing: .025em;
}

/* Footer */
.crm-sidebar-footer {
    min-height: 3.8rem;
    padding: .75rem 1rem;
    background: rgba(5, 16, 28, .14);
    border-top-color: rgba(255, 255, 255, .08);
}

.crm-sidebar-footer-text {
    color: var(--crm-sidebar-muted) !important;
    font-size: .75rem;
    letter-spacing: .01em;
}

/* Top bar: subtle, consistent teal treatment */
.crm-topbar {
    background: linear-gradient(90deg, #078783 0%, #067e7b 58%, #057572 100%) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 .3rem 1.2rem rgba(4, 61, 59, .11);
}

.crm-topbar-icon,
.crm-user-trigger {
    transition: background .15s ease, transform .15s ease;
}

    .crm-topbar-icon:hover,
    .crm-topbar-icon:focus,
    .crm-user-trigger:hover,
    .crm-user-trigger:focus {
        background: rgba(255, 255, 255, .12);
    }

/* Collapsed desktop state */
@media (min-width: 992px) {
    body.crm-sidebar-collapsed .crm-sidebar-brand {
        min-height: 4.75rem;
        padding-inline: .55rem;
    }

    body.crm-sidebar-collapsed .crm-logo-mark {
        width: 2.5rem;
        height: 2.5rem;
    }

    body.crm-sidebar-collapsed .crm-nav-link {
        min-height: 2.85rem;
        padding-inline: .45rem;
        transform: none;
    }

        body.crm-sidebar-collapsed .crm-nav-link.active::before {
            top: auto;
            right: auto;
            bottom: .18rem;
            left: 50%;
            width: 1.35rem;
            height: 2px;
            transform: translateX(-50%);
            border-radius: 999px;
        }
}

/* Off-canvas sidebar remains usable on tablets and phones. */
@media (max-width: 991.98px) {
    .crm-sidebar {
        width: min(var(--crm-sidebar-width), 86vw);
        min-width: min(var(--crm-sidebar-width), 86vw);
        box-shadow: 1rem 0 2.5rem rgba(5, 15, 27, .28);
    }

    .crm-sidebar-brand {
        min-height: 4.85rem;
    }
}

@media (max-width: 575.98px) {
    .crm-sidebar {
        width: min(var(--crm-sidebar-width), 90vw);
        min-width: min(var(--crm-sidebar-width), 90vw);
    }

    .crm-sidebar-scroll {
        padding-inline: .65rem;
    }
}


/* ==============================================================
   CRM PROFESSIONAL DATA UI (RC10)
   Reusable across all list screens. Change tokens here only.
   ============================================================== */
:root {
    --crm-table-head-bg: #f4f7fb;
    --crm-table-head-text: #52637a;
    --crm-table-row-bg: var(--crm-surface, #fff);
    --crm-table-row-hover: #f8fbff;
    --crm-table-border: var(--crm-border, #dfe6ef);
    --crm-table-cell-y: .56rem;
    --crm-table-cell-x: .85rem;
    --crm-table-font-size: .875rem;
    --crm-table-radius: .75rem;
    --crm-table-footer-bg: #fff;
    --crm-person-avatar-size: 1.75rem;
    --crm-select-focus: rgba(var(--crm-primary-rgb, 36,120,201), .14);
}

[data-bs-theme="dark"] {
    --crm-table-head-bg: rgba(255,255,255,.035);
    --crm-table-head-text: #a8b4c4;
    --crm-table-row-bg: #182433;
    --crm-table-row-hover: rgba(255,255,255,.035);
    --crm-table-border: rgba(255,255,255,.08);
    --crm-table-footer-bg: #182433;
}

.crm-table-shell {
    border: 1px solid var(--crm-table-border);
    border-radius: var(--crm-table-radius);
    background: var(--crm-table-row-bg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(24,36,51,.04);
}
.crm-table-shell > .table-responsive { margin: 0; }

.table.crm-pro-table {
    margin: 0;
    font-size: var(--crm-table-font-size);
    --tblr-table-border-color: var(--crm-table-border);
}
.table.crm-pro-table > :not(caption) > * > * {
    padding: var(--crm-table-cell-y) var(--crm-table-cell-x);
    vertical-align: middle;
    border-bottom-color: var(--crm-table-border);
}
.table.crm-pro-table thead th {
    position: relative;
    background: var(--crm-table-head-bg);
    color: var(--crm-table-head-text);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom-width: 1px;
}
.table.crm-pro-table tbody tr { background: var(--crm-table-row-bg); }
.table.crm-pro-table tbody tr:hover { background: var(--crm-table-row-hover); }
.table.crm-pro-table tbody td { line-height: 1.25; }
.table.crm-pro-table .btn.btn-sm { min-height: 1.9rem; padding: .3rem .55rem; }
.table.crm-pro-table .badge { line-height: 1.15; }
.table.crm-pro-table .text-secondary.small,
.table.crm-pro-table small.text-secondary { font-size: .77rem; }

.crm-sortable-th { cursor: pointer; user-select: none; padding-right: 1.7rem !important; }
.crm-sortable-th::after {
    content: "↕";
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: .42;
    font-size: .72rem;
}
.crm-sortable-th[data-sort-dir="asc"]::after { content: "↑"; opacity: .9; }
.crm-sortable-th[data-sort-dir="desc"]::after { content: "↓"; opacity: .9; }

.crm-pro-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .75rem;
    border-top: 1px solid var(--crm-table-border);
    background: var(--crm-table-footer-bg);
    font-size: .78rem;
}
.crm-pro-table-footer .crm-page-buttons { display: flex; align-items: center; gap: .3rem; }
.crm-pro-table-footer .btn { min-width: 2rem; min-height: 2rem; padding: .25rem .45rem; }
.crm-pro-table-footer .crm-page-current { min-width: 2rem; border-color: var(--crm-primary, #2478c9); color: var(--crm-primary, #2478c9); }
.crm-pro-table-footer .form-select { width: auto; min-width: 4.5rem; }

.crm-person { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.crm-person-avatar {
    width: var(--crm-person-avatar-size);
    height: var(--crm-person-avatar-size);
    min-width: var(--crm-person-avatar-size);
    border-radius: 50%;
    object-fit: cover;
    background: #e8eef6;
    border: 1px solid var(--crm-table-border);
}
.crm-person-avatar.crm-person-initials {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--crm-primary, #2478c9); font-size: .68rem; font-weight: 700;
}
.crm-person-body { min-width: 0; line-height: 1.15; }
.crm-person-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-person-meta { color: var(--tblr-secondary-color); font-size: .72rem; margin-top: .1rem; }

/* Choices.js made to look native to CRM */
.choices { margin-bottom: 0; min-width: 0; }
.choices__inner {
    min-height: 2.35rem;
    padding: .38rem .72rem !important;
    border-radius: var(--tblr-border-radius, .375rem);
    border: 1px solid var(--crm-table-border);
    background: var(--crm-surface, #fff);
    font-size: .875rem;
}
.is-focused .choices__inner, .is-open .choices__inner {
    border-color: var(--crm-primary, #2478c9);
    box-shadow: 0 0 0 .2rem var(--crm-select-focus);
}
.choices__list--single { padding: .05rem 1.4rem .05rem 0; }
.choices__list--dropdown, .choices__list[aria-expanded] {
    z-index: 1085;
    border-color: var(--crm-table-border);
    background: var(--crm-surface, #fff);
    box-shadow: 0 .75rem 2rem rgba(24,36,51,.14);
}
.choices__input { background: transparent !important; color: inherit; }
.choices__item--choice.is-highlighted { background: var(--crm-table-row-hover); }
[data-bs-theme="dark"] .choices__inner,
[data-bs-theme="dark"] .choices__list--dropdown,
[data-bs-theme="dark"] .choices__list[aria-expanded] { background: #182433; color: #e8edf4; }

@media (max-width: 767.98px) {
    :root { --crm-table-cell-y: .48rem; --crm-table-cell-x: .65rem; }
    .crm-pro-table-footer { align-items: flex-start; flex-direction: column; }
}
\n\n/* ==============================================================
   CRM PROFESSIONAL ENTRY FORMS + WORKFLOW STAGES (RC12)
   ============================================================== */
:root {
    --crm-form-max-width: 1480px;
    --crm-form-gap: .7rem;
    --crm-form-card-radius: .65rem;
    --crm-form-control-height: 2.2rem;
    --crm-form-label-size: .76rem;
    --crm-form-section-bg: var(--crm-surface, #fff);
    --crm-form-section-border: var(--crm-border, #dfe6ef);
    --crm-form-header-bg: rgba(var(--crm-primary-rgb, 36,120,201), .025);
}
.crm-entry-form { max-width: var(--crm-form-max-width); margin-inline: auto; }
.crm-entry-form .row.g-3 { --tblr-gutter-y: var(--crm-form-gap); --tblr-gutter-x: var(--crm-form-gap); }
.crm-entry-form .card {
    border-radius: var(--crm-form-card-radius);
    border-color: var(--crm-form-section-border);
    box-shadow: 0 1px 2px rgba(24,36,51,.035);
    margin-bottom: .7rem !important;
}
.crm-entry-form .card-header {
    min-height: 2.55rem;
    padding: .55rem .8rem;
    background: var(--crm-form-header-bg);
    border-bottom-color: var(--crm-form-section-border);
}
.crm-entry-form .card-title { font-size: .9rem; font-weight: 700; }
.crm-entry-form .card-body { padding: .75rem .8rem; }
.crm-entry-form .form-label {
    margin-bottom: .25rem;
    color: var(--crm-text, #1f2937);
    font-size: var(--crm-form-label-size);
    font-weight: 650;
}
.crm-entry-form .form-control,
.crm-entry-form .form-select,
.crm-entry-form .choices__inner {
    min-height: var(--crm-form-control-height);
    font-size: .84rem;
}
.crm-entry-form .form-control,
.crm-entry-form .form-select { padding-top: .34rem; padding-bottom: .34rem; }
.crm-entry-form textarea.form-control { min-height: 4.6rem; line-height: 1.4; resize: vertical; }
.crm-entry-form textarea[rows="5"] { min-height: 6.7rem; }
.crm-entry-form .form-hint, .crm-entry-form .text-secondary { font-size: .75rem; }
.crm-entry-form .btn { min-height: 2.15rem; }
.crm-entry-form .table > :not(caption) > * > * { padding-top: .45rem; padding-bottom: .45rem; }
.crm-entry-form .alert { padding: .55rem .75rem; margin-bottom: .7rem; }
.crm-flow-strip { display:flex; align-items:center; gap:.35rem; flex-wrap:wrap; font-size:.76rem; }
.crm-flow-strip span { display:inline-flex; align-items:center; gap:.3rem; padding:.3rem .55rem; border:1px solid var(--crm-border,#dfe6ef); border-radius:999px; background:var(--crm-surface,#fff); color:var(--tblr-secondary-color); font-weight:650; }
.crm-flow-strip span.done { color:var(--tblr-success); background:var(--tblr-success-lt); border-color:transparent; }
.crm-flow-strip span.active { color:var(--crm-primary,#2478c9); background:rgba(var(--crm-primary-rgb,36,120,201),.09); border-color:rgba(var(--crm-primary-rgb,36,120,201),.22); }
.crm-flow-strip > i { color:var(--tblr-secondary-color); opacity:.55; }
@media (max-width: 767.98px) {
    :root { --crm-form-gap: .55rem; --crm-form-control-height: 2.1rem; }
    .crm-entry-form .card-body { padding: .65rem; }
    .crm-flow-strip { display:none; }
}

/* ==============================================================
   CRM PREMIUM FORMS + REQUIREMENT STRUCTURE DESIGNER (RC13)
   ============================================================== */
:root {
    --crm-form-gap-x: 1rem;
    --crm-form-gap-y: .9rem;
    --crm-form-card-bg: var(--crm-surface, #fff);
    --crm-form-card-border: #dce5f0;
    --crm-form-card-shadow: 0 8px 28px rgba(24, 36, 51, .055);
    --crm-form-card-shadow-hover: 0 12px 34px rgba(24, 36, 51, .075);
    --crm-form-card-radius-premium: .9rem;
    --crm-input-radius: .55rem;
    --crm-input-border: #d9e2ee;
    --crm-input-bg: #fff;
    --crm-input-focus-shadow: 0 0 0 .2rem rgba(var(--crm-primary-rgb, 36,120,201), .10);
    --crm-structure-bg: #f8fbff;
    --crm-structure-line: #dbe7f4;
    --crm-structure-selected: rgba(var(--crm-primary-rgb,36,120,201), .085);
}
[data-bs-theme="dark"] {
    --crm-form-card-border: rgba(255,255,255,.085);
    --crm-input-border: rgba(255,255,255,.12);
    --crm-input-bg: #1c2b3b;
    --crm-structure-bg: rgba(255,255,255,.025);
    --crm-structure-line: rgba(255,255,255,.08);
}
.crm-form-page-head {
    display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
    margin-bottom: 1rem;
}
.crm-form-eyebrow { color:var(--crm-primary); font-size:.68rem; font-weight:800; letter-spacing:.08em; }
.crm-form-page-title { margin:.15rem 0 .1rem; font-size:1.25rem; letter-spacing:-.025em; }
.crm-form-page-subtitle { color:var(--tblr-secondary-color); font-size:.82rem; }
.crm-btn-compact { min-height:2.15rem; padding:.35rem .7rem; }
.crm-premium-form { max-width: 1540px; }
.crm-entry-form .row.g-3,
.crm-entry-form .row.g-4,
.crm-entry-form .crm-field-grid {
    --bs-gutter-x: var(--crm-form-gap-x);
    --bs-gutter-y: var(--crm-form-gap-y);
    --tblr-gutter-x: var(--crm-form-gap-x);
    --tblr-gutter-y: var(--crm-form-gap-y);
}
.crm-entry-form .row > [class*="col-"] { min-width: 0; }
.crm-entry-form .crm-form-card,
.crm-entry-form > .row > [class*="col-"] > .card,
.crm-entry-form .card {
    background: var(--crm-form-card-bg);
    border: 1px solid var(--crm-form-card-border);
    border-radius: var(--crm-form-card-radius-premium);
    box-shadow: var(--crm-form-card-shadow);
    overflow: visible;
    transition: box-shadow .16s ease, border-color .16s ease;
}
.crm-entry-form .crm-form-card:hover { box-shadow: var(--crm-form-card-shadow-hover); }
.crm-entry-form .crm-form-card-header {
    min-height:3.2rem; padding:.7rem .9rem; background:transparent;
    border-bottom:1px solid var(--crm-form-card-border);
    border-radius:var(--crm-form-card-radius-premium) var(--crm-form-card-radius-premium) 0 0;
}
.crm-section-heading { display:flex; align-items:center; gap:.65rem; min-width:0; }
.crm-section-icon {
    width:2rem; height:2rem; min-width:2rem; display:inline-flex; align-items:center; justify-content:center;
    border-radius:.6rem; background:rgba(var(--crm-primary-rgb,36,120,201),.10); color:var(--crm-primary);
    font-size:1.05rem;
}
.crm-section-heading .card-title { margin:0; font-size:.9rem; font-weight:750; }
.crm-section-heading .text-secondary { margin-top:.08rem; font-size:.72rem; }
.crm-entry-form .crm-form-card > .card-body { padding:.9rem; }
.crm-entry-form .form-label { margin-bottom:.32rem; }
.crm-entry-form .form-control,
.crm-entry-form .form-select,
.crm-entry-form .choices__inner {
    border-color:var(--crm-input-border);
    border-radius:var(--crm-input-radius);
    background-color:var(--crm-input-bg);
    min-height:2.4rem;
}
.crm-entry-form .form-control:focus,
.crm-entry-form .form-select:focus {
    border-color:rgba(var(--crm-primary-rgb,36,120,201),.55);
    box-shadow:var(--crm-input-focus-shadow);
}
.crm-entry-form .choices { width:100%; }
.crm-entry-form .choices__inner { padding:.43rem .72rem !important; }
.crm-entry-form .crm-textarea-sm { min-height:5.1rem; }
.crm-entry-form .crm-textarea-md { min-height:7.2rem; }
.crm-form-side-sticky { position:sticky; top:calc(var(--crm-topbar-height,4rem) + 3.2rem); }
.crm-switch-row { display:flex; align-items:flex-start; gap:.7rem; margin:0; padding:.7rem .75rem; border:1px solid var(--crm-form-card-border); border-radius:.65rem; background:var(--crm-structure-bg); }
.crm-switch-row span { display:flex; flex-direction:column; line-height:1.25; }
.crm-switch-row small { color:var(--tblr-secondary-color); margin-top:.12rem; }
.crm-action-card .crm-action-summary { display:flex; gap:.5rem; color:var(--tblr-secondary-color); font-size:.76rem; line-height:1.35; }
.crm-action-card .crm-action-summary i { color:var(--crm-primary); font-size:1rem; margin-top:.05rem; }
.crm-upload-zone { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.25rem; min-height:7rem; padding:1rem; text-align:center; border:1px dashed #b9c9db; border-radius:.75rem; background:var(--crm-structure-bg); cursor:pointer; }
.crm-upload-zone input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.crm-upload-icon { font-size:1.45rem; color:var(--crm-primary); }
.crm-upload-zone small { color:var(--tblr-secondary-color); }

.crm-structure-designer { border:1px solid var(--crm-structure-line); border-radius:.8rem; background:var(--crm-structure-bg); overflow:hidden; }
.crm-structure-empty { min-height:7rem; padding:1rem; display:flex; align-items:center; justify-content:center; gap:.75rem; color:var(--tblr-secondary-color); }
.crm-structure-empty strong { display:block; color:var(--crm-text); margin-bottom:.1rem; }
.crm-structure-empty-icon { width:2.6rem; height:2.6rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.8rem; background:rgba(var(--crm-primary-rgb,36,120,201),.10); color:var(--crm-primary); font-size:1.25rem; }
.crm-feature-item + .crm-feature-item { border-top:1px solid var(--crm-structure-line); }
.crm-feature-item.selected { background:rgba(var(--crm-primary-rgb,36,120,201),.025); }
.crm-feature-toggle { width:100%; border:0; background:transparent; color:inherit; display:grid; grid-template-columns:2.2rem minmax(0,1fr) auto 1.5rem; align-items:center; gap:.65rem; padding:.72rem .8rem; text-align:left; }
.crm-feature-toggle:hover { background:rgba(var(--crm-primary-rgb,36,120,201),.04); }
.crm-feature-number { width:2rem; height:2rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.55rem; background:var(--crm-form-card-bg); border:1px solid var(--crm-structure-line); color:var(--crm-primary); font-size:.68rem; font-weight:800; }
.crm-feature-title { display:flex; flex-direction:column; min-width:0; }
.crm-feature-title strong { font-size:.82rem; }
.crm-feature-title small { color:var(--tblr-secondary-color); font-size:.68rem; margin-top:.08rem; }
.crm-feature-state { color:var(--crm-primary); font-size:.7rem; font-weight:700; white-space:nowrap; }
.crm-feature-chevron { color:var(--tblr-secondary-color); transition:transform .15s ease; }
.crm-feature-toggle[aria-expanded="true"] .crm-feature-chevron { transform:rotate(180deg); }
.crm-feature-pages { padding:.1rem .8rem .8rem 3.65rem; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.crm-page-node { border:1px solid var(--crm-structure-line); background:var(--crm-form-card-bg); color:inherit; border-radius:.65rem; display:grid; grid-template-columns:1.8rem minmax(0,1fr) 1.25rem; gap:.5rem; align-items:center; padding:.58rem .65rem; text-align:left; transition:border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease; }
.crm-page-node:hover { border-color:rgba(var(--crm-primary-rgb,36,120,201),.40); transform:translateY(-1px); box-shadow:0 5px 14px rgba(24,36,51,.06); }
.crm-page-node.selected { border-color:var(--crm-primary); background:var(--crm-structure-selected); box-shadow:0 0 0 2px rgba(var(--crm-primary-rgb,36,120,201),.07); }
.crm-page-node-icon { width:1.7rem; height:1.7rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.5rem; background:rgba(var(--crm-primary-rgb,36,120,201),.08); color:var(--crm-primary); }
.crm-page-node-body { display:flex; flex-direction:column; min-width:0; }
.crm-page-node-body strong { font-size:.77rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crm-page-node-body small { color:var(--tblr-secondary-color); font-size:.65rem; }
.crm-page-node-check { color:var(--crm-primary); opacity:.15; }
.crm-page-node.selected .crm-page-node-check { opacity:1; }
.crm-no-pages { grid-column:1/-1; color:var(--tblr-secondary-color); font-size:.75rem; padding:.55rem; }
.crm-structure-selection { padding:.6rem .7rem; border:1px solid var(--crm-structure-line); border-radius:.7rem; background:var(--crm-form-card-bg); }
.crm-structure-selection > .text-secondary { display:block; margin-bottom:.35rem; font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.crm-path-chips { display:flex; align-items:center; flex-wrap:wrap; gap:.3rem; }
.crm-path-chip { display:inline-flex; padding:.28rem .5rem; border-radius:.5rem; background:var(--crm-structure-bg); border:1px solid var(--crm-structure-line); font-size:.71rem; font-weight:650; }
.crm-path-chip.active { background:rgba(var(--crm-primary-rgb,36,120,201),.10); border-color:rgba(var(--crm-primary-rgb,36,120,201),.24); color:var(--crm-primary); }
.crm-path-chips > i { color:var(--tblr-secondary-color); font-size:.75rem; }
.crm-invalid-pulse { animation:crmInvalidPulse .8s ease; }
@keyframes crmInvalidPulse { 0%,100%{box-shadow:none} 35%{box-shadow:0 0 0 4px rgba(214,57,57,.15); border-color:#d63939} }

/* Existing Project / Client / User forms get real Bootstrap gutters and premium cards too. */
.crm-entry-form > .row { --bs-gutter-x:1rem; --bs-gutter-y:1rem; }
.crm-entry-form .card-body.row { margin-left:calc(-.5 * var(--bs-gutter-x)); margin-right:calc(-.5 * var(--bs-gutter-x)); }
.crm-entry-form .card-body.row > [class*="col-"] { padding-left:calc(var(--bs-gutter-x) * .5); padding-right:calc(var(--bs-gutter-x) * .5); }

@media (max-width: 1199.98px) { .crm-form-side-sticky { position:static; } }
@media (max-width: 767.98px) {
    :root { --crm-form-gap-x:.8rem; --crm-form-gap-y:.75rem; }
    .crm-feature-pages { grid-template-columns:1fr; padding-left:.8rem; }
    .crm-feature-toggle { grid-template-columns:2.2rem minmax(0,1fr) 1.5rem; }
    .crm-feature-state { display:none; }
    .crm-form-page-head { align-items:center; }
}


/* ==============================================================
   CRM UNIFIED PREMIUM FORM SYSTEM + MULTI-PAGE STRUCTURE (RC14)
   Change these variables to re-theme every entry form.
   ============================================================== */
:root {
    --crm-form-primary: var(--crm-primary, #0f8f8a);
    --crm-form-surface: var(--crm-surface, #fff);
    --crm-form-page-bg: var(--crm-page-bg, #f5f7fb);
    --crm-form-card-border: #dce5ee;
    --crm-form-card-radius: .78rem;
    --crm-form-card-shadow: 0 5px 18px rgba(24,36,51,.045);
    --crm-form-header-height: 2.75rem;
    --crm-form-control-height: 2.12rem;
    --crm-form-control-radius: .48rem;
    --crm-form-control-font: .82rem;
    --crm-form-label-font: .72rem;
    --crm-form-gap-x: .8rem;
    --crm-form-gap-y: .68rem;
    --crm-form-body-pad: .78rem;
    --crm-form-section-icon: 1.85rem;
    --crm-form-muted-bg: #f8fbfd;
    --crm-form-selected-bg: rgba(var(--crm-primary-rgb,15,143,138),.08);
}
.crm-entry-form, .crm-premium-form { max-width: 1540px; margin-inline:auto; }
.crm-entry-form > .row, .crm-entry-form .row.g-3, .crm-entry-form .row.g-4, .crm-entry-form .card-body.row, .crm-entry-form .crm-field-grid {
    --bs-gutter-x: var(--crm-form-gap-x)!important; --bs-gutter-y: var(--crm-form-gap-y)!important;
    --tblr-gutter-x: var(--crm-form-gap-x)!important; --tblr-gutter-y: var(--crm-form-gap-y)!important;
}
.crm-entry-form .card, .crm-entry-form .crm-form-card {
    background:var(--crm-form-surface); border:1px solid var(--crm-form-card-border); border-radius:var(--crm-form-card-radius);
    box-shadow:var(--crm-form-card-shadow); overflow:visible; margin-bottom:.75rem!important;
}
.crm-entry-form .card-header, .crm-entry-form .crm-form-card-header {
    min-height:var(--crm-form-header-height); padding:.55rem .78rem; background:transparent; border-bottom:1px solid var(--crm-form-card-border);
}
.crm-entry-form .card-body, .crm-entry-form .crm-form-card>.card-body { padding:var(--crm-form-body-pad); }
.crm-entry-form .card-title { font-size:.86rem; font-weight:750; letter-spacing:-.01em; }
.crm-entry-form .form-label { font-size:var(--crm-form-label-font); font-weight:700; margin-bottom:.22rem; }
.crm-entry-form .form-control, .crm-entry-form .form-select, .crm-entry-form .choices__inner {
    min-height:var(--crm-form-control-height)!important; height:auto; border-radius:var(--crm-form-control-radius); font-size:var(--crm-form-control-font); padding:.3rem .62rem!important;
}
.crm-entry-form .choices__inner { display:flex; align-items:center; }
.crm-entry-form .choices__list--single { padding:0 1rem 0 0; }
.crm-entry-form textarea.form-control { min-height:4rem!important; padding:.48rem .62rem!important; line-height:1.38; }
.crm-entry-form textarea.crm-textarea-sm { min-height:4.2rem!important; }
.crm-entry-form textarea.crm-textarea-md { min-height:5.5rem!important; }
.crm-entry-form .form-hint { margin-top:.16rem; font-size:.68rem; }
.crm-entry-form .btn { min-height:2.05rem; padding:.32rem .62rem; font-size:.78rem; }
.crm-entry-form .form-check-input { width:1.9rem; height:1rem; }
.crm-section-icon { width:var(--crm-form-section-icon); height:var(--crm-form-section-icon); min-width:var(--crm-form-section-icon); border-radius:.52rem; font-size:.95rem; }
.crm-form-page-head { margin-bottom:.72rem; }
.crm-form-page-title { font-size:1.12rem; }
.crm-form-page-subtitle { font-size:.76rem; }

.crm-structure-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.5rem .65rem; border:1px solid var(--crm-structure-line); border-bottom:0; border-radius:.65rem .65rem 0 0; background:var(--crm-form-muted-bg); }
.crm-structure-toolbar strong { display:block; font-size:.76rem; }
.crm-structure-toolbar small { display:block; color:var(--tblr-secondary-color); font-size:.65rem; }
.crm-structure-tools { display:flex; gap:.35rem; flex-wrap:wrap; }
.crm-structure-designer { border-radius:0 0 .65rem .65rem; }
.crm-feature-item + .crm-feature-item { border-top:1px solid var(--crm-structure-line); }
.crm-feature-toggle[data-feature-header] { display:grid; grid-template-columns:1.65rem 1.8rem minmax(0,1fr) auto auto; gap:.45rem; padding:.48rem .62rem; min-height:2.8rem; }
.crm-feature-expand { width:1.65rem; height:1.65rem; padding:0; border:0; background:transparent; color:var(--tblr-secondary-color); border-radius:.4rem; }
.crm-feature-expand:hover { background:rgba(var(--crm-primary-rgb,36,120,201),.08); color:var(--crm-form-primary); }
.crm-feature-expand[aria-expanded="true"] i { transform:rotate(180deg); }
.crm-feature-expand i { display:inline-block; transition:transform .15s ease; }
.crm-feature-number { width:1.8rem; height:1.8rem; font-size:.63rem; }
.crm-feature-title strong { font-size:.78rem; }
.crm-feature-title small { font-size:.62rem; }
.crm-feature-check { display:inline-flex; align-items:center; gap:.25rem; font-size:.65rem; font-weight:700; color:var(--tblr-secondary-color); cursor:pointer; margin:0; }
.crm-feature-check input { width:.9rem; height:.9rem; accent-color:var(--crm-form-primary); }
.crm-feature-state { min-width:2.7rem; text-align:right; font-size:.64rem; }
.crm-feature-pages { padding:.15rem .62rem .58rem 3.9rem; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem; }
.crm-page-node { min-height:2.65rem; border-radius:.55rem; grid-template-columns:1.55rem minmax(0,1fr) 1rem; gap:.42rem; padding:.42rem .5rem; }
.crm-page-node:hover { transform:none; box-shadow:none; }
.crm-page-node.selected { background:var(--crm-form-selected-bg); }
.crm-page-node-icon { width:1.5rem; height:1.5rem; border-radius:.4rem; }
.crm-page-node-body strong { font-size:.72rem; }
.crm-page-node-body small { font-size:.6rem; }
.crm-page-node-check { opacity:.55; font-size:1rem; }
.crm-page-node.selected .crm-page-node-check { opacity:1; }
.crm-structure-selection { padding:.48rem .58rem; }
.crm-path-chip { font-size:.66rem; padding:.22rem .42rem; }
.crm-upload-zone { min-height:5.5rem; padding:.7rem; }
.crm-switch-row { padding:.52rem .58rem; }

/* Existing forms automatically inherit the same visual language without page-specific CSS. */
.crm-entry-form > .d-flex:first-child, .crm-entry-form > .crm-form-page-head { margin-bottom:.7rem!important; }
.crm-entry-form > .d-flex:first-child .page-title { font-size:1.1rem; }
.crm-entry-form .card-header:not(.crm-form-card-header) .card-title { margin:0; }
.crm-entry-form hr { margin:.6rem 0; opacity:.5; }

@media (max-width:1199.98px){ .crm-feature-pages{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:767.98px){
    :root{--crm-form-gap-x:.65rem;--crm-form-gap-y:.58rem;--crm-form-body-pad:.65rem;}
    .crm-structure-toolbar{align-items:flex-start;flex-direction:column;}
    .crm-feature-toggle[data-feature-header]{grid-template-columns:1.55rem 1.7rem minmax(0,1fr) auto;}
    .crm-feature-state{display:none;}
    .crm-feature-pages{grid-template-columns:1fr;padding-left:.62rem;}
}


/* Master-entry and action modals share the same compact form language. */
.modal form[data-master-form] .modal-content,
.modal .crm-modal-form .modal-content { border-radius:var(--crm-form-card-radius); }
.modal form[data-master-form] .form-label,
.crm-modal-form .form-label { font-size:var(--crm-form-label-font); font-weight:700; margin-bottom:.22rem; }
.modal form[data-master-form] .form-control,
.modal form[data-master-form] .form-select,
.crm-modal-form .form-control,
.crm-modal-form .form-select { min-height:var(--crm-form-control-height); border-radius:var(--crm-form-control-radius); font-size:var(--crm-form-control-font); padding:.3rem .62rem; }
.modal form[data-master-form] .modal-body,
.crm-modal-form .modal-body { padding:.78rem; }
.modal form[data-master-form] .row,
.crm-modal-form .row { --bs-gutter-x:.7rem; --bs-gutter-y:.6rem; }

/* RC15: clean professional tables — sorting is opt-in, no generic garbage glyphs */
.crm-sortable-th::after { content: none !important; display: none !important; }
.crm-sortable-th { padding-right: var(--crm-table-cell-x) !important; }

.card.crm-table-shell,
.crm-master-card {
    overflow: hidden;
    border: 1px solid var(--crm-table-border);
    border-radius: .8rem;
    box-shadow: 0 .25rem .9rem rgba(24,36,51,.045);
}
.table.crm-pro-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.table.crm-pro-table thead th {
    height: 2.4rem;
    padding-top: .48rem;
    padding-bottom: .48rem;
    background: color-mix(in srgb, var(--crm-table-head-bg) 94%, var(--crm-primary) 6%);
    border-top: 0;
}
.table.crm-pro-table tbody td {
    min-height: 2.75rem;
    padding-top: .48rem;
    padding-bottom: .48rem;
}
.table.crm-pro-table tbody tr:last-child td { border-bottom: 0; }
.table.crm-pro-table td.text-end,
.table.crm-pro-table th.text-end { white-space: nowrap; }
.table.crm-pro-table .btn-list { flex-wrap: nowrap; }
.crm-pro-table-footer {
    min-height: 2.75rem;
    background: color-mix(in srgb, var(--crm-table-footer-bg) 97%, var(--crm-primary) 3%);
}

/* Cascading searchable selects: disabled/loading state stays visually obvious. */
.crm-entry-form .choices.is-disabled .choices__inner {
    opacity: .72;
    background: var(--tblr-bg-surface-secondary, #f3f5f8);
    cursor: not-allowed;
}

/* ==============================================================
   CRM ROLE-AWARE OPERATIONS DASHBOARD (RC16)
   ============================================================== */
:root {
    --crm-dashboard-card-bg: var(--crm-surface, #fff);
    --crm-dashboard-border: var(--crm-border, #dfe6ef);
    --crm-dashboard-radius: .85rem;
    --crm-dashboard-shadow: 0 .3rem 1.2rem rgba(24,36,51,.055);
    --crm-dashboard-gap: .9rem;
    --crm-dashboard-muted: var(--tblr-secondary-color, #667085);
    --crm-calendar-cell-height: 6.1rem;
}
[data-bs-theme="dark"] {
    --crm-dashboard-card-bg: #182433;
    --crm-dashboard-border: rgba(255,255,255,.085);
    --crm-dashboard-shadow: 0 .3rem 1.2rem rgba(0,0,0,.16);
}
.crm-dashboard { max-width: 1680px; margin-inline: auto; }
.crm-dashboard-hero {
    display:flex; align-items:center; justify-content:space-between; gap:1rem;
    padding:1rem 1.1rem; margin-bottom:var(--crm-dashboard-gap);
    border:1px solid var(--crm-dashboard-border); border-radius:var(--crm-dashboard-radius);
    background:
        radial-gradient(circle at 90% 15%, rgba(var(--crm-primary-rgb,7,135,131),.13), transparent 30%),
        linear-gradient(135deg, var(--crm-dashboard-card-bg), color-mix(in srgb, var(--crm-dashboard-card-bg) 96%, var(--crm-primary) 4%));
    box-shadow:var(--crm-dashboard-shadow);
}
.crm-dashboard-eyebrow { color:var(--crm-primary); font-size:.68rem; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.crm-dashboard-title { margin:.18rem 0 .15rem; font-size:1.35rem; letter-spacing:-.03em; }
.crm-dashboard-subtitle { margin:0; color:var(--crm-dashboard-muted); font-size:.82rem; }
.crm-dashboard-meta { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin-top:.6rem; color:var(--crm-dashboard-muted); font-size:.72rem; }
.crm-dashboard-hero-actions { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; justify-content:flex-end; }

.crm-kpi-card {
    display:flex; align-items:center; gap:.72rem; min-height:6rem; height:100%; padding:.8rem;
    border:1px solid var(--crm-dashboard-border); border-radius:var(--crm-dashboard-radius);
    background:var(--crm-dashboard-card-bg); box-shadow:var(--crm-dashboard-shadow);
    transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
a.crm-kpi-card:hover { transform:translateY(-2px); border-color:rgba(var(--crm-primary-rgb,7,135,131),.35); box-shadow:0 .6rem 1.5rem rgba(24,36,51,.08); }
.crm-kpi-icon { width:2.5rem; height:2.5rem; min-width:2.5rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.72rem; font-size:1.25rem; }
.crm-kpi-body { min-width:0; display:flex; flex-direction:column; line-height:1.15; }
.crm-kpi-label { color:var(--crm-dashboard-muted); font-size:.7rem; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crm-kpi-value { margin-top:.18rem; font-size:1.45rem; letter-spacing:-.04em; }
.crm-kpi-hint { margin-top:.22rem; color:var(--crm-dashboard-muted); font-size:.64rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crm-tone-blue { color:#206bc4; background:#e9f2ff; }
.crm-tone-azure { color:#1694c5; background:#e7f7fc; }
.crm-tone-indigo { color:#5e55d6; background:#efedff; }
.crm-tone-yellow { color:#b77900; background:#fff6d8; }
.crm-tone-red { color:#d63939; background:#fdecec; }
.crm-tone-teal { color:#0b8f87; background:#e4f8f5; }
.crm-tone-orange { color:#d66b16; background:#fff0e4; }
.crm-tone-purple { color:#8b5cf6; background:#f2edff; }
[data-bs-theme="dark"] .crm-tone-blue,
[data-bs-theme="dark"] .crm-tone-azure,
[data-bs-theme="dark"] .crm-tone-indigo,
[data-bs-theme="dark"] .crm-tone-yellow,
[data-bs-theme="dark"] .crm-tone-red,
[data-bs-theme="dark"] .crm-tone-teal,
[data-bs-theme="dark"] .crm-tone-orange,
[data-bs-theme="dark"] .crm-tone-purple { background:rgba(255,255,255,.07); }

.crm-dashboard-card {
    border:1px solid var(--crm-dashboard-border); border-radius:var(--crm-dashboard-radius);
    background:var(--crm-dashboard-card-bg); box-shadow:var(--crm-dashboard-shadow); overflow:hidden;
}
.crm-dashboard-card-header { min-height:3.45rem; display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.65rem .8rem; background:transparent; }
.crm-dashboard-card-header .card-title { margin:0; font-size:.88rem; font-weight:750; }
.crm-dashboard-table { font-size:.78rem; }
.crm-dashboard-table thead th { padding:.48rem .72rem; color:var(--crm-table-head-text); background:var(--crm-table-head-bg); font-size:.64rem; letter-spacing:.045em; text-transform:uppercase; }
.crm-dashboard-table tbody td { padding:.55rem .72rem; border-color:var(--crm-dashboard-border); }
.crm-dashboard-table tbody tr:hover { background:color-mix(in srgb, var(--crm-dashboard-card-bg) 96%, var(--crm-primary) 4%); }
.crm-dashboard-task-title { max-width:16rem; }
.crm-dashboard-structure { max-width:22rem; }

.crm-dashboard-empty { min-height:8rem; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:.25rem; padding:1rem; color:var(--crm-dashboard-muted); text-align:center; }
.crm-dashboard-empty > i { font-size:1.55rem; color:var(--crm-primary); opacity:.72; }
.crm-dashboard-empty strong { color:var(--crm-text, #1f2937); font-size:.82rem; }
[data-bs-theme="dark"] .crm-dashboard-empty strong { color:#e7edf5; }
.crm-dashboard-empty span { max-width:24rem; font-size:.7rem; }

.crm-dashboard-notifications { max-height:28rem; overflow:auto; }
.crm-dashboard-notification { display:grid; grid-template-columns:2rem minmax(0,1fr); gap:.62rem; padding:.65rem .75rem; color:inherit; text-decoration:none; border-bottom:1px solid var(--crm-dashboard-border); transition:background .14s ease; }
.crm-dashboard-notification:hover { background:color-mix(in srgb, var(--crm-dashboard-card-bg) 95%, var(--crm-primary) 5%); color:inherit; }
.crm-dashboard-notification.is-unread { background:rgba(var(--crm-primary-rgb,7,135,131),.045); }
.crm-notification-dot { width:2rem; height:2rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.62rem; }
.crm-line-clamp-2 { display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

.crm-dashboard-projects { max-height:34rem; overflow:auto; }
.crm-dashboard-project { display:block; padding:.72rem .8rem; border-bottom:1px solid var(--crm-dashboard-border); color:inherit; text-decoration:none; transition:background .14s ease; }
.crm-dashboard-project:hover { color:inherit; background:color-mix(in srgb, var(--crm-dashboard-card-bg) 95%, var(--crm-primary) 5%); }
.crm-dashboard-project:last-child { border-bottom:0; }

.crm-work-calendar { min-height:25rem; }
.crm-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); border-top:1px solid var(--crm-dashboard-border); border-left:1px solid var(--crm-dashboard-border); }
.crm-calendar-weekday { padding:.38rem .45rem; color:var(--crm-dashboard-muted); background:var(--crm-table-head-bg); border-right:1px solid var(--crm-dashboard-border); border-bottom:1px solid var(--crm-dashboard-border); font-size:.62rem; font-weight:750; letter-spacing:.05em; text-transform:uppercase; text-align:center; }
.crm-calendar-day { position:relative; min-height:var(--crm-calendar-cell-height); padding:.35rem; border-right:1px solid var(--crm-dashboard-border); border-bottom:1px solid var(--crm-dashboard-border); background:var(--crm-dashboard-card-bg); overflow:hidden; }
.crm-calendar-day.is-other-month { opacity:.46; background:color-mix(in srgb, var(--crm-dashboard-card-bg) 96%, #889 4%); }
.crm-calendar-day.is-today { box-shadow:inset 0 0 0 2px rgba(var(--crm-primary-rgb,7,135,131),.55); }
.crm-calendar-date { width:1.45rem; height:1.45rem; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; font-size:.66rem; font-weight:700; }
.crm-calendar-day.is-today .crm-calendar-date { background:var(--crm-primary); color:#fff; }
.crm-calendar-events { display:flex; flex-direction:column; gap:.2rem; margin-top:.2rem; }
.crm-calendar-event { display:block; width:100%; padding:.18rem .28rem; border:0; border-left:3px solid currentColor; border-radius:.3rem; color:inherit; text-decoration:none; text-align:left; font:inherit; font-size:.58rem; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:rgba(var(--crm-primary-rgb,7,135,131),.055); cursor:pointer; }
.crm-calendar-more { color:var(--crm-dashboard-muted); font-size:.56rem; padding-left:.2rem; }
.crm-calendar-legend { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:.6rem; color:var(--crm-dashboard-muted); font-size:.64rem; }
.crm-calendar-legend span { display:inline-flex; align-items:center; gap:.3rem; }
.crm-calendar-legend-dot { width:.45rem; height:.45rem; display:inline-block; border-radius:50%; }
.crm-calendar-month { min-width:8.5rem; pointer-events:none; }

.crm-delivery-bars { display:flex; flex-direction:column; gap:.72rem; }
.crm-delivery-row { display:grid; grid-template-columns:7rem minmax(0,1fr) 2rem; gap:.65rem; align-items:center; font-size:.72rem; }
.crm-delivery-row .progress { height:.48rem; }
.crm-delivery-row strong { text-align:right; font-size:.76rem; }

.crm-dashboard-workload { max-height:22rem; overflow:auto; }
.crm-workload-row { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.62rem .75rem; border-bottom:1px solid var(--crm-dashboard-border); }
.crm-workload-row:last-child { border-bottom:0; }
.crm-workload-stats { display:flex; align-items:center; gap:.7rem; color:var(--crm-dashboard-muted); font-size:.62rem; white-space:nowrap; }
.crm-workload-stats strong { color:var(--crm-text,#1f2937); }
[data-bs-theme="dark"] .crm-workload-stats strong { color:#e7edf5; }

.crm-dashboard-quick-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.crm-dashboard-quick-actions a { display:grid; grid-template-columns:2rem minmax(0,1fr); gap:.5rem; align-items:center; padding:.65rem; border:1px solid var(--crm-dashboard-border); border-radius:.65rem; color:inherit; text-decoration:none; transition:background .14s ease, border-color .14s ease; }
.crm-dashboard-quick-actions a:hover { background:rgba(var(--crm-primary-rgb,7,135,131),.05); border-color:rgba(var(--crm-primary-rgb,7,135,131),.28); }
.crm-dashboard-quick-actions a > i { width:2rem; height:2rem; display:inline-flex; align-items:center; justify-content:center; border-radius:.55rem; color:var(--crm-primary); background:rgba(var(--crm-primary-rgb,7,135,131),.09); font-size:1rem; }
.crm-dashboard-quick-actions strong { display:block; font-size:.72rem; }
.crm-dashboard-quick-actions small { display:block; color:var(--crm-dashboard-muted); font-size:.6rem; margin-top:.08rem; }

@media (max-width:1199.98px) {
    .crm-dashboard-hero { align-items:flex-start; }
    .crm-dashboard-hero-actions { max-width:22rem; }
}
@media (max-width:767.98px) {
    :root { --crm-calendar-cell-height:4.65rem; }
    .crm-dashboard-hero { flex-direction:column; padding:.8rem; }
    .crm-dashboard-hero-actions { width:100%; max-width:none; justify-content:flex-start; }
    .crm-dashboard-title { font-size:1.12rem; }
    .crm-kpi-card { min-height:5.35rem; padding:.65rem; }
    .crm-kpi-icon { width:2.15rem; height:2.15rem; min-width:2.15rem; }
    .crm-kpi-value { font-size:1.2rem; }
    .crm-calendar-event { width:.42rem; height:.42rem; border:0; border-radius:50%; padding:0; font-size:0; }
    .crm-calendar-events { flex-direction:row; flex-wrap:wrap; }
    .crm-calendar-weekday { font-size:.52rem; padding:.3rem .15rem; }
    .crm-calendar-day { padding:.22rem; }
    .crm-workload-row { align-items:flex-start; flex-direction:column; }
    .crm-dashboard-quick-actions { grid-template-columns:1fr; }
}

/* ==============================================================
   RC27 PAGE-WISE BULK REQUIREMENT ENTRY
   Feature accordion -> page table -> multiple requirement rows.
   ============================================================== */
.crm-bulk-requirement-form { --crm-bulk-line:var(--crm-form-card-border,#dce5ee); --crm-bulk-soft:var(--crm-form-muted-bg,#f8fbfd); }
.crm-bulk-board-card { overflow:hidden!important; }
.crm-bulk-board-header { align-items:center; justify-content:space-between; gap:.75rem; }
.crm-bulk-header-actions { display:flex; align-items:center; justify-content:flex-end; gap:.4rem; flex-wrap:wrap; }
.crm-bulk-search-wrap { width:min(300px,32vw); }
.crm-bulk-search-wrap .form-control { min-width:0; }
.crm-bulk-board-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.55rem .72rem; border-bottom:1px solid var(--crm-bulk-line); background:var(--crm-bulk-soft); }
.crm-bulk-board-toolbar strong { display:block; font-size:.76rem; }
.crm-bulk-board-toolbar small { display:block; color:var(--tblr-secondary-color); font-size:.66rem; }
.crm-bulk-structure { min-height:220px; }
.crm-bulk-empty { min-height:220px; display:flex; align-items:center; justify-content:center; gap:.75rem; color:var(--tblr-secondary-color); padding:1.5rem; text-align:left; }
.crm-bulk-empty>span { width:2.6rem; height:2.6rem; display:grid; place-items:center; border-radius:.7rem; background:rgba(var(--crm-primary-rgb,15,143,138),.08); color:var(--crm-form-primary); font-size:1.25rem; }
.crm-bulk-empty strong,.crm-bulk-empty small { display:block; }
.crm-bulk-empty strong { color:var(--tblr-body-color); font-size:.82rem; }
.crm-bulk-empty small { font-size:.69rem; margin-top:.12rem; }
.crm-bulk-feature+.crm-bulk-feature { border-top:1px solid var(--crm-bulk-line); }
.crm-bulk-feature-head { width:100%; display:grid; grid-template-columns:2rem minmax(0,1fr) 2rem; align-items:center; gap:.55rem; border:0; padding:.55rem .72rem; background:var(--crm-form-surface); text-align:left; color:inherit; }
.crm-bulk-feature-head:hover { background:var(--crm-bulk-soft); }
.crm-bulk-feature-index { width:1.8rem; height:1.8rem; display:grid; place-items:center; border-radius:.5rem; background:rgba(var(--crm-primary-rgb,15,143,138),.09); color:var(--crm-form-primary); font-size:.63rem; font-weight:800; }
.crm-bulk-feature-name { min-width:0; }
.crm-bulk-feature-name strong,.crm-bulk-feature-name small { display:block; }
.crm-bulk-feature-name strong { font-size:.79rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-bulk-feature-name small { color:var(--tblr-secondary-color); font-size:.63rem; margin-top:.08rem; }
.crm-bulk-feature-chevron { text-align:center; color:var(--tblr-secondary-color); }
.crm-bulk-feature-head[aria-expanded="true"] .crm-bulk-feature-chevron i { display:inline-block; transform:rotate(180deg); }
.crm-bulk-feature-body { border-top:1px solid var(--crm-bulk-line); }
.crm-bulk-requirement-table { min-width:1180px; font-size:.72rem; }
.crm-bulk-requirement-table thead th { height:32px; padding:.35rem .48rem; background:var(--crm-bulk-soft); border-bottom:1px solid var(--crm-bulk-line); font-size:.64rem; text-transform:uppercase; letter-spacing:.035em; white-space:nowrap; color:var(--tblr-secondary-color); }
.crm-bulk-requirement-table thead th:nth-child(1){width:160px}.crm-bulk-requirement-table thead th:nth-child(2){width:210px}.crm-bulk-requirement-table thead th:nth-child(3){min-width:320px}.crm-bulk-requirement-table thead th:nth-child(4){width:120px}.crm-bulk-requirement-table thead th:nth-child(5){width:135px}.crm-bulk-requirement-table thead th:nth-child(6){width:105px}.crm-bulk-requirement-table thead th:nth-child(7){width:58px}
.crm-bulk-requirement-table td { padding:.4rem .48rem; vertical-align:top; border-color:var(--crm-bulk-line); }
.crm-bulk-page-head td { padding:.38rem .55rem; background:rgba(var(--crm-primary-rgb,15,143,138),.045); border-top:1px solid var(--crm-bulk-line); border-bottom:1px solid var(--crm-bulk-line); }
.crm-bulk-page-bar { display:flex; align-items:center; justify-content:space-between; gap:.6rem; min-height:30px; }
.crm-bulk-page-title { display:flex; align-items:center; gap:.38rem; min-width:0; }
.crm-bulk-page-title>i { color:var(--crm-form-primary); font-size:.95rem; }
.crm-bulk-page-title strong { font-size:.73rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-bulk-page-title .badge { font-size:.58rem; }
.crm-bulk-page-empty td { padding:.28rem .48rem .45rem; background:var(--crm-form-surface); }
.crm-bulk-page-placeholder { min-height:36px; display:flex; align-items:center; gap:.35rem; padding:.35rem .5rem; border:1px dashed var(--crm-bulk-line); border-radius:.45rem; color:var(--tblr-secondary-color); font-size:.65rem; }
.crm-bulk-page-placeholder i { color:var(--crm-form-primary); }
.crm-bulk-requirement-row td { background:var(--crm-form-surface); }
.crm-bulk-requirement-row:hover td { background:rgba(var(--crm-primary-rgb,15,143,138),.018); }
.crm-bulk-requirement-row .form-control,.crm-bulk-requirement-row .form-select { min-height:31px!important; font-size:.71rem!important; padding:.26rem .43rem!important; border-radius:.4rem; }
.crm-bulk-requirement-row textarea.form-control { min-height:52px!important; resize:vertical; line-height:1.32; }
.crm-bulk-page-repeat { color:var(--tblr-secondary-color); }
.crm-bulk-page-mini { display:flex; align-items:center; gap:.3rem; max-width:145px; font-size:.64rem; }
.crm-bulk-page-mini i { color:var(--crm-form-primary); }
.crm-bulk-page-mini { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-bulk-criteria { margin-top:.3rem; }
.crm-bulk-criteria summary { cursor:pointer; color:var(--crm-form-primary); font-size:.62rem; font-weight:700; user-select:none; }
.crm-bulk-file-picker { display:block; cursor:pointer; margin:0; }
.crm-bulk-file-picker input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.crm-bulk-file-picker span { min-height:31px; display:flex; align-items:center; justify-content:center; gap:.3rem; padding:.25rem .38rem; border:1px dashed var(--crm-bulk-line); border-radius:.4rem; color:var(--tblr-secondary-color); font-size:.63rem; font-weight:650; background:var(--crm-bulk-soft); }
.crm-bulk-file-picker:hover span,.crm-bulk-requirement-row.has-files .crm-bulk-file-picker span { color:var(--crm-form-primary); border-color:rgba(var(--crm-primary-rgb,15,143,138),.38); background:rgba(var(--crm-primary-rgb,15,143,138),.06); }
.crm-bulk-action-cell .btn { width:30px; min-height:30px; padding:0; }
.crm-bulk-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.crm-bulk-summary-grid>div { min-height:58px; display:flex; flex-direction:column; justify-content:center; align-items:center; border:1px solid var(--crm-bulk-line); border-radius:.55rem; background:var(--crm-bulk-soft); }
.crm-bulk-summary-grid strong { font-size:1.05rem; line-height:1; color:var(--crm-form-primary); }
.crm-bulk-summary-grid span { margin-top:.2rem; color:var(--tblr-secondary-color); font-size:.61rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.d-none-search { display:none!important; }

@media (max-width:1199.98px){
    .crm-bulk-search-wrap{width:260px;max-width:100%}
}
@media (max-width:767.98px){
    .crm-bulk-board-header{align-items:flex-start;flex-direction:column}
    .crm-bulk-header-actions{width:100%;justify-content:flex-start}
    .crm-bulk-search-wrap{width:100%}
    .crm-bulk-board-toolbar{align-items:flex-start;flex-direction:column}
    .crm-bulk-board-toolbar .btn{width:100%}
}

/* ==============================================================
   RC31 CLIENT -> PRODUCT -> PROJECT -> MODULE CASCADE
   Compact multi-selects, bulk pricing and downward dropdown layer.
   ============================================================== */
.crm-client-product-picker-toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:.55rem;
    margin-bottom:.55rem;
}
.crm-client-product-picker-toolbar .input-icon { flex:1 1 auto; min-width:0; }
.crm-client-product-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.42rem;
    max-height:290px;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:.05rem .18rem .05rem 0;
    scrollbar-width:thin;
}
.crm-client-product-option {
    min-width:0;
    min-height:38px;
    display:flex;
    align-items:center;
    gap:.48rem;
    padding:.48rem .55rem;
    border:1px solid var(--crm-form-card-border,#dce5ee);
    border-radius:.48rem;
    background:var(--crm-form-surface,#fff);
    cursor:pointer;
}
.crm-client-product-option:hover { border-color:rgba(var(--crm-primary-rgb,15,143,138),.38); background:rgba(var(--crm-primary-rgb,15,143,138),.035); }
.crm-client-product-option:has(.form-check-input:checked) { border-color:rgba(var(--crm-primary-rgb,15,143,138),.48); background:rgba(var(--crm-primary-rgb,15,143,138),.065); }
.crm-client-product-option > span { min-width:0; }

.crm-project-module-card { overflow:visible!important; }
.crm-project-module-toolbar,
.crm-module-pricing-toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:.6rem;
    padding:.55rem .7rem;
    border-bottom:1px solid var(--crm-form-card-border,#dce5ee);
    background:var(--crm-form-muted-bg,#f8fbfd);
}
.crm-project-module-toolbar .input-icon,
.crm-module-pricing-toolbar .input-icon { width:min(340px,100%); }
.crm-project-module-table-wrap { max-height:350px; overflow:auto; overscroll-behavior:contain; }
.crm-project-module-table { min-width:690px; }
.crm-project-module-table thead th,
.crm-module-pricing-bulk-table thead th {
    position:sticky;
    top:0;
    z-index:3;
    background:var(--crm-table-head-bg,var(--crm-form-muted-bg,#f8fbfd));
    box-shadow:0 1px 0 var(--crm-form-card-border,#dce5ee);
}
.crm-module-pricing-bulk-wrap { max-height:430px; overflow:auto; overscroll-behavior:contain; }
.crm-module-pricing-bulk-table { min-width:720px; }
.crm-module-pricing-bulk-table td { vertical-align:middle; }
.crm-module-pricing-bulk-table input[type="number"] { min-width:125px; }

/* Choices.js must render below the field and above following cards/controls. */
.crm-entry-form .card,
.crm-entry-form .card-body,
.crm-entry-form .row > [class*="col-"],
.crm-form-card { overflow:visible!important; }
body .choices { overflow:visible!important; }
body .choices.is-open { position:relative; z-index:5000!important; }
body .choices__inner { position:relative; z-index:1; }
body .choices__list--dropdown,
body .choices__list[aria-expanded] {
    z-index:5100!important;
    top:100%!important;
    bottom:auto!important;
    margin-top:-1px!important;
    margin-bottom:0!important;
    max-height:280px;
    overflow:auto;
}
body .choices.is-flipped .choices__list--dropdown,
body .choices.is-flipped .choices__list[aria-expanded] {
    top:100%!important;
    bottom:auto!important;
    margin-top:-1px!important;
    margin-bottom:0!important;
}
.modal .choices.is-open { z-index:1600!important; }
.modal .choices__list--dropdown,
.modal .choices__list[aria-expanded] { z-index:1610!important; }

@media (max-width:767.98px) {
    .crm-client-product-grid { grid-template-columns:1fr; max-height:260px; }
    .crm-client-product-picker-toolbar,
    .crm-project-module-toolbar,
    .crm-module-pricing-toolbar { align-items:stretch; flex-direction:column; }
    .crm-project-module-toolbar .input-icon,
    .crm-module-pricing-toolbar .input-icon { width:100%; }
}

/* =========================================================
   RC38 - MODAL STACKING + MASTER SETTINGS MODAL SHELL
   ---------------------------------------------------------
   The reference topbar intentionally sits above normal page
   content (z-index 1120). Bootstrap's default modal layer is
   lower than that, which allowed the sticky topbar to cover
   the upper part of dynamically loaded Master Settings forms.

   All application modals must be above the shell. Master Entry
   modals are additionally centered and body-scrollable so their
   header/footer remain visible on every viewport size.
   ========================================================= */
body.crm-reference-ui .modal {
    z-index: 2050 !important;
}

body.crm-reference-ui .modal-backdrop {
    z-index: 2040 !important;
}

body.crm-reference-ui .crm-master-entry-modal {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.crm-reference-ui .crm-master-entry-modal .modal-dialog {
    width: auto;
    margin: 1rem auto !important;
    max-width: min(48rem, calc(100vw - 2rem));
}

body.crm-reference-ui .crm-master-entry-modal .modal-dialog.modal-lg {
    max-width: min(64rem, calc(100vw - 2rem));
}

body.crm-reference-ui .crm-master-entry-modal .modal-content,
body.crm-reference-ui .crm-master-entry-modal .crm-modal-form {
    width: 100%;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}

body.crm-reference-ui .crm-master-entry-modal .crm-modal-form {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

body.crm-reference-ui .crm-master-entry-modal .modal-header,
body.crm-reference-ui .crm-master-entry-modal .modal-footer {
    flex: 0 0 auto;
}

body.crm-reference-ui .crm-master-entry-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: visible;
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.crm-reference-ui .crm-master-entry-modal .modal-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    body.crm-reference-ui .crm-master-entry-modal .modal-dialog,
    body.crm-reference-ui .crm-master-entry-modal .modal-dialog.modal-lg {
        width: auto;
        max-width: none;
        margin: .5rem !important;
    }

    body.crm-reference-ui .crm-master-entry-modal .modal-content,
    body.crm-reference-ui .crm-master-entry-modal .crm-modal-form {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
}

/* =========================================================
   ROLE PERMISSIONS - RELIABLE NESTED ACCORDION + SCROLL (RC40)
   ========================================================= */
.crm-role-permission-header {
    margin-bottom: .75rem;
}

.crm-permission-hierarchy-shell {
    overflow: hidden;
}

/* Toolbar stays outside the scrollable tree. This prevents it from covering
   the first permission row and makes the editor usable on short screens. */
.crm-permission-hierarchy-toolbar {
    padding: .75rem .9rem;
    position: relative;
    z-index: 4;
    background: var(--tblr-card-bg, #fff);
    border-bottom: 1px solid #e8edf3;
}

.crm-permission-toolbar-top,
.crm-permission-toolbar-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.crm-permission-toolbar-filter {
    margin-top: .65rem;
}

.crm-permission-global-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.crm-permission-search-wrap {
    width: min(46rem, 100%);
    flex: 1 1 28rem;
}

.crm-permission-selected-filter {
    white-space: nowrap;
    color: #4d5d72;
    font-size: .82rem;
    font-weight: 600;
}

/* The permission list owns its own vertical scrolling. The page no longer
   needs to grow to the full height of every menu/submenu/permission. */
.crm-permission-tree {
    background: #fff;
    padding: .6rem;
    height: clamp(22rem, calc(100vh - 20rem), 48rem);
    height: clamp(22rem, calc(100dvh - 20rem), 48rem);
    min-height: 22rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 105, 128, .35) transparent;
}

.crm-permission-tree::-webkit-scrollbar {
    width: 8px;
}

.crm-permission-tree::-webkit-scrollbar-track {
    background: transparent;
}

.crm-permission-tree::-webkit-scrollbar-thumb {
    background: rgba(88, 105, 128, .28);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

.crm-permission-tree:hover::-webkit-scrollbar-thumb {
    background: rgba(88, 105, 128, .45);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.crm-permission-tree-node {
    --permission-indent-step: 1.15rem;
    border: 1px solid #e5eaf1;
    border-radius: .65rem;
    background: #fff;
    margin-bottom: .45rem;
    overflow: hidden;
}

.crm-permission-tree-node:last-child {
    margin-bottom: 0;
}

.crm-permission-tree-node .crm-permission-tree-node {
    margin: .4rem .55rem .4rem calc(.55rem + (var(--permission-level) * .04rem));
    border-color: #e8edf3;
    box-shadow: none;
}

.crm-permission-tree-node-additional {
    border-style: dashed;
}

.crm-permission-tree-row {
    min-height: 2.9rem;
    display: flex;
    align-items: stretch;
    background: #fff;
}

.crm-permission-tree-node[data-permission-level="0"] > .crm-permission-tree-row {
    background: #f7f9fc;
}

.crm-permission-tree-node[data-permission-level="0"] > .crm-permission-tree-row .crm-permission-tree-name {
    font-weight: 700;
    color: #1d2b3e;
}

.crm-permission-tree-toggle {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .58rem .65rem;
    color: inherit;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

.crm-permission-tree-toggle:hover {
    background: rgba(32,107,196,.035);
}

.crm-permission-tree-toggle:focus-visible {
    outline: 2px solid rgba(32,107,196,.32);
    outline-offset: -2px;
}

.crm-permission-tree-indent {
    width: calc(var(--permission-level) * var(--permission-indent-step));
    flex: 0 0 calc(var(--permission-level) * var(--permission-indent-step));
}

.crm-permission-tree-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #206bc4;
    background: #eef5ff;
    flex: 0 0 auto;
    font-size: .95rem;
}

.crm-permission-tree-node-additional > .crm-permission-tree-row .crm-permission-tree-icon {
    color: #986c00;
    background: #fff7dc;
}

.crm-permission-tree-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.18;
}

.crm-permission-tree-name {
    font-size: .84rem;
    font-weight: 650;
    color: #27364a;
}

.crm-permission-tree-hint {
    margin-top: .16rem;
    color: #7a8798;
    font-size: .71rem;
    line-height: 1.25;
}

.crm-permission-tree-count {
    margin-left: auto;
    padding: .24rem .48rem;
    min-width: 3.65rem;
    border-radius: 999px;
    background: #eef3f8;
    color: #66758a;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.crm-permission-tree-chevron {
    display: inline-flex;
    align-items: center;
    color: #8390a2;
    font-size: .83rem;
    transition: transform .12s ease;
}

.crm-permission-tree-toggle[aria-expanded="true"] .crm-permission-tree-chevron {
    transform: rotate(90deg);
}

.crm-permission-scope-check {
    width: 2.75rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e8edf3;
    cursor: pointer;
    background: rgba(248,250,252,.6);
    flex: 0 0 2.75rem;
}

.crm-permission-scope-check:hover {
    background: #f1f6fc;
}

/* Custom accordion: no Bootstrap collapse dependency. */
.crm-permission-tree-collapse {
    border-top: 1px solid #edf1f5;
    background: #fcfdff;
}

.crm-permission-tree-collapse[hidden] {
    display: none !important;
}

.crm-permission-tree-collapse.is-open {
    display: block;
}

.crm-permission-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
    padding: .55rem .65rem .6rem calc(.65rem + ((var(--permission-level) + 1) * var(--permission-indent-step)));
}

.crm-permission-action {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 0;
    padding: .5rem .55rem;
    border: 1px solid #e8edf3;
    border-radius: .55rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.crm-permission-action:hover {
    border-color: #cfdced;
    background: #f9fbfe;
    box-shadow: 0 1px 4px rgba(24,36,51,.035);
}

.crm-permission-action .form-check-input {
    margin: .16rem 0 0;
    flex: 0 0 auto;
}

.crm-permission-action-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.crm-permission-action-title {
    font-size: .8rem;
    font-weight: 700;
    color: #26364b;
}

.crm-permission-action-code {
    margin-top: .1rem;
    color: #206bc4;
    font-size: .67rem;
    font-family: var(--tblr-font-monospace);
    overflow-wrap: anywhere;
}

.crm-permission-action-description {
    margin-top: .16rem;
    color: #7a8798;
    font-size: .69rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-permission-no-results {
    min-height: 9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    text-align: left;
    color: #68788c;
}

.crm-permission-no-results > i {
    font-size: 1.8rem;
    color: #9ba8b8;
}

.crm-permission-tree-node[hidden] {
    display: none !important;
}

.crm-permission-savebar {
    position: relative;
    z-index: 3;
    background: var(--tblr-card-bg, #fff);
    border-top: 1px solid #e8edf3;
}

@media (max-width: 1199.98px) {
    .crm-permission-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .crm-permission-global-actions {
        width: 100%;
    }

    .crm-permission-global-actions .btn {
        flex: 1 1 auto;
    }

    .crm-permission-toolbar-filter {
        align-items: stretch;
    }

    .crm-permission-search-wrap {
        flex-basis: 100%;
    }

    .crm-permission-tree {
        height: clamp(20rem, calc(100vh - 22rem), 38rem);
        height: clamp(20rem, calc(100dvh - 22rem), 38rem);
        min-height: 20rem;
    }

    .crm-permission-action-grid {
        grid-template-columns: 1fr;
        padding-left: .7rem;
    }

    .crm-permission-tree-indent {
        width: calc(var(--permission-level) * .55rem);
        flex-basis: calc(var(--permission-level) * .55rem);
    }

    .crm-permission-tree-hint,
    .crm-permission-action-description {
        display: none;
    }
}

[data-bs-theme="dark"] .crm-permission-hierarchy-toolbar,
[data-bs-theme="dark"] .crm-permission-tree,
[data-bs-theme="dark"] .crm-permission-tree-node,
[data-bs-theme="dark"] .crm-permission-tree-row,
[data-bs-theme="dark"] .crm-permission-action,
[data-bs-theme="dark"] .crm-permission-savebar {
    background: var(--tblr-bg-surface);
    border-color: rgba(255,255,255,.09);
}

[data-bs-theme="dark"] .crm-permission-tree-node[data-permission-level="0"] > .crm-permission-tree-row,
[data-bs-theme="dark"] .crm-permission-tree-collapse,
[data-bs-theme="dark"] .crm-permission-scope-check {
    background: rgba(255,255,255,.02);
    border-color: rgba(255,255,255,.08);
}

[data-bs-theme="dark"] .crm-permission-tree-name,
[data-bs-theme="dark"] .crm-permission-tree-node[data-permission-level="0"] > .crm-permission-tree-row .crm-permission-tree-name,
[data-bs-theme="dark"] .crm-permission-action-title {
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .crm-permission-tree-count {
    background: rgba(255,255,255,.06);
    color: var(--tblr-secondary-color);
}

[data-bs-theme="dark"] .crm-permission-action:hover,
[data-bs-theme="dark"] .crm-permission-tree-toggle:hover,
[data-bs-theme="dark"] .crm-permission-scope-check:hover {
    background: rgba(255,255,255,.04);
}

.crm-permission-tree-shared {
    margin-left: auto;
    padding: .22rem .48rem;
    border-radius: 999px;
    background: #f2f4f7;
    color: #7a8798;
    font-size: .68rem;
    font-weight: 650;
    white-space: nowrap;
}

.crm-permission-tree-toggle-static {
    cursor: default;
}

.crm-permission-tree-toggle-static:hover {
    background: transparent;
}

[data-bs-theme="dark"] .crm-permission-tree-shared {
    background: rgba(255,255,255,.05);
    color: var(--tblr-secondary-color);
}


/* Requirement workspace: multi-session page-wise entry and client verification */
.crm-bulk-filter {
    min-width: 11rem;
}

.crm-bulk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    align-items: center;
    font-size: .78rem;
    color: var(--tblr-secondary-color);
}

.crm-bulk-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
}

.crm-state-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    display: inline-block;
    background: var(--tblr-secondary);
}

.crm-state-dot.is-available { background: var(--tblr-secondary); }
.crm-state-dot.is-draft { background: var(--tblr-blue); }
.crm-state-dot.is-submitted { background: var(--tblr-azure); }
.crm-state-dot.is-approved { background: var(--tblr-green); }
.crm-state-dot.is-revision { background: var(--tblr-orange); }

.crm-page-list {
    display: grid;
    gap: .65rem;
}

.crm-page-card {
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: .7rem;
    background: var(--tblr-card-bg, #fff);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.crm-page-card:hover {
    box-shadow: 0 .2rem .75rem rgba(24, 36, 51, .06);
}

.crm-page-card[data-state="draft"] { border-left: .23rem solid var(--tblr-blue); }
.crm-page-card[data-state="submitted"] { border-left: .23rem solid var(--tblr-azure); }
.crm-page-card[data-state="approved"] { border-left: .23rem solid var(--tblr-green); }
.crm-page-card[data-state="revision"] { border-left: .23rem solid var(--tblr-orange); }

.crm-page-card-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem .8rem;
}

.crm-page-card-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--tblr-bg-surface-secondary, #f6f8fb);
    color: var(--tblr-secondary-color);
}

.crm-page-card-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.crm-page-card-copy strong,
.crm-page-card-copy small {
    display: block;
}

.crm-page-card-copy small {
    margin-top: .12rem;
    color: var(--tblr-secondary-color);
}

.crm-page-card-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
}

.crm-page-editor {
    border-top: 1px solid var(--tblr-border-color, #e6e7e9);
    padding: .9rem;
    background: var(--tblr-bg-surface-secondary, #f8fafc);
}

.crm-page-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: .9rem;
}

.crm-page-editor-main,
.crm-page-editor-side {
    min-width: 0;
}

.crm-page-editor-side {
    display: grid;
    align-content: start;
    gap: .7rem;
}

.crm-submit-check {
    padding: .65rem .75rem;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: .55rem;
    background: var(--tblr-card-bg, #fff);
}

.crm-submit-check .form-check {
    margin-bottom: 0;
}

.crm-bulk-summary-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
}

.crm-bulk-summary-grid-3 > div {
    padding: .65rem;
    border-radius: .55rem;
    background: var(--tblr-bg-surface-secondary, #f6f8fb);
    text-align: center;
}

.crm-bulk-summary-grid-3 strong {
    display: block;
    font-size: 1.05rem;
}

.crm-bulk-summary-grid-3 span {
    display: block;
    margin-top: .08rem;
    font-size: .7rem;
    color: var(--tblr-secondary-color);
}

.crm-client-verification-card {
    border-left: .22rem solid var(--tblr-azure);
}

.crm-client-verification-card.is-revision {
    border-left-color: var(--tblr-orange);
}

.crm-verification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    color: var(--tblr-secondary-color);
    font-size: .78rem;
}

.crm-verification-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .6rem;
    align-items: end;
}

[data-bs-theme="dark"] .crm-page-card,
[data-bs-theme="dark"] .crm-submit-check {
    background: var(--tblr-bg-surface);
    border-color: rgba(255,255,255,.09);
}

[data-bs-theme="dark"] .crm-page-editor,
[data-bs-theme="dark"] .crm-page-card-icon,
[data-bs-theme="dark"] .crm-bulk-summary-grid-3 > div {
    background: rgba(255,255,255,.025);
    border-color: rgba(255,255,255,.09);
}

@media (max-width: 991.98px) {
    .crm-page-editor-grid {
        grid-template-columns: 1fr;
    }

    .crm-verification-actions {
        grid-template-columns: 1fr 1fr;
    }

    .crm-verification-actions .crm-verification-comment {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .crm-page-card-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .crm-page-card-actions {
        width: 100%;
        padding-left: 2.75rem;
    }

    .crm-page-card-actions .btn {
        flex: 1 1 auto;
    }

    .crm-bulk-summary-grid-3,
    .crm-verification-actions {
        grid-template-columns: 1fr;
    }

    .crm-verification-actions .crm-verification-comment {
        grid-column: auto;
    }
}

.crm-page-card-copy {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.crm-page-card-copy > .crm-page-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    font-size: 1rem;
    background: var(--tblr-bg-surface-secondary, #f6f8fb);
    color: var(--tblr-secondary-color);
}

.crm-submit-check .form-check-label {
    display: grid;
    line-height: 1.2;
}

.crm-submit-check .form-check-label small {
    margin-top: .2rem;
    color: var(--tblr-secondary-color);
}
.crm-sidebar {
    width: 235px;
    background: #0f2f46;
}

.crm-sidebar .nav-link {
    min-height: 38px;
    margin: 2px 8px;
    padding: 8px 12px;
    border-radius: 7px;
    color: #d8e4ec;
    font-size: 13px;
    font-weight: 500;
    transition: .18s ease;
}

.crm-sidebar .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.crm-sidebar .nav-link.parent-active {
    background: rgba(20,184,166,.12);
    color: #fff;
}

.crm-sidebar .submenu {
    padding-left: 12px;
}

.crm-sidebar .submenu .nav-link {
    position: relative;
    min-height: 34px;
    margin-left: 8px;
    padding-left: 28px;
    font-size: 12.5px;
    color: #c2d0da;
}

.crm-sidebar .submenu .nav-link.active {
    background: rgba(20,184,166,.16);
    color: #5eead4;
    font-weight: 600;
}

.crm-sidebar .submenu .nav-link.active::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 3px;
    background: #14b8a6;
}

.crm-sidebar .nav-link .menu-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-sidebar::-webkit-scrollbar {
    width: 4px;
}

.crm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.16);
    border-radius: 10px;
}

/* Requirement single-page selector */
.crm-page-node.crm-page-node-occupied,
.crm-page-node.crm-page-node-occupied:hover {
    cursor:not-allowed;
    opacity:.62;
    transform:none;
    box-shadow:none;
    border-style:dashed;
    background:var(--tblr-bg-surface-secondary, #f6f8fb);
}
.crm-page-node.crm-page-node-occupied .crm-page-node-check {
    opacity:.8;
    color:var(--tblr-secondary-color);
}
.crm-page-node.crm-page-node-occupied .crm-page-node-body small {
    color:var(--tblr-warning, #f59f00);
}


/* =========================================================
   V35 - PROJECT CREATION HIERARCHICAL SCOPE PICKER
   Module -> Feature -> Page selection from active product pricing.
   ========================================================= */
.crm-project-scope-card { overflow:visible!important; }
.crm-project-scope-head { gap:.75rem; flex-wrap:wrap; }
.crm-project-scope-toolbar {
    display:flex; align-items:center; justify-content:space-between; gap:.65rem;
    padding:.5rem .7rem; border-bottom:1px solid var(--crm-form-card-border,#dce5ee);
    background:var(--crm-form-muted-bg,#f8fbfd); position:sticky; top:0; z-index:5;
}
.crm-project-scope-toolbar .input-icon { width:min(420px,100%); }
.crm-project-scope-tree { max-height:430px; overflow:auto; padding:.5rem; background:#f6f9fc; overscroll-behavior:contain; }
.crm-scope-module { border:1px solid #d9e3ec; border-radius:.5rem; background:#fff; margin-bottom:.45rem; overflow:hidden; }
.crm-scope-module:last-child { margin-bottom:0; }
.crm-scope-module-head,
.crm-scope-feature-head {
    display:grid; grid-template-columns:24px 24px minmax(0,1fr) auto; align-items:center; gap:.42rem;
    cursor:pointer; user-select:none;
}
.crm-scope-module-head { min-height:42px; padding:.38rem .55rem; background:#f8fbfd; }
.crm-scope-module-head:hover { background:#f2f8fa; }
.crm-scope-feature-head { grid-template-columns:22px 22px minmax(0,1fr); min-height:36px; padding:.3rem .5rem; }
.crm-scope-feature-head:hover { background:rgba(13,148,136,.045); }
.crm-scope-chevron { border:0; background:transparent; width:22px; height:22px; padding:0; display:grid; place-items:center; color:#587083; border-radius:.3rem; }
.crm-scope-chevron:hover { background:#e8f0f5; color:#173b55; }
.crm-scope-chevron i { transition:transform .16s ease; }
.crm-scope-module.is-open > .crm-scope-module-head .crm-scope-chevron i,
.crm-scope-feature.is-open > .crm-scope-feature-head .crm-scope-chevron i { transform:rotate(90deg); }
.crm-scope-title { display:flex; align-items:baseline; gap:.5rem; }
.crm-scope-title strong { font-size:.8rem; color:#173b55; }
.crm-scope-title span { font-size:.66rem; color:#708496; white-space:nowrap; }
.crm-scope-price { display:flex; align-items:center; gap:.3rem; flex-wrap:wrap; justify-content:flex-end; }
.crm-scope-price span { padding:.12rem .34rem; border:1px solid #dbe6ee; border-radius:.3rem; font-size:.64rem; color:#526b7c; background:#fff; white-space:nowrap; }
.crm-scope-module-body { border-top:1px solid #e4ebf1; padding:.28rem .4rem .4rem 2rem; }
.crm-scope-feature { border-left:2px solid #d9e7ed; margin:.2rem 0; border-radius:.35rem; background:#fff; }
.crm-scope-feature.is-open { border-left-color:#0d9488; }
.crm-scope-pages { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.24rem; padding:.15rem .45rem .42rem 2.85rem; }
.crm-scope-page { display:flex; align-items:center; gap:.4rem; min-width:0; min-height:30px; padding:.22rem .4rem; border:1px solid #e1e8ee; border-radius:.35rem; background:#fbfdfe; cursor:pointer; }
.crm-scope-page:hover { border-color:#b9d8d4; background:#f4fbfa; }
.crm-scope-page:has(input:checked) { border-color:#b8ddd7; background:#f0faf8; }
.crm-scope-page span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.72rem; color:#29485d; }
.crm-scope-no-features,.crm-scope-no-pages { padding:.55rem .7rem; color:#8091a0; font-size:.7rem; }
.crm-project-scope-tree .form-check-input { width:1rem!important; height:1rem!important; margin:0; cursor:pointer; }
@media (max-width:991.98px){ .crm-scope-pages{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:767.98px){
    .crm-project-scope-head{align-items:stretch!important;}
    .crm-project-scope-head>div:last-child{width:100%; justify-content:flex-start!important;}
    .crm-project-scope-toolbar{align-items:stretch; flex-direction:column; position:static;}
    .crm-project-scope-toolbar .input-icon{width:100%;}
    .crm-project-scope-tree{max-height:none; overflow:visible; padding:.35rem;}
    .crm-scope-module-head{grid-template-columns:22px 22px minmax(0,1fr);}
    .crm-scope-price{grid-column:3; justify-content:flex-start; padding-bottom:.2rem;}
    .crm-scope-module-body{padding-left:.6rem;}
    .crm-scope-pages{grid-template-columns:1fr; padding-left:2.3rem;}
}


/* V41.11: make BA accordion header feel fully clickable without affecting action buttons. */
.crm-ba-requirement-head[data-ba-header-toggle] {
    cursor: pointer;
}

.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-main-wrap,
.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-header-info {
    cursor: pointer;
}

.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-actions,
.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-actions * {
    cursor: default;
}

/* V41.11: full-row BA accordion interaction. */
.crm-ba-requirement-head[data-ba-header-toggle] {
    cursor: pointer;
    user-select: none;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.crm-ba-requirement-head[data-ba-header-toggle]:hover {
    background: #f7fbfb;
}
.crm-ba-requirement-head[data-ba-header-toggle]:focus-visible {
    outline: 2px solid rgba(13, 148, 136, .28);
    outline-offset: -2px;
}
.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-actions a,
.crm-ba-requirement-head[data-ba-header-toggle] .crm-ba-req-actions button {
    cursor: pointer;
}
