/* =================================================================
   Lead Details Panel – Contract-Style Modal Popup
   Matches the cf-* design language from the Contract Modal
================================================================= */

/* ── Container & Global Base ── */
#leadModal .modal-content,
#clientModal .modal-content {
    display: flex;
    flex-direction: column;
    background: #f4fbfb !important;
    max-height: 90vh;
}

#leadModal {
    --ld-navy: #123f78;
    --ld-teal: #006263;
    --ld-border: #e2e8ee;
    --ld-canvas: #f3fafb;
}

#clientModal {
    --ld-navy: #123f78;
    --ld-teal: #006263;
    --ld-border: #e2e8ee;
    --ld-canvas: #f3fafb;
}

#leadModal .ld-modal-dialog,
#clientModal .ld-modal-dialog {
    width: min(940px, calc(100vw - 32px));
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
}

#leadModal .ld-modal-content,
#clientModal .ld-modal-content {
    height: min(830px, 88vh);
    max-height: 88vh;
    border: 0 !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 26px 80px rgba(15, 35, 58, 0.32);
}

.ld-body {
    padding: 0 !important;
    overflow: hidden !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--ld-canvas, #f3fafb);
}

/* ── Modal Header (matching cf-modal-header) ── */
.ld-header {
    position: relative;
    padding: 17px 21px;
    background: linear-gradient(112deg, var(--ld-teal, #006263) 0%, #075b70 43%, var(--ld-navy, #123f78) 100%);
    color: #ffffff;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex: 0 0 auto;
}

.ld-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    gap: 18px;
}

.ld-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.ld-name {
    font-size: 1rem;
    font-weight: 750;
    margin: 0;
    color: #ffffff;
    line-height: 1.3;
}

.ld-company {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    display: block;
    margin-top: 1px;
}

.ld-status-chip {
    min-width: 52px;
    min-height: 29px;
    padding: 5px 13px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #6f747b;
    color: #ffffff;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ld-quick-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.ld-quick-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.ld-header .btn-close {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0 0 0 2px !important;
    border-radius: 8px;
    background-size: 13px;
    transition: background-color .15s ease, opacity .15s ease;
}

.ld-header .btn-close:hover {
    background-color: rgba(255, 255, 255, .13);
    opacity: 1 !important;
}

.ld-quick-btn i {
    font-size: 1.08rem;
}

.ld-quick-btn-wa i {
    color: #25d366 !important;
    font-size: 1.2rem;
}

/* ── Segmented Control Tabs (matching cf-section-title style) ── */
.ld-tab-nav {
    display: flex;
    background: #ffffff;
    padding: 6px 16px;
    gap: 4px;
    border-bottom: 1.5px solid #e8eaed;
}

#leadModal .custom-tabs,
#clientModal .custom-tabs {
    flex: 0 0 auto;
    min-height: 46px;
    margin: 0;
    padding: 0 15px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    background: #fff;
    border-bottom: 1px solid var(--ld-border, #e2e8ee);
    scrollbar-width: none;
}

#leadModal .custom-tabs::-webkit-scrollbar,
#clientModal .custom-tabs::-webkit-scrollbar {
    display: none;
}

#leadModal .custom-tabs .nav-item,
#clientModal .custom-tabs .nav-item {
    min-width: 128px;
}

#leadModal .custom-tabs .nav-link,
#clientModal .custom-tabs .nav-link {
    height: 46px;
    padding: 0 14px;
    color: #4d555d;
    background: transparent;
    border: 0;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    outline: none;
    font-size: .79rem;
    font-weight: 650;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

#leadModal .custom-tabs .nav-link:hover,
#clientModal .custom-tabs .nav-link:hover {
    color: var(--ld-navy, #123f78);
    background: #f8fafc;
}

