.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0px 0px 1rem 0px;
    font-size: clamp(13px, 2.1vw, 14px);}

.leads-filters {
    display: none;
    overflow: hidden;
    background: var(--white);
    padding: 1rem;
    border-radius: 1rem;
    justify-content: flex-end;
    transition: opacity 0.3s ease;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 1rem;
}

.leads-filters.is-open {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

#leadMobileQuickSearchWrap {
    display: none;
}

#screen-leads .leads-table-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    position: sticky;
    bottom: 0;
    border-top: 1px solid #f1f5f9;
    padding: .6rem 1rem;
    background: #fafbfb;
    justify-content: space-between;
    flex-direction: row-reverse;
}

#screen-leads .leads-table-footer-count {
    text-align: left;
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 500;
    color: var(--text1);
    display: block;
    opacity: 1;
    visibility: visible;
    margin-right: auto;
}

#leadsPaginationControls {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

#leadsPaginationControls .btn {
    font-size: 14px;
    min-height: unset;
    border-radius: .5rem;
    background: var(--white);
    color: var(--black);
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border: none;
}

#leadsPaginationControls .btn#leadsPageNextBtn,
#leadsPaginationControls .btn#leadsPagePrevBtn {
    border: 1px solid var(--border);
}

#leadsPaginationControls .btn.primary {
    color: var(--white);
    background: var(--btn-primary);
}

#leadsPageSizeLabel {
    color: var(--text1);
    font-size: 13px;
    font-weight: 500;
    order: 1;
}

#leadsPageSizeSelect.input {
    text-align: center;
    order: 0;
    height: 32px;
    min-height: unset;
    font-size: 14px;
    cursor: pointer;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    } 
    to {
        opacity: 1;
        transform: translateY(0) scale(1); 
    }
}

@media (min-width: 1281px) {
    #screen-leads .leads-layout .table {
        max-height: calc(100vh - 260px);
        overflow-y: auto;
        overflow-x: hidden;
        padding-top: .5rem;
    }
    
    #screen-leads .leads-layout .table:has(.leads-cards-grid) {
        display: block;
    }

    #screen-leads .leads-layout .table-head {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    #screen-leads .leads-layout .table::-webkit-scrollbar {
        width: 0;
    }

    #screen-leads .leads-layout .table::-webkit-scrollbar-track {
        background: transparent;
        margin: 0;
    }

    #screen-leads .leads-layout .table::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 10px;
        transition: background 0.2s ease;
    }

    #screen-leads .leads-layout .table::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.25);
    }

    #screen-tasks .table {
        max-height: calc(100vh - 240px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    #screen-tasks .table-head {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--white);
    }

    #screen-tasks .table::-webkit-scrollbar {
        width: 0;
    }

    #screen-tasks .table::-webkit-scrollbar-track {
        background: transparent;
        margin: 0;
    }

    #screen-tasks .table::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 10px;
        transition: background 0.2s ease;
    }

    #screen-tasks .table::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.25);
    }

    #screen-event-card .results .table {
        max-height: calc(100vh - 260px);
        overflow-y: auto;
        overflow-x: hidden;
        padding-left: 8px;
        padding-top: .5rem;
    }

    #screen-event-card .results .table-head {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    #screen-event-card .results .table::-webkit-scrollbar {
        width: 0;
    }

    #screen-event-card .results .table::-webkit-scrollbar-track {
        background: transparent;
        margin: 0;
    }

    #screen-event-card .results .table::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 10px;
        transition: background 0.2s ease;
    }

    #screen-event-card .results .table::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.25);
    }

    .leads-layout {
        margin-top: 2rem;
    }
}

.leads-filters .tw-dp-trigger {
    padding: .25rem .75rem;
}


.toolbar > .btn {
    padding: .25rem 1rem;
    font-size: clamp(15px, 2.5vw, 16px);
}

#screen-leads .meetings-filters {
    display: none;
}

#tasks-toolbar.toolbar > .btn {
    padding: .5rem 1rem;
    font-size: clamp(16px, 2.5vw, 18px);
}

#tasks-toolbar.toolbar > .btn:first-of-type {
    margin-right: auto;
}

#tasks-toolbar.toolbar > select {
    width: auto;
}

#tasks-toolbar.toolbar {
    flex-direction: column;
    align-items: stretch;
    margin: 1rem;
}

#tasks-toolbar.toolbar > label {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: fit-content;
}

#tasks-toolbar.toolbar > label span {
    margin-right: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}


.tasks-form-container {
    display: none;
    overflow: hidden;
    background: var(--white);
    padding: 1rem;
    border-radius: 1rem;
    justify-content: flex-end;
    gap: 1rem;
    transition: opacity 0.3s ease;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: .5rem -1rem 1rem;
}

.tasks-form-container.is-open {
    display: flex;
}

.tasks-form-container .input,
.tasks-form-container select.input {
    min-height: 32px;
    padding: .2rem .5rem;
    font-size: 14px;
    max-width: 100%;
}

.input#tasksAssignedUser {
    width: 100%;
    max-width: 18%;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker {
    flex: 0 0 220px;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker .tw-dp-trigger {
    width: 100%;
    max-width: 100%;
}

#screen-tasks .tasks-form-container .input::placeholder {
    color: var(--black);
    opacity: 0.6;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker .tw-dp-value {
    color: var(--black);
    opacity: 0.6;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker .tw-dp-foot {
    gap: 8px;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker .tw-dp-foot-btn-set {
    flex: 2 1 0%;
    order: 2;
}

#screen-tasks .tasks-form-container .lead-reminder-datetime-picker .tw-dp-foot-btn-clear {
    flex: 1 1 0%;
    order: 1;
}

.meta-notes {
    font-weight: 500;
    padding: .15rem .4rem;
    min-height: 34px;
    display: flex;
    align-items: center;
    color: var(--primary);
    background: var(--white);
    margin: .5rem 0 0;
    border-radius: .5rem;
    font-size: 16px;
    width: 100%;
}

.leads-only-last {
    white-space: nowrap;
    font-size: clamp(15px, 2.5vw, 16px);
    display: none;
}

.lead-views-card {
    margin-top: 1rem;
}

#screen-leads .table-row > div[data-label="סוג"] {
    justify-content: center;
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source] {
    --lead-source-color: var(--text1);
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lead-source-bg);
    color: var(--lead-source-color);
    border: 1px solid var(--lead-source-border);
    position: relative;
    overflow: visible;
    box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source] > svg {
    width: 20px;
    height: 20px;
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source="answered"] {
    --lead-source-color: var(--lbl1);
    --lead-source-bg: var(--lbl7);
    --lead-source-border: var(--lbl11);
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source="missed"] {
    --lead-source-color: var(--lbl8);
    --lead-source-bg: var(--lbl9);
    --lead-source-border: var(--lbl12);
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source="message"] {
    --lead-source-color: var(--lbl5);
    --lead-source-bg: var(--lbl6);
    --lead-source-border: var(--lbl10);
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source="in-call"] {
    --lead-source-color: var(--lbl1);
    --lead-source-bg: var(--lbl7);
    --lead-source-border: var(--lbl11);
}

#screen-leads .table-row > div[data-label="סוג"] > span[data-lead-source="in-call"]::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lead-source-color);
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 1;
    animation: pulse 1.2s infinite;
}

#screen-leads .table-row > div[data-label="שם"]>div {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: self-start;
    gap: 0;
}

#screen-leads .table-row > div[data-label="מקור"] {
    font-size: 13px;
    color: var(--text-secondary, var(--muted));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#screen-leads .table-row > div[data-label="מקור"] > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--lighter);
    background: var(--lightgray);
    color: var(--text1);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#screen-leads .table-head > div:nth-child(1),
#screen-leads .table-row > div[data-label="צפייה"] {
    justify-content: center;
    align-items: center;
}

#screen-leads .table-row > div[data-label="צפייה"] .btn.icon-only.inline-edit-icon {
    width: 34px;
    height: 34px;
    min-height: 34px;
    opacity: 1;
    pointer-events: auto;
}

#screen-leads .table-row > div[data-label="צפייה"] .btn.icon-only.inline-edit-icon svg {
    width: 24px;
    height: 24px;
}

#screen-leads .table-head > div:nth-child(6),
#screen-leads .table-row > div[data-label="וואטסאפ"] {
    justify-content: center;
    align-items: center;
}

#screen-leads .table-row > div[data-label="וואטסאפ"] .lead-whatsapp-cell-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--lbl11);
    background: var(--lbl7);
    color: var(--lbl1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#screen-leads .table-row > div[data-label="וואטסאפ"] .lead-whatsapp-cell-btn svg {
    width: 22px;
    height: 22px;
}

#screen-leads .table-row > div[data-label="וואטסאפ"] .lead-whatsapp-cell-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

#screen-leads .table-row > div[data-label="סטטוס"] .lead-crmstatus-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: fit-content;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.lead-views-chip::before {
    content: "";
    display: inline-block;
    margin-left: 4px;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/><circle cx='12' cy='12' r='3'/></svg>");
    color: var(--primary);
}

.lead-views-unseen {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.lead-views-seen {
    color: var(--text-muted);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.lead-calltype-chip {
    min-width: 96px;
}

.lead-hint-text {
    --status-color: var(--primary);
    color: #667085 !important;
    background: transparent !important;
    padding: 0;
    border: 0 !important;
    border-radius: 999px;
    font-weight: 500;
    font-size: 13px !important;
    line-height: 1.1;
    white-space: nowrap;
}

.lead-hint-text::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-color);
    margin-inline-end: 6px;
}

.leads-cards-grid .lead-hint-text::before {
    width: 6px;
    height: 6px;

}

#screen-leads .lead-name-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    line-height: 1.1;
    color: var(--text1);
    white-space: nowrap;
    direction: rtl;
}

#screen-leads .lead-name-cta svg {
    width: 12px;
    height: 12px;
}

