.dashboard-page .page-wrapper,
.dashboard-page .container-fluid,
.dashboard-page.page-wrapper,
.dashboard-page .u-bg-page {
    background: #f5f7fb;
}

/* Shared desktop action alignment */
.client-leads-page .crm-page-header,
.cp-leads-page .crm-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.client-leads-page .crm-page-header__content,
.cp-leads-page .crm-page-header__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.client-leads-page .crm-page-header__actions,
.cp-leads-page .crm-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.client-leads-page .crm-filter-form,
.cp-leads-page .crm-filter-form {
    display: grid;
    gap: 16px;
}

.client-leads-page .crm-filter-grid,
.cp-leads-page .crm-filter-grid {
    display: grid;
    gap: 14px;
    align-items: end;
}

.client-leads-page .crm-filter-grid--lead-fields,
.cp-leads-page .crm-filter-grid--lead-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-leads-page .crm-filter-grid--lead-search,
.cp-leads-page .crm-filter-grid--lead-search {
    grid-template-columns: minmax(280px, 1fr) auto;
}

.client-leads-page .crm-filter-grid--lead-search .filter-actions,
.cp-leads-page .crm-filter-grid--lead-search .cp-filter-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.crm-form-page .crm-form-actions,
.crm-edit-page .crm-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.crm-form-page .crm-form-actions .btn,
.crm-edit-page .crm-form-actions .btn {
    min-width: 140px;
}

.client-leads-page .crm-bulk-toolbar,
.cp-leads-page .crm-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid #dde7f3;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.client-leads-page .crm-bulk-toolbar__controls,
.cp-leads-page .crm-bulk-toolbar__controls {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(220px, 320px) auto;
    gap: 12px;
    align-items: end;
    flex: 1 1 720px;
}

.client-leads-page .crm-bulk-toolbar__buttons,
.cp-leads-page .crm-bulk-toolbar__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.client-leads-page .crm-bulk-feedback,
.cp-leads-page .crm-bulk-feedback {
    width: 100%;
    margin-bottom: 0;
    display: none;
}

.client-leads-page .crm-bulk-feedback.is-visible,
.cp-leads-page .crm-bulk-feedback.is-visible {
    display: block;
}

.client-leads-page .crm-bulk-col,
.cp-leads-page .crm-bulk-col {
    width: 52px;
    min-width: 52px !important;
    text-align: center;
    vertical-align: middle !important;
}

.client-leads-page .crm-bulk-checkbox,
.cp-leads-page .crm-bulk-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8a5a22;
}

.client-leads-page tbody tr.is-selected td,
.cp-leads-page tbody tr.is-selected td {
    background: #fff7ed !important;
}

@media (max-width: 1199px) {
    .client-leads-page .crm-filter-grid--lead-fields,
    .cp-leads-page .crm-filter-grid--lead-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        grid-template-columns: minmax(170px, 220px) minmax(220px, 1fr) auto;
    }
}

@media (max-width: 991px) {
    .client-leads-page .crm-filter-grid--lead-search,
    .cp-leads-page .crm-filter-grid--lead-search {
        grid-template-columns: 1fr;
    }

    .client-leads-page .crm-filter-grid--lead-search .filter-actions,
    .cp-leads-page .crm-filter-grid--lead-search .cp-filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .client-leads-page .crm-filter-grid--lead-search .filter-actions .btn,
    .cp-leads-page .crm-filter-grid--lead-search .cp-filter-actions .btn {
        flex: 1 1 0;
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        grid-template-columns: 1fr;
        width: 100%;
    }

}