#leadModal .custom-tabs .nav-link.active,
#clientModal .custom-tabs .nav-link.active {
    color: var(--ld-navy, #123f78);
    background: transparent;
    border-bottom-color: var(--ld-navy, #123f78);
}

.ld-tab {
    padding: 7px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ld-tab i {
    font-size: 0.95rem;
    color: #80868b;
}

.ld-tab:hover {
    background: #f1f3f4;
    color: #202124;
}

.ld-tab.active {
    background: rgba(22, 63, 122, 0.08);
    color: #163f7a;
}

.ld-tab.active i {
    color: #163f7a;
}

/* ── Content Layout ── */
#leadModal .tab-content,
#clientModal .tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

#leadModal .tab-content > .tab-pane,
#clientModal .tab-content > .tab-pane {
    width: 100%;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

#leadModal .tab-content > .tab-pane.active,
#clientModal .tab-content > .tab-pane.active {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-color: #aab8c7 transparent;
    scrollbar-width: thin;
}

#leadModal .tab-content > .tab-pane.active::-webkit-scrollbar,
#clientModal .tab-content > .tab-pane.active::-webkit-scrollbar {
    width: 8px;
}

#leadModal .tab-content > .tab-pane.active::-webkit-scrollbar-track,
#clientModal .tab-content > .tab-pane.active::-webkit-scrollbar-track {
    margin: 9px 0 12px;
    background: transparent;
}

#leadModal .tab-content > .tab-pane.active::-webkit-scrollbar-thumb,
#clientModal .tab-content > .tab-pane.active::-webkit-scrollbar-thumb {
    min-height: 44px;
    background: #aab8c7;
    border: 2px solid transparent;
    border-radius: 8px;
    background-clip: padding-box;
}

#leadModal .tab-content > .tab-pane.active::-webkit-scrollbar-thumb:hover,
#clientModal .tab-content > .tab-pane.active::-webkit-scrollbar-thumb:hover {
    background: #7f91a5;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#leadModal .ld-body,
#clientModal .ld-body,
#leadModal .tab-content,
#clientModal .tab-content {
    border-radius: 0 0 8px 8px;
}

.ld-tab-pane {
    flex: 1;
    display: none;
    overflow-y: auto;
    padding: 0;
}

.ld-tab-pane.active {
    display: block;
}

.ld-scroll {
    padding: 20px;
}

/* ── Section Title (matching cf-section-title) ── */
.ld-section-label {
    font-size: .72rem;
    font-weight: 700;
    color: #163f7a;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 18px 0 12px;
    padding-bottom: 4px;
    border-bottom: 1.5px solid rgba(22, 63, 122, .12);
}

.ld-section-label:first-child {
    margin-top: 0;
}

/* ── Info Grid & Cards (View Mode) ── */
.ld-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 15px;
    margin-bottom: 14px;
}

.ld-info-card {
    background: #ffffff;
    border: 1px solid var(--ld-border, #e2e8ee);
    border-radius: 13px;
    padding: 15px 16px 10px;
    box-shadow: 0 2px 5px rgba(22, 63, 122, 0.05);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ld-info-card:hover {
    transform: translateY(-1px);
    border-color: #d4dfe8;
    box-shadow: 0 6px 16px rgba(22, 63, 122, 0.08);
}

.ld-info-card-header {
    font-size: .71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #163f7a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1.5px solid rgba(22, 63, 122, .08);
    padding-bottom: 9px;
}

.ld-info-card-header i {
    font-size: 1rem;
}

.ld-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 35px;
    padding: 7px 1px;
    border-bottom: 1px solid #edf1f4;
    gap: 12px;
}

.ld-info-row:last-child {
    border-bottom: none;
}

.ld-info-label {
    font-size: 0.79rem;
    color: #5f6368;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ld-info-label i {
    font-size: 1rem;
    color: #163f7a;
    width: 18px;
    text-align: center;
}

.ld-info-val {
    font-size: 0.82rem;
    font-weight: 650;
    color: #202124;
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}

.ld-info-val a {
    color: #163f7a;
    text-decoration: none;
}

.ld-info-val a:hover {
    text-decoration: underline;
}

/* ── Action Bar (View Mode) ── */
.ld-action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 0 2px;
    border-top: 1.5px solid #e8eaed;
    margin-top: 8px;
}