@media (min-width: 901px) {
    #screen-leads .table-row>div.lead-mobile-actions {
        display: none;
    }

    #screen-leads .table-row>div[data-label="שם"]:has(.lead-name-user-icon) > div {
        position: relative;
        padding-inline-start: 0;
        min-height: 46px;
        text-align: right;
    }

    #screen-leads .table-row>div[data-label="שם"]:has(.lead-name-user-icon) .lead-name-main {
        display: block;
    }

    #screen-leads .lead-name-main {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-weight: 600;
        color: var(--black);
    }

    #screen-leads .lead-name-main .lead-name-user-icon {
           display: none;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        background: var(--lighter);
        border: 1px solid var(--primary-1);
        color: var(--primary);
        flex: 0 0 auto;
        position: absolute;
        inset-inline-start: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    #screen-leads .lead-name-main .lead-name-user-icon svg {
        width: 19px;
        height: 19px;
    }

    #screen-leads .btn.icon-only.inline-edit-icon {
        position: static;
        width: 24px;
        height: 24px;
        min-height: unset;
        padding: 0;
        opacity: 0.65;
        flex: 0 0 auto;
    }

    #screen-leads .btn.icon-only.inline-edit-icon[data-tooltip] {
        position: relative;
    }

    #screen-leads #lead-add-note-btn[data-tooltip]::before,
    #screen-leads #lead-add-note-btn[data-tooltip]::after {
        left: calc(50% + 1rem);
    }

    #screen-leads .btn.icon-only.inline-edit-icon:hover {
        opacity: 1;
    }

    #screen-leads .btn.icon-only.inline-edit-icon.show-on-hover {
        opacity: 0;
        pointer-events: none;
    }

    #screen-leads .table-row:hover .btn.icon-only.inline-edit-icon.show-on-hover {
        opacity: 0.65;
        pointer-events: auto;
    }

    #screen-leads .table-row:hover .btn.icon-only.inline-edit-icon.show-on-hover:hover {
        opacity: 1;
    }

    #screen-leads .lead-name-edit-btn.btn.icon-only {
        background: transparent;
        border: none;
        padding: 0;
        min-height: unset;
        width: 18px;
        height: 18px;
    }

    #screen-leads .lead-name-edit-btn.btn.icon-only svg,
    #screen-leads .btn.icon-only.inline-edit-icon svg {
        width: 12px;
        height: auto;
    }

    #screen-leads .lead-details-column-1 .lead-name-edit-btn.btn.icon-only svg {
        width: 16px;
    }

    #screen-leads .lead-name-edit-btn.btn.icon-only:hover {
        opacity: 1;
    }

    #screen-leads .lead-name-inline-input.input {
        font-size: 14px;
        padding: 4px 8px;
        min-height: 30px;
        width: 100%;
        max-width: 220px;
    }
}

.ai-transcript-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 102, 255, 0.08);
    border: 1px solid rgba(0, 102, 255, 0.18);
    line-height: 1.2;
}

#screen-leads .leads-history-meta.has-ai-transcript {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#screen-leads .leads-history-meta.has-ai-transcript > span:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

#screen-leads .leads-history-meta.has-ai-transcript .ai-transcript-badge {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 1px 8px;
}

/* Listen call button in meta line (desktop only) */
#screen-leads .leads-history-meta:has(.listen_call_link) {
    display: flex;
    align-items: center;
    gap: 8px;
}

#screen-leads .leads-history-meta .listen_call_link {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 767px) {
    #screen-leads .leads-history-meta .listen_call_link {
        display: none;
    }
}

#screen-leads .lead-main-meta-item.has-ai-transcript {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
}

#screen-leads .lead-main-meta-item.has-ai-transcript > span:first-child {
    min-width: 0;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#screen-leads .lead-main-meta-item.has-ai-transcript .ai-transcript-badge {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 1px 8px;
    white-space: nowrap;
}

#screen-leads .lead-main-meta-item.has-ai-transcript > span:first-child::after {
    content: " •";
    display: inline;
    color: var(--placeholder, #9ca3af);
    font-weight: 700;
}

#screen-leads .ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 30px;
    max-height: 30px;
    min-height: unset;
    padding: 0 .6rem;
    border-radius: .5rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--white);
    font-weight: 400;
    font-size: clamp(14px, 2.5vw, 15px);
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--primary));
    background-size: 100% auto;
    animation: none;
    box-shadow:
        0 1px 0 rgba(0,0,0,0.08),
        0 0 0 3px var(--primary-4, rgba(25, 84, 141, 0.08));
}

#screen-leads .ai-button .sparkle {
    font-weight: 900;
    line-height: 1;
    animation: none;
}

#screen-leads .ai-button[data-loading="1"] {
    cursor: wait;
    opacity: 0.92;
    background-size: 200% auto;
    animation: ai-shine 2.2s linear infinite;
}

#screen-leads .ai-button[data-loading="1"] .sparkle {
    animation: ai-blink 1.5s ease-in-out infinite;
}

#screen-leads .ai-button:hover {
    filter: brightness(1.03);
}

#screen-leads .ai-button:disabled,
#screen-leads .ai-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.65;
    animation: none;
}

#screen-leads .ai-button:disabled .sparkle,
#screen-leads .ai-button[aria-disabled="true"] .sparkle {
    animation: none;
}

@keyframes ai-shine {
    to { background-position: 200% center; }
}

@keyframes ai-blink {
    0%, 100% { opacity: 1; transform: scale(1.12); }
    50% { opacity: 0.55; transform: scale(0.92); }
}

#screen-leads .ai-transcript-skeleton {
    margin-top: 8px;
}

#screen-leads .skeleton-container {
    width: 100%;
    max-width: 520px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft, #e5e7eb);
    border-radius: 12px;
    background: var(--white, #fff);
    direction: rtl;
}

#screen-leads .skeleton-title {
    font-size: 14px;
    color: var(--placeholder, #9ca3af);
    margin-bottom: 12px;
    font-weight: 600;
}

#screen-leads .skeleton-line {
    height: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        var(--lightgray, #f3f4f6) 25%,
        var(--border-soft, #e5e7eb) 50%,
        var(--lightgray, #f3f4f6) 75%
    );
    background-size: 200% 100%;
    animation: ai-shimmer 1.5s infinite;
}

#screen-leads .skeleton-line.short {
    width: 60%;
}

@keyframes ai-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.lead-reminder-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(30, 78, 132, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.lead-reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--white);
    margin-bottom: 0.5rem;
}




.lead-reminder-add-row label {
    white-space: nowrap;
    font-size: clamp(15px, 2.5vw, 16px);
}



.lead-reminder-view {
    flex: 1;
    font-size: 15px;
}

.lead-task-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.lead-task-date {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.lead-task-title {
    font-weight: 500;
    color: var(--text-primary);
}

.lead-task-notes {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.lead-task-edit-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lead-task-edit-btn svg {
    width: 16px;
    height: 16px;
}

.global-reminders-empty{
    font-size: clamp(14px, 1.5vw, 16px);
}



.lead-details-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(30, 78, 132, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

@media (max-width: 900px) {
    .lead-details-overlay {
        display: none !important;
    }
    
    .tasks-split-container {
        grid-template-columns: 1fr;
    }
}

.lead-reminder-overlay.visible,
.lead-details-overlay.visible {
    display: flex;
}

.lead-reminder-popup {
    background: var(--white);
    direction: rtl;
    width: 420px;
    max-width: 90%;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    to { transform: scale(1); }
}

.lead-reminder-popup .card-top-accent {
    height: 6px;
    background: var(--primary);
    width: 100%;
}

.popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 20px;
    line-height: 1;
}

.lead-reminder-popup .popup-body {
    padding: 25px 30px;
    text-align: center;
}

.bell-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--lightblue);
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 24px;
    animation: ring 2s infinite ease-in-out;
}

.bell-icon-wrapper svg {
    fill: var(--primary);
}

@keyframes ring {
    0%, 50%, 100% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
}

.popup-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.task-name {
    font-weight: 800;
    color: var(--table-row-text);
    font-size: 15px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.lead-reminder-popup .task-name {
    font-size: 19.2px;
}

.task-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--black);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f9fafb;
    padding: 4px 10px;
    border-radius: 8px;
}

.linked-entity {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entity-info {
    text-align: right;
}

.entity-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    display: block;
}

.entity-phone {
    font-size: 13px;
    color: var(--text-light);
}

.entity-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: 0.2s;
}

.btn-whatsapp {
    background: #dcfce7;
    color: #16a34a;
}

.btn-whatsapp:hover {
    background: #16a34a;
    color: var(--white);
}

.btn-link {
    background: var(--lightblue);
    color: var(--primary);
}

.btn-link:hover {
    background: var(--primary);
    color: var(--white);
}

.lead-reminder-popup .popup-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.btn-primary-done {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(30, 78, 132, 0.3);
}

.btn-primary-done:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.secondary-actions-row {
    display: flex;
    gap: 10px;
}

.btn-secondary-action {
    flex: 1;
    background: var(--white);
    border: 1px solid #e5e7eb;
    color: var(--text-dark);
    padding: .75rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .btn-secondary-action:hover {
        background: #f9fafb;
        border-color: #d1d5db;
    }

    .popup-close:hover {
        color: #1f2937;
        background: #e5e7eb;
    }
}

