/* ═══════════════════════════════════════════════════════════════
   HIGH 5 CONNECT CRM — V2 Reviews Card + Reports Tab
   Styles for the per-contact review tracker and the Reports → Reviews tab.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Contact Detail: Reviews Card ──────────────────────────── */
.reviews-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  margin-top: var(--s4);
}

.reviews-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.reviews-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight, -0.01em);
}

.reviews-empty {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0;
  padding: var(--s3) 0;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* ─── One Review Row ────────────────────────────────────────── */
.review-row {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3);
  background: var(--bg-input, var(--bg-card));
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.review-row-top {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.review-row-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s2);
  align-items: end;
}

.review-field {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  width: 100%;
}

.review-field:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.review-source { max-width: 130px; }
.review-status { max-width: 110px; }
.review-source-other { max-width: 180px; }
.review-amount { max-width: 110px; }

.review-inline-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--text-label, var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, 0.04em);
  font-weight: 600;
}

.review-notes-label { grid-column: 1 / -1; }

/* ─── 5-Star Rating Control ─────────────────────────────────── */
.review-stars {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
}

.review-star {
  border: none;
  background: transparent;
  color: var(--border);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  transition: color var(--t-fast);
}

.review-star.filled { color: #f59e0b; }
.review-star:hover { color: #fbbf24; }

/* ─── Delete ─────────────────────────────────────────────────── */
.review-delete {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: var(--r-sm);
}

.review-delete:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }

/* ─── Reports: Reviews Tab ─────────────────────────────────── */
.reviews-report-filters {
  display: flex;
  gap: var(--s3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}

.reviews-report-filters label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.reviews-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.reviews-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

@media (max-width: 900px) {
  .reviews-charts { grid-template-columns: 1fr; }
}

.reviews-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
}

.reviews-chart-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-label, var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, 0.04em);
  margin: 0 0 var(--s3);
}

/* Pie by source — SVG scales to container */
.reviews-pie {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s3);
  align-items: center;
}

.reviews-pie svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.reviews-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
}

.reviews-pie-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: var(--s2);
  align-items: center;
}

.reviews-pie-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Monthly bars */
.reviews-month-bars {
  display: flex;
  gap: var(--s2);
  align-items: end;
  height: 140px;
  padding-top: var(--s2);
}

.reviews-month-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.reviews-month-bar-fill {
  width: 100%;
  background: var(--accent, #068bc3);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  min-height: 2px;
}

.reviews-month-bar-count {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 600;
}

.reviews-month-bar-label {
  font-size: 10px;
  color: var(--text-label, var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Table */
.reviews-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.reviews-table th,
.reviews-table td {
  padding: var(--s3);
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}

.reviews-table th {
  background: var(--bg-input, var(--bg-card));
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, 0.04em);
  color: var(--text-label, var(--text-secondary));
  font-weight: 700;
}

.reviews-table tbody tr {
  cursor: pointer;
  transition: background var(--t-fast);
}

.reviews-table tbody tr:hover {
  background: var(--bg-hover, rgba(6, 139, 195, 0.06));
}

.reviews-table tbody tr:last-child td { border-bottom: none; }

.reviews-table-stars { color: #f59e0b; letter-spacing: 1px; }