/* ── Buttons (matching cf-btn-*) ── */
.ld-btn {
    font-size: .82rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    text-decoration: none;
}

.ld-btn-primary {
    background: #163f7a;
    color: #fff;
}

.ld-btn-primary:hover {
    background: #004e4e;
}

.ld-btn-danger {
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
    border: 1.5px solid rgba(234, 67, 53, 0.15);
}

.ld-btn-danger:hover {
    background: rgba(234, 67, 53, 0.18);
}

.ld-btn-ghost {
    background: #fff;
    color: #5f6368;
    border: 1.5px solid #d1d5db;
}

.ld-btn-ghost:hover {
    background: #f5f5f5;
}

/* ── Edit Mode (matching cf-input-box / cf-wrap) ── */
.ld-edit-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(22, 63, 122, 0.06);
    border-bottom: 1.5px solid rgba(22, 63, 122, 0.12);
    font-size: 0.82rem;
    font-weight: 600;
    color: #163f7a;
}

.ld-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1.5px solid #e8eaed;
    margin-top: 8px;
}

/* ── Form Controls (matching cf-input-box / cf-field) ── */
.ld-label {
    font-size: .78rem;
    color: #5f6368;
    font-weight: 400;
    margin-bottom: 5px;
    display: block;
    text-transform: none;
}

#ld-edit-mode .input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    height: 40px;
}

#ld-edit-mode .input-group:focus-within {
    border-color: #163f7a;
    box-shadow: 0 0 0 3px rgba(22, 63, 122, .08);
}

#ld-edit-mode .input-group .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    flex-shrink: 0;
    color: #163f7a;
    font-size: 1rem;
    border: none;
    border-right: 1.5px solid #e8eaed;
    background: #f8fdfd;
    padding: 0;
}

#ld-edit-mode .input-group .form-control,
#ld-edit-mode .input-group .form-select {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    font-size: .875rem;
    color: #202124;
    padding: 0 10px;
    height: 100%;
}

#ld-edit-mode .input-group .form-control::placeholder {
    color: #9aa0a6;
}

#ld-edit-mode .input-group .form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* ── Conversation Tab — Two-Column Layout ── */
.ld-convo-wrap {
    display: flex;
    height: 100%;
    min-height: 0;
}

.ld-timeline-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1.5px solid #e8eaed;
}

.ld-timeline-head {
    font-size: .72rem;
    font-weight: 700;
    color: #163f7a;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 14px 16px 10px;
    border-bottom: 1.5px solid rgba(22, 63, 122, .12);
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
}

