/* ====================================
   CHECK-IN HISTORY — Pulse Protocol MVP
   ==================================== */

.hist-hidden { display: none; }

/* ---- LAYOUT ---- */
.hist-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---- NAV ACTIONS ---- */
.ci-nav-actions { display: flex; align-items: center; gap: 12px; }
.ci-btn-primary-sm {
  display: inline-block;
  padding: 8px 18px;
  background: var(--dark);
  color: var(--white);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.ci-btn-primary-sm:hover { background: var(--dark-mid); }

/* ---- EMPTY STATE ---- */
.hist-empty {
  text-align: center;
  padding: 80px 0;
}
.hist-empty-icon {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 24px;
}
.hist-empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--dark);
  margin-bottom: 12px;
}
.hist-empty-body {
  font-size: 16px;
  color: var(--fg-muted);
  margin-bottom: 32px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.hist-empty-cta { display: inline-block; }

/* ---- STATS ROW ---- */
.hist-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.hist-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
}
.hist-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.hist-stat-lbl {
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
}

/* ---- AVERAGES CARD ---- */
.hist-avgs-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}
.hist-avgs-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 20px;
}
.hist-avg-bars { display: flex; flex-direction: column; gap: 14px; }
.hist-avg-row {
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  align-items: center;
  gap: 12px;
}
.hist-avg-label {
  font-size: 13px;
  color: var(--fg-muted);
  text-align: right;
}
.hist-avg-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}
.hist-avg-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s ease;
}
.hist-avg-fill-mood { background: #6b9e6b; }
.hist-avg-fill-sleep { background: #4a7db5; }
.hist-avg-fill-stress { background: #c0392b; }
.hist-avg-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  text-align: right;
}
.hist-avgs-note {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ---- HISTORY LIST ---- */
.hist-list-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 20px;
}
.hist-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
}
.hist-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.hist-item-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}
.hist-item-time {
  font-size: 12px;
  color: var(--fg-muted);
}
.hist-item-ratings {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.hist-rating {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.hist-rating-mood { background: rgba(107,158,107,0.15); color: #4a7a4a; }
.hist-rating-sleep { background: rgba(74,125,181,0.15); color: #3a6a9a; }
.hist-rating-stress { background: rgba(192,57,43,0.12); color: #9a3025; }
.hist-notes {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.5;
}
.hist-follow-up {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.55;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .hist-stats { grid-template-columns: repeat(2, 1fr); }
  .hist-container { padding: 24px 16px 60px; }
}
@media (max-width: 380px) {
  .hist-stats { grid-template-columns: 1fr 1fr; }
}