*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Light theme (default) ── */
:root {
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface2: #edf2ed;
  --border: #c8d8c8;
  --border-subtle: #dce8dc;
  --primary: #3a8f3e;
  --primary-light: #4aa84e;
  --text: #1a2c1a;
  --muted: #4a6e4a;
  --dim: #7a9a7a;
  --danger: #c0392b;
  --nav-bg: #ffffff;
  --nav-border: #dce8dc;
  --tag-cart-bg: #d4edda;    --tag-cart-text: #2d7a30;
  --tag-flower-bg: #eaf0c0;  --tag-flower-text: #6a7a10;
  --tag-preroll-bg: #fde8d8; --tag-preroll-text: #a04010;
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --bg: #0c180c;
  --surface: #162416;
  --surface2: #1e301e;
  --border: #2a422a;
  --border-subtle: #1f331f;
  --primary: #5cb85c;
  --primary-light: #7ecb7e;
  --text: #eaf4ea;
  --muted: #8fbf8f;
  --dim: #5a7a5a;
  --danger: #e05252;
  --nav-bg: #162416;
  --nav-border: #1f331f;
  --tag-cart-bg: #173322;    --tag-cart-text: #5cb85c;
  --tag-flower-bg: #252910;  --tag-flower-text: #b5cc4a;
  --tag-preroll-bg: #2a1a10; --tag-preroll-text: #e07840;
}

/* ── Sage theme ── */
[data-theme="sage"] {
  --bg: #e2ead4;
  --surface: #eef4e2;
  --surface2: #d6e2c4;
  --border: #a8c088;
  --border-subtle: #bdd0a0;
  --primary: #4a6e18;
  --primary-light: #5e8a24;
  --text: #182810;
  --muted: #3a5818;
  --dim: #6a8848;
  --danger: #b83030;
  --nav-bg: #eef4e2;
  --nav-border: #bdd0a0;
  --tag-cart-bg: #c8dca8;    --tag-cart-text: #2e5010;
  --tag-flower-bg: #dce0a0;  --tag-flower-text: #505810;
  --tag-preroll-bg: #f0d8c0; --tag-preroll-text: #883010;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.2s, color 0.2s;
}

/* ── Nav ── */
nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-right: 0.25rem;
}
nav a { color: var(--dim); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
nav a.active { color: var(--text); }
nav a:hover { color: var(--muted); }
nav .spacer { flex: 1; }

/* ── Theme picker ── */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
}
.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.theme-btn:hover { color: var(--muted); }
.theme-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Layout ── */
main { max-width: 900px; margin: 0 auto; padding: 2.5rem 2rem; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 1rem; margin-bottom: 1rem; color: var(--muted); }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
label { font-size: 0.8rem; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
input, select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
input::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}
select option { background: var(--surface2); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.btn:hover { background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--muted); color: var(--text); background: transparent; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card-accent-cart    { border-left: 3px solid var(--primary); }
.card-accent-flower  { border-left: 3px solid #8aaa20; }
.card-accent-preroll { border-left: 3px solid #e07840; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }

/* ── Sections ── */
.section { margin-bottom: 2rem; }
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Tags ── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag.cart    { background: var(--tag-cart-bg);    color: var(--tag-cart-text); }
.tag.flower  { background: var(--tag-flower-bg);  color: var(--tag-flower-text); }
.tag.preroll { background: var(--tag-preroll-bg); color: var(--tag-preroll-text); }

hr { border: none; border-top: 1px solid var(--border-subtle); margin: 2rem 0; }