@media (max-width: 767px) {
    .lead-reminder-overlay {
        align-items: center;
    }

    .lead-reminder-popup {
        width: 90%;
        max-width: 90%;
        border-radius: 24px;
        animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        padding-bottom: 20px;
    }

    .lead-reminder-popup .card-top-accent {
        display: none;
    }

    .drag-handle {
        width: 40px;
        height: 5px;
        background: var(--border-color);
        border-radius: 10px;
        margin: 12px auto 5px auto;
    }

    .popup-close {
        background: transparent;
        font-size: 24px;
    }

    .lead-reminder-popup .popup-body {
        padding: 10px 25px 25px 25px;
    }

    .bell-icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 10px;
    }

    .lead-reminder-popup .task-name {
        font-size: 16px;
    }

    .linked-entity {
        padding: 15px;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

.col-crmstatus {
    width: auto;
    max-width:unset;
}

.lead-details {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 35%;
    padding: 0;
    border-radius: 0;
    border: none;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 2100;
    overflow-y: auto;
    scrollbar-width: none;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

@keyframes leadsDetailsScaleIn {
    0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes leadsDetailsScaleOut {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
}

@keyframes leadsOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes leadsOverlayFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.ui-overlay.leads-overlay {
    background-color: rgba(30, 78, 132, 0.85);
    z-index: 2050;
    transition: opacity 0.65s ease;
}

.ui-overlay.leads-overlay.is-active:not(.closing) {
    animation: leadsOverlayFadeIn 0.3s ease-out both;
    transition: none;
}

.ui-overlay.leads-overlay.is-active.closing {
    animation: leadsOverlayFadeOut 0.3s ease-in both;
    transition: none;
}

.lead-details::-webkit-scrollbar {
    display: none;
}

.lead-details.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    padding-bottom: 0;
}

.lead-details-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 768px) {
    #screen-leads .lead-details {
        top: 50%;
        left: 50%;
        height: 85vh;
        width: 95vw;
        max-width: 1100px;
        border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0;
        will-change: opacity, transform;
        overflow: hidden;
        background: var(--white);
        transition: none;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    #screen-leads .lead-details.is-open {
        animation: leadsDetailsScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    #screen-leads .lead-details.is-open.closing {
        animation: leadsDetailsScaleOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    #screen-leads .lead-details .editor-topbar.lead-details-header {
        background: var(--white);
        border-bottom: 1px solid var(--border-soft);
        margin: 0;
        padding: 15px 30px;
        display: flex;
        align-items: center;
        gap: 12px;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 200;
        direction: rtl;
    }

    #screen-leads .lead-details .lead-details-header-title {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        order: 1;
        direction: rtl;
    }

    #screen-leads .lead-details .editor-topbar .editor-title {
        margin: 0;
        padding: 0;
        border-radius: 0;
        font-weight: 800;
        font-size: 18px;
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    #screen-leads .lead-details .lead-details-close-btn {
        position: absolute;
        top: 1rem;
        left: 1rem;
        width: 36px;
        height: 36px;
        background: #f1f5f9;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
        z-index: 1;
        color: #64748b;
        order: 4;
    }

    #screen-leads .lead-details .lead-details-close-btn:hover {
        background: #e2e8f0;
        color: var(--primary);
        transform: rotate(90deg);
    }

    #screen-leads .lead-details .lead-details-close-btn svg {
        width: 16px;
        height: 16px;
        stroke-width: 2;
    }

    #screen-leads .lead-details .lead-details-header-actions {
        display: flex;
        gap: 1rem;
        align-items: center;
        order: 3;
        direction: rtl;
        margin-left: 3rem;
    }

    #screen-leads .lead-details .lead-details-header-actions .btn {
        border-radius: 10px;
        padding: 8px 12px;
        font-size: 15px;
        font-weight: 500;
        border: 1px solid var(--border-soft);
        background: color-mix(in srgb, var(--primary) 10%, var(--white));
        color: var(--primary);
        min-height: 34px;
    }

    #screen-leads .lead-details .lead-details-header-actions .btn:last-child {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--white);
    }

    #screen-leads .lead-details .lead-details-header-actions .btn:hover {
        border-color: color-mix(in srgb, var(--primary) 40%, var(--border-soft));
        background: color-mix(in srgb, var(--primary) 16%, var(--white));
    }

    #screen-leads .lead-details .lead-details-header-actions .btn:last-child:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
    }

    #screen-leads .lead-details .event-editor-nav {
        display: none;
        gap: 8px;
        align-items: center;
        order: 2;
        direction: rtl;
    }

    #screen-leads .lead-details .event-editor-nav .btn {
        width: 42px;
        height: 42px;
        min-height: 42px;
        min-width: 42px;
        padding: 0;
        border-radius: 12px;
        border: 1px solid var(--border-soft);
        background: var(--white);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #screen-leads .lead-details .event-editor-nav .btn svg {
        width: 22px;
        height: 22px;
    }

    #screen-leads .lead-details .event-editor-nav .btn.prev {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--white);
    }

    #screen-leads .lead-details-main {
        display: flex;
        flex-direction: row;
        padding: 0;
        gap: 0;
        background: var(--bg-app);
        flex: 1;
        min-height: 0;
    }

    #screen-leads .lead-details-column-1 {
        background: var(--white);
        border-radius: 0;
        padding: 30px;
        border: none;
        border-left: 1px solid var(--border-soft);
        width: 360px;
        max-width: 360px;
        flex: 0 0 360px;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-sizing: content-box;
        overflow-y: scroll;
    }

    #screen-leads .lead-details .lead-profile-avatar {
        --_avatar-clr: var(--primary);
        width: 90px;
        height: 90px;
        border-radius: 50%;
        background: color-mix(in srgb, var(--_avatar-clr) 12%, var(--white));
        color: var(--_avatar-clr);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
        flex-shrink: 0;
        position: relative;
    }
    #screen-leads .lead-details .lead-profile-avatar > svg {
        width: 38px;
        height: 38px;
    }
    #screen-leads .lead-details .lead-profile-avatar[data-lead-source="answered"] {
        --_avatar-clr: var(--lbl1);
    }
    #screen-leads .lead-details .lead-profile-avatar[data-lead-source="in-call"] {
        --_avatar-clr: var(--lbl1);
    }
    #screen-leads .lead-details .lead-profile-avatar[data-lead-source="missed"] {
        --_avatar-clr: var(--delete);
    }
    #screen-leads .lead-details .lead-profile-avatar[data-lead-source="message"] {
        --_avatar-clr: var(--lbl5);
    }
    #screen-leads .lead-details .lead-profile-avatar[data-lead-source="in-call"]::after {
        content: "";
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--_avatar-clr);
        position: absolute;
        top: 2px;
        right: 2px;
        animation: pulse 1.2s infinite;
    }

    #screen-leads .lead-details-column-2 {
        border-radius: 0;
        background: unset;
        padding: 0;
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #screen-leads .lead-details .form-grid .field {
        display: block;
        width: 100%;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-name) {
        margin: 0;
        order: 1;
        position: relative;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-name) .status-combo-group {
        background: transparent;
        border: none;
        padding: 0;
        width: 100%;
        display: block;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-phone) {
        margin: 0 0 14px 0;
        order: 2;
        position: relative;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-phone) .status-combo-group {
        background: transparent;
        border: none;
        padding: 0;
        width: 100%;
        display: block;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-crmstatus) {
        margin: 0;
        order: 3;
    }

    #screen-leads .lead-details .form-grid .field:has(#leadHintBadge) {
        display: none;
    }

    #screen-leads .lead-details #leadHintBadge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 12px;
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--lbl1) 35%, var(--border-soft));
        background: color-mix(in srgb, var(--lbl1) 18%, var(--white));
        color: var(--black);
        font-weight: 800;
        font-size: 12px;
        white-space: nowrap;
    }

    #screen-leads .lead-details #leadHintBadge::after {
        content: '';
        width: 18px;
        height: 18px;
        display: inline-block;
        background: currentColor;
        opacity: 0.0;
    }

    #screen-leads .lead-details #lead-save-main {
        display: none;
    }

    #screen-leads .lead-details select.input.lead-main-crmstatus {
        display: block;
        border-radius: 12px;
        padding: 12px 16px;
        font-weight: 600;
        min-height: 46px;
        width: 100%;
        text-align: center;
        background: var(--lightblue2);
        border: 1px solid var(--border-soft);
        color: var(--primary);
        font-size: 16px;
    }

    #screen-leads .lead-details .form-grid #lead-save-main {
        grid-column: 1 / -1;
        margin-top: 6px;
    }

    #screen-leads .lead-details .lead-main-name {
        font-size: 24px;
        font-weight: 700;
        color: var(--black);
        border: none;
        border-radius: 0;
        padding: 0;
        background: transparent;
        text-align: center;
        line-height: 1.2;
        outline: none;
        box-shadow: none;
        width: 100%;
    }

    #screen-leads .lead-details .lead-main-name:focus {
        outline: none;
        border: none;
        box-shadow: none;
    }

    #screen-leads .lead-details .lead-main-phone {
        display: block;
        justify-content: center;
        color: #6b7280;
        font-size: 15px;
        padding: 0;
        text-align: center;
        direction: ltr;
        font-weight: 400;
        margin-top: 4px;
        width: 100%;
    }

    #screen-leads .lead-details .lead-main-phone .event-view-icon {
        display: none;
    }

    #screen-leads .lead-details .lead-main-phone span {
        display: block;
        width: 100%;
        text-align: center;
    }

    #screen-leads .lead-details .lead-name-edit-btn.btn.icon-only {
        position: absolute;
        left: 53%;
        top: 50%;
        transform: translate(-50%, -50%) translateX(90px);
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-name):hover .lead-name-edit-btn.btn.icon-only {
        opacity: 0.65;
        pointer-events: auto;
    }

    #screen-leads .lead-details .lead-name-edit-btn.btn.icon-only.always-visible-when-empty {
        opacity: 0.65;
        pointer-events: auto;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-name):hover .lead-name-edit-btn.btn.icon-only:hover {
        opacity: 1;
    }

    #screen-leads .lead-details .lead-main-name:focus {
        background: var(--white);
        border: 1px solid var(--primary) !important;
        border-radius: 6px;
        padding: 8px 12px;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    }

    #screen-leads .lead-details .lead-call-actions {
        margin-top: 20px;
        padding-top: 0;
        border-top: none;
        gap: 12px;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        align-items: stretch;
    }

    #screen-leads .lead-details #leadWhatsappBtn,
    #screen-leads .lead-details #leadCallBtn,
    #screen-leads .lead-details #leadTaskBtn,
    #screen-leads .lead-details .ai-button,
    #screen-leads .lead-details .lead-task-btn {
        width: 100%;
        min-height: 60px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        justify-content: center;
        border: 1px solid var(--border-soft);
        background: var(--white);
        color: var(--black);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    #screen-leads .lead-details #leadWhatsappBtn {
        border-color: #d1fae5;
        background: #ecfdf5;
        color: #059669;
    }

    #screen-leads .lead-details #leadCallBtn {
        border-color: #dbeafe;
        background: #eff6ff;
        color: var(--primary);
    }

    #screen-leads .lead-details .ai-button:hover {
        background: #e9d5ff;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons>.btn svg {
        flex-shrink: 0;
    }

    #screen-leads .lead-details #leadWhatsappBtn svg path,
    #screen-leads .lead-details #leadCallBtn svg path {
        fill: currentColor;
    }

    #screen-leads .lead-details #lead-call-player-host {
        margin-top: 10px;
    }

    #screen-leads .lead-details #lead-call-player-host .custom-player-bar {
        width: 100%;
        border-radius: 14px;
        border: 1px solid var(--border-soft);
        background: var(--lightblue2);
        padding: 12px 12px;
    }

    #screen-leads .lead-details .custom-player-bar .play-btn {
        background: var(--primary);
    }

    #screen-leads .lead-details .custom-player-bar .progress-fill {
        background: var(--primary);
    }

    #screen-leads .lead-details .lead-buttons-row {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border-soft);
        gap: 10px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: stretch;
    }

    #screen-leads .lead-details .lead-buttons-row .btn {
        border-radius: 12px;
        min-height: 42px;
        font-weight: 800;
    }

    #screen-leads .lead-details .lead-buttons-row .btn.btn-outline {
        border-color: var(--primary);
        color: var(--primary);
        background: var(--white);
        padding: 10px 16px;
        white-space: nowrap;
        min-width: 170px;
        justify-content: center;
    }

    #screen-leads .lead-details #lead-save-main {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--white);
        width: 100%;
    }

    #screen-leads .lead-details #lead-save-main:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
    }

    #screen-leads .lead-details .lead-inline-task-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
        padding-top: 14px;
        border-top: 1px solid color-mix(in srgb, var(--border-soft) 65%, transparent);
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-add-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-message-input {
        width: 100%;
        padding: 12px 14px;
        border-radius: 10px;
        border: 1px solid var(--border-soft);
        background: var(--white);
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-second-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-second-row .tw-date-picker,
    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-second-row .tw-time-picker {
        width: 100%;
        max-width: 49%;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-datetime-picker {
        max-width: 100%;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-reminder-datetime-picker .tw-dp-trigger {
        width: 100%;
        min-height: 42px;
        border-radius: 10px;
        border: 1px solid var(--border-soft);
        background: var(--white);
        padding: 8px 10px;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-task-buttons {
        display: flex;
        gap: 10px;
        align-items: center;
        margin: 0;
    }

    #screen-leads .lead-details .lead-inline-task-form #lead-add-task-btn-inline.btn-outline {
        background: var(--white);
        border-color: var(--primary);
        color: var(--primary);
        font-weight: 800;
        min-height: 40px;
        border-radius: 10px;
    }

    #screen-leads .lead-details .lead-inline-task-form .btn.btn-light {
        min-height: 40px;
        border-radius: 10px;
        border: 1px solid var(--border-soft);
        background: var(--white);
        color: var(--black);
    }

    #screen-leads .comments-box.lead-timeline-card {
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #screen-leads .lead-timeline-card .editor-title {
        font-size: 15px;
        font-weight: 800;
        color: var(--text1);
        margin: 0;
        padding: 1rem .5rem 0 0;
        flex-shrink: 0;
    }

    #screen-leads .timeline-container {
        position: relative;
        padding: 0 54px 18px 20px;
        flex: 1;
        overflow-y: auto;
    }

    #screen-leads .leads-history-row.timeline-item,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta {
        position: relative;
        display: flex;
        flex-direction: row-reverse;
        gap: 15px;
        margin: 0 0 20px;
    }

    #screen-leads .leads-history-row.timeline-item::after,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta::after {
        content: '';
        position: absolute;
        top: 36px;
        right: -36px;
        bottom: -20px;
        width: 2px;
        background: color-mix(in srgb, var(--border-soft) 70%, var(--gray));
        z-index: 0;
    }

    #screen-leads .leads-history-row.timeline-item:last-child::after,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta:last-child::after {
        display: none;
    }

    #screen-leads .timeline-avatar {
        position: absolute;
        right: -54px;
        top: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--white);
        border: 1px solid var(--border-soft);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        z-index: 1;
        font-size: 14px;
        font-weight: 700;
        color: var(--text1);
    }

    #screen-leads .timeline-avatar i {
        font-size: 14px;
    }

    #screen-leads .timeline-avatar-answered {
        background: color-mix(in srgb, var(--primary) 10%, var(--white));
        color: var(--primary);
        border-color: color-mix(in srgb, var(--primary) 20%, var(--white));
    }

    #screen-leads .timeline-avatar-missed {
        background: color-mix(in srgb, var(--delete) 10%, var(--white));
        color: var(--delete);
        border-color: color-mix(in srgb, var(--delete) 20%, var(--white));
    }

    #screen-leads .timeline-avatar-note {
        background: var(--white);
        color: var(--text1);
    }

    #screen-leads .timeline-avatar-meta {
        background: #fef3c7;
        color: #d97706;
        border-color: #fde68a;
    }

    #screen-leads .timeline-card-content {
        flex: 1;
        padding: 1rem;
        background: var(--white);
        border-radius: 0 12px 12px 12px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
        border: 1px solid var(--border-soft);
    }

    #screen-leads .leads-history-row.timeline-item::before,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta::before {
        display: none;
    }

    #screen-leads .leads-history-meta {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        font-size: 12px;
        color: #64748b;
        flex-wrap: wrap;
    }

    #screen-leads .lead-inline-comment-form {
        flex-shrink: 0;
        padding: 20px;
        border-radius: 0;
        background: var(--white);
        border-top: 1px solid var(--border-soft);
        z-index: 2;
        box-shadow: 0 -10px 15px -3px rgba(0, 0, 0, 0.05);
    }

    #screen-leads .lead-inline-comment-form .comments-add {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        margin: 0;
        padding: 0;
        gap: 1rem;
        flex-direction: row;
    }

    #screen-leads .lead-inline-comment-form textarea.input.lead-add-note-input {
        flex: 1;
        min-height: 46px;
        max-height: 92px;
        border-radius: 12px;
        background: var(--bg-app);
        border: 1px solid var(--border-soft);
        padding: 12px 14px;
        resize: none;
        overflow: hidden;
    }

    #screen-leads .lead-inline-comment-form textarea.input.lead-add-note-input:focus {
        flex: 1;
        min-height: 46px;
        max-height: 92px;
        border-radius: 12px;
        background: var(--lightblue2);
        border: 1px solid var(--primary);
        padding: 12px 14px;
        resize: none;
        overflow: hidden;
        box-shadow: 0 0 0 4px rgba(30, 78, 132, 0.1);
    }

    #screen-leads .lead-inline-comment-form #lead-add-note-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        border-radius: 12px;
        background: var(--primary);
        border-color: var(--primary);
        color: var(--white);
        justify-content: center;
        padding: 0;
    }

    #screen-leads .lead-inline-comment-form #lead-add-note-btn span {
        display: none;
    }

    #screen-leads .lead-inline-comment-form #lead-add-note-btn svg {
        margin: 0;
    }

    /* Lead Meta Player Card (Desktop Only) */
    .lead-meta-player-top {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
    }

    .lead-meta-play-circle {
        width: 44px;
        height: 44px;
        background: var(--primary);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 5px 15px rgba(30, 78, 132, 0.3);
        border: none;
        flex-shrink: 0;
    }

    .lead-meta-play-circle:hover {
        background: var(--brand-dark, #0f294d);
    }

    .lead-meta-wave-visual {
        flex: 1;
        height: 30px;
        display: flex;
        align-items: center;
        gap: 3px;
        opacity: 0.8;
    }

    .lead-meta-bar {
        width: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        animation: wave 1.2s infinite paused;
    }

    @keyframes wave {
        0%, 100% {
            height: 40%;
        }

        50% {
            height: 100%;
        }
    }

    .lead-meta-bar.active {
        background: var(--primary);
        animation-play-state: running;
    }

    .lead-meta-bar:nth-child(2n) {
        height: 60%;
    }

    .lead-meta-bar:nth-child(3n) {
        height: 100%;
    }

    @keyframes lead-meta-wave {
        0%, 100% {
            height: 40%;
        }
        50% {
            height: 100%;
        }
    }

    .lead-meta-time-label {
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
        flex-shrink: 0;
    }

    /* AI Summary in Lead Meta */
    #screen-leads .lead-main-meta .leads-history-text[data-ai-transcript="1"] {
        background: linear-gradient(135deg, #f0fdfa 0%, #eff6ff 100%);
        border: 1px solid #ccfbf1;
        border-radius: 12px;
        padding: 15px;
        font-size: 14px;
        color: #334155;
        line-height: 1.5;
        margin-top: 0;
    }

    #screen-leads .lead-details .lead-buttons-row .btn.btn-outline {
        border-radius: 10px;
        padding: 10px 18px;
        min-height: 42px;
        border: 1px solid var(--primary);
        color: var(--primary);
        background: var(--white);
        font-weight: 800;
        justify-content: center;
    }

    #screen-leads .lead-details .lead-buttons-row .btn.btn-outline:hover {
        background: color-mix(in srgb, var(--primary) 8%, var(--white));
    }
}

