:root {
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-light: #eef2ff;

  --c-gray: #6b7280;
  --c-blue: #3b82f6;
  --c-green: #10b981;

  --bg-gray: #f3f4f6;
  --bg-blue: #eff6ff;
  --bg-green: #f0fdf4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Header ── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-title {
  display: flex;
  flex-direction: column;
}

.header-title h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.header-title span {
  font-size: 0.75rem;
  color: var(--muted);
}

.header-progress {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.progress-label strong {
  color: var(--accent);
  font-size: 1.25rem;
}

.progress-bar {
  width: 180px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Main ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.125rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.stat-card.s-gray  .stat-icon { background: var(--bg-gray); }
.stat-card.s-blue  .stat-icon { background: var(--bg-blue); }
.stat-card.s-green .stat-icon { background: var(--bg-green); }

.stat-info { display: flex; flex-direction: column; }

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card.s-gray  .stat-value { color: var(--c-gray); }
.stat-card.s-blue  .stat-value { color: var(--c-blue); }
.stat-card.s-green .stat-value { color: var(--c-green); }

/* ── Filters ── */
.filters {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 64px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.pill {
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  font-family: inherit;
}

.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }

/* ── Sample List ── */
.list-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.list-meta span { font-weight: 600; color: var(--text); }

.sample-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ── Sample Card ── */
.sample-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.125rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: box-shadow 0.15s, transform 0.15s;
}

.sample-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}

.sample-card.sl-gray  { border-top-color: var(--c-gray); }
.sample-card.sl-blue  { border-top-color: var(--c-blue); }
.sample-card.sl-green { border-top-color: var(--c-green); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sample-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-body {
  flex: 1;
}

.sample-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.sample-desc {
  font-size: 0.775rem;
  color: var(--muted);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.cat-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.status-badge.sb-gray  { background: var(--bg-gray);  color: var(--c-gray); }
.status-badge.sb-blue  { background: var(--bg-blue);  color: var(--c-blue); }
.status-badge.sb-green { background: var(--bg-green); color: var(--c-green); }

.demo-link {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.demo-link:hover { text-decoration: underline; }


/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sample-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  main { padding: 1rem; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .progress-bar { width: 120px; }
  .sample-list { grid-template-columns: 1fr; }
}
