﻿/* ============================================================
   leadmanagement-common.css  |  BraiCalling CRM
   Unique prefix : lm-
   Responsive    : mobile-first (320px → desktop)
   Fonts         : Sora (headings) + DM Sans (body) via Google
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ── */
:root {
    --lm-primary: #378ADD;
    --lm-primary-dark: #185FA5;
    --lm-primary-light: #EBF4FF;
    --lm-danger: #E24B4A;
    --lm-success: #3DAA6B;
    --lm-warning: #F59E0B;
    --lm-orange: #D85A30;
    --lm-purple: #7C5CFC;
    --lm-bg: #F0F4FA;
    --lm-card-bg: #FFFFFF;
    --lm-border: rgba(0, 0, 0, 0.08);
    --lm-border-strong: rgba(0, 0, 0, 0.14);
    --lm-text-heading: #0F1729;
    --lm-text-body: #2C3654;
    --lm-text-muted: #6C7A9C;
    --lm-text-xs: #9199AD;
    --lm-shadow-sm: 0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --lm-shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.05);
    --lm-shadow-card: 0 2px 8px rgba(55,138,221,.07), 0 1px 3px rgba(15,23,42,.05);
    --lm-radius-sm: 6px;
    --lm-radius: 10px;
    --lm-radius-lg: 14px;
    --lm-radius-xl: 18px;
    --lm-font-heading: 'Sora', sans-serif;
    --lm-font-body: 'DM Sans', sans-serif;
    --lm-transition: 0.18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--lm-font-body);
    background: var(--lm-bg);
    color: var(--lm-text-body);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   WRAPPER
═══════════════════════════════════════════ */
.lm-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
}

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.lm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 0.5px solid var(--lm-border);
    background: var(--lm-card-bg);
    margin-bottom: 1.25rem;
}

.lm-page-title {
    font-family: var(--lm-font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lm-text-heading);
    letter-spacing: -0.02em;
}

.lm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--lm-text-muted);
    margin-top: 3px;
    flex-wrap: wrap;
}

    .lm-breadcrumb i {
        font-size: 9px;
    }

/* ═══════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════ */
.lm-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .lm-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.lm-stat {
    background: var(--lm-card-bg);
    border: 0.5px solid var(--lm-border);
    border-radius: var(--lm-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--lm-shadow-sm);
    transition: box-shadow var(--lm-transition);
    position: relative;
    overflow: hidden;
}

    .lm-stat::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--lm-primary), var(--lm-purple));
        border-radius: 3px 3px 0 0;
    }

    .lm-stat:hover {
        box-shadow: var(--lm-shadow-md);
    }