.lead-fields-wrapper {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
}


.lead-details-column-1 {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.lead-profile-avatar {
    display: none;
}

.lead-buttons-row {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    justify-content: space-between;
    border-top: 1px solid var(--border-soft);
}
.lead-buttons-row .btn.primary {
    margin-right: auto;
}

.lead-details-column-2 .comments-add {
    margin-top: 1rem;
}

.call-player-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: .5rem 0 1rem;
}


#leadListenBtn {
    width: 100%;
    max-width: 90px;
}

#screen-leads .call-player {
    width: 179px;
}

#screen-leads .call-player audio {
    width: 100%;
    height: 30px;
}

.custom-player-bar {
    background: var(--white);
    border-radius: 50px;
    padding: 8px 12px;
    display: none;
    align-items: center;
    gap: 12px;
    border: 1px solid #eaecf0;
    direction: rtl;
    width: 96%;
    margin-right: auto;
}

#lead-call-player-host .custom-player-bar { 
    margin: 0;
    width: 100%;
}

.custom-player-bar.show {
    display: flex;
}

.custom-player-bar audio {
    display: none;
}

.custom-player-bar .play-btn {
    width: 44px;
    height: 44px;
    background: #1e4e8c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-player-bar .progress-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.custom-player-bar .track-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.custom-player-bar .track-info #player-time {
    color: #667085;
}

.custom-player-bar .progress-container {
    width: 100%;
    height: 6px;
    background: #e4e7ec;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.custom-player-bar .progress-fill {
    width: 0%;
    height: 100%;
    background: #1e4e8c;
    border-radius: 10px;
}

.custom-player-bar .speed-btn {
    background: #f2f4f7;
    color: #1d2939;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    border: none;
}

.custom-player-bar .close-btn {
    color: #667085;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    display: none;
}

.lead-call-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: stretch;
    margin-top: 1rem;
}

#screen-leads .lead-details .lead-call-actions .lead-task-buttons {
    width: 100%;
    justify-content: flex-start;
    flex-direction: row;
}

.lead-call-actions .btn {
    color: var(--primary);
    border: 1px solid var(--primary);
    background: none;
    background: var(--white);
    min-height: 30px;
}

.lead-call-actions .btn svg {
    width: 20px;
    height: auto;
}

.lead-call-actions .lead-call-duration {
    width: 100%;
    text-align: center;
}

.lead-stats-cards-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .lead-stats-cards-wrapper {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        order: 4;
    }

    #screen-event-card .results .table,
    #screen-leads .leads-layout .table {
        padding: 0;
    }

    #screen-event-card .results .table-row,
    #screen-leads .table-row {
        padding: 0;
        min-height: unset;
    }

    #screen-leads .leads-layout .table-head::before, #screen-tasks .table-head::before {
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
    }

    #screen-event-card .results .table-head::before {
        background: var(--white);
        border-bottom: none;
    }

    #screen-event-card .table-row > div {
        padding: .7rem 1.25rem;
    }
}

.lead-stat-card {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.lead-stat-card--done {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.lead-stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    direction: rtl;
}

.lead-stat-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-stat-card--done .lead-stat-card-title {
    color: #10b981;
}

.lead-stat-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    border: none;
}

.lead-stat-card-badge--done {
    color: #10b981;
}

/* Expand icon */
.lead-stat-card-expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: var(--text1);
    opacity: 0.7;
    margin-right: auto;
}

.lead-stat-card-expand-icon.rotated {
    transform: rotate(180deg);
}

/* Card expanded state */
.lead-stat-card--expanded {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Content area */
.lead-stat-card-content {
    padding: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-stat-card-content.hidden {
    display: none;
}

/* Empty state */
.lead-stat-card-empty {
    padding: 12px;
    text-align: center;
    color: var(--text2);
    font-size: 13px;
}

/* Task item */
.lead-stat-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.lead-stat-task-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Checkbox (read-only) */
.lead-stat-task-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.lead-stat-task-checkbox svg {
    width: 14px;
    height: 14px;
}

/* Task content */
.lead-stat-task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-stat-task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text1);
    line-height: 1.4;
}

