/* ============================================================
MG · Hub Intelligence Center — Modern Dashboard
============================================================ */
:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e2e6ef;
  --text: #1a1d29;
  --text-2: #4a5068;
  --text-3: #8b90a5;
  --accent: #dc5034;
  --accent-light: #fdf0ed;
  --green: #22c55e;
  --green-light: #ecfdf5;
  --red: #ef4444;
  --red-light: #fef2f2;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --purple: #8b5cf6;
  --yellow: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.brand-name span { color: var(--accent); }

.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}

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

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: all 150ms ease;
  white-space: nowrap;
}

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

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

.tab-new {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 700;
  vertical-align: middle;
}

/* ===== FILTER BAR ===== */
.filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-date {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.filter-date:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-spacer { flex: 1; }

.btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-primary:hover { filter: brightness(0.92); }

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

.btn-secondary:hover { background: var(--surface-2); }

/* ===== MAIN ===== */
main {
  padding: 24px 32px;
  max-width: 1600px;
  margin: 0 auto;
}

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.kpi-card .kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.kpi-card .kpi-sub {
  font-size: 12px;
  color: var(--text-3);
}

.kpi-card .kpi-delta {
  font-size: 12px;
  font-weight: 600;
}

.kpi-card .kpi-delta.pos { color: var(--green); }
.kpi-card .kpi-delta.neg { color: var(--red); }

.kpi-card.positive { border-top: 3px solid var(--green); }
.kpi-card.negative { border-top: 3px solid var(--red); }
.kpi-card.neutral { border-top: 3px solid var(--blue); }
.kpi-card.leads { border-top: 3px solid var(--yellow); }
.kpi-card.total { border-top: 3px solid var(--accent); }

/* ===== CHART CARDS ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.chart-card.full { grid-column: 1 / -1; }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.chart-subtitle {
  font-size: 11px;
  color: var(--text-3);
}

/* ===== DONUT CHART ===== */
.donut-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-chart {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .donut-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.donut-center .donut-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== BAR CHART (VOLUME) ===== */
.volume-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-top: 20px;
  position: relative;
}

.volume-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.volume-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  width: 100%;
  height: 130px;
}

.volume-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-width: 8px;
  transition: all 150ms ease;
  cursor: pointer;
  position: relative;
}

.volume-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.volume-bar.pos { background: var(--green); }
.volume-bar.neg { background: var(--red); }
.volume-bar.neu { background: var(--blue); opacity: 0.4; }

.volume-label {
  font-size: 10px;
  color: var(--text-3);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
}

.volume-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.volume-bar:hover .volume-tooltip {
  opacity: 1;
}

.volume-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  justify-content: center;
}

.volume-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.volume-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ===== WORD CLOUD ===== */
.wordcloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 12px 0;
  min-height: 120px;
}

.word {
  cursor: pointer;
  transition: all 150ms ease;
  font-weight: 600;
}

.word:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.word-xl { font-size: 28px; color: var(--accent); }
.word-lg { font-size: 22px; color: var(--red); }
.word-md { font-size: 17px; color: var(--text); }
.word-sm { font-size: 14px; color: var(--text-2); }
.word-xs { font-size: 12px; color: var(--text-3); }

/* ===== TYPOLOGY / MODEL LIST ===== */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms ease;
}

.top-item:hover {
  background: var(--border);
  transform: translateX(4px);
}

.top-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}

.top-item-info {
  flex: 1;
  min-width: 0;
}

.top-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-item-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
  display: flex;
}

.top-bar-seg {
  height: 100%;
  transition: width 300ms ease;
}

.top-bar-seg.p { background: var(--green); }
.top-bar-seg.n { background: var(--red); }
.top-bar-seg.z { background: var(--blue); opacity: 0.4; }

.top-item-count {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

.top-item-pct {
  font-size: 11px;
  color: var(--text-3);
}

/* ===== NEGATIVES LIST ===== */
.neg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.neg-item {
  padding: 14px 16px;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
}

.neg-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}

.neg-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-3);
}

.neg-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== ALERTS ===== */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-card {
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
}

.alert-card.high {
  background: var(--red-light);
  border: 1px solid #fecaca;
}

.alert-card.opportunity {
  background: var(--green-light);
  border: 1px solid #bbf7d0;
}

.alert-card.medium {
  background: var(--blue-light);
  border: 1px solid #bfdbfe;
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.alert-card.high .alert-icon { background: var(--red); color: white; }
.alert-card.opportunity .alert-icon { background: var(--green); color: white; }
.alert-card.medium .alert-icon { background: var(--blue); color: white; }

.alert-content { flex: 1; }

.alert-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.alert-detail {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.alert-cta {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.alert-card.high .alert-cta {
  background: var(--red);
  color: white;
}

.alert-card.opportunity .alert-cta {
  background: var(--green);
  color: white;
}

.alert-card.medium .alert-cta {
  background: var(--blue);
  color: white;
}

/* ===== DRILLDOWN MODAL ===== */
.drilldown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drilldown-modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 300ms ease;
}

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

.drilldown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.drilldown-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.drilldown-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 150ms ease;
}

.drilldown-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.drilldown-body {
  padding: 24px 28px;
}

.drilldown-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.drill-stat {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-sm);
}

