/* ═══════════════════════════════════════════════════════════════════
   AI Sales Coach — Conversation Intelligence Dashboard
   Professional SaaS-style UI
   ═══════════════════════════════════════════════════════════════════ */

/* ── RESET & BASE ────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary palette */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-bg: rgba(79, 70, 229, 0.08);

    /* Semantic colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.10);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.10);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.10);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.10);

    /* Neutrals */
    --bg-app: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-hover: #f8fafc;
    --bg-active: #eef2ff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

    /* Transitions */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── TOP HEADER ──────────────────────────────────────────────────── */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.meta-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--warning-bg);
    color: #b45309;
    font-size: 12px;
    font-weight: 500;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
}

.badge-dot.live {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-header:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
}

/* ── APP CONTAINER ───────────────────────────────────────────────── */
.app-container {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ── PANELS ──────────────────────────────────────────────────────── */
.panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    overflow: hidden;
}

/* Left panel */
.panel-left {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--border);
}

/* Center panel */
.panel-center {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--border);
}

/* Right panel */
.panel-right {
    width: 380px;
    min-width: 340px;
}

/* Panel header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.panel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.panel-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 12px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-bg), rgba(99, 102, 241, 0.12));
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ── LEFT PANEL: TOOLBAR ─────────────────────────────────────────── */
.panel-toolbar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-app);
    transition: all var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-bg);
    background: var(--bg-surface);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-row {
    display: flex;
    gap: 6px;
}