.lead-stat-task-date {
    font-size: 12px;
    color: var(--text2);
    direction: rtl;
}

.lead-main-phone {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    font-size: 15px;
    padding: 0;
}

#screen-leads .leads-layout.has-details {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.9fr);
}

#lead-add-task-btn {
    white-space: nowrap;
}

#screen-tasks .tasks-source-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

#screen-tasks .tasks-source-link:hover {
    color: var(--primary-dark);
}

.table:has(.tasks-two-zone-layout) {
    background: none;
    padding: 0;
    padding-top: 0;
}

.tasks-list-container {
    background: var(--white);
    border-radius: var(--table-radius);
    padding: var(--table-card-pad);
}

.tasks-split-container {
    display: grid;
    grid-template-columns: 65.9% 32.3%;
    gap: 1.5rem;
    margin-top: 0;
}

.task-list-meta-info .fw-bold {
    display: none;
}

.tasks-panel {
    background: var(--white);
    border-radius: var(--table-radius);
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.tasks-panel-completed {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.tasks-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 1rem;
}

.tasks-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tasks-panel-completed .tasks-panel-title,
.tasks-panel-completed .tasks-count-badge {
    color: #10b981;
}

.tasks-count-badge {
    background: #f1f5f9;
    padding: 0.125rem 0.625rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}

.tasks-panel .tasks-list-container {
    padding: 0;
    background: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.tasks-panel .tasks-list-container .task-list-item {
    border: 1px solid #e2e8f0;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-card-title-wrap .task-card-edit-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    align-items: center;
    display: flex;
    gap: .3rem;
    border-radius: .5rem;
}

.task-card-meta-wrap .task-edit-picker {
    z-index: 10;
}

.task-card-title-wrap .task-card-edit-icon:hover {
    background-color: var(--gray);
}

.task-card-meta-wrap .btn.icon-only.task-edit-icon {
    margin-left: 2.2rem;
}

.task-card-meta-wrap .btn.icon-only.task-edit-icon svg {
    width: 14px;
    height: 14px;
}

.tasks-empty-message {
    text-align: center;
    color: #cbd5e1;
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

.tasks-date-filter-wrapper {
    display: flex;
    align-items: center;
    gap: .5rem;
}

#screen-tasks #tasksMobileQuickSearchWrap {
    display: none;
}

.tasks-date-filter-select {
    cursor: pointer;
}

.task-list-source-wrapper {
    display: flex;
    align-items: center;
}

.task-list-source-wrapper .module-source-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.task-list-source-wrapper .module-source-icon:hover {
    transform: scale(1.1);
}

.tasks-date-filter-select {
    min-width: 140px;
}

.tasks-custom-range-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.tasks-custom-range-wrapper.hidden {
    display: none;
}

.tasks-date-input {
    min-width: 140px;
    font-size: 14px;
}


@media (max-width: 767px) {
    .lead-details.is-open {
        padding: 0;
        background: var(--bg-mobile);
        gap: 0;
    }
    
    .tasks-split-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #screen-tasks .card-header {
        justify-content: flex-end;
        align-items: center;
        flex-direction: row-reverse;
        gap: .5rem;
        background: rgba(0, 0, 0, 0.02);
        border: unset;
        position: static;
        margin: -35px .5rem 0;
    }

    #screen-tasks .screen-header-actions {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
        position: static;
        margin-top: 50px;
        margin-bottom: 1rem;
        background: none;
        padding: 0px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
    }

    .lead-hint-text {
        padding-right: 0 !important;
    }

    #screen-tasks .screen-header-actions .btn:first-child {
        display: none !important;
    }

    #screen-tasks .screen-header-actions .tasks-date-filter-wrapper {
        display: none !important;
    }

    #screen-tasks .screen-header-actions #tasksMobileQuickSearchWrap {
        display: block;
        flex: 1;
        width: auto;
        max-width: calc(100% - 78px);
    }

    #screen-tasks .screen-header-actions #tasksMobileQuickSearch {
        font-size: 14px;
        border-radius: 30px !important;
        text-align: right !important;
        direction: rtl;
        padding-right: 46px;
        padding-left: 12px;
    }

    #screen-tasks .screen-header-actions #tasksMobileQuickSearch::placeholder {
        text-align: right;
        direction: rtl;
    }

    #screen-tasks .screen-header-actions #tasksMobileQuickSearchWrap .search-icon-inline {
        right: 12px;
    }

    #screen-tasks .screen-header-actions .btn:last-child {
        display: inline-flex !important;
        align-items: center;
        gap: 0.5rem;
    }

    #screen-tasks .screen-header-actions .btn:last-child span {
        display: none;
    }

    #screen-tasks .table {
        border: none;
        margin-top: -30px;
    }

    #screen-tasks .table-head,
    #screen-tasks .table-row {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    #screen-tasks .table-row {
        border: 1px solid var(--border-soft);
        margin-bottom: 1rem;
        border-radius: 1rem;
        padding: .75rem;
    }

    #screen-tasks .table-row > div::before {
        content: attr(data-label);
        display: block;
        color: var(--primary);
        font-size: 15px;
        font-weight: 500;
        margin-bottom: .25rem;
        border-radius: .5rem .5rem 0 0;
    }

    #screen-tasks .table-head>div,
    #screen-tasks .table-row>div {
        padding: 0;
        border: none;
        margin: 0;
        text-align: right;
        width: 100%;
        display: flex;
        align-items: flex-start;
        gap: .5rem;
        border-bottom: 1px solid var(--border-soft);
        padding-bottom: .25rem;
        justify-content: flex-start;
        padding-right: .5rem;
        padding-left: .5rem;
    }

    #screen-tasks .table-head {
        display: none;
    }

    #screen-tasks .task-card-title,
    #screen-tasks .task-card-title-input {
        font-size: 15px;
        font-weight: 700;
        color: var(--text1);
    }
}

#screen-tasks .table-row.task-done {
    opacity: 0.6;
}

#screen-tasks .table-empty {
    padding: 2rem;
    text-align: center;
    color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-4);
    font-size: clamp(14px, 2.5vw, 16px);
    background: var(--white);
    border-radius: var(--table-radius);
}

.lead-views-row-main {
    width: 100%;display: flex;
    gap: .5rem;
    align-items: center;
}

.leads-history-text.lead-views-row-main {
    display: flex;
    align-items: flex-start;
}

#screen-leads .lead-call-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#screen-leads .lead-call-left {
    flex: 1;
}

#screen-leads .lead-call-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.listen_call_link {
    display: inline-flex;
    width: fit-content;
    height: 30px;
    max-height: 30px;
    min-height: unset;
    max-width: 90px;
}

@media (min-width: 768px) {
    #screen-leads .table-head > div:last-of-type,
    #screen-leads .table-row > div:last-of-type {
        border: none;
    }

    .lead-call-actions .btn:hover {
        background: var(--lightblue);
    }

    /* #screen-leads .table-row:hover {
        background-color: var(--lightblue);
    } */

    #screen-leads .table-row:hover .lead-name-user-icon {
        color: #2563eb;
        background-color: #daeaff;
    }

    #screen-leads .leads-row:hover {
        border: 1px solid var(--primary);
        background: var(--white);
        box-shadow: 0 8px 18px var(--gray);
    }

    .tasks-panel .tasks-list-container .task-list-item:hover {
        border: 1px solid var(--primary);
    }


    #screen-leads .table-row > div.lead-mobile-actions,
    .phone-icon,
    .task-source {
        display: none;
    }
}

#screen-leads .lead-details .form-grid {
    align-items: center;
    flex-direction: row;
    gap: 1rem;
}

#screen-leads .lead-details .lead-main-name,
#screen-leads .lead-details select.input.lead-main-crmstatus {
    text-align: right;
}

#screen-leads .lead-details .lead-main-name {
    font-weight: 500;
    font-size: clamp(18px, 2.6vw, 22px);
    color: var(--primary);
}

#screen-leads .lead-details .status-combo-group:has(#leadMainStatus),
#screen-leads .lead-details .status-combo-group:has(.lead-main-phone) {
    border-bottom: none;
    box-shadow: none;
}

#screen-leads .lead-details select.input.lead-main-crmstatus {
    --status-color: var(--primary);
    color: var(--status-color);
    background: color-mix(in srgb, var(--status-color) 10%, var(--white));
    border: none;
    border-radius: 999px;
    padding: 3px 10px 3px 28px;
    font-size: 14px;
    font-weight: 500;
    width: fit-content;
    min-height: auto;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 12px;
    cursor: pointer;
}

#screen-leads select.input.lead-main-crmstatus option {
    background-color: var(--white);
    color: var(--black);
}

#screen-leads select.input.lead-main-crmstatus option:checked {
    background-color: var(--primary);
    color: var(--white);
}

.event-view-icon {
    width: 20px;
    height: auto;
}

.status-in-call {
    padding-right: 20px;
    position: relative;
}

.status-in-call::before{
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #026AA2;
    position: absolute;
    right: 8px;
    top: 9px;
    animation: pulse 1.2s infinite;
}

#screen-leads .table-row > div[data-label="נוצר"] > div:first-child {
    font-weight: 500;
}

#screen-leads .table-row > div[data-label="נוצר"] > div + div {
    font-weight: 400;
    color: var(--text1);
    font-size: 13px;
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    font-size: inherit;
    line-height: 1.2;
    width: fit-content;
    max-width: 100%;
    background: transparent;
    border: none;
    color: var(--text1);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    flex: 0 0 auto;
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="0"]::before {
    background: var(--gray);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="1"]::before {
    background: var(--primary);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="3"]::before {
    background: var(--lbl3);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="4"]::before {
    background: var(--lbl4);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="10"]::before {
    background: var(--btn-primary);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="11"]::before {
    background: var(--lbl5);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="12"]::before {
    background: var(--btn-pr-hover);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="20"]::before {
    background: var(--lbl2);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="21"]::before {
    background: var(--primary-dark);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="22"]::before {
    background: var(--indicator);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="99"]::before {
    background: var(--dark-gray);
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="2"] {
    gap: 0;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 400;
    font-size: inherit;
    color: var(--white);
    background: var(--lbl1);
    border: none;
}

#screen-leads .table-row > div[data-label="סטטוס אוטומטי"] .lead-hint-label[data-hint-primary="2"]::before {
    content: none;
}

#screen-leads .table-row > div[data-label="סטטוס"] .lead-crmstatus-label {
    background: var(--white);
    border: 2px solid transparent;
    color: var(--black);
    max-width: 100%;
}