@media (max-width: 767px) {
    .client-leads-page .crm-filter-grid--lead-fields,
    .cp-leads-page .crm-filter-grid--lead-fields {
        grid-template-columns: 1fr;
    }

    .crm-form-page .crm-form-actions,
    .crm-edit-page .crm-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-form-page .crm-form-actions .btn,
    .crm-edit-page .crm-form-actions .btn,
    .client-leads-page .crm-bulk-toolbar__buttons .btn,
    .cp-leads-page .crm-bulk-toolbar__buttons .btn {
        width: 100%;
    }

    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        padding: 12px;
    }

    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        width: 100%;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(1),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(1) {
        width: 56px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(2),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(2) {
        width: 52px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(3),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(3) {
        width: 160px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(4),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(4) {
        width: 130px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(5),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(5) {
        width: 230px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(6),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(6) {
        width: 100px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(7),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(7) {
        width: 110px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(8),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(8) {
        width: 90px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(9),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(9) {
        width: 280px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(10),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(10) {
        width: 120px !important;
    }

    .client-leads-page.has-bulk-actions #clientLeadsTable th:nth-child(11),
    .client-leads-page.has-bulk-actions #clientLeadsTable td:nth-child(11) {
        width: 138px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(1),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(1) {
        width: 56px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(2),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(2) {
        width: 52px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(3),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(3) {
        width: 170px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(4),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(4) {
        width: 170px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(5),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(5) {
        width: 130px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(6),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(6) {
        width: 210px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(7),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(7) {
        width: 110px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(8),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(8) {
        width: 120px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(9),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(9) {
        width: 100px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(10),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(10) {
        width: 90px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(11),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(11) {
        width: 280px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(12),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(12) {
        width: 120px !important;
    }

    .cp-leads-page.has-bulk-actions #cpLeadsTable th:nth-child(13),
    .cp-leads-page.has-bulk-actions #cpLeadsTable td:nth-child(13) {
        width: 140px !important;
    }
}

.dashboard-page .dashboard .card {
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.dashboard-page .table td,
.dashboard-page .table th {
    vertical-align: middle !important;
}

.dashboard-page .dashboard-alert {
    border-radius: 14px;
    border-color: #f3d38b;
    box-shadow: 0 10px 24px rgba(180, 83, 9, 0.08);
}

.dashboard-page .dashboard-hero {
    margin-bottom: 26px;
}

.dashboard-page .dashboard-actions-grid {
    margin-bottom: 18px;
}

.dashboard-page .dashboard-summary-grid,
.dashboard-page .dashboard-status-grid,
.dashboard-page .dashboard-role-blocks {
    display: grid;
    gap: 16px;
}

.dashboard-page .dashboard-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 20px;
}

.dashboard-page .dashboard-status-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 0 24px;
}

.dashboard-page .dashboard-role-blocks {
    grid-template-columns: 1fr;
}

.dashboard-page .dashboard-summary-card,
.dashboard-page .dashboard-status-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.dashboard-page .dashboard-summary-label {
    display: block;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-page .dashboard-summary-card strong,
.dashboard-page .dashboard-status-card strong {
    display: block;
    color: #111827;
    font-size: 28px;
    line-height: 1;
}

.dashboard-page .dashboard-summary-card small,
.dashboard-page .dashboard-status-card small {
    display: block;
    margin-top: 10px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-page .dashboard-status-card.is-neutral {
    border-top: 4px solid #94a3b8;
}

.dashboard-page .dashboard-status-card.is-info {
    border-top: 4px solid #2563eb;
}

.dashboard-page .dashboard-status-card.is-accent {
    border-top: 4px solid #0ea5e9;
}

.dashboard-page .dashboard-status-card.is-success {
    border-top: 4px solid #16a34a;
}

.dashboard-page .dashboard-status-card.is-danger {
    border-top: 4px solid #dc2626;
}

.dashboard-page .dashboard-status-card.is-dark {
    border-top: 4px solid #0f172a;
}

.dashboard-page .dashboard-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.dashboard-page .dashboard-chart-wrap {
    position: relative;
    min-height: 280px;
}

.dashboard-page .dashboard-chart-empty {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-page .dashboard-followup-list {
    display: grid;
    gap: 14px;
}

.dashboard-page .dashboard-followup-item {
    background: #f8fafc;
    border: 1px solid #e5edf5;
    border-radius: 16px;
    padding: 16px;
}

.dashboard-page .dashboard-followup-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dashboard-page .dashboard-followup-top strong {
    color: #111827;
    font-size: 15px;
}

.dashboard-page .dashboard-followup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-page .dashboard-followup-badge.is-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-page .dashboard-followup-badge.is-upcoming {
    background: #dbeafe;
    color: #1d4ed8;
}

.dashboard-page .dashboard-followup-meta {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-page .dashboard-followup-date {
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0 6px;
}

.dashboard-page .dashboard-followup-card .card-body,
.dashboard-page .dashboard .card .card-body {
    padding: 24px;
}

.dashboard-page .dashboard .card {
    height: calc(100% - 1rem);
}

@media (max-width: 1199px) {
    .dashboard-page .dashboard-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-form-page .section-title,
.crm-form-page .crm-section-heading {
    font-size: 18px;
}

.crm-form-page,
.crm-form-page .page-wrapper,
.crm-form-page .container-fluid,
.crm-edit-page,
.crm-edit-page .page-wrapper,
.crm-edit-page .container-fluid {
    background: #f5f7fb;
}

.crm-form-page .form-card,
.crm-edit-page .edit-card,
.crm-edit-page .history-card,
.crm-edit-page .additional-card,
.crm-edit-page .summary-card,
.crm-edit-page .form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.crm-form-page .form-card .card-body {
    padding: 28px;
}

.crm-form-page .info-note,
.crm-form-page .crm-info-note,
.crm-edit-page .note-box {
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    color: #0c5460;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.crm-form-page .required-star {
    color: #dc3545;
}

.crm-form-page .form-control,
.crm-form-page .form-control:focus,
.crm-form-page select.form-control,
.crm-edit-page .form-control,
.crm-edit-page .form-control:focus,
.crm-edit-page select.form-control,
.crm-edit-page textarea.form-control {
    min-height: 46px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-shadow: none !important;
}

.crm-form-page textarea.form-control,
.crm-edit-page textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.crm-form-page .form-group label,
.crm-edit-page .form-group label {
    display: block;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.crm-edit-page .edit-page-wrap {
    max-width: 1180px;
    margin: 0 auto;
}

.crm-edit-page .edit-card .card-body,
.crm-edit-page .history-card .card-body,
.crm-edit-page .additional-card .card-body,
.crm-edit-page .summary-card .card-body {
    padding: 28px;
}

.crm-edit-page .crm-section-title {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 18px;
}

.crm-edit-page .crm-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: -6px;
    margin-bottom: 18px;
}

.crm-edit-page .section-divider {
    margin: 8px 0 20px;
    border-top: 1px solid #edf2f7;
}

.crm-edit-page .admin-warning {
    display: block;
    margin-top: 7px;
    color: #6b7280;
    font-size: 13px;
}

.crm-edit-page .top-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.crm-edit-page .summary-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
}

.crm-edit-page .summary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    margin-bottom: 8px;
}

.crm-edit-page .summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.crm-edit-page .status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.crm-edit-page .badge-new { background: #e5e7eb; color: #374151; }
.crm-edit-page .badge-working { background: #dbeafe; color: #1d4ed8; }
.crm-edit-page .badge-contacted { background: #ede9fe; color: #6d28d9; }
.crm-edit-page .badge-qualified { background: #dcfce7; color: #166534; }
.crm-edit-page .badge-failed { background: #fee2e2; color: #b91c1c; }
.crm-edit-page .badge-closed { background: #cffafe; color: #155e75; }
.crm-edit-page .badge-default { background: #f3f4f6; color: #4b5563; }

.crm-edit-page .followups-list {
    display: grid;
    gap: 16px;
}

.crm-edit-page .followup-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #2563eb;
    border-radius: 14px;
    padding: 18px;
}

.crm-edit-page .followup-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.crm-edit-page .followup-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.crm-edit-page .followup-lock {
    background: #ecfdf5;
    color: #059669;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.crm-edit-page .followup-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.crm-edit-page .followup-meta-item {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 12px 14px;
}

.crm-edit-page .followup-meta-item small {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.35px;
    margin-bottom: 5px;
}

.crm-edit-page .followup-meta-item div {
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

.crm-edit-page .followup-text {
    color: #374151;
    line-height: 1.7;
    white-space: pre-wrap;
}

.client-leads-page .lead-product-hero,
.cp-leads-page .cp-product-hero {
    margin-bottom: 18px;
}

.client-leads-page .card,
.cp-leads-page .cp-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #edf1f7;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.client-leads-page .card-body,
.cp-leads-page .cp-card-body {
    padding: 16px;
}

.client-leads-page .container-fluid,
.cp-leads-page .container-fluid,
.report-page .container-fluid {
    padding-top: 0 !important;
}

.client-leads-page .page-head-wrap,
.users-page .users-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.client-leads-page .top-actions,
.cp-leads-page .cp-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.client-leads-page .top-actions .btn,
.cp-leads-page .cp-top-actions .btn,
.client-leads-page .filter-actions .btn,
.cp-leads-page .cp-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px !important;
    border-radius: 14px !important;
    font-size: 13px;
    font-weight: 700;
}

.client-leads-page .page-head-wrap,
.cp-leads-page .cp-page-head {
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
    padding-top: 0;
}

.client-leads-page .top-actions,
.cp-leads-page .cp-top-actions {
    min-height: 42px;
}

.client-leads-page .card-body,
.cp-leads-page .cp-card-body {
    padding-top: 14px !important;
}

.client-leads-page .filters-card,
.cp-leads-page .cp-filters-card {
    margin-top: 0 !important;
}

.client-leads-page .card-body > .page-head-wrap + .filters-card,
.cp-leads-page .cp-card-body > .cp-page-head + .cp-filters-card {
    margin-top: 8px;
}

.client-leads-page .summary-box,
.cp-leads-page .cp-summary-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #eef6ff;
    border: 1px solid #dbeafe;
    color: #0d6efd;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.client-leads-page .filters-card,
.cp-leads-page .cp-filters-card,
.report-page .filter-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dde7f3;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.client-leads-page .crm-filter-scope,
.cp-leads-page .crm-filter-scope {
    margin-bottom: 14px;
}

.client-leads-page .crm-filter-scope .filter-group,
.cp-leads-page .crm-filter-scope .cp-filter-group {
    max-width: 240px;
}

.client-leads-page .filters-row,
.client-leads-page .filters-toolbar,
.cp-leads-page .cp-filters-row {
    display: grid;
    gap: 14px;
    align-items: end;
}

.client-leads-page .filters-row + .filters-row,
.client-leads-page .filters-row + .filters-toolbar,
.client-leads-page .filters-toolbar + .filters-row,
.client-leads-page .filters-toolbar + .filters-toolbar,
.cp-leads-page .cp-filters-row + .cp-filters-row {
    margin-top: 14px;
}

.client-leads-page .filters-row-primary,
.cp-leads-page .filters-row-primary,
.cp-leads-page .cp-filters-row.filters-row-primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-leads-page .filters-row-secondary,
.cp-leads-page .filters-row-secondary,
.cp-leads-page .cp-filters-row.filters-row-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-leads-page .filters-row-actions,
.cp-leads-page .filters-row-actions,
.cp-leads-page .cp-filters-row.filters-row-actions {
    grid-template-columns: 1fr;
}

.client-leads-page .filter-group,
.cp-leads-page .cp-filter-group {
    min-width: 0;
}

.client-leads-page .filter-group label,
.cp-leads-page .cp-filter-group label {
    display: block;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 12px;
}

.client-leads-page .filter-group select.form-control,
.client-leads-page .filter-group .form-control,
.cp-leads-page .cp-filter-group .form-control {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #111827;
    font-size: 13px;
    box-shadow: none !important;
    padding: 0 14px;
}

.client-leads-page .filter-group .form-control:focus,
.cp-leads-page .cp-filter-group .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}

.client-leads-page .table td,
.client-leads-page .table th,
.cp-leads-page .cp-table td,
.cp-leads-page .cp-table th {
    vertical-align: middle !important;
}

.client-leads-page .table-responsive,
.cp-leads-page .cp-table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 12px;
}

.client-leads-page .table-responsive.dt-managed-scroll,
.cp-leads-page .cp-table-wrap.dt-managed-scroll {
    overflow: visible !important;
}

.client-leads-page .assign-form {
    margin: 0 !important;
    width: 100%;
}

.client-leads-page .assign-top-row,
.cp-leads-page .cp-assign-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.client-leads-page .assign-label,
.cp-leads-page .cp-assign-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.client-leads-page .reassign-btn,
.cp-leads-page .cp-reassign-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #0d6efd;
    background: #eef6ff;
    color: #0d6efd;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.client-leads-page .assigned-select,
.cp-leads-page .cp-assigned-select {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 0 34px 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background-color: #fff;
    color: #111827;
    font-size: 12px;
    line-height: 40px;
    box-sizing: border-box;
}

.client-leads-page .select2-container,
.cp-leads-page .select2-container {
    width: 100% !important;
}

.client-leads-page .assign-inline-row .select2-container,
.cp-leads-page .cp-assign-inline-row .select2-container {
    flex: 1 1 auto;
    min-width: 170px;
}

.client-leads-page .select2-container--default .select2-selection--single,
.cp-leads-page .select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    box-shadow: none;
}

.client-leads-page .select2-container--default .select2-selection--single .select2-selection__rendered,
.cp-leads-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: 0 38px 0 12px;
    color: #111827;
    font-size: 12px;
    line-height: 38px;
}

.client-leads-page .select2-container--default .select2-selection--single .select2-selection__placeholder,
.cp-leads-page .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6b7280;
}

.client-leads-page .select2-container--default .select2-selection--single .select2-selection__arrow,
.cp-leads-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    width: 34px;
    right: 2px;
}

.client-leads-page .select2-container--default.select2-container--disabled .select2-selection--single,
.cp-leads-page .select2-container--default.select2-container--disabled .select2-selection--single {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.select2-container--default .select2-dropdown {
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    z-index: 9999;
}

.select2-container--default .select2-search--dropdown {
    padding: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5eaf1;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    font-size: 13px;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 280px;
}

.select2-container--default .select2-results__group {
    padding: 10px 12px 6px;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.select2-container--default .select2-results__option {
    padding: 9px 12px;
    font-size: 13px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background: #8a5a22;
    color: #ffffff;
}

.client-leads-page .crm-assignment-readonly,
.cp-leads-page .crm-assignment-readonly {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

.client-leads-page .crm-assignment-readonly strong,
.cp-leads-page .crm-assignment-readonly strong {
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
}

.crm-assignment-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.crm-assignment-badge.is-admin {
    background: #e0f2fe;
    color: #075985;
}

.crm-assignment-badge.is-leader {
    background: #ede9fe;
    color: #5b21b6;
}

.crm-assignment-badge.is-staff {
    background: #dcfce7;
    color: #166534;
}

.crm-assignment-badge.is-info,
.crm-assignment-badge.is-neutral {
    background: #e5e7eb;
    color: #374151;
}

.crm-reroute-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.client-leads-page .assigned-cell {
    min-width: 220px !important;
    width: 220px !important;
}

.client-leads-page .status-cell {
    min-width: 105px !important;
    white-space: nowrap !important;
}

.client-leads-page .action-cell {
    min-width: 110px !important;
    white-space: nowrap !important;
}

.cp-leads-page .cp-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e9edf3;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.cp-leads-page .cp-card-body {
    padding: 16px;
}

.cp-leads-page .cp-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #edf1f7;
    border-radius: 12px;
    background: #fff;
}

.client-leads-page .dataTables_wrapper .dataTables_scrollBody,
.cp-leads-page .dataTables_wrapper .dataTables_scrollBody {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.cp-leads-page .cp-table {
    width: 100% !important;
    min-width: 1280px;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.cp-leads-page .cp-table thead th {
    background: #f8fafc !important;
    color: #111827 !important;
    white-space: nowrap;
    font-weight: 700;
    font-size: 12.5px;
    padding: 12px 10px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.cp-leads-page .cp-table tbody td {
    background: #fff !important;
    color: #111827 !important;
    font-size: 12.5px;
    padding: 10px !important;
    border-top: 1px solid #f1f5f9 !important;
}

.cp-leads-page .cp-col-id { min-width: 55px; width: 55px; text-align: center; }
.cp-leads-page .cp-col-name { min-width: 160px; }
.cp-leads-page .cp-col-company { min-width: 150px; }
.cp-leads-page .cp-col-phone { min-width: 120px; }
.cp-leads-page .cp-col-email { min-width: 180px; }
.cp-leads-page .cp-col-city { min-width: 110px; }
.cp-leads-page .cp-col-project { min-width: 160px; }
.cp-leads-page .cp-col-type { min-width: 120px; }
.cp-leads-page .cp-col-source { min-width: 120px; }
.cp-leads-page .cp-col-assigned { min-width: 220px; width: 220px; }

.client-leads-page .dataTables_wrapper .dataTables_filter,
.cp-leads-page .dataTables_wrapper .dataTables_filter {
    display: none !important;
}

.client-leads-page .filter-actions,
.cp-leads-page .cp-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.client-leads-page .filter-actions .btn,
.cp-leads-page .cp-filter-actions .btn {
    min-width: 110px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 700;
}

.crm-assignment-flow-view .crm-assignment-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.crm-assignment-flow-view .crm-assignment-overview-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 16px;
}

.crm-assignment-flow-view .crm-assignment-overview-label {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.crm-assignment-flow-view .crm-assignment-overview-card strong {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.5;
}

.crm-assignment-flow-view .crm-assignment-timeline {
    display: grid;
    gap: 14px;
}

.crm-assignment-flow-view .crm-assignment-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 14px;
    align-items: start;
}

.crm-assignment-flow-view .crm-assignment-step-marker {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.crm-assignment-flow-view .crm-assignment-step-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    padding: 16px;
}

.crm-assignment-flow-view .crm-assignment-step-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 10px;
}

.crm-assignment-flow-view .crm-assignment-step-top strong {
    color: #0f172a;
    font-size: 15px;
}

.crm-assignment-flow-view .crm-assignment-step-meta {
    display: grid;
    gap: 8px;
    color: #334155;
    font-size: 13px;
}

.crm-assignment-flow-view .crm-assignment-step-meta span {
    color: #64748b;
    font-weight: 700;
    margin-right: 6px;
}

.crm-detail-view .crm-assignment-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.crm-detail-view .crm-assignment-step-marker {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.crm-detail-view .crm-assignment-step-meta {
    display: grid;
    gap: 8px;
    color: #334155;
    font-size: 13px;
}

.crm-detail-view .crm-assignment-step-meta span {
    color: #64748b;
    font-weight: 700;
    margin-right: 6px;
}

.crm-detail-view .crm-assignment-timeline {
    display: grid;
    gap: 12px;
}

.crm-detail-view .crm-assignment-history-heading {
    margin: 2px 0 12px;
    color: #1b3044;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.crm-detail-view .crm-section-collapsible {
    overflow: hidden;
}

.crm-detail-view .crm-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #fbf8f3 0%, #f3f6fa 100%);
}

.crm-detail-view .crm-section-toggle::-webkit-details-marker {
    display: none;
}

.crm-detail-view .crm-section-toggle strong {
    display: block;
    color: #1b3044;
    font-size: 16px;
    font-weight: 800;
}

.crm-detail-view .crm-section-toggle small {
    display: block;
    margin-top: 4px;
    color: #738396;
    font-size: 12px;
    line-height: 1.5;
}

.crm-detail-view .crm-section-toggle-icon {
    position: relative;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #d7e0ea;
    background: #fff;
}

.crm-detail-view .crm-section-toggle-icon::before,
.crm-detail-view .crm-section-toggle-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    background: #36506a;
    border-radius: 999px;
    transform-origin: center;
    transition: transform 0.2s ease;
}

.crm-detail-view .crm-section-toggle-icon::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.crm-detail-view .crm-section-toggle-icon::after {
    transform: translate(-30%, -50%) rotate(-45deg);
}

.crm-detail-view .crm-section-collapsible[open] .crm-section-toggle-icon::before {
    transform: translate(-70%, -50%) rotate(-45deg);
}

.crm-detail-view .crm-section-collapsible[open] .crm-section-toggle-icon::after {
    transform: translate(-30%, -50%) rotate(45deg);
}

.crm-detail-view .crm-section-collapsible .crm-section-body {
    border-top: 1px solid rgba(216, 224, 235, 0.92);
}

.crm-detail-view .crm-assignment-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.crm-detail-view .crm-assignment-accordion-summary {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: #f8fafc;
}

.crm-detail-view .crm-assignment-accordion-summary::-webkit-details-marker {
    display: none;
}

.crm-detail-view .crm-assignment-accordion-summary strong {
    color: #0f172a;
    font-size: 14px;
}

.crm-detail-view .crm-assignment-accordion-body {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.users-page,
.users-page .page-wrapper,
.users-page .container-fluid {
    background: #f5f7fb;
}

.users-page .stats-card {
    transition: all 0.22s ease;
}

.users-page .card,
.users-page .users-panel,
.users-page .stats-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.users-page .users-panel .card-body {
    padding: 22px;
}

.users-page .stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.users-page .stats-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2563eb;
    background: #e0ecff;
    border: 1px solid #bfdbfe;
}

.users-page .users-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.users-page #myTable {
    width: 100% !important;
    margin-bottom: 0 !important;
}

.users-page #myTable thead th {
    background: #f8fafc;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 14px 12px;
    white-space: nowrap;
}

.users-page #myTable tbody td {
    padding: 14px 12px;
    vertical-align: middle !important;
    color: #374151;
    font-size: 14px;
    border-color: #edf2f7 !important;
    background: #ffffff;
}

.users-page #myTable tbody tr:hover td {
    background: #f8fbff;
}

.users-page .user-name {
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.users-page .user-meta {
    font-size: 12px;
    color: #6b7280;
}

.users-page .soft-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #e0ecff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.users-page .soft-count.gray {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #6b7280;
}

.users-page .col-name { min-width: 190px; }
.users-page .col-username { min-width: 120px; }
.users-page .col-email { min-width: 220px; white-space: normal !important; word-break: break-word; }
.users-page .col-phone { min-width: 130px; }
.users-page .col-reports { min-width: 150px; white-space: normal !important; }
.users-page .col-actions { min-width: 220px; }

.users-page .status-badge,
.users-page .role-badge,
.users-page .access-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 10px;
    margin: 2px 4px 2px 0;
}

.users-page .badge-approved { background: #dcfce7; color: #166534; }
.users-page .badge-pending { background: #fef3c7; color: #92400e; }
.users-page .badge-rejected { background: #fee2e2; color: #b91c1c; }
.users-page .badge-inactive { background: #f3f4f6; color: #6b7280; }
.users-page .badge-role-dark { background: #2563eb; color: #ffffff; }
.users-page .badge-role-primary { background: #dbeafe; color: #1d4ed8; }
.users-page .badge-role-info { background: #f3f4f6; color: #4b5563; }
.users-page .access-pill.full { background: #2563eb; color: #ffffff; }
.users-page .access-pill.client,
.users-page .access-pill.cp,
.users-page .access-pill.report,
.users-page .access-pill.user {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.users-page .action-btns {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.users-page .action-btns .btn {
    white-space: nowrap;
}

.users-page .action-btns .dropdown,
.users-page .action-btns .btn {
    flex: 0 0 auto;
}

.users-page .action-btns .dropdown-toggle {
    min-width: 108px;
}

.users-page .users-table-wrap .table td:nth-child(1),
.users-page .users-table-wrap .table th:nth-child(1),
.users-page .users-table-wrap .table td:nth-child(8),
.users-page .users-table-wrap .table th:nth-child(8),
.users-page .users-table-wrap .table td:nth-child(9),
.users-page .users-table-wrap .table th:nth-child(9) {
    text-align: center;
}

.users-page .users-table-wrap .table td:last-child,
.users-page .users-table-wrap .table th:last-child {
    text-align: left;
}

.users-page .action-btns .btn i,
.users-page .action-btns .btn .fa,
.users-page .action-btns .btn .fas,
.users-page .action-btns .btn .far,
.users-page .action-btns .btn .fab {
    margin-right: 0;
}

.users-page .view-user-modal .modal-dialog {
    max-width: 1040px;
    width: calc(100% - 32px);
    margin: 1rem auto;
}

.users-page .view-user-modal {
    z-index: 1065;
}

.users-page .view-user-modal .modal-dialog.modal-dialog-scrollable {
    max-height: calc(100vh - 32px);
}

.users-page .view-user-modal .modal-content {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    background: #ffffff;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

.users-page .view-user-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #102133 0%, #1f4564 65%, #2d6f73 100%);
    padding: 28px 30px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    position: sticky;
    top: 0;
    z-index: 3;
}

.users-page .view-user-top-copy {
    min-width: 0;
}

.users-page .view-user-top h4 {
    margin: 0;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
}

.users-page .view-user-sub {
    margin-top: 8px;
    color: rgba(255,255,255,0.82);
    font-size: 14px;
    line-height: 1.5;
}

.users-page .view-user-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.users-page .view-user-close:hover,
.users-page .view-user-close:focus {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    outline: none;
}

.users-page .view-user-body {
    background: #f8fafc;
    padding: 26px;
    overflow-y: auto;
    max-height: none;
    flex: 1 1 auto;
}

.users-page .view-user-highlights {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.users-page .view-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.users-page .view-highlight-box,
.users-page .view-user-card {
    background: #ffffff;
    border: 1px solid #e5edf5;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.users-page .view-highlight-box {
    padding: 18px;
}

.users-page .view-highlight-label,
.users-page .view-user-card .label {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.users-page .view-highlight-value {
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.users-page .view-user-card {
    padding: 18px 20px;
    min-height: 110px;
}

.users-page .view-user-card .value {
    color: #111827;
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
}

.users-page .view-user-access-panel {
    margin-top: 16px;
}

.users-page .view-user-access-panel .view-user-card {
    min-height: auto;
}

.users-page .access-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.users-page .access-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid #dbe4ee;
    background: #f8fafc;
    color: #475569;
}

.users-page .access-chip.access-yes {
    background: #e8f5ff;
    border-color: #c4e1ff;
    color: #0f4f8a;
}

.users-page .access-chip.access-no {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #6b7280;
}

.users-page .view-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.users-page .view-badge.role-admin,
.users-page .view-badge.status-approved {
    background: #dcfce7;
    color: #166534;
}

.users-page .view-badge.role-leader,
.users-page .view-badge.status-pending {
    background: #dbeafe;
    color: #1d4ed8;
}

.users-page .view-badge.role-staff {
    background: #f3f4f6;
    color: #4b5563;
}

.users-page .view-badge.status-inactive,
.users-page .view-badge.status-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.users-page .view-user-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 26px 24px;
    background: #ffffff;
    border-top: 1px solid #e5edf5;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.users-page .view-user-footer-note {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    max-width: 620px;
}

.crm-detail-view .crm-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.crm-detail-view .crm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.crm-detail-view .crm-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.crm-detail-view .crm-summary-card,
.crm-detail-view .crm-section,
.crm-detail-view .crm-box,
.crm-detail-view .crm-followup-card,
.crm-detail-view .crm-reference details {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
}

.crm-detail-view .crm-section-body {
    padding: 18px;
}

.crm-detail-view .crm-followup-card {
    border-left: 4px solid #0d6efd;
    padding: 16px;
    margin-bottom: 14px;
}

.settings-shell .section-card,
.integration-grid .integration-card {
    border-radius: 22px;
    background: #fff;
    border: 1px solid #dbe4ee;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.settings-shell .section-card {
    padding: 22px;
    margin-bottom: 18px;
}

.settings-shell .section-card h4 {
    margin-bottom: 6px;
}

.settings-shell .section-card p {
    color: #5f7185;
    margin-bottom: 18px;
}

.settings-anchor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.settings-anchor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe4ee;
    color: #102133;
    font-size: 13px;
    font-weight: 700;
}

.settings-grid,
.integration-form-grid,
.integration-grid {
    display: grid;
    gap: 16px;
}

.settings-grid,
.integration-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-grid-full,
.integration-form-grid .full {
    grid-column: 1 / -1;
}

.settings-note,
.integration-mini-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f7fafc;
    border: 1px solid #dbe4ee;
    color: #5f7185;
    font-size: 13px;
}

.settings-logo-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    min-width: 160px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid #dbe4ee;
    background: #fff;
}

.settings-logo-preview img {
    max-width: 140px;
    max-height: 54px;
}

.integration-card {
    overflow: hidden;
}

.integration-card-top {
    padding: 22px 22px 10px;
}

.integration-card-body {
    padding: 0 22px 22px;
}

.integration-status-row,
.integration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.integration-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.integration-badge.active {
    background: #dcfce7;
    color: #166534;
}

.integration-badge.coming_soon {
    background: #fef3c7;
    color: #92400e;
}

.integration-badge.disconnected,
.integration-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.crm-detail-view .crm-wrap {
    color: #212529;
}

.crm-detail-view .crm-alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin: 0;
    font-size: 14px;
}

.crm-detail-view .crm-alert-danger {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.crm-detail-view .crm-alert-warning {
    color: #664d03;
    background: #fff3cd;
    border: 1px solid #ffecb5;
}

.crm-detail-view .crm-header {
    margin-bottom: 18px;
}

.crm-detail-view .crm-header h3 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2d3d;
}

.crm-detail-view .crm-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.crm-detail-view .crm-summary-card {
    padding: 15px;
}

.crm-detail-view .crm-summary-card small,
.crm-detail-view .crm-box small {
    display: block;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: .3px;
}

.crm-detail-view .crm-summary-card strong,
.crm-detail-view .crm-box div,
.crm-detail-view .crm-box strong {
    color: #212529;
    font-size: 14px;
    word-break: break-word;
    line-height: 1.6;
}

.crm-detail-view .crm-section-head {
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f4;
    background: #f8f9fa;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.crm-detail-view .crm-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.crm-detail-view .crm-badge-primary { background: #e8f1ff; color: #0d6efd; }
.crm-detail-view .crm-badge-warning { background: #fff3cd; color: #946200; }
.crm-detail-view .crm-badge-info { background: #d1ecf1; color: #0c5460; }
.crm-detail-view .crm-badge-success { background: #d4edda; color: #155724; }
.crm-detail-view .crm-badge-danger { background: #f8d7da; color: #842029; }
.crm-detail-view .crm-badge-dark { background: #d6d8db; color: #1b1e21; }
.crm-detail-view .crm-badge-secondary { background: #ececec; color: #555; }

.crm-detail-view .crm-followup-note {
    background: #fff8e1;
    border: 1px solid #f7e3a1;
    color: #7a5b00;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}

.crm-detail-view .crm-followup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.crm-detail-view .crm-followup-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.crm-detail-view .crm-followup-lock {
    background: #eaf7ef;
    color: #198754;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.crm-detail-view .crm-followup-meta {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.crm-detail-view .crm-followup-text {
    color: #212529;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.crm-detail-view .crm-empty {
    background: #f8f9fa;
    border: 1px dashed #d8dee4;
    border-radius: 12px;
    padding: 18px;
    color: #6c757d;
    text-align: center;
}

.report-page .dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-page .report-hero {
    border-radius: 18px;
    padding: 20px;
    background: linear-gradient(135deg, #14532d, #0f766e);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.report-page .report-hero-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.report-page .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.report-page .section-card .card-body {
    padding: 16px !important;
}

.report-page .section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 14px;
}

.crm-checkbox-inline label {
    margin-right: 14px;
}

@media (max-width: 991px) {
    .integration-grid,
    .integration-form-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .crm-edit-page .top-summary-grid,
    .crm-edit-page .followup-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .crm-form-page .form-card .card-body,
    .crm-edit-page .edit-card .card-body,
    .crm-edit-page .history-card .card-body,
    .crm-edit-page .additional-card .card-body,
    .crm-edit-page .summary-card .card-body {
        padding: 18px;
    }
}

@media (max-width: 767px) {
    .client-leads-page .top-actions,
    .client-leads-page .filter-actions,
    .cp-leads-page .cp-top-actions,
    .cp-leads-page .cp-filter-actions {
        width: 100%;
    }

    .client-leads-page .top-actions .btn,
    .client-leads-page .filter-actions .btn,
    .cp-leads-page .cp-top-actions .btn,
    .cp-leads-page .cp-filter-actions .btn {
        width: 100%;
    }

    .users-page .view-user-highlights,
    .users-page .view-user-grid,
    .dashboard-page .dashboard-summary-grid,
    .dashboard-page .dashboard-status-grid,
    .crm-detail-view .crm-summary-strip,
    .crm-detail-view .crm-grid,
    .crm-detail-view .crm-grid-3 {
        grid-template-columns: 1fr;
    }

    .users-page .view-user-top,
    .users-page .view-user-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .users-page .view-user-close {
        align-self: flex-end;
    }

    .users-page .view-user-modal .modal-dialog {
        width: calc(100% - 20px);
        margin: 0.75rem auto;
    }

    .users-page .view-user-modal .modal-content {
        max-height: calc(100vh - 24px);
    }

    .users-page .view-user-body {
        padding: 20px;
    }

    .dashboard-page .dashboard-status-card strong,
    .dashboard-page .dashboard-summary-card strong {
        font-size: 24px;
    }
}

/* Lead popup and table refinement overrides */
.crm-detail-view .crm-wrap {
    color: var(--crm-text);
    padding: 6px 2px 4px;
}

.crm-detail-view .crm-summary-strip {
    gap: 16px;
    margin-bottom: 22px;
}

.crm-detail-view .crm-grid,
.crm-detail-view .crm-grid-3 {
    gap: 16px;
}

.crm-detail-view .crm-summary-card,
.crm-detail-view .crm-section,
.crm-detail-view .crm-box,
.crm-detail-view .crm-followup-card,
.crm-detail-view .crm-reference details {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    border: 1px solid rgba(216, 224, 235, 0.9);
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.crm-detail-view .crm-section-body {
    padding: 20px;
}

.crm-detail-view .crm-followup-card {
    border-left: 4px solid var(--crm-accent);
    padding: 16px 18px;
    margin-bottom: 14px;
}

.crm-detail-view .crm-header {
    margin-bottom: 18px;
    padding-right: 52px;
}

.crm-detail-view .crm-header h3 {
    margin: 0 0 8px 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    color: #182a3d;
}

.crm-detail-view .crm-header p {
    color: var(--crm-muted);
    font-size: 15px;
    line-height: 1.6;
}

.crm-detail-view .crm-summary-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 128px;
    padding: 18px 18px 16px;
}

.crm-detail-view .crm-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--crm-accent), rgba(22, 40, 59, 0.28));
}

.crm-detail-view .crm-summary-card small,
.crm-detail-view .crm-box small {
    color: #738396;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

.crm-detail-view .crm-summary-card strong,
.crm-detail-view .crm-box div,
.crm-detail-view .crm-box strong {
    color: var(--crm-text);
    font-size: 15px;
    line-height: 1.55;
}

.crm-detail-view .crm-summary-card strong {
    display: block;
    min-height: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
}

.crm-detail-view .crm-box {
    padding: 14px 16px;
}

.crm-detail-view .crm-box div,
.crm-detail-view .crm-box strong {
    margin: 0;
}

.crm-detail-view .crm-section-head {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(216, 224, 235, 0.92);
    background: linear-gradient(180deg, #fbf8f3 0%, #f3f6fa 100%);
    font-size: 17px;
    font-weight: 800;
    color: #1b3044;
}

.crm-detail-view .crm-badge {
    padding: 7px 12px;
}

.crm-detail-view .crm-badge-primary { background: #e8f0ff; color: #255fcf; }
.crm-detail-view .crm-badge-warning { background: #fff0cb; color: #8d6504; }
.crm-detail-view .crm-badge-info { background: #d9eef7; color: #155e75; }
.crm-detail-view .crm-badge-success { background: #deefe1; color: #20613b; }
.crm-detail-view .crm-badge-danger { background: #f9dfdf; color: #912f2f; }
.crm-detail-view .crm-badge-dark { background: #dce1e8; color: #243547; }
.crm-detail-view .crm-badge-secondary { background: #ece7de; color: #665949; }

.crm-detail-view .crm-followup-note {
    background: linear-gradient(180deg, #fff9ea 0%, #fff2cc 100%);
    border: 1px solid #f0ddb0;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.crm-detail-view .crm-followup-title {
    font-weight: 800;
    color: var(--crm-text);
}

.crm-detail-view .crm-followup-lock {
    background: #e7f2e9;
    color: #20613b;
    padding: 6px 11px;
}

.crm-detail-view .crm-followup-meta {
    color: var(--crm-muted);
}

.crm-detail-view .crm-followup-text {
    color: var(--crm-text);
}

.crm-detail-view .crm-empty {
    background: linear-gradient(180deg, #fbf8f3 0%, #f4f7fa 100%);
    border: 1px dashed #ccd6e2;
    border-radius: 18px;
    padding: 24px;
    color: var(--crm-muted);
}

.lead-modal-overlay {
    display: none;
    position: fixed;
    z-index: 100000;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: rgba(10, 18, 30, 0.54);
    backdrop-filter: blur(7px);
}

.lead-modal-box {
    position: relative;
    width: min(980px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    padding: 22px 22px 18px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(231, 236, 243, 0.98);
    background:
        radial-gradient(circle at top right, rgba(185, 133, 70, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
    box-shadow: 0 34px 80px rgba(15, 23, 42, 0.28);
}

.lead-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(216, 224, 235, 0.96);
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff 0%, #f7f1e8 100%);
    color: #183049;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.lead-modal-content {
    color: var(--crm-text);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    padding-right: 8px;
}

.lead-modal-content::-webkit-scrollbar {
    width: 9px;
}

.lead-modal-content::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 999px;
}

.lead-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c6d0dd 0%, #aab7c7 100%);
    border-radius: 999px;
}

.lead-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b3bfce 0%, #8ea1b7 100%);
}

.client-leads-page .action-btns,
.cp-leads-page .cp-action-btns {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    width: max-content;
}

.client-leads-page .action-btns .btn,
.cp-leads-page .cp-action-btns .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 12px !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

.client-leads-page .action-cell {
    min-width: 118px !important;
    width: 118px !important;
}

.cp-leads-page .cp-col-action {
    min-width: 118px !important;
    width: 118px !important;
    text-align: center;
    white-space: nowrap !important;
}

.client-leads-page .table-responsive,
.cp-leads-page .cp-table-wrap {
    border: 1px solid rgba(216, 224, 235, 0.95);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.client-leads-page .table thead th,
.cp-leads-page .cp-table thead th {
    background: linear-gradient(180deg, #fbf8f3 0%, #f2f6fb 100%) !important;
    color: #1b3044 !important;
    font-weight: 800;
}

.client-leads-page .table tbody tr:hover td,
.cp-leads-page .cp-table tbody tr:hover td {
    background: #fcf7f1 !important;
}

@media (max-width: 991px) {
    .crm-detail-view .crm-summary-strip,
    .crm-detail-view .crm-grid,
    .crm-detail-view .crm-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .lead-modal-overlay {
        padding: 14px;
    }

    .lead-modal-box {
        width: calc(100vw - 28px);
        max-height: calc(100vh - 28px);
        padding: 16px 16px 14px;
        border-radius: 20px;
    }

    .lead-modal-content {
        max-height: calc(100vh - 82px);
        padding-right: 6px;
    }

    .crm-detail-view .crm-header {
        padding-right: 44px;
    }

    .crm-detail-view .crm-header h3 {
        font-size: 24px;
    }

    .crm-detail-view .crm-header p {
        font-size: 13px;
    }

    .crm-detail-view .crm-summary-strip,
    .crm-detail-view .crm-grid,
    .crm-detail-view .crm-grid-3 {
        grid-template-columns: 1fr;
    }

    .crm-detail-view .crm-summary-card {
        min-height: auto;
    }
}

.dashboard-page .dashboard-hero {
    margin-bottom: 16px;
}

.dashboard-page .dashboard-actions-grid {
    margin-bottom: 12px;
}

.dashboard-page .dashboard-summary-grid,
.dashboard-page .dashboard-status-grid,
.dashboard-page .dashboard-role-blocks {
    gap: 12px;
}

.dashboard-page .dashboard-summary-grid {
    margin-top: 12px;
}

.dashboard-page .dashboard-status-grid {
    margin-bottom: 16px;
}

.dashboard-page .dashboard-summary-card,
.dashboard-page .dashboard-status-card {
    padding: 14px;
    border-radius: 14px;
}

.dashboard-page .dashboard-summary-label {
    margin-bottom: 8px;
    font-size: 10px;
}

.dashboard-page .dashboard-summary-card strong,
.dashboard-page .dashboard-status-card strong {
    font-size: 22px;
}

.dashboard-page .dashboard-summary-card small,
.dashboard-page .dashboard-status-card small {
    margin-top: 8px;
    font-size: 11px;
}

.dashboard-page .dashboard-kicker {
    min-height: 26px;
    padding: 0 10px;
    margin-bottom: 10px;
    font-size: 10px;
}

.dashboard-page .dashboard-chart-wrap,
.dashboard-page .dashboard-chart-empty {
    min-height: 220px;
}

.dashboard-page .dashboard-followup-list {
    gap: 10px;
}

.dashboard-page .dashboard-followup-item {
    border-radius: 12px;
    padding: 12px;
}

.dashboard-page .dashboard-followup-top {
    margin-bottom: 6px;
}

.dashboard-page .dashboard-followup-top strong {
    font-size: 13px;
}

.dashboard-page .dashboard-followup-meta {
    font-size: 12px;
}

.dashboard-page .dashboard-followup-date {
    font-size: 13px;
    margin: 6px 0 4px;
}

.dashboard-page .dashboard-followup-card .card-body,
.dashboard-page .dashboard .card .card-body {
    padding: 16px;
}

.crm-form-page .form-card .card-body,
.crm-edit-page .edit-card .card-body,
.crm-edit-page .history-card .card-body,
.crm-edit-page .additional-card .card-body,
.crm-edit-page .summary-card .card-body {
    padding: 18px;
}

.crm-form-page .info-note,
.crm-form-page .crm-info-note,
.crm-edit-page .note-box {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

.crm-form-page .form-control,
.crm-form-page .form-control:focus,
.crm-form-page select.form-control,
.crm-edit-page .form-control,
.crm-edit-page .form-control:focus,
.crm-edit-page select.form-control,
.crm-edit-page textarea.form-control {
    min-height: 38px;
}

.crm-form-page textarea.form-control,
.crm-edit-page textarea.form-control {
    min-height: 88px;
}

.crm-form-page .form-group label,
.crm-edit-page .form-group label {
    margin-bottom: 6px;
}

.crm-edit-page .crm-section-title {
    font-size: 16px;
    margin-bottom: 12px;
}

.crm-edit-page .crm-subtitle {
    font-size: 12px;
    margin-bottom: 12px;
}

.crm-edit-page .section-divider {
    margin: 6px 0 14px;
}

.crm-edit-page .top-summary-grid,
.crm-edit-page .followup-meta-grid {
    gap: 10px;
}

.crm-edit-page .summary-box,
.crm-edit-page .followup-box {
    border-radius: 12px;
    padding: 12px;
}

.crm-edit-page .summary-label {
    margin-bottom: 6px;
    font-size: 10px;
}

.crm-edit-page .summary-value {
    font-size: 15px;
}

.crm-edit-page .status-pill {
    padding: 6px 10px;
    font-size: 11px;
}

.crm-edit-page .followup-title {
    font-size: 14px;
}

.lead-modal-overlay {
    padding: 16px;
}

.lead-modal-box {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 16px 16px 14px;
    border-radius: 18px;
}

.lead-modal-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 24px;
}

.lead-modal-content {
    max-height: calc(100vh - 72px);
}

.client-leads-page .action-btns,
.cp-leads-page .cp-action-btns {
    gap: 6px !important;
}

.client-leads-page .action-btns .btn,
.cp-leads-page .cp-action-btns .btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border-radius: 10px !important;
}

.client-leads-page .action-cell,
.cp-leads-page .cp-col-action {
    min-width: 102px !important;
    width: 102px !important;
}

.client-leads-page .table-responsive,
.cp-leads-page .cp-table-wrap {
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

@media (max-width: 1199px) {
    .dashboard-page .dashboard-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .crm-edit-page .edit-page-wrap {
        max-width: 100%;
    }

    .crm-edit-page .top-summary-grid,
    .crm-edit-page .followup-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .dashboard-page .dashboard-summary-grid,
    .dashboard-page .dashboard-status-grid,
    .crm-edit-page .top-summary-grid,
    .crm-edit-page .followup-meta-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-page .dashboard .card .card-body,
    .crm-form-page .form-card .card-body,
    .crm-edit-page .edit-card .card-body,
    .crm-edit-page .history-card .card-body,
    .crm-edit-page .additional-card .card-body,
    .crm-edit-page .summary-card .card-body {
        padding: 14px;
    }
}

/* Cohesive page-level mobile polish */
.report-page .report-shell,
.client-leads-page .container-fluid,
.cp-leads-page .container-fluid,
.dashboard-page .container-fluid {
    min-width: 0;
}

.report-page .report-hero-meta,
.report-page .report-toolbar,
.report-page .report-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.report-page .report-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 991px) {
    .dashboard-page .crm-kpi-grid,
    .client-leads-page .crm-kpi-grid,
    .cp-leads-page .crm-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-leads-page .filters-row,
    .client-leads-page .filters-toolbar,
    .cp-leads-page .cp-filters-row,
    .report-page .filters-row,
    .crm-assignment-flow-view .crm-assignment-overview {
        grid-template-columns: 1fr;
    }

    .client-leads-page .filter-group,
    .cp-leads-page .cp-filter-group,
    .report-page .filter-group {
        min-width: 0;
    }

    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions,
    .report-page .filter-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .report-page .report-hero {
        padding: 18px;
        border-radius: 16px;
    }

    .report-page .section-card,
    .client-leads-page .card,
    .cp-leads-page .cp-card,
    .dashboard-page .card {
        border-radius: 16px;
    }

    .client-leads-page .assigned-cell,
    .cp-leads-page .cp-col-assigned {
        min-width: 220px !important;
        width: 220px !important;
    }

    .client-leads-page .action-btns .btn,
    .cp-leads-page .cp-action-btns .btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
    }
}

@media (max-width: 767px) {
    .dashboard-page .crm-hero,
    .client-leads-page .crm-hero,
    .cp-leads-page .crm-hero,
    .report-page .report-hero {
        border-radius: 16px;
    }

    .dashboard-page .crm-chip-row,
    .client-leads-page .crm-chip-row,
    .cp-leads-page .crm-chip-row {
        gap: 8px;
    }

    .dashboard-page .crm-chip,
    .client-leads-page .crm-chip,
    .cp-leads-page .crm-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-page .crm-kpi-grid,
    .client-leads-page .crm-kpi-grid,
    .cp-leads-page .crm-kpi-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-page .dashboard-chart-wrap,
    .dashboard-page .dashboard-chart-empty,
    .report-page canvas {
        min-height: 210px;
    }

    .dashboard-page .dashboard-followup-top,
    .report-page .report-hero-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card,
    .report-page .filter-panel {
        padding: 12px;
        border-radius: 14px;
    }

    .client-leads-page .crm-filter-scope,
    .cp-leads-page .crm-filter-scope {
        margin-bottom: 12px;
    }

    .client-leads-page .crm-filter-scope .filter-group,
    .cp-leads-page .crm-filter-scope .cp-filter-group,
    .client-leads-page .filters-toolbar,
    .cp-leads-page .cp-filters-row {
        width: 100% !important;
        max-width: none !important;
    }

    .client-leads-page .filters-row,
    .client-leads-page .filters-toolbar,
    .cp-leads-page .cp-filters-row,
    .report-page .filters-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .client-leads-page .filter-group,
    .cp-leads-page .cp-filter-group {
        grid-column: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .client-leads-page .filter-group label,
    .cp-leads-page .cp-filter-group label {
        display: block;
        width: 100%;
        margin-bottom: 6px;
        line-height: 1.4;
        white-space: normal !important;
        word-break: normal !important;
    }

    .client-leads-page .filter-group .form-control,
    .cp-leads-page .cp-filter-group .form-control {
        width: 100% !important;
        min-width: 0 !important;
    }

    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions,
    .report-page .filter-actions,
    .client-leads-page .top-actions,
    .cp-leads-page .cp-top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .client-leads-page .filter-actions .btn,
    .cp-leads-page .cp-filter-actions .btn,
    .report-page .filter-actions .btn,
    .client-leads-page .top-actions .btn,
    .cp-leads-page .cp-top-actions .btn {
        width: 100%;
    }

    .client-leads-page .page-head-wrap,
    .cp-leads-page .cp-page-head,
    .report-page .report-toolbar {
        align-items: stretch;
    }

    .client-leads-page .table-responsive,
    .cp-leads-page .cp-table-wrap,
    .report-page .report-table-wrap {
        margin-left: -2px;
        margin-right: -2px;
        border-radius: 14px;
    }

    .client-leads-page .assigned-cell,
    .cp-leads-page .cp-col-assigned {
        min-width: 200px !important;
        width: 200px !important;
    }

    .crm-assignment-flow-view .crm-assignment-step-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .crm-detail-view .crm-assignment-accordion-summary {
        grid-template-columns: 1fr;
    }

    .lead-modal-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .lead-modal-box {
        width: 100%;
        max-height: min(86vh, 760px);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

@media (max-width: 575px) {
    .report-page .report-pill,
    .report-page .hero-badge {
        width: 100%;
        justify-content: flex-start;
    }

    .report-page .report-toolbar-group,
    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions,
    .report-page .filter-actions,
    .client-leads-page .top-actions,
    .cp-leads-page .cp-top-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-leads-page .action-btns,
    .cp-leads-page .cp-action-btns {
        width: auto;
        min-width: max-content;
    }
}

/* Cross-page compact polish */
.dashboard-page .crm-hero,
.client-leads-page .crm-hero,
.cp-leads-page .crm-hero,
.report-page .report-hero {
    padding: 18px;
    border-radius: 18px;
}

.dashboard-page .crm-chip-row,
.client-leads-page .crm-chip-row,
.cp-leads-page .crm-chip-row,
.report-page .report-toolbar {
    gap: 10px;
}

.dashboard-page .crm-kpi-card,
.client-leads-page .crm-kpi-card,
.cp-leads-page .crm-kpi-card,
.report-page .summary-card {
    border-radius: 16px;
}

.dashboard-page .crm-kpi-card .card-body,
.client-leads-page .crm-kpi-card .card-body,
.cp-leads-page .crm-kpi-card .card-body,
.report-page .summary-card .card-body {
    padding: 14px !important;
}

.client-leads-page .filters-card,
.cp-leads-page .cp-filters-card,
.report-page .filter-panel {
    padding: 14px;
    border-radius: 16px;
}

.client-leads-page .page-head-wrap,
.cp-leads-page .cp-page-head,
.report-page .report-hero-top,
.dashboard-page .dashboard-followup-top {
    gap: 10px;
}

.client-leads-page .top-actions,
.cp-leads-page .cp-top-actions,
.report-page .filter-actions {
    gap: 8px;
}

.client-leads-page .action-btns,
.cp-leads-page .cp-action-btns {
    gap: 6px;
}

@media (max-width: 991px) {
    .dashboard-page .crm-hero,
    .client-leads-page .crm-hero,
    .cp-leads-page .crm-hero,
    .report-page .report-hero {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 767px) {
    .dashboard-page .crm-hero,
    .client-leads-page .crm-hero,
    .cp-leads-page .crm-hero,
    .report-page .report-hero {
        padding: 14px;
        border-radius: 14px;
    }

    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card,
    .report-page .filter-panel {
        padding: 12px;
        border-radius: 14px;
    }
}

/* Shared CRM layout tightening */
.dashboard-page .container-fluid,
.client-leads-page .container-fluid,
.cp-leads-page .container-fluid {
    padding-top: 0 !important;
}

.dashboard-page .crm-hero,
.client-leads-page .crm-hero,
.cp-leads-page .crm-hero {
    margin-bottom: 12px;
}

.dashboard-page .crm-kpi-grid,
.client-leads-page .crm-kpi-grid,
.cp-leads-page .crm-kpi-grid {
    margin: 12px 0;
    gap: 12px;
}

.dashboard-page .crm-kpi-card,
.client-leads-page .crm-kpi-card,
.cp-leads-page .crm-kpi-card {
    min-height: 132px;
    padding: 14px;
}

.dashboard-page .crm-kpi-card .crm-kpi-value,
.client-leads-page .crm-kpi-card .crm-kpi-value,
.cp-leads-page .crm-kpi-card .crm-kpi-value {
    font-size: 24px;
}

.client-leads-page .page-head-wrap,
.cp-leads-page .cp-page-head {
    margin-bottom: 10px;
    align-items: center;
}

.client-leads-page .filters-card,
.cp-leads-page .cp-filters-card {
    margin-bottom: 12px;
}

.client-leads-page .table-responsive,
.cp-leads-page .cp-table-wrap {
    border-radius: 14px;
}

.client-leads-page .action-btns,
.cp-leads-page .cp-action-btns {
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

/* Shared lead status colors and mobile-safe table actions */
.status-badge,
.cp-status-badge,
.crm-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 22px;
    padding: 5px 9px !important;
    border-radius: 999px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

.status-badge.badge-primary,
.cp-status-badge.badge-primary,
.crm-badge.crm-badge-primary {
    background: #e7f0ff !important;
    color: #0b57d0 !important;
}

.status-badge.badge-success,
.cp-status-badge.badge-success,
.crm-badge.crm-badge-success {
    background: #dff7ea !important;
    color: #137333 !important;
}

.status-badge.badge-danger,
.cp-status-badge.badge-danger,
.crm-badge.crm-badge-danger {
    background: #fde7e9 !important;
    color: #b3261e !important;
}

.status-badge.badge-secondary,
.cp-status-badge.badge-secondary,
.crm-badge.crm-badge-secondary {
    background: #eef2f7 !important;
    color: #405064 !important;
}

.client-leads-page .action-cell,
.cp-leads-page .cp-col-action {
    overflow: visible !important;
    vertical-align: middle !important;
}

.client-leads-page .action-btns,
.cp-leads-page .cp-action-btns {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    min-width: max-content !important;
    width: max-content !important;
    overflow: visible !important;
    padding: 2px !important;
    line-height: 1 !important;
}

.client-leads-page .action-btns .btn,
.cp-leads-page .cp-action-btns .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    line-height: 1 !important;
    overflow: visible !important;
}

.client-leads-page .action-btns .btn i,
.cp-leads-page .cp-action-btns .btn i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1em;
    height: 1em;
    line-height: 1 !important;
    margin: 0 !important;
}

@media (max-width: 575px) {
    .client-leads-page .action-cell,
    .cp-leads-page .cp-col-action {
        min-width: 134px !important;
        width: 134px !important;
    }

    .client-leads-page .action-btns,
    .cp-leads-page .cp-action-btns {
        gap: 7px !important;
        padding: 3px !important;
    }
}

.client-leads-page .action-btns .btn,
.cp-leads-page .cp-action-btns .btn {
    min-width: 36px;
}

.client-leads-page .assign-form,
.cp-leads-page .cp-assign-form {
    display: grid;
    gap: 8px;
}

.client-leads-page .assign-inline-row,
.cp-leads-page .cp-assign-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.client-leads-page .assign-top-row,
.cp-leads-page .cp-assign-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.client-leads-page .assigned-select,
.cp-leads-page .cp-assigned-select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px !important;
}

.client-leads-page .reassign-btn,
.cp-leads-page .cp-reassign-btn {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 10px;
}

.client-leads-page .crm-kpi-card-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.client-leads-page .crm-kpi-card-link:hover,
.client-leads-page .crm-kpi-card-link:focus {
    color: inherit;
    border-color: rgba(183, 110, 34, 0.26);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.client-leads-page .crm-kpi-card-link.is-active {
    border-color: rgba(183, 110, 34, 0.4);
    box-shadow: 0 14px 30px rgba(183, 110, 34, 0.12);
}

@media (max-width: 991px) {
    .dashboard-page .crm-kpi-grid,
    .client-leads-page .crm-kpi-grid,
    .cp-leads-page .crm-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .dashboard-page .crm-kpi-grid,
    .client-leads-page .crm-kpi-grid,
    .cp-leads-page .crm-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-page .crm-kpi-card,
    .client-leads-page .crm-kpi-card,
    .cp-leads-page .crm-kpi-card {
        min-height: 0;
    }

    .client-leads-page .page-head-wrap,
    .cp-leads-page .cp-page-head {
        gap: 8px;
        margin-bottom: 8px;
    }

    .client-leads-page .table-responsive,
    .cp-leads-page .cp-table-wrap {
        border: 0;
        background: transparent;
    }

    .client-leads-page .assign-top-row,
    .cp-leads-page .cp-assign-top-row {
        align-items: flex-start;
    }

    .client-leads-page .assigned-select,
    .cp-leads-page .cp-assigned-select {
        font-size: 12px;
    }

    .client-leads-page .assign-inline-row,
    .cp-leads-page .cp-assign-inline-row {
        align-items: stretch;
    }

    .client-leads-page .assigned-select,
    .cp-leads-page .cp-assigned-select {
        min-height: 36px !important;
    }

    .client-leads-page .reassign-btn,
    .cp-leads-page .cp-reassign-btn {
        min-height: 36px;
        padding: 0 11px;
        border-radius: 10px;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .client-leads-page .container-fluid,
    .cp-leads-page .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .client-leads-page .page-titles,
    .cp-leads-page .page-titles {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .client-leads-page .card-body,
    .cp-leads-page .cp-card-body {
        padding: 10px 6px !important;
    }

    .client-leads-page .page-head-wrap,
    .cp-leads-page .cp-page-head {
        margin-bottom: 6px !important;
    }

    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card {
        margin-bottom: 10px !important;
        padding: 10px !important;
    }

    .client-leads-page .table-responsive,
    .cp-leads-page .cp-table-wrap {
        overflow: hidden !important;
        width: calc(100% + 12px) !important;
        max-width: none !important;
        margin-left: -6px !important;
        margin-right: -6px !important;
        border: 1px solid rgba(219, 228, 238, 0.9) !important;
        background: #ffffff !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .client-leads-page .dataTables_wrapper,
    .cp-leads-page .dataTables_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scroll,
    .cp-leads-page .dataTables_wrapper .dataTables_scroll {
        width: 100% !important;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scrollHead,
    .client-leads-page .dataTables_wrapper .dataTables_scrollHeadInner,
    .client-leads-page .dataTables_wrapper .dataTables_scrollBody,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollHead,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollHeadInner,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody {
        width: 100% !important;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scrollBody,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scrollHead table,
    .client-leads-page .dataTables_wrapper .dataTables_scrollBody table {
        width: 1360px !important;
        min-width: 1360px !important;
        table-layout: fixed;
    }

    .cp-leads-page .dataTables_wrapper .dataTables_scrollHead table,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody table {
        width: 1500px !important;
        min-width: 1500px !important;
        table-layout: fixed;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scrollHead th,
    .client-leads-page .dataTables_wrapper .dataTables_scrollBody td,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollHead th,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody td {
        white-space: nowrap !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(1),
    .client-leads-page #clientLeadsTable td:nth-child(1) {
        width: 52px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(2),
    .client-leads-page #clientLeadsTable td:nth-child(2) {
        width: 160px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(3),
    .client-leads-page #clientLeadsTable td:nth-child(3) {
        width: 130px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(4),
    .client-leads-page #clientLeadsTable td:nth-child(4) {
        width: 230px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(5),
    .client-leads-page #clientLeadsTable td:nth-child(5) {
        width: 100px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(6),
    .client-leads-page #clientLeadsTable td:nth-child(6) {
        width: 110px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(7),
    .client-leads-page #clientLeadsTable td:nth-child(7) {
        width: 90px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(8),
    .client-leads-page #clientLeadsTable td:nth-child(8) {
        width: 280px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(9),
    .client-leads-page #clientLeadsTable td:nth-child(9) {
        width: 120px !important;
    }

    .client-leads-page #clientLeadsTable th:nth-child(10),
    .client-leads-page #clientLeadsTable td:nth-child(10) {
        width: 138px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(1),
    .cp-leads-page #cpLeadsTable td:nth-child(1) {
        width: 52px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(2),
    .cp-leads-page #cpLeadsTable td:nth-child(2) {
        width: 170px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(3),
    .cp-leads-page #cpLeadsTable td:nth-child(3) {
        width: 170px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(4),
    .cp-leads-page #cpLeadsTable td:nth-child(4) {
        width: 130px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(5),
    .cp-leads-page #cpLeadsTable td:nth-child(5) {
        width: 210px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(6),
    .cp-leads-page #cpLeadsTable td:nth-child(6) {
        width: 110px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(7),
    .cp-leads-page #cpLeadsTable td:nth-child(7) {
        width: 120px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(8),
    .cp-leads-page #cpLeadsTable td:nth-child(8) {
        width: 100px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(9),
    .cp-leads-page #cpLeadsTable td:nth-child(9) {
        width: 90px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(10),
    .cp-leads-page #cpLeadsTable td:nth-child(10) {
        width: 280px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(11),
    .cp-leads-page #cpLeadsTable td:nth-child(11) {
        width: 120px !important;
    }

    .cp-leads-page #cpLeadsTable th:nth-child(12),
    .cp-leads-page #cpLeadsTable td:nth-child(12) {
        width: 140px !important;
    }

    .client-leads-page .assign-inline-row,
    .cp-leads-page .cp-assign-inline-row {
        align-items: center !important;
        flex-wrap: nowrap !important;
        min-width: 240px;
    }

    .client-leads-page .assigned-select,
    .cp-leads-page .cp-assigned-select {
        min-width: 170px;
        font-size: 12px;
    }

    .client-leads-page .status-cell,
    .cp-leads-page .cp-col-status {
        min-width: 120px;
        white-space: nowrap;
    }

.client-leads-page .action-cell,
.cp-leads-page .cp-col-action {
    min-width: 142px;
    white-space: nowrap;
    }
}

/* WordPress-style desktop listing toolbars */
@media (min-width: 992px) {
    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card,
    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        padding: 12px 14px;
        border-radius: 14px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
    }

    .client-leads-page .crm-filter-form,
    .cp-leads-page .crm-filter-form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 10px 12px;
    }

    .client-leads-page .crm-filter-scope,
    .cp-leads-page .crm-filter-scope,
    .client-leads-page .crm-filter-grid--lead-fields,
    .cp-leads-page .crm-filter-grid--lead-fields {
        display: contents;
    }

    .client-leads-page .crm-filter-grid--lead-search,
    .cp-leads-page .crm-filter-grid--lead-search {
        display: flex;
        flex: 1 1 540px;
        min-width: 470px;
        align-items: flex-end;
        gap: 10px 12px;
        margin-left: auto;
    }

    .client-leads-page .filter-group,
    .cp-leads-page .cp-filter-group {
        flex: 0 1 150px;
        min-width: 150px;
        margin-bottom: 0;
    }

    .client-leads-page .crm-filter-scope .filter-group,
    .cp-leads-page .crm-filter-scope .cp-filter-group {
        flex-basis: 140px;
        max-width: 168px;
    }

    .client-leads-page .filter-group.filter-group-search,
    .cp-leads-page .cp-filter-group.filter-group-search {
        flex: 1 1 300px;
        min-width: 280px;
    }

    .client-leads-page .filter-group label,
    .cp-leads-page .cp-filter-group label,
    .client-leads-page .crm-bulk-toolbar .form-group label,
    .cp-leads-page .crm-bulk-toolbar .form-group label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .client-leads-page .filter-group .form-control,
    .client-leads-page .filter-group select.form-control,
    .cp-leads-page .cp-filter-group .form-control,
    .client-leads-page .crm-bulk-toolbar .form-control,
    .cp-leads-page .crm-bulk-toolbar .form-control {
        min-height: 40px;
        height: 40px;
        border-radius: 8px;
        padding: 0 12px;
    }

    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        white-space: nowrap;
    }

    .client-leads-page .filter-actions .btn,
    .cp-leads-page .cp-filter-actions .btn,
    .client-leads-page .crm-bulk-toolbar__buttons .btn,
    .cp-leads-page .crm-bulk-toolbar__buttons .btn {
        min-width: 88px;
        min-height: 40px;
        height: 40px;
        padding: 0 14px;
        border-radius: 8px;
    }

    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
        margin-bottom: 12px;
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        display: flex;
        flex: 1 1 560px;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px 12px;
        min-width: 0;
    }

    .client-leads-page .crm-bulk-toolbar__controls .form-group,
    .cp-leads-page .crm-bulk-toolbar__controls .form-group {
        flex: 0 1 220px;
        min-width: 180px;
        margin-bottom: 0;
    }

    .client-leads-page .crm-bulk-toolbar__controls .form-group:first-child,
    .cp-leads-page .crm-bulk-toolbar__controls .form-group:first-child {
        flex-basis: 210px;
    }

    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .client-leads-page .crm-bulk-toolbar__buttons .btn-outline-secondary,
    .cp-leads-page .crm-bulk-toolbar__buttons .btn-outline-secondary {
        border-color: #d0d7e2;
        color: #5f6b7a;
        background: #ffffff;
    }

    .client-leads-page .crm-bulk-toolbar__buttons .btn-outline-secondary:hover,
    .cp-leads-page .crm-bulk-toolbar__buttons .btn-outline-secondary:hover {
        border-color: #bec8d6;
        color: #334155;
        background: #f8fafc;
    }

    .client-leads-page .crm-bulk-feedback,
    .cp-leads-page .crm-bulk-feedback {
        margin-top: 10px;
    }
}

/* Global CRM toolbar normalization */
@media (min-width: 992px) {
    .client-leads-page .crm-filter-form,
    .cp-leads-page .crm-filter-form {
        display: flex !important;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 10px 12px;
    }

    .client-leads-page .crm-filter-scope,
    .cp-leads-page .crm-filter-scope,
    .client-leads-page .crm-filter-grid--lead-fields,
    .cp-leads-page .crm-filter-grid--lead-fields,
    .client-leads-page .crm-filter-grid--lead-search,
    .cp-leads-page .crm-filter-grid--lead-search {
        display: contents;
    }

    .client-leads-page .filter-group,
    .cp-leads-page .cp-filter-group {
        flex: 0 1 118px;
        min-width: 118px;
        max-width: 136px;
        margin-bottom: 0;
    }

    .client-leads-page .crm-filter-scope .filter-group,
    .cp-leads-page .crm-filter-scope .cp-filter-group {
        flex-basis: 112px;
        max-width: 128px;
    }

    .client-leads-page .filter-group.filter-group-search,
    .cp-leads-page .cp-filter-group.filter-group-search {
        flex: 1 1 220px;
        min-width: 200px;
        max-width: none;
    }

    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions {
        margin-left: auto;
        flex-wrap: nowrap !important;
        align-self: flex-end;
        gap: 10px;
    }

    .client-leads-page .filter-actions .btn,
    .cp-leads-page .cp-filter-actions .btn {
        min-width: 100px;
    }

    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .client-leads-page .crm-bulk-toolbar__length,
    .cp-leads-page .crm-bulk-toolbar__length {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        min-width: max-content;
        white-space: nowrap;
    }

    .client-leads-page .crm-bulk-toolbar__length-text,
    .cp-leads-page .crm-bulk-toolbar__length-text {
        color: #0f172a;
        font-size: 12px;
        font-weight: 600;
    }

    .client-leads-page .crm-bulk-toolbar__length-select,
    .cp-leads-page .crm-bulk-toolbar__length-select {
        width: 72px;
        min-width: 72px;
        padding-right: 30px;
    }

    .client-leads-page .crm-bulk-toolbar__form,
    .cp-leads-page .crm-bulk-toolbar__form {
        display: grid;
        flex: 1 1 auto;
        justify-items: end;
        gap: 8px;
        min-width: 0;
        margin-left: auto;
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        display: flex;
        flex: 0 1 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
    }

    .client-leads-page .crm-bulk-toolbar__controls .form-group,
    .cp-leads-page .crm-bulk-toolbar__controls .form-group {
        flex: 0 1 180px;
        min-width: 160px;
        margin-bottom: 0;
    }

    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .client-leads-page .crm-bulk-feedback,
    .cp-leads-page .crm-bulk-feedback {
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 991px) {
    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar,
    .client-leads-page .crm-bulk-toolbar__form,
    .cp-leads-page .crm-bulk-toolbar__form,
    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .client-leads-page .crm-bulk-toolbar__length,
    .cp-leads-page .crm-bulk-toolbar__length {
        justify-content: flex-start;
    }

    .client-leads-page .crm-bulk-toolbar__controls .form-group,
    .cp-leads-page .crm-bulk-toolbar__controls .form-group,
    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        width: 100%;
    }
}

/* Mobile lead-list compaction */
@media (max-width: 767px) {
    .client-leads-page .card-body,
    .cp-leads-page .cp-card-body {
        padding: 12px !important;
    }

    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .client-leads-page .crm-filter-form,
    .cp-leads-page .crm-filter-form,
    .client-leads-page .crm-filter-grid,
    .cp-leads-page .crm-filter-grid {
        gap: 10px !important;
    }

    .client-leads-page .crm-filter-scope,
    .cp-leads-page .crm-filter-scope {
        margin-bottom: 10px !important;
    }

    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        margin-bottom: 8px !important;
        padding: 12px !important;
        gap: 8px !important;
    }

    .client-leads-page .crm-bulk-toolbar__form,
    .cp-leads-page .crm-bulk-toolbar__form,
    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls,
    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        gap: 8px !important;
    }

    .client-leads-page .crm-bulk-toolbar__length,
    .cp-leads-page .crm-bulk-toolbar__length {
        margin-bottom: 0 !important;
    }

    .client-leads-page .crm-bulk-toolbar + .table-responsive,
    .cp-leads-page .crm-bulk-toolbar + .table-responsive,
    .client-leads-page .crm-bulk-toolbar + .cp-table-wrap,
    .cp-leads-page .crm-bulk-toolbar + .cp-table-wrap {
        margin-top: 0 !important;
    }

    .client-leads-page .table-responsive,
    .cp-leads-page .cp-table-wrap {
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 12px !important;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scroll,
    .cp-leads-page .dataTables_wrapper .dataTables_scroll,
    .client-leads-page .dataTables_wrapper .dataTables_scrollHead,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollHead,
    .client-leads-page .dataTables_wrapper .dataTables_scrollBody,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody {
        margin-top: 0 !important;
    }

    .client-leads-page .dataTables_wrapper .dataTables_scrollBody,
    .cp-leads-page .dataTables_wrapper .dataTables_scrollBody {
        min-height: 0 !important;
        max-height: none !important;
    }
}

/* Final mobile lead-list spacing fix */
@media (max-width: 767px) {
    .client-leads-page .crm-mobile-filter-toggle,
    .cp-leads-page .crm-mobile-filter-toggle {
        margin-bottom: 8px !important;
    }

    .client-leads-page,
    .cp-leads-page,
    .client-leads-page .container-fluid,
    .cp-leads-page .container-fluid,
    .client-leads-page .card,
    .cp-leads-page .cp-card,
    .client-leads-page .card-body,
    .cp-leads-page .cp-card-body {
        min-height: 0 !important;
        height: auto !important;
    }

    .client-leads-page .filters-card,
    .cp-leads-page .cp-filters-card {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        margin-bottom: 8px !important;
        padding: 8px !important;
        overflow: visible !important;
    }

    .client-leads-page .crm-collapsible-filter-panel.is-collapsed,
    .cp-leads-page .crm-collapsible-filter-panel.is-collapsed {
        max-height: 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-top-width: 0 !important;
        border-bottom-width: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .client-leads-page .crm-collapsible-filter-panel:not(.is-collapsed),
    .cp-leads-page .crm-collapsible-filter-panel:not(.is-collapsed) {
        max-height: none !important;
    }

    .client-leads-page .crm-filter-form,
    .cp-leads-page .crm-filter-form,
    .client-leads-page .crm-filter-grid,
    .cp-leads-page .crm-filter-grid,
    .client-leads-page .crm-filter-scope,
    .cp-leads-page .crm-filter-scope {
        min-height: 0 !important;
        height: auto !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        gap: 8px !important;
    }

    .client-leads-page .filter-group,
    .cp-leads-page .cp-filter-group {
        margin-bottom: 0 !important;
    }

    .client-leads-page .filter-actions,
    .cp-leads-page .cp-filter-actions {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    .client-leads-page .crm-bulk-toolbar,
    .cp-leads-page .crm-bulk-toolbar {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 8px 0 10px !important;
        padding: 8px !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .client-leads-page .crm-bulk-toolbar__form,
    .cp-leads-page .crm-bulk-toolbar__form {
        display: block !important;
        width: 100% !important;
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
    }

    .client-leads-page .crm-bulk-toolbar__controls,
    .cp-leads-page .crm-bulk-toolbar__controls,
    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons,
    .client-leads-page .crm-bulk-toolbar__length,
    .cp-leads-page .crm-bulk-toolbar__length {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 8px !important;
    }

    .client-leads-page .crm-bulk-toolbar__buttons,
    .cp-leads-page .crm-bulk-toolbar__buttons {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
    }

    .client-leads-page .crm-bulk-feedback:not(.is-visible),
    .cp-leads-page .crm-bulk-feedback:not(.is-visible),
    .client-leads-page #clientBulkHiddenFields:empty,
    .cp-leads-page #cpBulkHiddenFields:empty {
        display: none !important;
        min-height: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }

    .client-leads-page .crm-bulk-toolbar + .table-responsive,
    .cp-leads-page .crm-bulk-toolbar + .cp-table-wrap,
    .client-leads-page .table-responsive,
    .cp-leads-page .cp-table-wrap {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        margin-top: 0 !important;
    }

    .client-leads-page .dataTables_wrapper,
    .cp-leads-page .dataTables_wrapper {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Final lead-row status overrides. These live after table/page rules so striped
   and DataTables cell backgrounds cannot hide the shared follow-up state. */
.client-leads-page tr.row-followup-scheduled,
.client-leads-page tr.row-followup-scheduled td,
.cp-leads-page tr.row-followup-scheduled,
.cp-leads-page tr.row-followup-scheduled td,
.team-performance-page tr.row-followup-scheduled,
.team-performance-page tr.row-followup-scheduled td,
.accountability-report-page tr.row-followup-scheduled,
.accountability-report-page tr.row-followup-scheduled td,
tr.crm-row-scheduled,
tr.crm-row-scheduled td {
    background: #e8f8ef !important;
    background-color: #e8f8ef !important;
}

.client-leads-page tr.row-followup-none,
.client-leads-page tr.row-followup-none td,
.cp-leads-page tr.row-followup-none,
.cp-leads-page tr.row-followup-none td,
.team-performance-page tr.row-followup-none,
.team-performance-page tr.row-followup-none td,
.accountability-report-page tr.row-followup-none,
.accountability-report-page tr.row-followup-none td,
tr.crm-row-no-followup,
tr.crm-row-no-followup td {
    background: #fff0dc !important;
    background-color: #fff0dc !important;
}

.client-leads-page tr.row-followup-overdue,
.client-leads-page tr.row-followup-overdue td,
.cp-leads-page tr.row-followup-overdue,
.cp-leads-page tr.row-followup-overdue td,
.team-performance-page tr.row-followup-overdue,
.team-performance-page tr.row-followup-overdue td,
.accountability-report-page tr.row-followup-overdue,
.accountability-report-page tr.row-followup-overdue td,
tr.crm-row-overdue,
tr.crm-row-overdue td {
    background: #fde2e2 !important;
    background-color: #fde2e2 !important;
}

.client-leads-page tr.row-followup-closed,
.client-leads-page tr.row-followup-closed td,
.cp-leads-page tr.row-followup-closed,
.cp-leads-page tr.row-followup-closed td,
.team-performance-page tr.row-followup-closed,
.team-performance-page tr.row-followup-closed td,
.accountability-report-page tr.row-followup-closed,
.accountability-report-page tr.row-followup-closed td,
tr.crm-row-closed,
tr.crm-row-closed td {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
}

.client-leads-page tr.row-followup-unassigned,
.client-leads-page tr.row-followup-unassigned td,
.cp-leads-page tr.row-followup-unassigned,
.cp-leads-page tr.row-followup-unassigned td,
.team-performance-page tr.row-followup-unassigned,
.team-performance-page tr.row-followup-unassigned td,
.accountability-report-page tr.row-followup-unassigned,
.accountability-report-page tr.row-followup-unassigned td,
tr.crm-row-unassigned,
tr.crm-row-unassigned td {
    background: #eef4ff !important;
    background-color: #eef4ff !important;
}
