/* ── HISTORY PAGE ── */
.history-content {
  flex: 1; padding: 24px 28px; max-width: 1180px;
  margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Top Metrics Bar ── */
.hist-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  width: 100%;
}
.hist-metric-card {
  background: rgba(26, 22, 40, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.hist-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(173, 98, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.hist-metric-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex-shrink: 0;
}
.hist-metric-info { flex: 1; min-width: 0; }
.hist-metric-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 2px;
}
.hist-metric-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Flat Pill Tabs ── */
.hist-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 10px;
  align-items: center;
}

.hist-tab {
  background: rgba(26, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text2);
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-tab:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}
.hist-tab.active {
  background: linear-gradient(135deg, rgba(173, 98, 255, 0.28) 0%, rgba(99, 102, 241, 0.24) 100%);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(173, 98, 255, 0.35);
}

.hist-count-badge {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 2px 8px; border-radius: 10px;
}
.chart-wrap { position: relative; height: 260px; padding: 12px; }
.hist-pagination {
  display: flex; gap: 6px; justify-content: center;
  padding: 14px 0 4px; flex-wrap: wrap;
}
.hist-page-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 5px 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.hist-page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.hist-page-btn.active { background: rgba(173, 98, 255, 0.22); border-color: var(--accent); color: var(--accent); }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.result-full    { color: var(--accent); font-weight: 600; }
.result-partial { color: var(--warn);   font-weight: 500; }
.result-pending { color: var(--danger); }
.result-solved  { color: var(--accent); }
.puzzle-link-cell {
  color: var(--accent); font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.puzzle-link-cell:hover { opacity: 0.75; }

.hist-stage-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 12px; font-size: 11px;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 720px) {
  .history-content { padding: 14px 10px; gap: 14px; }
  .hist-metrics-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hist-metric-card { padding: 10px 12px; gap: 10px; }
  .hist-metric-icon { width: 36px; height: 36px; font-size: 20px; }
  .hist-metric-value { font-size: 16px; }
  .lb-table th:nth-child(5), .lb-table td:nth-child(5) { display: none; }
}