.ld-note-col {
    width: 310px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ld-note-head {
    font-size: .72rem;
    font-weight: 700;
    color: #163f7a;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 14px 16px 10px;
    border-bottom: 1.5px solid rgba(22, 63, 122, .12);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ld-note-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.ld-note-field {
    display: flex;
    flex-direction: column;
}

.ld-note-field textarea,
.ld-note-field input[type="datetime-local"],
.ld-note-field .form-select {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .85rem;
    color: #202124;
    padding: 10px;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}

.ld-note-field textarea:focus,
.ld-note-field input[type="datetime-local"]:focus,
.ld-note-field .form-select:focus {
    outline: none;
    border-color: #163f7a;
    box-shadow: 0 0 0 3px rgba(22, 63, 122, .08);
}

/* ── Vertical Timeline ── */
.ld-timeline {
    position: relative;
    padding: 16px 16px 16px 36px;
    overflow-y: auto;
    flex: 1;
}

.ld-timeline::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: linear-gradient(180deg, #163f7a, #e8eaed);
    border-radius: 2px;
}

.ld-timeline-item {
    position: relative;
    margin-bottom: 18px;
    padding-left: 20px;
}

.ld-tl-dot {
    position: absolute;
    left: -19px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #163f7a;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(22, 63, 122, .1);
}

.ld-tl-meta {
    font-size: 0.70rem;
    color: #80868b;
    margin-bottom: 4px;
    font-weight: 500;
    gap: 5px;
    display: flex;
    align-items: center;
    justify-content: start;
}

.ld-tl-body {
    background: #ffffff;
    border: 1.5px solid #e8eaed;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #3c4043;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ld-tl-msg {
    margin: 0;
    line-height: 1.5;
}

/* ── Assign Tab Card ── */
.ld-assign-card {
    background: #ffffff;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ld-assign-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(22, 63, 122, 0.08);
    color: #163f7a;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.ld-assign-card .input-group {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.ld-assign-card .input-group:focus-within {
    border-color: #163f7a;
    box-shadow: 0 0 0 3px rgba(22, 63, 122, .08);
}

.ld-assign-card .input-group .input-group-text {
    background: #f8fdfd;
    border: none;
    border-right: 1.5px solid #e8eaed;
    color: #163f7a;
}

.ld-assign-card .input-group .form-select {
    border: none !important;
    box-shadow: none !important;
}

/* Customer detail tabs */
#clientModal #c-tab-sales .ld-scroll,
#clientModal #c-tab-props .ld-scroll,
#clientModal #c-tab-assign .ld-scroll,
#clientModal #c-tab-wptemplate .ld-scroll {
    padding: 24px !important;
}

#clientModal #c-tab-sales h6,
#clientModal #c-tab-props h6,
#clientModal #c-tab-assign h6,
#clientModal #c-tab-wptemplate h6 {
    color: var(--ld-navy, #123f78) !important;
    font-size: .9rem;
    font-weight: 750 !important;
}

#clientModal #c-tab-sales .table-responsive,
#clientModal #c-tab-props .table-responsive {
    overflow: hidden;
    border: 1px solid var(--ld-border, #e2e8ee);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(22, 63, 122, .05);
}

#clientModal #c-tab-sales table,
#clientModal #c-tab-props table {
    margin: 0 !important;
    border: 0 !important;
}

#clientModal #c-tab-sales thead,
#clientModal #c-tab-props thead {
    background: #f7fafc !important;
}

#clientModal #c-tab-sales th,
#clientModal #c-tab-props th {
    padding: 11px 13px;
    border-bottom: 1px solid var(--ld-border, #e2e8ee);
    color: #52606d;
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .035em;
}

#clientModal #c-tab-sales td,
#clientModal #c-tab-props td {
    padding: 11px 13px;
    color: #27313a;
    font-size: .8rem;
    vertical-align: middle;
}

#clientModal #c-tab-assign .ld-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#clientModal #c-tab-assign .ld-scroll > h6 {
    display: none;
}

#clientModal #c-tab-assign .card {
    width: min(100%, 480px);
    margin-bottom: 14px !important;
    padding: 14px !important;
    border: 1px solid var(--ld-border, #e2e8ee) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(22, 63, 122, .06) !important;
}

#clientModal #c_assigned_avatar {
    width: 46px !important;
    height: 46px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--ld-teal, #006263), var(--ld-navy, #123f78)) !important;
    font-size: 1rem !important;
}

#clientModal #instantAssignForm {
    width: min(100%, 480px);
    padding: 18px;
    border: 1px solid var(--ld-border, #e2e8ee);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(22, 63, 122, .06);
}

#clientModal #instantAssignForm .form-select,
#clientModal #c-tab-wptemplate .form-select,
#clientModal #c-tab-wptemplate textarea {
    border: 1.5px solid #d1d5db;
    border-radius: 9px !important;
    box-shadow: none;
    font-size: .84rem;
}

#clientModal #instantAssignForm .form-select:focus,
#clientModal #c-tab-wptemplate .form-select:focus,
#clientModal #c-tab-wptemplate textarea:focus {
    border-color: var(--ld-navy, #123f78);
    box-shadow: 0 0 0 3px rgba(18, 63, 120, .08);
}

