/* Analytics Dashboard Styles */

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.analytics-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.analytics-section h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Engagement bars */
.analytics-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.engagement-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.engagement-label {
  width: 100px;
  font-size: 0.85rem;
  text-transform: capitalize;
}

.engagement-bar-bg {
  flex: 1;
  height: 24px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.engagement-bar-fill {
  height: 100%;
  background: var(--accent, #e74c3c);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.engagement-count {
  width: 40px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Funnel */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.funnel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--accent, #e74c3c);
  border-radius: 4px;
  min-height: 36px;
  transition: width 0.3s ease;
}

.funnel-label {
  font-size: 0.85rem;
  white-space: nowrap;
}

.funnel-value {
  font-weight: 700;
  font-size: 0.9rem;
}

.funnel-drop {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
}

/* Feature usage */
.feature-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feature-card h4 {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.feature-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Churn risk */
.churn-summary {
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--error);
}

.churn-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.churn-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.churn-days {
  color: var(--error);
  font-weight: 600;
}

.churn-activity {
  opacity: 0.7;
}

/* Analytics tables */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.analytics-table thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border-strong);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.analytics-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.analytics-table tbody tr:hover {
  background: var(--bg-hover);
}

.analytics-table .table-sub {
  font-size: 0.75rem;
  opacity: 0.6;
}

.analytics-table .table-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

/* ── Feedback Admin Panel ─────────────────── */

.feedback-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.feedback-admin-item {
  background: var(--bg-card, #fff);
  border: 1px solid rgba(128,128,128,0.15);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.feedback-admin-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

.feedback-admin-user {
  font-weight: 500;
}

.feedback-admin-date {
  margin-left: auto;
  opacity: 0.55;
  font-size: 0.8rem;
  white-space: nowrap;
}

.feedback-admin-message {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.9;
}

.table-badge.badge-danger  { background: rgba(220, 53, 69, 0.2); color: #f87171; }
.table-badge.badge-info    { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.table-badge.badge-neutral { background: rgba(128,128,128,0.15); }

/* ── Section description ──────────────────── */
.analytics-section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

/* ── Lifecycle stages ─────────────────────── */
.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.lifecycle-card {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 1rem;
}
.lifecycle-count {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.lifecycle-stage {
  font-size: 0.85rem;
  margin-top: 0.3rem;
  color: var(--text-primary);
}
.lifecycle-action {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Drop-off funnel ──────────────────────── */
.dropoff-funnel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dropoff-step {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dropoff-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.dropoff-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dropoff-bar {
  display: flex;
  align-items: center;
  background: var(--accent-dim, rgba(201,168,76,0.25));
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 80px;
  transition: width 0.3s;
}
.dropoff-bar.dropoff-high { background: rgba(239,68,68,0.25); }
.dropoff-bar.dropoff-med  { background: rgba(234,179,8,0.25); }
.dropoff-pct {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.dropoff-loss {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 0.25rem;
}
.dropoff-loss.dropoff-high { color: #ef4444; font-weight: 600; }
.dropoff-loss.dropoff-med  { color: #eab308; font-weight: 600; }

/* ── Feature adoption bars ────────────────── */
.adoption-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.adoption-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.adoption-name {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.adoption-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 5px;
  overflow: hidden;
}
.adoption-bar-fill {
  height: 100%;
  background: var(--accent, #c9a84c);
  border-radius: 5px;
  transition: width 0.3s;
}
.adoption-stats {
  width: 100px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

/* ── Tracking depth cards ─────────────────── */
.tracking-depth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.tracking-depth-card {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 1rem;
}
.tracking-depth-card h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--accent);
}
.tdepth-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.tdepth-averages {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Task/Ritual + Session inner panels ───── */
.task-ritual-grid,
.session-patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.analytics-section-inner {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 1rem;
}
.analytics-section-inner h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--accent);
}