.lm-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lm-text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.lm-stat-val {
    font-family: var(--lm-font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

/* ═══════════════════════════════════════════
   CARD
═══════════════════════════════════════════ */
.lm-card {
    background: var(--lm-card-bg);
    border: 0.5px solid var(--lm-border);
    border-radius: var(--lm-radius-lg);
    box-shadow: var(--lm-shadow-card);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.lm-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 0.5px solid var(--lm-border);
    background: linear-gradient(135deg, #FAFBFE 0%, #F4F7FD 100%);
}

.lm-card-title {
    font-family: var(--lm-font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--lm-text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lm-card-desc {
    font-size: 12px;
    color: var(--lm-text-muted);
    margin-top: 3px;
}

.lm-card-body {
    padding: 1.25rem;
}

/* ═══════════════════════════════════════════
   GRID LAYOUTS
═══════════════════════════════════════════ */
.lm-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lm-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 600px) {
    .lm-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .lm-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ═══════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════ */
.lm-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lm-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--lm-text-body);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}

    .lm-label i {
        color: var(--lm-primary);
        font-size: 11px;
    }

.lm-input {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--lm-font-body);
    font-size: 13px;
    color: var(--lm-text-body);
    background: #FAFBFD;
    border: 1px solid var(--lm-border-strong);
    border-radius: var(--lm-radius-sm);
    outline: none;
    transition: border-color var(--lm-transition), box-shadow var(--lm-transition), background var(--lm-transition);
    -webkit-appearance: none;
    appearance: none;
}

    .lm-input::placeholder {
        color: #B0B8CC;
        font-size: 12px;
    }

    .lm-input:focus {
        border-color: var(--lm-primary);
        background: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(55,138,221,0.12);
    }

    .lm-input:hover:not(:focus) {
        border-color: #AEC4DC;
    }

/* Select */
.lm-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236C7A9C' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* Textarea */
.lm-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

/* File Input */
.lm-file-input {
    width: 100%;
    font-family: var(--lm-font-body);
    font-size: 12px;
    color: var(--lm-text-muted);
    padding: 8px 12px;
    border: 1.5px dashed var(--lm-border-strong);
    border-radius: var(--lm-radius-sm);
    background: #FAFBFD;
    cursor: pointer;
    transition: border-color var(--lm-transition);
}

    .lm-file-input:hover {
        border-color: var(--lm-primary);
    }

.lm-file-hint {
    font-size: 11px;
    color: var(--lm-text-xs);
    margin-top: 4px;
}

/* ── Radio Group ── */
.lm-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lm-radio-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid var(--lm-border-strong);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    color: var(--lm-text-body);
    cursor: pointer;
    transition: all var(--lm-transition);
    user-select: none;
    background: #FAFBFD;
}

    .lm-radio-label:has(input:checked) {
        border-color: var(--lm-primary);
        background: var(--lm-primary-light);
        color: var(--lm-primary-dark);
    }

    .lm-radio-label input[type="radio"] {
        accent-color: var(--lm-primary);
        width: 14px;
        height: 14px;
        cursor: pointer;
    }

    .lm-radio-label i {
        color: var(--lm-primary);
    }

/* ── Checkbox Group ── */
.lm-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lm-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--lm-border-strong);
    border-radius: var(--lm-radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--lm-text-body);
    cursor: pointer;
    transition: all var(--lm-transition);
    user-select: none;
    background: #FAFBFD;
}

    .lm-check-label:has(input:checked) {
        border-color: var(--lm-success);
        background: #EEFAF4;
        color: #217A4A;
    }

    .lm-check-label input[type="checkbox"] {
        accent-color: var(--lm-success);
        width: 14px;
        height: 14px;
        cursor: pointer;
    }

/* ── Divider ── */
.lm-divider {
    border: none;
    border-top: 0.5px solid var(--lm-border);
    margin: 1.1rem 0;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.lm-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.25rem;
    align-items: center;
}

.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    font-family: var(--lm-font-body);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--lm-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--lm-transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1;
}

    .lm-btn:focus-visible {
        outline: 3px solid rgba(55,138,221,0.35);
        outline-offset: 2px;
    }

.lm-btn-primary {
    background: linear-gradient(135deg, #378ADD 0%, #185FA5 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(55,138,221,0.3);
}

    .lm-btn-primary:hover {
        background: linear-gradient(135deg, #2D78C9 0%, #12508F 100%);
        box-shadow: 0 4px 14px rgba(55,138,221,0.4);
        transform: translateY(-1px);
    }

.lm-btn-secondary {
    background: #fff;
    color: var(--lm-text-body);
    border-color: var(--lm-border-strong);
    box-shadow: var(--lm-shadow-sm);
}

    .lm-btn-secondary:hover {
        background: #F4F7FD;
        border-color: #AEC4DC;
        transform: translateY(-1px);
    }

.lm-btn-danger {
    background: linear-gradient(135deg, #E24B4A 0%, #B22C2B 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(226,75,74,0.3);
}

    .lm-btn-danger:hover {
        opacity: 0.92;
        transform: translateY(-1px);
    }

/* ═══════════════════════════════════════════
   VALIDATION SUMMARY
═══════════════════════════════════════════ */
.lm-validation-summary {
    background: #FFF4F4;
    border: 0.5px solid #F5C6C6;
    border-left: 3px solid var(--lm-danger);
    border-radius: var(--lm-radius-sm);
    padding: 10px 14px;
    font-size: 12.5px;
    color: #A32D2D;
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════
   SEARCH ROW
═══════════════════════════════════════════ */
.lm-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: center;
}

.lm-search-wrap {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
}

.lm-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lm-text-muted);
    font-size: 12px;
    pointer-events: none;
}

.lm-search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    font-family: var(--lm-font-body);
    font-size: 13px;
    color: var(--lm-text-body);
    background: #FAFBFD;
    border: 1px solid var(--lm-border-strong);
    border-radius: var(--lm-radius-sm);
    outline: none;
    transition: border-color var(--lm-transition), box-shadow var(--lm-transition);
}

    .lm-search-input::placeholder {
        color: #B0B8CC;
    }

    .lm-search-input:focus {
        border-color: var(--lm-primary);
        box-shadow: 0 0 0 3px rgba(55,138,221,0.12);
        background: #fff;
    }