.filter-select {
    flex: 1;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

.filter-select:focus {
    border-color: var(--primary-light);
}

/* ── LEFT PANEL: CONVERSATION LIST ───────────────────────────────── */
.conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conv-list::-webkit-scrollbar {
    width: 4px;
}

.conv-list::-webkit-scrollbar-track {
    background: transparent;
}

.conv-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.conv-item {
    padding: 14px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.conv-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.conv-item.active {
    background: var(--bg-active);
    border-color: #c7d2fe;
    box-shadow: var(--shadow-xs);
}

.conv-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.conv-stage {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Stage colors */
.stage-new-inquiry             { background: #dbeafe; color: #1e40af; }
.stage-information-gathering   { background: #e0e7ff; color: #3730a3; }
.stage-quote-sent              { background: #fef3c7; color: #92400e; }
.stage-objection-handling      { background: #fee2e2; color: #991b1b; }
.stage-follow-up-needed        { background: #fce7f3; color: #9d174d; }
.stage-ready-to-schedule       { background: #d1fae5; color: #065f46; }
.stage-existing-customer       { background: #cffafe; color: #155e75; }
.stage-lost-lead               { background: #f1f5f9; color: #475569; }

.conv-mid {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.conv-service {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.conv-vehicle {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-bottom {
    margin-top: 2px;
}

.conv-preview {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── CENTER PANEL: CONVERSATION THREAD ───────────────────────────── */
.conv-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state.small {
    padding: 30px;
}

.empty-icon {
    margin-bottom: 16px;
    color: #cbd5e1;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    max-width: 280px;
    line-height: 1.6;
}

.empty-hint {
    margin-top: 12px;
    font-weight: 600;
    color: var(--primary) !important;
}

/* Message thread */
.message-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-thread::-webkit-scrollbar {
    width: 4px;
}

.message-thread::-webkit-scrollbar-track {
    background: transparent;
}

.message-thread::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Message bubble */
.msg-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    position: relative;
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.msg-customer {
    align-self: flex-start;
    background: #f1f5f9;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.msg-sales {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    opacity: 0.7;
}

.msg-sales .msg-role {
    opacity: 0.9;
}

.msg-text {
    font-size: 13.5px;
    line-height: 1.55;
}

.msg-time {
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.6;
    text-align: right;
}

.msg-sales .msg-time {
    opacity: 0.8;
}

/* Conversation header info */
.conv-info-bar {
    padding: 16px 20px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.conv-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conv-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.conv-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Analyze bar */
.analyze-bar {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.btn-analyze {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    letter-spacing: -0.01em;
}

.btn-analyze:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.btn-analyze:active {
    transform: translateY(0);
}

.btn-analyze.loading {
    pointer-events: none;
    opacity: 0.8;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── RIGHT PANEL: AI ANALYSIS ────────────────────────────────────── */
.analysis-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analysis-results::-webkit-scrollbar {
    width: 4px;
}

.analysis-results::-webkit-scrollbar-track {
    background: transparent;
}

.analysis-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Score card */
.score-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    align-items: center;
}

.score-ring {
    position: relative;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
}

.score-ring svg {
    transform: rotate(-90deg);
}

.score-ring .bg-circle {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 6;
}

.score-ring .fg-circle {
    fill: none;
    stroke: white;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.8;
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.score-detail-label {
    font-size: 12px;
    opacity: 0.8;
}

.score-detail-value {
    font-size: 14px;
    font-weight: 700;
}

/* Analysis cards */
.analysis-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.analysis-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.analysis-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.analysis-card-icon.service  { background: var(--primary-bg); color: var(--primary); }
.analysis-card-icon.stage    { background: var(--success-bg); color: var(--success); }
.analysis-card-icon.objection { background: var(--danger-bg); color: var(--danger); }
.analysis-card-icon.action   { background: var(--warning-bg); color: #b45309; }

.analysis-card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.analysis-card-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1px;
}

.analysis-card-value.large {
    font-size: 15px;
}

/* Reasoning card */
.reasoning-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #fefce8, #fffbeb);
    border: 1px solid #fde68a;
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.reasoning-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: #fef3c7;
    color: #92400e;
}

.reasoning-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reasoning-text {
    font-size: 13px;
    line-height: 1.65;
    color: #78350f;
}

/* Coaching tip card */
.coaching-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #6ee7b7;
}

.coaching-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.coaching-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: #d1fae5;
    color: #065f46;
}

.coaching-title {
    font-size: 12px;
    font-weight: 700;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.coaching-text {
    font-size: 13px;
    line-height: 1.65;
    color: #064e3b;
}

/* Next stage indicator */
.next-stage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
}

.next-stage-arrow {
    display: flex;
    align-items: center;
    color: var(--info);
    font-size: 18px;
}

.next-stage-content {
    display: flex;
    flex-direction: column;
}

.next-stage-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e40af;
}

.next-stage-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--info);
}

/* ── ANALYSIS LOADING ANIMATION ────────────────────────────────────── */
.analysis-loading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    animation: stepIn 0.35s ease-out;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.analysis-step-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
}

.analysis-step-text {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Analysis complete flash */
.analysis-loading.complete {
    opacity: 0;
    transition: opacity 150ms ease;
}

/* ── PRIORITY BADGE ────────────────────────────────────────────────── */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.priority-badge.hot {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.priority-badge.warm {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.priority-badge.cold {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── SALES MANAGER SUMMARY ────────────────────────────────────────── */
.manager-summary-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #93c5fd;
    position: relative;
}

.manager-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.manager-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.manager-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: #3b82f6;
    color: white;
}

.manager-summary-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: -0.01em;
}

.manager-summary-text {
    font-size: 13.5px;
    line-height: 1.7;
    color: #1e3a5f;
}

/* ── NEXT BEST ACTION ─────────────────────────────────────────────── */
.next-best-action-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #fcd34d;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.next-best-action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.next-best-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: #f59e0b;
    color: white;
}

.next-best-action-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.next-best-action-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nba-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.nba-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #b45309;
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 3px;
}

.nba-value {
    font-size: 13px;
    line-height: 1.5;
    color: #78350f;
}

.nba-action {
    font-size: 15px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #fde68a;
}

/* ── BUYING SIGNALS ───────────────────────────────────────────────── */
.buying-signals-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #a7f3d0;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.buying-signals-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.buying-signals-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: #10b981;
    color: white;
}

.buying-signals-title {
    font-size: 12px;
    font-weight: 700;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.buying-signals-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.buying-signal-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #064e3b;
    line-height: 1.5;
}

.buying-signal-check {
    color: #10b981;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── CONVERSATION STATUS ──────────────────────────────────────────── */
.conversation-status-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.conversation-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.conversation-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.conversation-status-icon.progressing { background: #d1fae5; color: #065f46; }
.conversation-status-icon.stalled     { background: #fef3c7; color: #92400e; }
.conversation-status-icon.at-risk     { background: #fee2e2; color: #991b1b; }
.conversation-status-icon.lost        { background: #f1f5f9; color: #475569; }

.conversation-status-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.conversation-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.conversation-status-badge.progressing { background: #d1fae5; color: #065f46; }
.conversation-status-badge.stalled     { background: #fef3c7; color: #92400e; }
.conversation-status-badge.at-risk     { background: #fee2e2; color: #991b1b; }
.conversation-status-badge.lost        { background: #f1f5f9; color: #475569; }

.conversation-status-reason {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ── COMMUNICATION RECOMMENDATION ─────────────────────────────────── */
.comm-recommendation-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.comm-recommendation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.comm-recommendation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
}

.comm-recommendation-title {
    font-size: 12px;
    font-weight: 700;
    color: #3730a3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comm-recommendation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.comm-recommendation-badge.sms {
    background: #d1fae5;
    color: #065f46;
}

.comm-recommendation-badge.call {
    background: #fef3c7;
    color: #92400e;
}

.comm-recommendation-badge.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.comm-recommendation-reason {
    font-size: 13px;
    line-height: 1.5;
    color: #3730a3;
}

/* ── TODAY'S PRIORITIES ──────────────────────────────────────────── */
.priorities-panel {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fafbff, #f5f3ff);
    flex-shrink: 0;
}

.priorities-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.priorities-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.priorities-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.priorities-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.priorities-loading {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

.priority-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.priority-row:hover {
    background: white;
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.priority-row-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.priority-row-info {
    flex: 1;
    min-width: 0;
}

.priority-row-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.priority-row-vehicle {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.priority-row-score {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
    min-width: 30px;
    text-align: right;
}

.priority-row-stage {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── SCORING FACTORS ──────────────────────────────────────────────── */
.scoring-factors-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.scoring-factors-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.scoring-factors-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
}

.scoring-factors-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.scoring-factors-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scoring-factor-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scoring-factor-label {
    flex: 1;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.scoring-factor-points {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

.scoring-factor-bar {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.scoring-factor-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    transition: width 0.6s ease;
}

.scoring-factors-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.scoring-factors-total-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

/* ── SALES PIPELINE ───────────────────────────────────────────────── */
.pipeline-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.pipeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.pipeline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--success-bg);
    color: var(--success);
}

.pipeline-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pipeline-stages {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pipeline-stage {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    transition: all var(--transition);
}

.pipeline-stage.completed {
    color: var(--success);
}

.pipeline-stage.completed .pipeline-dot {
    background: var(--success);
    color: white;
}

.pipeline-stage.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
}

.pipeline-stage.active .pipeline-dot {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.pipeline-stage.pending {
    color: var(--text-muted);
}

.pipeline-stage.pending .pipeline-dot {
    background: #e2e8f0;
    color: var(--text-muted);
}

.pipeline-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--transition);
}

.pipeline-label {
    font-size: 12.5px;
}

.pipeline-stage.active .pipeline-label {
    font-weight: 700;
}

/* ── TOAST ───────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--text-inverse);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-slow);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #065f46;
}

.toast.error {
    background: #991b1b;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .panel-right {
        width: 340px;
        min-width: 300px;
    }
    .panel-left {
        width: 280px;
        min-width: 260px;
    }
}

@media (max-width: 960px) {
    .app-container {
        flex-direction: column;
    }
    .panel-left {
        width: 100%;
        min-width: 0;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .panel-right {
        width: 100%;
        min-width: 0;
        max-height: 400px;
    }
}

@media (max-width: 640px) {
    .top-header {
        padding: 0 12px;
    }
    .brand-subtitle {
        display: none;
    }
    .panel-header {
        padding: 12px 14px;
    }
    .message-thread {
        padding: 12px;
    }
    .msg-bubble {
        max-width: 90%;
    }
    .score-card {
        flex-direction: column;
        text-align: center;
    }
}
