:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --border: #e2e2e2;
  --accent: #1f6feb;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header, .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-header nav a { margin-right: 1rem; }

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

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.product-card img, .product-card__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f2f2f2;
  border-radius: var(--radius);
}

.product-card h2 { font-size: 1rem; margin: 0.5rem 0 0.25rem; }
.price { color: var(--muted); font-weight: 600; }

.product-detail img { max-width: 100%; border-radius: var(--radius); }
.gallery { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.gallery img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius); }

.login { max-width: 320px; margin: 4rem auto; }
.login form { display: flex; flex-direction: column; gap: 0.75rem; }

input, button {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

.admin-main section { margin-bottom: 2rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #eaeaea;
    --muted: #9a9a9a;
    --border: #2a2d34;
  }
  .product-card img, .product-card__placeholder { background: #1a1d24; }
}