#screen-leads #leadHintBadge.status-label {
    font-size: inherit;
    font-weight: 400;
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary]::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-inline-end: 8px;
    background: var(--border);
    opacity: 0.9;
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="0"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="0"]::before {
    background: var(--gray);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="1"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="1"]::before {
    background: var(--primary);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="2"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="2"]::before {
    background: var(--lbl1);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="3"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="3"]::before {
    background: var(--lbl3);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="4"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="4"]::before {
    background: var(--lbl4);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="10"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="10"]::before {
    background: var(--btn-primary);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="11"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="11"]::before {
    background: var(--lbl5);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="12"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="12"]::before {
    background: var(--btn-pr-hover);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="20"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="20"]::before {
    background: var(--lbl2);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="21"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="21"]::before {
    background: var(--primary-dark);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="22"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="22"]::before {
    background: var(--indicator);
}

#screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="99"]::before,
#screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="99"]::before {
    background: var(--dark-gray);
}

#screen-leads .table-row > div[data-label="נוצר"] {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    text-align: right;
}

@keyframes pulse{
    0%{
        transform: scale(0.7);
        opacity: 0.4;
    }
    50%{
        transform: scale(1.4);
        opacity: 1;
    }
    100%{
        transform: scale(0.7);
        opacity: 0.4;
    }
}