#clientModal #c_assign_msg {
    width: min(100%, 480px);
}

#clientModal #c-tab-wptemplate .ld-scroll {
    width: min(100%, 500px);
    margin: 0 auto;
    padding: 24px 24px 34px !important;
}

.customer-wa-card {
    width: 100%;
    padding: 28px;
    border: 1px solid #dfe5ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(22, 63, 122, .06);
    text-align: center;
}

.customer-wa-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin: 0 auto 13px;
    border-radius: 14px;
    background: #e4f8ec;
    color: #079447;
}

.customer-wa-icon svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
}

.customer-wa-card h6 {
    margin: 0 0 4px;
    color: #202124 !important;
    font-size: 1rem !important;
    font-weight: 750 !important;
}

.customer-wa-card > p {
    margin: 0 0 18px;
    color: #687079;
    font-size: .8rem;
}

.customer-wa-field {
    margin-bottom: 16px;
    text-align: left;
}

.customer-wa-field label {
    display: block;
    margin-bottom: 7px;
    color: #ea3d49;
    font-size: .78rem;
    font-weight: 700;
}

#clientModal .customer-wa-field .form-select {
    height: 43px;
    border: 1px solid #d6dfe8;
    border-radius: 9px !important;
    color: #344054;
    background-color: #fff;
    font-size: .86rem;
}

#clientModal .customer-wa-card textarea {
    width: 100%;
    min-height: 130px;
    max-height: 220px;
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid #d6dfe8;
    border-radius: 9px !important;
    color: #1f2937;
    background: #fff;
    font-size: .84rem;
    line-height: 1.45;
    resize: vertical;
}

#clientModal .customer-wa-field .form-select:focus,
#clientModal .customer-wa-card textarea:focus {
    border-color: #1d4e91;
    box-shadow: 0 0 0 3px rgba(29, 78, 145, .08);
}

.customer-wa-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.customer-wa-manage,
.customer-wa-open {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.customer-wa-manage {
    border: 1px solid #d6dfe8;
    color: #303945;
    background: #fff;
}

.customer-wa-manage:hover {
    color: #123f78;
    background: #f8fafc;
}

.customer-wa-open {
    border: 1px solid #1b4c91;
    color: #fff;
    background: #1b4c91;
}

.customer-wa-open:hover {
    color: #fff;
    background: #153f79;
}

.customer-wa-manage:hover,
.customer-wa-open:hover {
    transform: translateY(-1px);
}

#clientModal #c-tab-emailtemplate .ld-scroll {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 24px 24px 34px !important;
}

.customer-email-card {
    width: 100%;
    padding: 28px 24px;
    border: 1px solid #dfe5ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(22, 63, 122, .06);
    text-align: center;
}

.customer-email-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin: 0 auto 13px;
    border-radius: 14px;
    background: #e7f0fb;
    color: #1473e6;
    font-size: 1.55rem;
}

.customer-email-card h6 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 1rem;
    font-weight: 750;
}

.customer-email-copy {
    margin: 0 0 18px;
    color: #596273;
    font-size: .78rem;
}

.customer-email-field {
    margin-bottom: 16px;
    text-align: left;
}

.customer-email-field > label {
    display: block;
    margin-bottom: 7px;
    color: #ed3347;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.customer-email-card .form-control,
.customer-email-card .form-select {
    border: 1px solid #d6dfe8;
    border-radius: 9px;
    box-shadow: none;
    color: #344054;
    background-color: #fff;
    font-size: .86rem;
}

.customer-email-card .form-select,
.customer-email-card input.form-control {
    height: 43px;
}

.customer-email-card .form-control:focus,
.customer-email-card .form-select:focus {
    border-color: #123f78;
    box-shadow: 0 0 0 3px rgba(18, 63, 120, .08);
}

.customer-email-card textarea {
    min-height: 130px;
    max-height: 240px;
    padding: 11px 12px;
    line-height: 1.45;
    resize: vertical;
}

.customer-email-counter {
    margin-top: 4px;
    color: #80868b;
    font-size: .71rem;
    text-align: right;
}

.customer-email-helper {
    margin: 5px 8px 0;
    color: #667085;
    font-size: .7rem;
    line-height: 1.35;
    text-align: center;
}

.customer-email-message-field {
    margin-bottom: 16px;
}

.customer-email-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    color: #80868b;
    font-size: .69rem;
}

