/* Leads Page Styles */

/* Filter Bar */
.filter-bar {
    background: var(--color-bg-card);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filter-bar label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    display: block;
    color: var(--color-text-secondary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Table */
.leads-table th,
.leads-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.leads-table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-body);
}

/* Modal Form Grid */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        width: 100%;
    }
}

/* Badges (Complementing variables.css if not present) */
.badge-info {
    background-color: #e0f2fe;
    color: #0284c7;
}

.badge-warning {
    background-color: #fef9c3;
    color: #ca8a04;
}

.badge-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Modal Styles override/shim */
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 130px);
    /* Adjust for header/footer */
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--color-bg-body);
    /* Slightly distinct background */
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Enhanced Form Controls for Modal */
.modal .form-control {
    background: var(--color-bg-body);
}

.modal .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-body);
    padding: 0 1.5rem;
}

.modal-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.modal-tab:hover {
    color: var(--color-primary);
}

.modal-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -21px;
    /* -1.5rem padding + half width */
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--color-border);
}

.timeline-content {
    background: var(--color-bg-card);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.timeline-user {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.timeline-body {
    color: var(--color-text-primary);
    line-height: 1.4;
}

.add-followup-box {
    background: var(--color-bg-body);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}