@media (max-width: 900px) {
    #screen-leads .leads-layout {
        margin-top: 20px;
        margin-bottom: 0;
        padding-bottom: 5rem;
    }

    /* במובייל - תיקון inline edit */
    .btn.icon-only.inline-edit-icon {
        position: static;
        opacity: 1;
        margin-right: 0.5rem;
    }

    .inline-editable-container {
        justify-content: flex-start;
    }

    .lead-details {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
        box-shadow: none;
        scrollbar-width: none;
        z-index: 9999;
        background: var(--white);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .lead-details::-webkit-scrollbar {
        display: none;
    }

    .lead-mobile-header {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        background: var(--primary);
        color: var(--white);
        padding: 1rem;
        padding-top: max(20px, env(safe-area-inset-top));
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 1000;
        flex-shrink: 0;
        max-height: 60px;
    }

    .lead-mobile-header h1 {
        font-size: 20px;
        font-weight: 600;
        margin: 0;
        flex: 1;
        text-align: center;
        order: 2;
    }

    .lead-mobile-nav-prev {
        order: 1;
    }

    .lead-mobile-nav-next {
        order: 3;
    }

    .lead-mobile-nav-btn,
    .lead-mobile-close-btn {
        background: none;
        border: none;
        color: var(--white);
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .lead-mobile-nav-prev {
        margin-right: 32px;
    }

    .lead-mobile-nav-btn svg,
    .lead-mobile-close-btn svg {
        width: 24px;
        height: 24px;
        stroke: var(--white);
        stroke-width: 2;
    }

    .lead-mobile-back-btn {
        background: none;
        border: none;
        color: var(--white);
        font-size: 22px;
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        order: 3;
    }

    .lead-mobile-close-btn {
        order: 4;
        padding: 0;
        width: 26px;
        height: 26px;
    }

    .lead-mobile-back-btn svg {
        width: 24px;
        height: 24px;
        stroke: var(--white);
        stroke-width: 2;
    }
    
    .lead-mobile-close-btn svg {
        stroke: var(--gray);
        width: 26px;
        height: 26px;
    }

    .lead-mobile-header-spacer {
        width: 26px;
        height: 26px;
        order: 1;
    }

    .lead-mobile-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .lead-mobile-content::-webkit-scrollbar {
        display: none;
    }

    .lead-details .editor-topbar {
        display: none;
    }

    .lead-mobile-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
        z-index: 10000;
        display: flex;
        flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .lead-mobile-input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-radius: 24px 24px 0 0;
        padding: 20px;
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.15);
        z-index: 20000;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }

    .lead-mobile-input-area.show {
        transform: translateY(0);
    }

    .lead-mobile-input-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(30, 78, 132, 0.4);
        z-index: 19999;
    }

    .lead-mobile-input-overlay.show {
        display: block;
    }

    .lead-mobile-input-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }

    .lead-mobile-input-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--black);
    }

    .lead-mobile-input-close {
        background: none;
        border: none;
        cursor: pointer;
        line-height: 1;
    }

    .lead-mobile-input-close svg {
        width: 24px;
        height: 24px;
        stroke-width: 1.5;
    }

    .lead-mobile-fab {
        position: fixed;
        bottom: 140px;
        left: 1rem;
        width: 56px;
        height: 56px;
        background: var(--primary);
        border-radius: 50%;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 9998;
    }

    .lead-mobile-fab svg {
        width: 24px;
        height: 24px;
        fill: var(--white);
    }

    .lead-mobile-input-box {
        width: 100%;
        padding: 14px 16px;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        font-size: 15px;
        background: #F9FAFB;
        margin-bottom: 12px;
        outline: none;
        text-align: right;
        resize: none;
        font-family: inherit;
        min-height: 80px;
    }

    .lead-mobile-input-box:focus {
        border-color: var(--primary);
        background: var(--white);
    }

    .lead-mobile-controls-row {
        display: flex;
        gap: 10px;
        align-items: stretch;
    }

    .lead-mobile-status-wrapper {
        flex: 1;
        position: relative;
        min-width: 150px;
        display: flex;
    }

    .lead-mobile-input-area .lead-mobile-status-wrapper select,
    .lead-mobile-status-wrapper select.lead-mobile-crmstatus,
    .lead-mobile-status-wrapper select.lead-main-crmstatus {
        width: 100% !important;
        min-height: 100% !important;
        display: block !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        padding: .75rem 1rem !important;
        border: none !important;
        border-radius: 8px !important;
        padding-left: 2.5rem !important;
        background-position: 0.75rem center !important;
        background-repeat: no-repeat !important;
        background-size: 20px 20px !important;
        cursor: pointer !important;
    }

    .lead-mobile-btn-update {
        flex: 2;
        background: var(--primary);
        color: var(--white);
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    }

    .lead-mobile-btn-update svg {
        width: 20px;
        height: 20px;
    }

    .lead-mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        padding: 0;
        padding-bottom: 32px;
        background: var(--white);
    }

    .lead-details.mobile-android .lead-mobile-bottom-nav {
        padding-bottom: 54px;
    }

    .lead-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: #9CA3AF;
        cursor: pointer;
        width: 25%;
        padding: 12px 4px;
        border-radius: 8px;
        transition: all 0.2s;
    }

    .lead-mobile-nav-item:not(:first-of-type) {
        pointer-events: none !important;
        opacity: .5;
    }

    .lead-mobile-nav-item.active {
        color: var(--primary);
        background: rgba(37, 99, 235, 0.05);
    }

    .lead-mobile-nav-item svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
    }

    .lead-mobile-nav-item span {
        font-size: 11px;
        font-weight: 500;
    }

    .lead-mobile-content {
        padding-bottom: 120px;
    }

    .lead-buttons-row {
        display: none !important;
    }

    #screen-leads .screen-header-actions {
        margin-inline-start: .25rem;
        gap: .5rem;
    }

    #screen-leads .screen-header-actions .btn {
        padding: .3rem .55rem;
        font-size: 14px;
        min-height: 32px;
        white-space: nowrap;
    }

    #screen-leads #leadsRefreshBtn span {
        white-space: normal;
    }

    #leadMobileQuickSearchWrap {
        display: block;
        margin: -15px 0 .5rem;
    }

    #leadMobileQuickSearchWrap .search-icon-inline {
        right: 0.75rem;
    }

    #screen-leads #leadMobileQuickSearch.search-input-inline {
        padding-right: 38px;
    }

    #screen-leads .leads-filters {
        margin-top: .25rem;
        margin: 0;
    }

    #screen-leads .table {
        border: none;
    }

    #screen-leads .table-head,
    #screen-leads .table-row {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    #screen-leads .table-row {
        margin-bottom: 1rem;
        border-radius: 1rem;
        padding: 20px;
        background: var(--white);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
        border: 1px solid #EAECF0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    #screen-leads .table-head>div,
    #screen-leads .table-row>div {
        padding: 0;
        margin: 0;
        border: none;
    }

    .lead-details-column-1 {
        display: none !important;
    }

    #screen-leads .lead-details .form-grid {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    .lead-buttons-row {
        position: sticky;
        bottom: 74px;
        left: 0;
        right: 0;
        margin: 0;
        padding: 1rem 1.5rem;
        background: var(--white);
        border-top: 1px solid var(--border-soft);
        z-index: 100;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-auto-columns: revert-layer;
        gap: 1rem;
        direction: ltr;
    }

    #screen-leads .table-row > div::before,
    #screen-leads .table-row>div:nth-child(1),
    .editor-topbar,
    .lead-main-crmstatus,
    .lead-buttons-row .btn-outline,
    .timeline-container::before,
    .lead-main-meta-row .lead-main-meta::before,
    .leads-history-row.timeline-item::before,
    .leads-history-row.timeline-item::after,
    .lead-main-meta-row.timeline-item.timeline-item-meta {
        display: none;
    }

    .form-grid .field>div.status-combo-group {
        border: none;
        box-shadow: none;
        justify-content: center;
    }
    

    #screen-leads .lead-details .lead-main-name {
        text-align: center;
        font-size: 18px;
        font-weight: 600;
        color: var(--black);
    }

    .lead-name-main .btn {
        padding: 0;
        background: none;
        border: none;
        min-height: unset;
    }

    .lead-name-main input {
        border: none;
        border-bottom: 1px solid var(--border-soft);
        min-height: unset;
        border-radius: 0;
        padding: 0;
    }

    .lead-name-main input::selection {
        background: transparent;
        color: inherit;
    }

    .lead-name-main input::-moz-selection {
        background: transparent;
        color: inherit;
    }

    .lead-hint-text {
        font-size: 13px;
    }

    .lead-hint-text::before {
        width: 6px;
        height: 6px;
        margin-inline-end: 5px;
        margin-bottom: 1px;
    }

    #screen-leads .lead-name-main {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        gap: 5px;
        min-width: 0;
    }

    #screen-leads .lead-name-main > span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
    }

    #screen-leads .lead-name-edit-btn.btn.icon-only {
        background: transparent;
        border: none;
        padding: 0;
        min-height: unset;
        opacity: 0.65;
    }

    #screen-leads .lead-name-edit-btn.btn.icon-only svg {
        width: 12px;
        height: auto;
    }

    #screen-leads .table-row > div[data-label="צפייה"],
    #screen-leads .table-row > div[data-label="סוג"],
    #screen-leads .table-row > div[data-label="טלפון"],
    #screen-leads .table-row > div[data-label="וואטסאפ"],
    #screen-leads .table-row > div[data-label="מקור"],
    #screen-leads .table-row > div[data-label="הערות"],
    #screen-leads .leads-table-footer {
        display: none;
    }

    #screen-leads .table-row > div[data-label="שם"]>div {
        gap: .2rem;
    }

    #screen-leads .table-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-hint-text {
        margin-top: 4px;
        white-space: nowrap;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-name-main {
        font-size: 15px;
        font-weight: 600;
        color: #667085;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-name-cta {
        order: 1;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-name-cta,
    #screen-leads .table-row > div[data-label="שם"] .lead-mobile-name-phone {
        order: 3;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-mobile-hint-line {
        order: 4;
    }

    #screen-leads .table-row > div[data-label="סטטוס"] .lead-crmstatus-label {
        font-size: 12px;
    }

    #screen-leads .table-row > div[data-label="סטטוס"] select {
        padding: 3px 10px;
        border-radius: 999px;
        height: auto;
        min-height: unset;
        font-size: 12px;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-mobile-name-phone .phone-link {
        color: var(--text1);
        text-decoration: none;
        font-size: 15px;
        line-height: 1.25;
    }

    #screen-leads .table-row > div[data-label="שם"] .lead-mobile-name-phone {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    #screen-leads .table-row > div[data-label="סטטוס"] {
        margin-right: auto;
    }

    #screen-leads .table-row > div[data-label="סטטוס"] .lead-crmstatus-label {
        white-space: nowrap;
    }

    #screen-leads .table-row > div[data-label="נוצר"] {
        grid-column: 2;
        margin-right: auto;
        display: flex;
        flex-direction: row;
        gap: .5rem;
        margin-top: -1rem;
    }

    #screen-leads .table-row > div[data-label="נוצר"] > div {
        line-height: 1.2;
    }

    #screen-leads .table-row > div.lead-mobile-actions {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .phone-icon {
        width: 14px;
        height: auto;
        display: inline-block;
        color: var(--text1);
        opacity: 0.95;
        position: relative;
        overflow: visible;
    }

    .phone-icon[data-lead-source="in-call"]::after {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        position: absolute;
        top: -2px;
        right: -2px;
        animation: pulse 1.2s infinite;
    }

    .listen_call_link {
        border-radius: 1rem;
    }

    .status-answered {
        --status-color: var(--lbl2);
        background: color-mix(in srgb, var(--status-color) 14%, var(--white));
        color: var(--status-color);
    }

    .status-in-call {
        --status-color: var(--primary);
        background: color-mix(in srgb, var(--status-color) 14%, var(--white));
        color: var(--status-color);
        padding-right: 20px !important;
    }

    .status-not-answered {
        --status-color: var(--delete);
        background: color-mix(in srgb, var(--status-color) 14%, var(--white));
        color: var(--status-color);
    }

    .status-message {
        --status-color: var(--lbl5);
        background: color-mix(in srgb, var(--status-color) 14%, var(--white));
        color: var(--status-color);
    }

    .status-unknown {
        --status-color: var(--dark-gray);
        background: color-mix(in srgb, var(--status-color) 12%, var(--white));
        color: var(--status-color);
    }

    .status-written {
        --status-color: var(--lbl1);
        background: color-mix(in srgb, var(--status-color) 14%, var(--white));
        color: var(--status-color);
    }

    #screen-leads .table-head{
        display: none;
    }

    #screen-leads .table-row>div.lead-mobile-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        grid-column: 1 / -1;
        padding-top: 1rem;
        margin-top: .5rem;
        border-top: 1px solid var(--border-soft);
        order: 999;
    }
    
    .lead-mobile-btn {
        grid-column: span 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: .75rem 1rem;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .lead-mobile-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    .event-view-icon {
        width: 16px;
    }
    
    .lead-mobile-wa {
        color: var(--white);
        background: #25D366;
    }

    .lead-mobile-details {
        color: var(--white);
        background: var(--primary);
    }

    .btn-secondary.lead-action-btn {
        grid-column: span 1;
        background: var(--white);
        border: 1px solid #E2E8F0;
        color: var(--primary);
        padding: 12px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        transition: 0.2s;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }

    .btn-secondary.lead-action-btn:active {
        background-color: #F8FAFC;
        border-color: var(--primary);
    }

    .btn-secondary .icon-box {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-secondary .icon-box svg {
        width: 16px;
        height: 16px;
        stroke-width: 2.5;
    }
    
    .lead-mobile-info-card {
        background: var(--white);
        border-radius: 1rem;
        padding: 1rem;
        margin: 1.5rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: center;
        position: relative;
    }
    
    .lead-mobile-info-card>span {
        display: block;
        padding: 4px 10px;
        border-radius: 100px;
        font-weight: 600;
        white-space: nowrap;
        font-size: 14px;
        margin-bottom: .5rem;
    }
    
    .lead-mobile-name {
        font-size: 24px;
        font-weight: 700;
        color: var(--text-primary);
    }

    .inline-editable-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    .inline-editable-display {
        text-align: center;
    }

    .inline-editable-input {
        text-align: center;
        width: 0;
        min-width: 0;
        opacity: 0;
        pointer-events: none;
        transition: width 0.2s, opacity 0.2s;
    }

    .inline-editable-input.editing {
        width: 100%;
        min-width: 150px;
        opacity: 1;
        pointer-events: auto;
        display: block;
    }

    .inline-editable-input:not(.editing) {
        display: none;
    }

    .inline-editable-display.hidden {
        display: none;
    }

    .btn.icon-only.inline-edit-icon {
        opacity: 0.6;
        transition: opacity 0.2s;
        flex-shrink: 0;
        padding: 3px;
        min-height: unset;
        height: 24px;
        width: 24px;
        border-radius: 0;
        border: none;
        padding: 0;
        position: absolute;
        left: -0.5rem;
        top: -2.5rem;
    }

    .inline-edit-icon.hover {
        opacity: 1;
    }
    
    .lead-mobile-phone {
        font-size: 18px;
        color: var(--text-secondary);
        direction: ltr;
        text-align: right;
    }
    
    .lead-mobile-info-card .lead-main-meta-note {
        font-size: 14px;
        color: var(--text-secondary);
        line-height: 1.5;
        padding: 0;
        margin: .5rem 0;
    }
    
    .lead-mobile-cta-buttons {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .lead-mobile-cta-buttons .btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        padding: .75rem 1rem;
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
    }
    
    .lead-mobile-btn-call {
        background: var(--primary);
        color: var(--white);
        border: none;
    }
    
    .lead-mobile-btn-wa {
        background: #25D366;
        color: var(--white);
        border: none;
    }
    
    .lead-mobile-btn-call svg,
    .lead-mobile-btn-wa svg {
        width: 20px;
        height: 20px;
    }

    .lead-mobile-action-buttons {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 1rem;
    }

    .btn-secondary.lead-detail-action-btn {
        background: #e5f2fb;
        border: 1px solid #E2E8F0;
        color: var(--dark-gray);
        padding: .5rem 1rem;
        font-size: 16px;
        font-weight: 600;
        border-radius: .5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
        transition: 0.2s;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        width: 100%;
    }

    .btn-secondary.lead-detail-action-btn:last-of-type {
        color: #2e7843;
        background: #e8f6e9;
    }

    .btn-secondary.lead-detail-action-btn:active {
        background-color: #F8FAFC;
        border-color: var(--primary);
    }

    .btn-secondary.lead-detail-action-btn .icon-box {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-secondary.lead-detail-action-btn .icon-box svg {
        width: 24px;
        height: 24px;
        stroke: #9ca3af;
        stroke-width: 1.5;
    }
  
    #screen-leads .table-row {
        cursor: default;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons {
        justify-content: center;
    }

    #leadWhatsappBtn {
        color: var(--white);
        background: #25D366;
        border-radius: 1rem;
        border: none;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px 12px;
    }

    #leadWhatsappBtn svg path {
        fill: var(--white) !important;
    }

    #leadListenBtn {
        width: auto;
        max-width: unset;
        border-radius: 1rem;
        border-color: var(--border-soft);
        width: 105px;
    }

    #screen-leads .call-player {
        width: 100%;
    }

    #screen-leads .call-player audio {
        height: 40px;
    }

    #screen-leads .leads-history-row.timeline-item .call-player {
        width: 200px;
    }

    .save-lead {
        margin: 0;
    }

    .lead-details-main {
        gap: 0;
    }

    .comments-box.lead-timeline-card {
        background: none;
        margin-top: 0;
        padding: 0 .5rem;
    }

    .lead-main-meta-row .lead-main-meta {
        background: var(--white);
        border: none;
    }

    .leads-history-row.timeline-item {
        margin: 1rem 0 0;
        background: var(--white);
        border-radius: 1rem 4px 1rem 1rem;
    }

    .custom-player-bar {
        padding: 2px 10px;
    }

    .call-player-wrapper {
        margin: 1rem auto;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .custom-player-bar .play-btn {
        width: 33px;
        height: 33px;
    }

    #lead-call-player-host-mobile {
        margin: 1rem auto;
        order: 5;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .custom-player-bar {
        margin: 0;
    }

    #lead-call-player-host .custom-player-bar { 
        margin: 0 -.5rem;
        width: 105%;
    }

    .comments-add .lead-task-buttons,
    #lead-save-main,
    .comments-box.lead-extras-card,
    #player-name,
    .lead-mobile-phone {
        display: none;
    }

    .lead-buttons-row .status-dropdown {
        flex: 1;
        background: var(--white);
        border: 1px solid var(--border-soft);
        border-radius: .5rem;
        color: var(--black);
        padding: 0 15px;
        padding-left: 35px;
        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='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 15px center;
    }

    .lead-buttons-row .status-dropdown:focus {
        outline: none;
        border-color: var(--primary-color);
    }

    .lead-buttons-row .btn,
    .lead-buttons-row .status-dropdown {
        padding: 1rem;
        font-weight: 700;
        width: 100%;
        direction: rtl;
        max-height: 55px;
    }

    .lead-buttons-row .comments-add {
        grid-column: 1 / -1;
    }

    .comments-add textarea.input {
        text-align: right;
        direction: rtl;
    }

    .timeline-container {
        padding-right: 0;
        padding-top: 0;
    }

    .lead-extras-card {
        margin: 0 1.5rem 5rem;
    }

    #screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary]::before,
    #screen-leads .lead-details .lead-mobile-header h1[data-hint-primary]::before {
        width: 10px;
        height: 10px;
    }

    #screen-leads .table-row > div[data-label="נוצר"] > div:first-child,
    #screen-leads .table-row>div:nth-child(5), .lead-hint-text {
        color: #667085 !important;
        font-size: 13px;
        font-weight: 500;
    }

    #screen-tasks .tasks-form-container .lead-reminder-datetime-picker {
        flex: 0 0 100%;
    }

    .tasks-form-container .input {
        width: 100%;
    }

    #tasks-toolbar.toolbar {
        margin: 0;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: space-between;
        margin-top: 2rem;
        width: 100%;
    }

    #tasks-toolbar.toolbar .btn {
        margin-right: auto;
        flex-shrink: 0;
        padding: .5rem .75rem;
        font-size: 14px;
    }

    #tasks-toolbar.toolbar > label {
        width: fit-content;
        flex-shrink: 0;
    }

    #tasks-toolbar.toolbar .tasks-form-container {
        flex-basis: 100%;
        flex-direction: column;
        margin: 2rem auto 0;
    }

    .input#tasksAssignedUser {
        max-width: unset;
    }

    #screen-leads .table-row > div[data-label="נוצר"] > div:first-child {
        color: #a8aaad !important;
    }
}

