:root {
  --bg: #f6f1ea;
  --bg-deep: #ebe3d6;
  --ink: #1c2a22;
  --muted: #5c6b62;
  --accent: #2f5d45;
  --accent-soft: #d8e6dc;
  --card: #fffdf9;
  --line: #d4cbbd;
  --danger: #8b3a3a;
  --radius: 4px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 10% 0%, #efe6d8 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, #e4efe8 0%, transparent 45%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-admin { background: #1c2a22; border-bottom-color: #2f3f35; }
.topbar-admin .brand, .topbar-admin .nav a { color: #f6f1ea; }
.brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.95rem; }
.nav a { color: var(--ink); }

.main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem 3rem;
  border-top: 1px solid var(--line);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: 1.8rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 36rem; }

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
  min-height: 55vh;
  align-content: end;
  background:
    linear-gradient(180deg, transparent 0%, var(--bg) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23c9d9cf' fill-opacity='0.35' d='M80 10c18 28 48 34 48 62s-22 48-48 48-48-20-48-48 30-34 48-62z'/%3E%3C/svg%3E") right 8% top 20% / 280px no-repeat;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-danger { background: var(--danger); border-color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-deep);
}
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.price { font-weight: 600; font-size: 1.1rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
}
.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.form {
  display: grid;
  gap: 0.85rem;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.25rem;
  border-radius: var(--radius);
}
.form label { display: grid; gap: 0.3rem; font-size: 0.92rem; }
.form input, .form select, .form textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat {
  background: var(--accent-soft);
  padding: 1rem;
  border-radius: var(--radius);
}
.stat strong { display: block; font-size: 1.8rem; font-family: var(--font-display); }

.chat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 640px;
}
.chat-log {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.bubble {
  max-width: 85%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--bg-deep);
}
.bubble.me { align-self: flex-end; background: var(--accent-soft); }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-ok { background: var(--accent-soft); }
.flash-err { background: #f3dede; color: var(--danger); }

.product-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.product-hero img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
@media (max-width: 720px) {
  .product-hero { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