.customer-email-error {
    display: none;
    margin-top: 5px;
    color: #ea4335;
    font-size: .75rem;
    font-weight: 600;
}

.customer-email-status {
    display: none;
    margin-top: 10px;
    font-size: .79rem;
    font-weight: 650;
    text-align: center;
}

.customer-email-status.is-success {
    color: #1e8e3e;
}

.customer-email-status.is-error {
    color: #ea4335;
}

.customer-email-send {
    background: #1a73e8;
}

.customer-email-send:hover {
    background: #155fbe;
}

/* ── Proposals Tab ── */
#tab-porposal .table thead {
    background: linear-gradient(135deg, #005757, #163f7a) !important;
}

#tab-porposal .table thead th {
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border: none;
    padding: 10px 12px;
}

#tab-porposal .table tbody td {
    font-size: 0.82rem;
    padding: 10px 12px;
    vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #leadModal .ld-modal-dialog,
    #clientModal .ld-modal-dialog {
        width: calc(100vw - 18px);
        max-width: none;
        margin: 9px auto;
        min-height: calc(100vh - 18px);
    }

    #leadModal .ld-modal-content,
    #clientModal .ld-modal-content {
        height: calc(100vh - 18px);
        max-height: calc(100vh - 18px);
        border-radius: 15px !important;
    }

    .ld-info-grid {
        grid-template-columns: 1fr;
    }

    .ld-header {
        padding: 13px 14px;
        border-radius: 15px 15px 0 0;
    }

    .ld-avatar {
        width: 38px;
        height: var(--crm-control-height);
        font-size: 1.1rem;
    }

    .ld-convo-wrap {
        flex-direction: column;
    }

    .ld-timeline-col {
        border-right: none;
        border-bottom: 1.5px solid #e8eaed;
    }

    .ld-note-col {
        width: 100%;
    }

    .ld-tab {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .ld-tab i {
        display: none;
    }

    #leadModal .custom-tabs,
    #clientModal .custom-tabs {
        padding: 0 5px;
    }

    #leadModal .custom-tabs .nav-item,
    #clientModal .custom-tabs .nav-item {
        min-width: 112px;
    }

    #leadModal .custom-tabs .nav-link,
    #clientModal .custom-tabs .nav-link {
        padding: 0 9px;
        font-size: .74rem;
    }

    .ld-scroll {
        padding: 13px;
    }
}

@media (max-width: 520px) {
    .ld-header-content {
        align-items: flex-start;
        gap: 10px;
    }

    .ld-header-content > .d-flex:last-child {
        gap: 5px !important;
    }

    .ld-status-chip {
        display: none;
    }

    .ld-quick-btn,
    .ld-header .btn-close {
        width: 32px;
        height: 32px;
    }

    .ld-avatar {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .ld-company {
        max-width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ld-info-card {
        padding: 13px 13px 8px;
    }

    .ld-info-row {
        align-items: flex-start;
    }

    .ld-info-val {
        max-width: 56%;
    }

    .customer-wa-card {
        padding: 20px 16px;
    }

    .customer-wa-actions {
        grid-template-columns: 1fr;
    }

    .customer-email-card {
        padding: 20px 16px;
    }

    .customer-email-message-meta {
        flex-direction: column;
        gap: 2px;
        text-align: left;
    }

    .customer-email-message-meta span:last-child {
        text-align: right;
    }
}

.modal-title.fw-bold.text-dark {
    gap: 10px;
    display: flex;
    align-items: center;
}
