/* 10-insights.css — Insights dashboard: range filter, stat cards, charts.
   Part of the old css/styles.css (lines 2009–2184); unused rules since removed.
   The number is the load order: later files override earlier ones, exactly
   as later lines in the single file used to. Keep them linked in order. */

/* ==================== Insights ==================== */
.insights-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 4rem 1rem; color: #95a5a6; }
.insights-spinner { width: 34px; height: 34px; border: 3px solid #e0e4ed; border-top-color: #19378C; border-radius: 50%; animation: spin 0.75s linear infinite; }

.insights-intro { margin-bottom: 1.1rem; }
.insights-intro p { font-size: 0.85rem; color: #666; margin-top: 2px; }

.insights-scope-chips { display: flex; gap: 8px; margin-bottom: 1.1rem; }
.insights-scope-chip {
  padding: 7px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  background: #eef1f9; color: #19378C; cursor: pointer; border: 1.5px solid transparent;
  transition: background 0.2s, color 0.2s;
}
.insights-scope-chip.active { background: #19378C; color: #fff; }

/* Date-range filter — Today / 7 Days / 30 Days. Visually a tier below the
   scope chips (which change WHAT you're looking at); this only changes the
   window, so it reads as a segmented control rather than a second set of
   equally-weighted pills. */
/* Read receipts are pinned on for guests — the switch shows its real
   state (on) but reads as not-yours-to-change rather than broken. */
.mk-toggle-locked { opacity: 0.55; cursor: not-allowed; }
.mk-toggle-locked input { cursor: not-allowed; }

.insights-range-chips {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 1.1rem;
  background: #eef1f9;
  border-radius: 20px;
  padding: 3px;
}
.insights-range-chip {
  border: none;
  background: transparent;
  color: #5a6580;
  padding: 6px 14px;
  border-radius: 17px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.insights-range-chip.active {
  background: #fff;
  color: #19378C;
  box-shadow: 0 1px 4px rgba(25, 55, 140, 0.18);
}
.insights-range-chip:active { transform: scale(0.97); }

/* "all time" marker on a card the range can't slice (shares) — small and
   quiet, but present, so the number isn't read as belonging to the
   selected window. */
.insights-stat-note {
  display: block;
  font-size: 0.66rem;
  color: #9aa3ad;
  font-weight: 600;
  margin-top: 1px;
}

.insights-scope-note {
  font-size: 0.72rem;
  color: #8d95a5;
  margin: -0.7rem 0 1.1rem;
  line-height: 1.4;
}

/* Today: one bucket, no trend to draw — show the figure instead of an
   empty plot area. See _renderChartSVG's n === 1 branch. */
.insights-chart-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1.6rem;
  text-align: center;
}
.insights-chart-single-value {
  font-size: 2.6rem; font-weight: 800; color: #19378C; line-height: 1;
}
.insights-chart-single-label {
  font-size: 0.84rem; color: #666; margin-top: 8px; font-weight: 600;
}
.insights-chart-single-hint {
  font-size: 0.74rem; color: #9aa3ad; margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .insights-range-chip { transition: none; }
  .insights-range-chip:active { transform: none; }
}

.insights-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.2rem; }
.insights-stat-card { background: #fff; border-radius: 16px; padding: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.insights-stat-icon {
  width: 38px; height: 38px; border-radius: 12px; background: #eef1f9; color: #19378C;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.insights-stat-value { font-size: 1.45rem; font-weight: 800; color: #1a1a2e; line-height: 1.1; }
.insights-stat-label { font-size: 0.78rem; color: #666; margin-top: 4px; }

.insights-chart-card { background: #fff; border-radius: 16px; padding: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.06); margin-bottom: 1.2rem; }
.insights-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.insights-chart-header h3 { font-size: 0.98rem; }
.insights-chart-tabs { display: flex; gap: 6px; }
.insights-chart-tab {
  border: none; background: #eef1f9; color: #19378C; font-size: 0.74rem; font-weight: 700;
  padding: 6px 10px; border-radius: 14px; cursor: pointer;
}
.insights-chart-tab.active { background: #19378C; color: #fff; }
.insights-chart-wrap { position: relative; margin-top: 26px; }
.insights-chart-badge {
  position: absolute; top: -26px; transform: translateX(-100%);
  background: #19378C; color: #fff; border-radius: 10px; padding: 5px 10px;
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25;
  white-space: nowrap; box-shadow: 0 3px 8px rgba(25,55,140,0.3);
}
.insights-chart-badge-date  { font-size: 0.62rem; opacity: 0.85; }
.insights-chart-badge-value { font-size: 0.76rem; font-weight: 800; }
.insights-chart-empty-note { font-size: 0.78rem; color: #95a5a6; text-align: center; margin-top: 8px; }

.insights-tip-card {
  display: flex; align-items: center; gap: 10px; background: #eef1f9;
  border-radius: 16px; padding: 1rem; margin-bottom: 1.3rem;
}
.insights-tip-icon {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #19378C;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.insights-tip-text { flex: 1; min-width: 0; }
.insights-tip-card h4 { font-size: 0.9rem; margin-bottom: 3px; color: #19378C; }
.insights-tip-card p  { font-size: 0.8rem; color: #444; line-height: 1.4; }
.insights-tip-btn {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  background: #fff; color: #19378C; border: none; border-radius: 20px;
  padding: 8px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.insights-tip-list-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.insights-tip-list-item:last-child { border-bottom: none; }
.insights-tip-list-item h4 { font-size: 0.86rem; margin-bottom: 3px; color: #1a1a2e; }
.insights-tip-list-item p  { font-size: 0.79rem; color: #666; line-height: 1.45; }

.insights-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.insights-section-header h3 { font-size: 1rem; }
.insights-see-all { font-size: 0.82rem; font-weight: 600; color: #19378C; cursor: pointer; background: none; border: none; }

.insights-listing-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px;
  padding: 0.7rem; margin-bottom: 0.55rem; cursor: pointer;
}
.insights-listing-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #eef1f9; }
.insights-listing-info  { flex: 1; min-width: 0; }
.insights-listing-info h4 { font-size: 0.87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.insights-listing-info p  { font-size: 0.76rem; color: #666; margin-top: 2px; }
.insights-top-badge {
  font-size: 0.65rem; font-weight: 700; color: #1a8a4c; background: #e4f7ec;
  padding: 2px 8px; border-radius: 10px; flex-shrink: 0;
}
.insights-listing-views { display: flex; align-items: center; gap: 3px; font-size: 0.8rem; color: #19378C; font-weight: 700; flex-shrink: 0; }

.insights-empty { text-align: center; padding: 3.5rem 1.5rem; color: #95a5a6; }
.insights-empty p { font-size: 15px; margin: 0 0 14px; line-height: 1.6; }

.activity-section  { margin-bottom: 2rem; }
.activity-item     { background: #fff; border-radius: 10px; padding: 0.8rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.8rem; }
.activity-icon     { width: 40px; height: 40px; background: #eef1f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #19378C; }
.activity-details h4 { font-size: 0.85rem; margin-bottom: 0.2rem; }
.activity-details p  { font-size: 0.75rem; color: #666; }
