* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f4f6f4; color: #1a2e1a; font-size: 15px; }

/* HEADER */
.header { background: linear-gradient(135deg, #1a5c38 0%, #2d8653 100%); color: white; padding: 28px 40px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.header-left h1 { font-size: 22px; font-weight: 700; }
.header-left p { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.header-badge { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }
.section { margin-bottom: 32px; }
.section-title { font-size: 16px; font-weight: 700; color: #1a5c38; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #d1fae5; display: flex; align-items: center; gap: 8px; }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border-left: 4px solid #2d8653; }
.kpi-card.red { border-left-color: #ef4444; }
.kpi-card.yellow { border-left-color: #f59e0b; }
.kpi-card.blue { border-left-color: #3b82f6; }
.kpi-num { font-size: 32px; font-weight: 800; color: #1a5c38; line-height: 1; }
.kpi-card.red .kpi-num { color: #ef4444; }
.kpi-card.yellow .kpi-num { color: #d97706; }
.kpi-card.blue .kpi-num { color: #2563eb; }
.kpi-label { font-size: 12px; color: #6b7280; margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* CHARTS ROW */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .charts-row { grid-template-columns: 1fr; } }
.chart-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.chart-card h3 { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 14px; }
.chart-wrap { position: relative; height: 220px; }

/* FUNNEL */
.funnel-list { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-label { width: 200px; font-size: 13px; color: #374151; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; background: #f1f5f1; border-radius: 4px; height: 26px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 600; color: white; transition: width 0.8s ease; min-width: 36px; }
.funnel-bar.dark { color: #1a2e1a; }
.funnel-val { width: 80px; text-align: right; font-size: 13px; font-weight: 600; color: #374151; }

/* VOLUME CHART */
.vol-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.vol-card h3 { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 14px; }
.vol-wrap { position: relative; height: 180px; }

/* ISSUES TABLE */
.issues-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.issues-table th { background: #1a5c38; color: white; text-align: left; padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.issues-table td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f0f4f0; vertical-align: top; }
.issues-table tr:last-child td { border-bottom: none; }
.issues-table tr:hover td { background: #f9fdf9; }
.sev-crit { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.sev-high { background: #fef3c7; color: #d97706; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.sev-med { background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.status-crit { color: #dc2626; font-weight: 600; }
.status-pend { color: #d97706; }
.status-part { color: #16a34a; }

/* CONVERSATION VIEWER */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn { padding: 6px 14px; border: 2px solid #d1d5db; border-radius: 20px; background: white; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; }
.filter-btn:hover { border-color: #2d8653; color: #2d8653; }
.filter-btn.active { background: #2d8653; color: white; border-color: #2d8653; }
.filter-btn.q5 { border-color: #22c55e; } .filter-btn.q5.active { background: #22c55e; border-color: #22c55e; }
.filter-btn.q4 { border-color: #86efac; } .filter-btn.q4.active { background: #16a34a; border-color: #16a34a; }
.filter-btn.q2 { border-color: #fca5a5; } .filter-btn.q2.active { background: #f87171; border-color: #f87171; }
.filter-btn.q1 { border-color: #ef4444; } .filter-btn.q1.active { background: #ef4444; border-color: #ef4444; }

/* Conv list */
#conv-container { display: flex; flex-direction: column; gap: 6px; }
.conv-item { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); overflow: hidden; border: 1px solid #e8f0e8; transition: box-shadow 0.15s; }
.conv-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.conv-item.conv-open { border-color: #2d8653; }
.conv-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; user-select: none; gap: 12px; }
.conv-header:hover { background: #f9fdf9; }
.conv-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conv-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.conv-date { font-size: 12px; color: #6b7280; font-weight: 500; }
.conv-msgs { font-size: 12px; color: #9ca3af; }
.conv-chevron { font-size: 11px; color: #9ca3af; margin-left: 4px; transition: transform 0.2s; }

.conv-body { border-top: 1px solid #e8f0e8; background: #f8fdf8; padding: 16px; }
.messages-wrap { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.msg-row { display: flex; }
.msg-row-in { justify-content: flex-start; }
.msg-row-out { justify-content: flex-end; }
.msg-bubble { max-width: 72%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.msg-in { background: #e8f5e9; color: #1a2e1a; border-radius: 2px 14px 14px 14px; }
.msg-out { background: #1a5c38; color: white; border-radius: 14px 2px 14px 14px; }
.msg-sender { font-size: 10px; font-weight: 700; opacity: 0.6; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.msg-text { word-break: break-word; }
.msg-time { font-size: 10px; opacity: 0.5; margin-top: 4px; text-align: right; }
.no-msgs { color: #9ca3af; font-style: italic; font-size: 13px; padding: 8px; }
.ninjo-link { font-size: 14px; text-decoration: none; opacity: 0.6; transition: opacity 0.15s; }
.ninjo-link:hover { opacity: 1; }
.conv-body-header { padding: 8px 0 12px; }
.ninjo-link-full { font-size: 12px; color: #2d8653; text-decoration: none; font-weight: 600; border: 1px solid #bbf7d0; background: #f0fdf4; padding: 4px 12px; border-radius: 20px; }
.ninjo-link-full:hover { background: #dcfce7; }

.q-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.q5b { background: #dcfce7; color: #15803d; }
.q4b { background: #d1fae5; color: #15803d; }
.q3b { background: #f1f5f9; color: #475569; }
.q2b { background: #fee2e2; color: #b91c1c; }
.q1b { background: #fef2f2; color: #dc2626; }
.tag { display: inline-block; font-size: 13px; }
.stage-pill { font-size: 11px; background: #f0fdf4; color: #15803d; padding: 2px 8px; border-radius: 8px; border: 1px solid #bbf7d0; }

/* AGENT PROFILE */
.profile-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
@media (max-width: 600px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-field { margin-bottom: 10px; }
.profile-field dt { font-size: 11px; text-transform: uppercase; color: #9ca3af; letter-spacing: 0.5px; font-weight: 600; }
.profile-field dd { font-size: 14px; color: #1a2e1a; margin-top: 2px; }
.flow-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.flow-step { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.flow-arrow { color: #9ca3af; align-self: center; font-size: 14px; }

/* VERDICT */
.verdict { background: linear-gradient(135deg, #1a5c38 0%, #2d8653 100%); color: white; border-radius: 16px; padding: 32px; box-shadow: 0 4px 16px rgba(26,92,56,0.25); }
.verdict h2 { font-size: 20px; margin-bottom: 8px; }
.verdict-answer { font-size: 28px; font-weight: 800; margin-bottom: 24px; }
.verdict-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 700px) { .verdict-cols { grid-template-columns: 1fr; } }
.verdict-col h4 { font-size: 13px; font-weight: 700; opacity: 0.8; margin-bottom: 10px; text-transform: uppercase; }
.verdict-col ul { list-style: none; }
.verdict-col ul li { font-size: 14px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.verdict-col ul li:last-child { border-bottom: none; }
