/* ============================================================
   WEB LEADS — Sales Hub Tab & Dashboard Widget Styles
   ============================================================ */

/* ── 60/40 Layout ────────────────────────────────────────── */

/* web-leads-root must stretch to fill the flex tab pane */
#web-leads-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wl-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 60% — leads panel */
.wl-panel-leads {
    flex: 0 0 60%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 16px 16px;
    border-right: 1px solid var(--color-border, #334155);
    overflow: hidden;
}

/* 40% — stats sidebar */
.wl-panel-stats {
    flex: 0 0 40%;
    min-width: 0;
    padding: 16px 16px 16px 20px;
    overflow-y: auto;
    background: rgba(0,0,0,0.08);
}

@media (max-width: 900px) {
    .wl-layout { flex-direction: column; }
    .wl-panel-leads { flex: none; border-right: none; border-bottom: 1px solid var(--color-border, #334155); }
    .wl-panel-stats  { flex: none; }
}

/* ── Toolbar ─────────────────────────────────────────────── */
.wl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.wl-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ── Table wrap (scrollable within the 60% panel) ────────── */
.wl-table-wrap {
    overflow: auto;
    flex: 1 1 0;
    min-height: 0;
}

/* ── Table ───────────────────────────────────────────────── */
.wl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wl-table thead th {
    text-align: left;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #94a3b8);
    border-bottom: 2px solid var(--color-border, #334155);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-dark, #0f172a);
    z-index: 1;
}
.wl-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--color-border, #334155);
    vertical-align: middle;
}
.wl-table tbody tr:hover {
    background: var(--color-surface-hover, rgba(255,255,255,0.03));
}
.wl-td-date  { white-space: nowrap; color: var(--color-text-muted, #94a3b8); font-size: 12px; }
.wl-td-value { white-space: nowrap; font-weight: 600; color: #34d399; font-size: 13px; }

/* ── Returning client row highlight ─────────────────────── */
.wl-row--returning td { background: rgba(16,185,129,0.04); }
.wl-row--returning:hover td { background: rgba(16,185,129,0.07) !important; }

/* ── Badges ──────────────────────────────────────────────── */
.wl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 6px;
}
.wl-badge--returning {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
}

/* ── Stats sidebar header ────────────────────────────────── */
.wl-stats-header {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #94a3b8);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.wl-stats-loading {
    text-align: center;
    padding: 24px 0;
    color: var(--color-text-muted, #94a3b8);
}

/* ── Stat cards ──────────────────────────────────────────── */
.wl-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border, #334155);
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.wl-stat-card:hover { background: rgba(255,255,255,0.05); }

.wl-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.wl-stat-card--active    .wl-stat-icon { background: rgba(59,130,246,0.15); color: #60a5fa; }
.wl-stat-card--converted .wl-stat-icon { background: rgba(16,185,129,0.15); color: #34d399; }
.wl-stat-card--rate      .wl-stat-icon { background: rgba(139,92,246,0.15); color: #a78bfa; }
.wl-stat-card--returning .wl-stat-icon { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.wl-stat-card--value          .wl-stat-icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.wl-stat-card--converted-value .wl-stat-icon { background: rgba(20,184,166,0.15); color: #2dd4bf; }

.wl-stat-body { flex: 1; min-width: 0; }
.wl-stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main, #f8fafc);
}
.wl-stat-value--money { font-size: 18px; }
.wl-stat-pct { font-size: 14px; font-weight: 600; color: var(--color-text-muted, #94a3b8); }
.wl-stat-label {
    font-size: 11px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 3px;
    font-weight: 500;
}

/* ── Dividers & recent list ──────────────────────────────── */
.wl-stats-divider {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted, #94a3b8);
    margin: 14px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border, #334155);
}
.wl-recent-list { margin-bottom: 8px; }
.wl-recent-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(255,255,255,0.04));
    color: var(--color-text-muted, #94a3b8);
}
.wl-recent-item i { color: #34d399; flex-shrink: 0; }
.wl-recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main, #f8fafc); }
.wl-recent-val  { flex-shrink: 0; font-weight: 600; color: #2dd4bf; }

/* ── Returning-client banner inside modal ────────────────── */
.wl-returning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #34d399;
    margin-bottom: 16px;
}
.wl-returning-banner i { font-size: 17px; flex-shrink: 0; }



/* ── Modal: Detail Grid ──────────────────────────────────── */
.wl-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 640px) {
    .wl-detail-grid {
        grid-template-columns: 1fr;
    }
}

.wl-detail-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border, #334155);
    border-radius: 10px;
    padding: 16px;
}
.wl-detail-section h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #94a3b8);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wl-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(255,255,255,0.04));
}
.wl-info-row > span:last-child {
    text-align: right;
    word-break: break-word;
    max-width: 65%;
}
.wl-info-row:last-child {
    border-bottom: none;
}
.wl-info-label {
    color: var(--color-text-muted, #94a3b8);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 12px;
}

/* ── Trims list inside modal ─────────────────────────────── */
.wl-trim-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.wl-trim-list li {
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(255,255,255,0.04));
}
.wl-trim-list li:last-child {
    border-bottom: none;
}

/* ── EagleView / attachment badge ────────────────────────── */
.wl-ev-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
}

/* ── Instant Quote Panel ─────────────────────────────────── */
.wl-iq-panel {
    background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(234,88,12,0.06) 100%);
    border-color: rgba(245,158,11,0.35) !important;
}
.wl-iq-panel h4 {
    color: #f59e0b !important;
    font-size: 13px !important;
    margin-bottom: 14px !important;
    gap: 8px;
}
.wl-iq-badge {
    display: inline-block;
    margin-left: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #f59e0b;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 4px;
    padding: 2px 6px;
    vertical-align: middle;
}
.wl-iq-breakdown {
    margin-bottom: 14px;
}
.wl-iq-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(245,158,11,0.1);
    color: var(--color-text-muted, #94a3b8);
}
.wl-iq-row:last-child {
    border-bottom: none;
}
.wl-iq-subtotal {
    margin-top: 4px;
    padding-top: 10px !important;
    border-top: 1px solid rgba(245,158,11,0.3) !important;
    border-bottom: none !important;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
}
.wl-iq-amount {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-main, #f8fafc);
    flex-shrink: 0;
}
.wl-iq-amount--total {
    font-size: 20px;
    color: #f59e0b;
}
.wl-iq-disclaimer {
    font-size: 11px;
    line-height: 1.65;
    color: var(--color-text-muted, #94a3b8);
    margin: 0 0 14px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.14);
    border-radius: 6px;
    border-left: 3px solid rgba(245,158,11,0.4);
}
.wl-iq-disclaimer i {
    margin-right: 4px;
    color: #f59e0b;
}
.wl-iq-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.12s;
    box-shadow: 0 4px 18px rgba(220,38,38,0.4);
    text-transform: uppercase;
}
.wl-iq-cta:hover {
    opacity: 0.91;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(220,38,38,0.5);
}
.wl-iq-cta i {
    font-size: 17px;
}

/* ── Light theme overrides ───────────────────────────────── */
html.theme-light .wl-panel-stats { background: rgba(0,0,0,0.02); }
html.theme-light .wl-table thead th { background: #f1f5f9; }
html.theme-light .wl-stat-card { background: #fff; border-color: #e2e8f0; }
html.theme-light .wl-stat-card:hover { background: #f8fafc; }
html.theme-light .wl-stat-value { color: #1e293b; }
html.theme-light .wl-recent-name { color: #1e293b; }
html.theme-light .wl-iq-panel {
    background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, rgba(234,88,12,0.03) 100%);
}
html.theme-light .wl-iq-row {
    color: #475569;
    border-bottom-color: rgba(245,158,11,0.15);
}
html.theme-light .wl-iq-subtotal,
html.theme-light .wl-iq-amount {
    color: #1e293b;
}
html.theme-light .wl-iq-disclaimer {
    color: #64748b;
    background: rgba(0,0,0,0.04);
}
html.theme-light .wl-returning-banner {
    background: rgba(16,185,129,0.07);
    border-color: rgba(16,185,129,0.2);
}