.phone-icon[data-lead-source] {
    --lead-source-color: var(--text1);
    color: var(--lead-source-color);
}

.phone-icon[data-lead-source="answered"],
.phone-icon[data-lead-source="in-call"] {
    --lead-source-color: var(--lbl1);
}

.phone-icon[data-lead-source="missed"] {
    --lead-source-color: var(--delete);
}

.phone-icon[data-lead-source="message"] {
    --lead-source-color: #667085;
}

#screen-leads .lead-details input.input.lead-main-name {
    border: 1px solid var(--border-soft);
    border-radius: .5rem;
    padding: .25rem .75rem;
    background: var(--white);
    color: var(--black);
    font-size: clamp(14px, 2.5vw, 15px);
    font-weight: 500;
    text-align: right;
    min-height: 36px;
}

#screen-leads .lead-details input.input.lead-main-name:focus {
    outline: none;
    border-color: var(--primary);
}

#screen-leads .table-row.empty {
    grid-template-columns: 1fr;
    margin: auto;
}

@media (min-width: 768px) {
    #screen-leads .lead-details .form-grid {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-name) .status-combo-group {
        box-shadow: none;
    }

    #screen-leads .lead-details input.input.lead-main-name {
        border: none;
        border-radius: 0;
        padding: 0;
        background: none;
        color: var(--black);
        text-align: center;
        min-height: unset;
        font-size: 24px;
        font-weight: 800;
        height: 36px;
    }

    #screen-leads .lead-details .form-grid .field:has(.lead-main-phone) {
        margin-bottom: 0;
    }

    #screen-leads .lead-details .lead-main-phone span {
        font-size: 16px;
        letter-spacing: 1px;
        color: var(--text1);
    }

    #screen-leads .lead-details select.input.lead-main-crmstatus {
        width: 100%;
        text-align: center;
        height: 46px;
        border-radius: 12px;
        font-weight: 700;
        background-size: 22px;
    }

    #screen-leads .lead-details .lead-call-actions {
        width: 100%;
        gap: 1rem;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons>.btn {
        gap: 5px;
        padding: 12px;
        border-radius: 12px;
        transition: 0.2s;
        box-shadow: none;
        height: 100%;
        min-height: 68px;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons>.btn span {
        font-size: 14px;
        font-weight: 600;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons>.btn svg {
        width: 18px;
        height: 18px;
    }

    #screen-leads .lead-details .lead-call-actions .lead-task-buttons>.btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        border-color: transparent;
    }

    #screen-leads .lead-details .lead-buttons-row,
    #screen-leads .lead-details .comments-box.lead-extras-card,
    .timeline-container::before,
    .lead-main-meta-row .lead-main-meta::before,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta .timeline-avatar-meta,
    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta::after,
    .lead-call-actions .lead-call-duration,
    #screen-leads .lead-main-meta-item.has-ai-transcript > span:first-child::after {
        display: none;
    }

    #screen-leads .lead-details .lead-reminder-datetime-picker .tw-dp-trigger {
        width: 100%;
        max-width: unset;
    }

    #screen-leads .timeline-card-content {
        padding: 0;
        margin-top: .5rem;
    }

    #screen-leads .timeline-container {
        padding-top: .5rem;
        padding-bottom: 0;
    }

    .leads-history-row.timeline-item::after {
        height: auto;
    }

    #screen-leads .lead-details .lead-reminder-add-row,
    #screen-leads .lead-details #lead-call-player-host,
    .lead-main-meta-row .lead-main-meta {
        margin: 0;
    }

    #screen-leads .lead-details .lead-inline-task-form {
        border: none;
        margin: 0;
        padding: 0;
        margin-bottom: 2rem;
    }

    #screen-leads .lead-details .lead-inline-task-form .lead-task-buttons {
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
    }

    /* #screen-leads .lead-details {
        height: auto;
        max-height: 85vh;
    } */

    .lead-extras-card {
        background: unset;
    }

    #screen-leads .comments-box.lead-timeline-card {
        padding: 1rem 30px;
        height: 100%;
        margin-top: 0;
    }

    #screen-leads .lead-details input.input.lead-main-name:focus {
        padding: .25rem .75rem;
        border-radius: 12px;
    }

    #screen-leads .lead-main-meta-row.timeline-item.timeline-item-meta {
        width: auto;
        padding: 20px;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .leads-history-row.timeline-item {
        border-radius: 0 12px 12px 12px;
    }

    #screen-leads .timeline-container .leads-history-row.timeline-item {
        flex-direction: column;
        gap: .5rem;
    }

    #screen-leads .leads-history-meta.has-ai-transcript {
        margin-bottom: .5rem;
    }

    .leads-history-row .lead-views-row-main {
        font-size: 15px;
        color: #1e293b;
    }

    #screen-leads .leads-history-meta.has-ai-transcript .ai-transcript-badge,
    #screen-leads .leads-history-meta .listen_call_link {
        height: 20px;
        max-height: 20px;
        min-height: unset;
        max-width: 90px;
        font-size: 13px;
    }

    #screen-leads .leads-history-meta .listen_call_link i {
        font-size: 11px;
    }

    #screen-leads .timeline-card-content {
        padding: .2rem .5rem;
        border-radius: 12px;
        margin: 0;
    }

    #screen-leads .timeline-card-content,
    .timeline-card-content .lead-main-meta {
        border: none;
    }

    #screen-leads .lead-main-meta-item.has-ai-transcript {
        flex-direction: row-reverse;
        width: 100%;
        justify-content: space-between;
    }

    #screen-leads .lead-details .call-player-wrapper .ai-button {
        border-radius: 10px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 700;
        width: fit-content;
        display: flex;
        min-height: 36px;
        flex-direction: row;
        box-shadow: unset;
        background: #4f46e5;
        color: white;
    }

    #screen-leads .timeline-container .custom-player-bar {
        margin-right: unset;
        width: 100%;
    }

    #screen-leads .lead-details .call-player-wrapper .ai-button:hover {
        background: #6f68f3;
    }

    .lead-reminder-add-row .btn {
        font-size: 16px;
    }

    .lead-main-meta .custom-player-bar {
        width: 75%;
        margin: auto 0 auto auto;
        margin-bottom: 1rem;
    }

    .custom-player-bar .play-btn {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 767px) {
    .tasks-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(30, 78, 132, 0.4);
        backdrop-filter: blur(4px);
        z-index: 9999;
        display: none;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transition: opacity 0.3s ease;
        cursor: pointer;
        padding: 12px;
    }

    .tasks-modal-overlay.open {
        display: flex;
        opacity: 1;
    }

    .tasks-modal-card {
        background: var(--white);
        width: 100%;
        max-width: 500px;
        border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
        overflow: visible;
        transform: scale(0.95) translateY(10px);
        transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        padding: 28px 20px 20px;
        text-align: center;
    }

    .tasks-modal-overlay.open .tasks-modal-card {
        transform: scale(1) translateY(0);
    }

    .tasks-modal-overlay .modal-header {
        padding: 0 0 20px 0;
        text-align: center;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
    }

    .tasks-modal-overlay .modal-header::before {
        content: '\f46c';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        width: 62px;
        height: 62px;
        background: #eff6ff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 0 0 8px #f8fafc;
        font-size: 24px;
        color: var(--primary);
        margin: 0 auto 12px auto;
    }

    .tasks-modal-overlay .modal-header::after {
        content: 'צור משימה חדשה והקצה אותה לאחראי';
        font-size: 14px;
        color: var(--text-muted);
        margin-top: 8px;
        display: block;
    }

    .tasks-modal-overlay .modal-close {
        position: absolute;
        top: -14px;
        left: -8px;
        width: 36px;
        height: 36px;
        background: #f1f5f9;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1;
        color: #64748b;
    }

    .tasks-modal-overlay .modal-close svg {
        width: 16px;
        height: 16px;
        stroke-width: 2;
    }

    .tasks-modal-overlay .modal-title {
        font-size: 24px;
        font-weight: 800;
        color: var(--primary);
        margin: 0 0 8px 0;
    }

    .tasks-modal-overlay .modal-header-spacer {
        height: 0;
    }

    .tasks-modal-overlay .modal-form {
        padding: 0;
        text-align: right;
    }

    .tasks-modal-overlay .input-row {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
    }

    .tasks-modal-overlay .input-row .input-group {
        flex: 1;
        margin-bottom: 0;
    }

    .tasks-modal-overlay .input-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 16px;
    }

    .tasks-modal-overlay .form-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-dark);
    }

    .tasks-modal-overlay .form-label .required {
        color: #ef4444;
        margin-right: 4px;
    }

    .tasks-modal-overlay .form-input,
    .tasks-modal-overlay .form-select {
        width: 100%;
        padding: .25rem .75rem;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        font-size: 15px;
        color: var(--black);
        background: #f8fafc;
        transition: all 0.2s;
        font-family: 'Heebo', sans-serif;
        box-sizing: border-box;
        min-height: 42px;
    }

    .tasks-modal-overlay .form-select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 10px center;
        background-size: 20px;
        padding-left: 2rem;
    }

    .tasks-modal-overlay .modal-actions {
        display: flex;
        gap: 12px;
        margin-top: 24px;
    }

    .tasks-modal-overlay .modal-actions .btn {
        border-radius: 50px;
        font-weight: 600;
        font-size: 16px;
        max-height: 50px;
        padding: 14px;
    }

    .tasks-modal-overlay .modal-actions .btn-cancel {
        background: var(--white);
        color: var(--black);
        border: 1px solid var(--border-soft);
        flex: 1;
    }

    .tasks-modal-overlay .modal-actions .btn-save {
        flex: 2;
    }

    #screen-tasks #tasks-add-btn,
    #tasks-toolbar.toolbar > #tasks-add-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    #screen-tasks #tasks-add-btn svg,
    #tasks-toolbar.toolbar > #tasks-add-btn svg {
        width: 20px;
        height: 20px;
    }

    #screen-tasks #tasks-add-btn span,
    #tasks-toolbar.toolbar > #tasks-add-btn span {
        display: none;
    }

    #screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="12"]::before,
    #screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="12"]::before {
        background: var(--indicator);
    }

    #screen-leads .lead-details .editor-topbar .editor-title[data-hint-primary="11"]::before,
    #screen-leads .lead-details .lead-mobile-header h1[data-hint-primary="11"]::before {
        background: var(--lbl5-mobile);
    }

    #screen-leads .table-row.empty>div {
        display: block;
        margin: auto;
    }
}