.drill-stat.positive { background: var(--green-light); }
.drill-stat.negative { background: var(--red-light); }
.drill-stat.neutral { background: var(--blue-light); }

.drill-stat-value {
  font-size: 28px;
  font-weight: 800;
}

.drill-stat.positive .drill-stat-value { color: var(--green); }
.drill-stat.negative .drill-stat-value { color: var(--red); }
.drill-stat.neutral .drill-stat-value { color: var(--blue); }

.drill-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-top: 4px;
}

.drilldown-sentiment-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  margin-bottom: 24px;
}

.drilldown-sentiment-bar .seg { height: 100%; }
.drilldown-sentiment-bar .seg.p { background: var(--green); }
.drilldown-sentiment-bar .seg.n { background: var(--red); }
.drilldown-sentiment-bar .seg.z { background: var(--blue); opacity: 0.4; }

.drilldown-comments-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.drilldown-comment {
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.drilldown-comment-sent {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.drilldown-comment-sent.p { background: var(--green); }
.drilldown-comment-sent.n { background: var(--red); }
.drilldown-comment-sent.z { background: var(--blue); opacity: 0.4; }

.drilldown-comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}

.drilldown-comment-who {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.drilldown-ai-btn {
  margin-top: 20px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  width: 100%;
}

.drilldown-ai-btn:hover { filter: brightness(0.92); }
.drilldown-ai-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.drilldown-ai-result {
  margin-top: 16px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.drilldown-ai-result h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 8px;
}

.drilldown-ai-result p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ===== NEWS VIEW ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 150ms ease;
  cursor: pointer;
}

.news-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.news-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 90px;
}

.news-src {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
}

.news-when {
  font-size: 11px;
  color: var(--text-3);
}

.news-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-3);
  width: fit-content;
}

.news-body { flex: 1; }

.news-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.news-summary {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.news-why {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.news-hot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--red);
  color: white;
  border-radius: 10px;
}

/* ===== COMPETITORS VIEW ===== */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 150ms ease;
}

.comp-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.comp-media {
  height: 160px;
  position: relative;
}

.comp-palette {
  position: absolute;
  inset: 0;
  display: flex;
}

.comp-palette > div { flex: 1; }

.comp-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.comp-engagement {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.comp-body {
  padding: 16px;
}

.comp-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.comp-caption {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.comp-why {
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.comp-why-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ===== IDEAS VIEW ===== */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: all 150ms ease;
}

.idea-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.idea-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.idea-card.high::before { background: var(--accent); }
.idea-card.medium::before { background: var(--yellow); }
.idea-card.low::before { background: var(--blue); }

.idea-weight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.idea-weight-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.idea-weight-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.idea-weight-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.idea-weight-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.idea-hook {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}

.idea-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
}

.idea-why {
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 14px;
}

.idea-why-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.idea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.idea-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.idea-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-3);
}

.idea-fmt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

/* ===== INSIGHTS CM (MANUAL) ===== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 150ms ease;
}

.insight-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.insight-image {
  width: 100%;
  height: 180px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.insight-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insight-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}

.insight-image-placeholder span:first-child {
  font-size: 32px;
}

.insight-image-placeholder span:last-child {
  font-size: 11px;
  font-weight: 600;
}

.insight-body {
  padding: 20px;
}

.insight-week {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.insight-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}

.insight-body-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
}

.insight-action {
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.insight-action-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.insight-action-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.insight-comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.insight-comment {
  font-size: 12px;
  color: var(--text-2);
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
  line-height: 1.5;
}

.insight-comment:last-child { border-bottom: none; }

.insight-comment strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== SECTION HEAD ===== */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ===== CHAT FAB ===== */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(220,80,52,0.3);
  cursor: pointer;
  z-index: 80;
  transition: all 150ms ease;
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(220,80,52,0.4);
}

/* ===== CHAT PANEL ===== */
.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-head-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.chat-head-sub {
  font-size: 11px;
  color: var(--text-3);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
}

.chat-msg.user {
  align-self: flex-end;
}

.chat-msg.assistant {
  align-self: flex-start;
}

.chat-msg-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-msg.user .chat-msg-role { color: var(--accent); }
.chat-msg.assistant .chat-msg-role { color: var(--text-3); }

.chat-msg-txt {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
}

.chat-msg.user .chat-msg-txt {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant .chat-msg-txt {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 12px;
}

.chat-suggestion {
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  transition: all 150ms ease;
}

.chat-suggestion:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chat-input-wrap {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.chat-input:focus { border-color: var(--accent); }

.chat-send {
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chat-send:hover { filter: brightness(0.92); }

.chat-loading {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
}

.chat-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: chatPulse 1.2s infinite ease-in-out;
}

.chat-loading span:nth-child(2) { animation-delay: 0.15s; }
.chat-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatPulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

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

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .chart-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .topbar { padding: 12px 16px; }
  .tabs { padding: 0 16px; }
  .filterbar { padding: 12px 16px; }
  main { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-grid { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
  .chat-panel { width: 100%; right: 0; bottom: 0; border-radius: 16px 16px 0 0; }
}