.web-crm-wrap { background: #f6f7fb; min-height: 100vh; }

/* Fab Button */
.crm-fab {
    position: fixed;
    right: 24px;
    bottom: 88px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a90e2 80%, #467ef8 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(74,144,226,0.18);
    border: none;
    cursor: pointer;
    z-index: 11100;
    transition: box-shadow 0.2s, background 0.2s, transform 0.13s;
}
.crm-fab:active {
    background: #336dde;
    transform: scale(0.97);
}
.crm-fab svg { display: block; }

/* Status Bar */
.crm-status-tabs-container {
    position: fixed;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    background: #f9fbfe;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -2px 13px rgba(70, 94, 142, 0.09);
    border: 1.5px solid #dfecfe;
    width: 98vw; max-width: 630px; min-width: 258px;
    z-index: 16000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 20px 12px 20px;
    user-select: none;
    box-sizing: border-box;
}
.crm-status-tabs {
    flex: 1 1 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
    align-items: center;
}
.crm-status-tab {
    padding: 8px 20px;
    font-size: 16px;
    font-weight: 600;
    background: #e8f0fa;
    color: #2b3c5f;
    border-radius: 21px;
    border: none;
    margin: 0;
    cursor: pointer;
    transition: background 0.19s, color 0.16s, box-shadow 0.18s;
    letter-spacing: 0.02em;
    border: 2px solid transparent;
}
.crm-status-tab.active,
.crm-status-tab:focus, .crm-status-tab:hover {
    background: linear-gradient(135deg, #4a90e2 70%, #467ef8 100%);
    color: #fff;
    border-color: #467ef8;
    box-shadow: 0 3px 10px rgba(74,144,226,0.12);
    outline: none;
}
.crm-status-tab.add-status-tab {
    background: #fff !important;
    color: #4a90e2;
    box-shadow: none;
    border: 2px dashed #8dc4fe !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    padding: 0;
}
.crm-status-tab.add-status-tab:focus, .crm-status-tab.add-status-tab:hover {
    background: #4a90e2 !important;
    color: #fff !important;
    border-color: #4a90e2 !important;
}
#crm-edit-status-btn {
    flex-shrink: 0;
    min-width: 40px;
    padding: 9px 14px;
    background: #e6e9f0;
    color: #4a90e2;
    border: 1.3px solid #b8d4f7;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: 0.2s;
    margin-left: 0 !important;
    margin-right: 0 !important;
    z-index: 9;
}
#crm-edit-status-btn:hover,#crm-edit-status-btn:focus{background:#d8e4fa;color:#357abd;}
#crm-edit-status-btn.editing,
#crm-edit-status-btn[aria-pressed="true"],#crm-edit-status-btn:active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}
#crm-edit-status-btn svg {display:block;}

#crm-status-tabs.status-edit-mode .crm-status-tab:not(.add-status-tab) {
    cursor: grab;
    user-select: none;
}
#crm-status-tabs.status-edit-mode .dragging {
    opacity: 0.8;
    background-color: #eaf3fe;
    border-color: #4a90e2;
}
.crm-status-tabs::-webkit-scrollbar { height: 6px;}
.crm-status-tabs::-webkit-scrollbar-thumb { background: #cce6fd; border-radius: 6px;}

/* Lead cards/List */
.crm-leads-list {padding: 26px 9px 16px 9px; max-width: 700px; margin: 0 auto;}
.crm-lead-row {
    background: #fff;
    border-radius: 13px;
    border: 1.3px solid #eaeef7;
    box-shadow: 0 3px 13px rgba(70,94,142,0.047);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    margin-bottom: 15px;
    min-height: 46px;
    position: relative;
    transition: box-shadow 0.16s, background 0.16s, transform .17s;
}
.crm-lead-row:hover {
    background: #f8fbff;
    box-shadow: 0 6px 24px rgba(74,144,226,0.10);
}
.crm-lead-main {
    display: flex;
    align-items: center;
    padding: 16px 16px;
}
.crm-lead-name-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.crm-lead-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1.10rem;
    color: #2f3e58;
}
.crm-lead-title em {
    color: #8e9ab3;
    font-style: normal;
    margin-left: 7px;
}
.crm-lead-icons {display: flex; gap: 5px; }
.crm-lead-whatsapp, .crm-lead-phone {
    color: #4a90e2;
    font-size: 21px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 6px;
    padding: 4px 8px;
    background: transparent;
    transition: background 0.14s;
}
.crm-lead-whatsapp:hover { background: #e1f8eb; color: #25d366; }
.crm-lead-phone:hover { background: #e7eefe; color: #0073aa; }
.crm-lead-phone svg, .crm-lead-whatsapp svg { width: 22px; height: 22px; display: block;}
.crm-drag-handle { color: #b9cbed; font-size: 19px; margin-right: 5px; cursor: grab; user-select: none; }
.crm-lead-actions { display: none !important; }
.crm-lead-expand {
    background: #f3f9ff;
    border-radius: 0 0 11px 11px;
    border-top: 1px solid #c8defa;
    padding: 13px 17px 10px 17px;
    font-size: 15px;
    color: #376;
    line-height: 1.5;
    margin-top: 0;
    display: none;
}
.crm-lead-row.expanded .crm-lead-expand { display: block; }

.crm-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4a90e2;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-top: 0;
    font-size: 15px;
}
.crm-btn-primary { background: #4a90e2; }
.crm-btn-primary:hover, .crm-btn-primary:focus { background: #357abd; }
.crm-btn-danger { background: #ea6666; }
.crm-btn-danger:hover, .crm-btn-danger:focus { background: #b23333; }
.crm-btn-secondary { background: #e6e9f0; color: #4a5a73; border: 1.2px solid #ccd5e3; }
.crm-btn-secondary:hover, .crm-btn-secondary:focus { background: #d3d9e6; }
.crm-btn-small { font-size: 14px; padding: 4.5px 11px; }
.crm-form-btn-row {
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    align-items: center;
    margin: 13px 0 0 0;
}

/* Modal */
.crm-modal-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(32,40,50,0.27);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1.7px);
}
.crm-modal {
    background: #fff;
    border-radius: 18px;
    padding: 30px 26px 26px 26px;
    min-width: 315px;
    max-width: 95vw;
    box-shadow: 0 16px 38px rgba(70,94,142,0.12);
    position: relative;
}
.crm-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: none;
    font-size: 30px;
    color: #4a90e2;
    cursor: pointer;
}
.crm-modal-close:focus { color: #357abd; }
#crm-lead-form input, #crm-lead-form select, #crm-lead-form textarea, #crm-add-status-form input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 7px;
    border: 1.3px solid #ccd5e3;
    background: #f5faff;
    color: #2f3e58;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.17s;
}
#crm-lead-form input:focus, #crm-lead-form select:focus, #crm-lead-form textarea:focus, #crm-add-status-form input:focus {
    border-color: #4a90e2;
    outline: none;
}

/* Ghost/drag styles (lead/status) */
.drag-ghost {
    opacity: 0.2;
    background: rgba(173,216,230,0.20);
    border: 2px dashed #9eb6d4;
    transform: scale(1.01);
}
.dragging {
    opacity: 0.85;
    background: #d6dde7;
    border-left: 4px solid #4a5a73;
    z-index: 999;
    user-select: none !important;
}
.drag-chosen {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    z-index: 12000;
    transition: box-shadow 0.22s, transform 0.20s;
}

/* Padding at Page Bottom */
.wrap.web-crm-wrap { padding-bottom: 120px !important; }

@media (max-width: 600px) {
    .crm-status-tabs-container { max-width: 100vw; min-width: 0; padding-left: 4px; padding-right: 4px; }
    .crm-status-tabs { gap: 5px;}
    .crm-status-tab { font-size: 13px; padding: 8px 10px; }
    .crm-fab { right: 12px !important; bottom: 83px !important; width: 44px; height: 44px; }
    .crm-lead-row { margin-bottom: 10px;}
    .crm-lead-main { padding: 13px 8px; }
    .crm-lead-title { font-size: 15px; }
}