/* Components — Buttons, Cards, Inputs, Data Grid */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font: 500 13px var(--font-body);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--gold);
    color: var(--void);
}

.btn-primary:hover { background: var(--gold-dim); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card-title {
    font: 600 14px var(--font-body);
    color: var(--text);
    margin-bottom: 12px;
}

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stat-value {
    font: 600 28px var(--font-data);
    color: var(--gold);
}

.stat-sub {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Input / Select */
input, select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 12px;
    font: 400 13px var(--font-body);
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    border-color: var(--gold);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data Grid */
.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-grid thead th {
    background: var(--surface);
    color: var(--text-dim);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-grid thead th:hover {
    color: var(--gold);
}

.data-grid thead th.sorted {
    color: var(--gold);
}

.data-grid tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.data-grid tbody tr:hover {
    background: var(--gold-subtle);
}

.data-grid td {
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font-data);
    font-size: 12px;
}

/* Tier badges */
.tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font: 600 11px var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-hot { background: rgba(248, 113, 113, 0.15); color: var(--tier-hot); }
.tier-warm { background: rgba(251, 191, 36, 0.15); color: var(--tier-warm); }
.tier-cold { background: rgba(96, 165, 250, 0.15); color: var(--tier-cold); }
.tier-disqualified { background: rgba(93, 106, 130, 0.15); color: var(--tier-disqualified); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font: 600 18px var(--font-heading);
    color: var(--text-dim);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--text-dim);
    font-size: 13px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* View placeholder */
.view-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: var(--text-muted);
}

.view-placeholder .placeholder-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.view-placeholder h2 {
    font: 600 22px var(--font-heading);
    color: var(--text-dim);
    margin-bottom: 8px;
}

.view-placeholder p {
    font-size: 14px;
    max-width: 460px;
    text-align: center;
    line-height: 1.6;
}

/* Round 3: Pipeline + Lead Detail styles */
.pipeline-container { max-width: 900px; }
.pipeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.pipeline-actions { display: flex; gap: 12px; align-items: center; }
.pipeline-progress { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border-radius: 8px; }
.progress-stage { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 6px; background: var(--bg-primary); }
.progress-stage.stage-done { border-left: 3px solid var(--success); }
.progress-stage.stage-active { border-left: 3px solid var(--gold); }
.stage-status { margin-left: auto; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); }
.result-card { padding: 20px; border-radius: 8px; background: var(--surface); margin-top: 16px; }
.result-error { border-left: 3px solid var(--error); }

/* Tier badges */
.tier-badge { padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.tier-hot { background: rgba(34,197,94,0.15); color: #22c55e; }
.tier-warm { background: rgba(234,179,8,0.15); color: #eab308; }
.tier-pool { background: rgba(107,114,128,0.15); color: #6b7280; }
.tier-dq { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Stats cards */
.stat-hot .stat-value { color: #22c55e; }
.stat-warm .stat-value { color: #eab308; }
.stat-pool .stat-value { color: #6b7280; }

/* Explorer toolbar */
.explorer-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }

/* Lead detail */
.lead-detail { max-width: 800px; }
.detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.detail-score { font-size: 1.5rem; font-weight: 700; color: var(--gold); margin-left: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-section { background: var(--surface); padding: 20px; border-radius: 8px; }
.detail-section h3 { margin-bottom: 12px; color: var(--gold); }
.detail-section p { margin: 6px 0; }

/* Scoring breakdown bars */
.factor-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.factor-name { width: 80px; font-size: 0.85rem; color: var(--text-secondary); text-transform: capitalize; }
.factor-bar { flex: 1; height: 8px; background: var(--bg-primary); border-radius: 4px; overflow: hidden; }
.factor-fill { height: 100%; background: var(--gold); border-radius: 4px; transition: width 0.3s; }
.factor-score { width: 60px; text-align: right; font-family: var(--font-mono); font-size: 0.8rem; }

/* Company link */
.company-link { cursor: pointer; color: var(--info); }
.company-link:hover { text-decoration: underline; }

/* Badge variants */
.badge { padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 500; }
.badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-warning { background: rgba(234,179,8,0.15); color: #eab308; }
.badge-error { background: rgba(239,68,68,0.15); color: #ef4444; }
