:root {
  --sand: #F4F0E6;
  --sand-dark: #E7E0CF;
  --olive: #6B7350;
  --olive-dark: #4E5439;
  --ink: #2B2A25;
  --ink-soft: #6B6A63;
  --line: #DDD7C7;
  --white: #FFFFFF;
  --radius: 6px;
  --max-width: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Inter", "Nunito", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 48px 0 36px;
}

.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin-bottom: 18px;
  display: inline-block;
}

.site-header h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.site-header p {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0;
  max-width: 480px;
}

/* ---------- Search ---------- */
.search-bar {
  margin-top: 32px;
  display: flex;
  gap: 10px;
  max-width: 420px;
}

.filters {
  margin-top: 30px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sand);
}

.filter-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 220px;
}

.filter-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.selected {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive);
}

.filter-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.results-summary {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

.search-bar input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--sand);
  color: var(--ink);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--olive);
  background: var(--white);
}

button, .btn {
  padding: 11px 18px;
  border: 1px solid var(--olive);
  background: var(--olive);
  color: var(--white);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button:hover, .btn:hover { background: var(--olive-dark); border-color: var(--olive-dark); text-decoration: none; }

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--olive-dark);
}
button.secondary:hover, .btn.secondary:hover { background: var(--sand); }
button.secondary.selected, .btn.secondary.selected {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive);
}

button.danger {
  background: transparent;
  border-color: #B5503B;
  color: #B5503B;
}
button.danger:hover { background: #FBEDE9; }

/* ---------- Store list ---------- */
.store-list {
  margin: 36px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.store-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.store-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sand);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--olive-dark);
  font-size: 15px;
  overflow: hidden;
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; }

.store-info { flex: 1; min-width: 0; }

.store-info h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
}

.store-meta {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 6px;
}

.models-line {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--sand);
  color: var(--olive-dark);
  border: 1px solid var(--sand-dark);
}

.badge.friendly {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive);
  font-weight: 600;
}

.store-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.store-actions .email { font-size: 12.5px; color: var(--ink-soft); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--ink-soft);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer .links { display: flex; gap: 16px; }

/* ---------- Admin ---------- */
.admin-shell { min-height: 100vh; background: var(--sand); }

.login-card {
  max-width: 360px;
  margin: 12vh auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.login-card h2 { margin-top: 0; font-size: 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--olive); }

.error-msg { color: #B5503B; font-size: 13px; margin: 8px 0 0; }

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-main { padding: 36px 0 80px; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.panel h2 { margin-top: 0; font-size: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
td.actions { display: flex; gap: 8px; }
td.actions button { padding: 6px 10px; font-size: 12.5px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.model-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.model-pill {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
}
.model-pill.selected { background: var(--olive); border-color: var(--olive); color: var(--white); }

.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 600px) {
  .store-card { flex-wrap: wrap; }
  .store-actions { flex-direction: row; width: 100%; justify-content: space-between; }
  .site-footer { flex-direction: column; }
}
