:root {
  --bg: #f7f5f2;
  --card: #ffffff;
  --text: #222;
  --muted: #666;
  --accent: #2a6f4d;
  --border: #e2ddd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

header a { color: var(--text); text-decoration: none; font-weight: 600; }
header .brand { font-size: 1.1rem; }
header nav { display: flex; gap: 1.5rem; }
header nav a:hover { color: var(--accent); }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: var(--card);
  border-top: 1px solid var(--border);
}

footer a { color: var(--accent); }

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img, .product-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eee;
}

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.card-body h3 { margin: 0; font-size: 1rem; }
.price { font-weight: 600; color: var(--accent); }

a.btn, button.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-size: 0.95rem;
}

a.btn.secondary, button.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--border); }

form.inline { display: inline; }

input, textarea, select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

label { font-weight: 600; font-size: 0.9rem; }

.muted { color: var(--muted); }

.alert {
  background: #fff8e1;
  border: 1px solid #f0d98c;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.status-pending_payment { color: #b26a00; }
.status-paid { color: var(--accent); font-weight: 600; }
.status-shipped { color: #1a5fb4; font-weight: 600; }
.status-delivered { color: #6a3fa0; font-weight: 600; }
.status-cancelled { color: #c0392b; }

.error-text { color: #c0392b; }

.alert-danger { border-color: #e0a0a0; background: #fdecea; }

.split { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1rem; }
.split-col { flex: 1; min-width: 260px; }

.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-actions { display: flex; gap: 0.5rem; }

.qty-cell { max-width: 100px; }
.qty-cell input { margin-bottom: 0; }

.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }

.thumb-strip { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.thumb-option {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.thumb-option:hover { border-color: var(--accent); }

.form-sm { max-width: 320px; }
.form-md { max-width: 400px; }
