* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}

header {
  background: #2b3a67;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

header h1 { margin: 0; font-size: 1.4rem; }
header a { color: #bcd0ff; text-decoration: none; }
header a:hover { text-decoration: underline; }
header .stats { margin-left: auto; font-size: 0.9rem; opacity: 0.85; }

main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* Overview list */
.csv-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; max-width: 480px; }
.csv-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  background: #fff;
  border: 1px solid #dde1ea;
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  text-decoration: none;
  color: inherit;
  font-size: 1.05rem;
  font-weight: 600;
}
.csv-list a:hover { border-color: #2b3a67; }
.csv-list .meta { font-size: 0.85rem; font-weight: 400; color: #6b7280; white-space: nowrap; }

/* Viewer controls */
.controls { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.controls input, .controls select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cfd4e0;
  border-radius: 8px;
  font-size: 0.95rem;
}
.controls input { flex: 1; min-width: 200px; }

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  background: #fff;
  border: 1px solid #dde1ea;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}
.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f4f5f7;
  border-radius: 6px;
  cursor: zoom-in;
}
.card .name { font-weight: 600; font-size: 0.9rem; }
.card .detail { font-size: 0.78rem; color: #6b7280; }
.card .bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.card .price { font-weight: 600; color: #14713d; }
.card .qty { color: #6b7280; }

.empty { color: #6b7280; padding: 2rem 0; }
.error { color: #b3261e; padding: 2rem 0; }