/* ═══════════════════════════════════════════
   TABLE
═══════════════════════════════════════════ */
.lm-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 0.5px solid var(--lm-border);
    border-radius: var(--lm-radius);
}

.lm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 820px;
}

    .lm-table th {
        padding: 10px 12px;
        text-align: left;
        font-weight: 600;
        color: var(--lm-text-muted);
        border-bottom: 1px solid var(--lm-border);
        white-space: nowrap;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        background: linear-gradient(180deg, #F4F7FD 0%, #EEF2FA 100%);
    }

    .lm-table td {
        padding: 10px 12px;
        color: var(--lm-text-body);
        border-bottom: 0.5px solid var(--lm-border);
        vertical-align: middle;
    }

    .lm-table tbody tr:last-child td {
        border-bottom: none;
    }

    .lm-table tbody tr:hover td {
        background: #F8FAFF;
    }

    .lm-table .lm-row-alt td {
        background: #FAFBFE;
    }

    .lm-table .lm-row-alt:hover td {
        background: #F4F7FF;
    }

.lm-cell-sm {
    font-size: 12px;
}

.lm-text-muted {
    color: var(--lm-text-muted);
}

.lm-actions-cell {
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════ */
.lm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

    .lm-badge::before {
        content: '';
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: currentColor;
        opacity: 0.75;
    }

.lm-badge-new {
    background: #EFF6FF;
    color: #1D4ED8;
}

.lm-badge-hot {
    background: #FFF1EE;
    color: #C2390D;
}

.lm-badge-warm {
    background: #FFFBEB;
    color: #B45309;
}

.lm-badge-cold {
    background: #F0F9FF;
    color: #0369A1;
}

.lm-badge-converted {
    background: #F0FDF4;
    color: #15803D;
}

.lm-badge-lost {
    background: #FDF2F8;
    color: #9D174D;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.lm-progress {
    height: 5px;
    background: #E8EDF5;
    border-radius: 10px;
    overflow: hidden;
    width: 90px;
}

.lm-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════
   ACTION BUTTONS (table row)
═══════════════════════════════════════════ */
.lm-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.lm-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--lm-radius-sm);
    border: 0.5px solid transparent;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: all var(--lm-transition);
    background: transparent;
    padding: 0;
}

    .lm-act-btn:hover {
        transform: translateY(-1px);
    }

    .lm-act-btn.view {
        color: var(--lm-primary);
        border-color: #C4DCEF;
        background: #EBF4FF;
    }

        .lm-act-btn.view:hover {
            background: #D5EAFF;
            border-color: var(--lm-primary);
        }

    .lm-act-btn.edit {
        color: #7C5CFC;
        border-color: #D8CFFE;
        background: #F2EFFE;
    }

        .lm-act-btn.edit:hover {
            background: #E5DCFE;
            border-color: #7C5CFC;
        }

    .lm-act-btn.update {
        color: var(--lm-success);
        border-color: #B5E5CC;
        background: #EEFAF4;
    }

        .lm-act-btn.update:hover {
            background: #D5F2E4;
            border-color: var(--lm-success);
        }

    .lm-act-btn.del {
        color: var(--lm-danger);
        border-color: #F5C6C6;
        background: #FFF0F0;
    }

        .lm-act-btn.del:hover {
            background: #FFE0E0;
            border-color: var(--lm-danger);
        }

    .lm-act-btn.cancel-btn {
        color: var(--lm-text-muted);
        border-color: var(--lm-border-strong);
        background: #F4F6FB;
    }

        .lm-act-btn.cancel-btn:hover {
            background: #E8ECF5;
        }

/* ═══════════════════════════════════════════
   PAGER
═══════════════════════════════════════════ */
.lm-pager-row td {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--lm-text-muted);
    border-top: 0.5px solid var(--lm-border);
    background: #FAFBFE;
}

.lm-pager-row a,
.lm-pager-row span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin: 0 2px;
    border: 0.5px solid var(--lm-border-strong);
    font-size: 12px;
    text-decoration: none;
    color: var(--lm-text-body);
    transition: all var(--lm-transition);
}

    .lm-pager-row a:hover {
        background: var(--lm-primary-light);
        color: var(--lm-primary);
        border-color: var(--lm-primary);
    }

.lm-pager-row span {
    background: var(--lm-primary);
    color: #fff;
    border-color: var(--lm-primary-dark);
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   RECORD COUNT
═══════════════════════════════════════════ */
.lm-record-count {
    margin-top: 0.75rem;
    font-size: 12px;
    color: var(--lm-text-muted);
}

    .lm-record-count strong {
        color: var(--lm-primary);
        font-weight: 700;
    }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════════ */
.lm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--lm-text-heading);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--lm-radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(15,23,42,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    max-width: 340px;
}

    .lm-toast.lm-toast-show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .lm-toast.lm-toast-success {
        border-left: 4px solid var(--lm-success);
    }

    .lm-toast.lm-toast-error {
        border-left: 4px solid var(--lm-danger);
    }

    .lm-toast.lm-toast-info {
        border-left: 4px solid var(--lm-primary);
    }

/* ═══════════════════════════════════════════
   MODAL (View Lead)
═══════════════════════════════════════════ */
.lm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .lm-modal-overlay.lm-modal-open {
        display: flex;
    }

.lm-modal {
    background: var(--lm-card-bg);
    border-radius: var(--lm-radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.25);
    animation: lm-slide-up 0.25s ease;
    overflow: hidden;
}

@keyframes lm-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 0.5px solid var(--lm-border);
    background: linear-gradient(135deg, #FAFBFE, #F4F7FD);
}

.lm-modal-title {
    font-family: var(--lm-font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--lm-text-heading);
}

.lm-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: #F0F3FA;
    color: var(--lm-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--lm-transition);
}

    .lm-modal-close:hover {
        background: #E2E8F5;
        color: var(--lm-text-heading);
    }

.lm-modal-body {
    padding: 1.25rem;
}

.lm-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lm-detail-item {
}

.lm-detail-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--lm-text-xs);
    font-weight: 600;
    margin-bottom: 3px;
}

.lm-detail-val {
    font-size: 13px;
    color: var(--lm-text-heading);
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   RESPONSIVE UTILITIES
═══════════════════════════════════════════ */
@media (max-width: 480px) {
    .lm-page-header {
        padding: 0.9rem 1rem 0.75rem;
    }

    .lm-card-body {
        padding: 1rem;
    }

    .lm-btn-row {
        flex-direction: column;
    }

    .lm-btn {
        width: 100%;
        justify-content: center;
    }

    .lm-detail-grid {
        grid-template-columns: 1fr;
    }

    .lm-stat-val {
        font-size: 1.5rem;
    }

    .lm-modal {
        border-radius: var(--lm-radius-lg);
    }
}

@media (max-width: 768px) {
    .lm-check-group {
        flex-direction: column;
    }

    .lm-radio-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .lm-search-row {
        flex-direction: column;
    }

    .lm-search-wrap {
        width: 100%;
    }
}
