:root {
  --ink: #1b1714;
  --char: #231e1a;
  --char-2: #2e2722;
  --line: #3d342d;
  --cream: #f4ece0;
  --paper: #fbf7f1;
  --muted: #a89b8c;
  --gold: #c9a35b;
  --gold-2: #e2c48a;
  --red: #8e2a24;
  --red-2: #a8352e;
  --green: #2f6b45;
  --text: #2a2420;
  --radius: 10px;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--text); background: var(--paper); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: #7a6e62; }
.small { font-size: .875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- header ---------- */
.topbar { background: var(--ink); color: var(--cream); border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { color: var(--cream); text-decoration: none; display: flex; flex-direction: column; line-height: 1.05; margin-right: auto; padding: 8px 0; }
.brand b { font-family: var(--serif); font-size: 1.45rem; letter-spacing: .14em; font-weight: 600; }
.brand span { font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button { color: var(--cream); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: .92rem; background: none; border: 0; font: inherit; cursor: pointer; }
.nav a:hover, .nav button:hover, .nav a.on { background: var(--char-2); color: var(--gold-2); }
.nav .cart-link { border: 1px solid var(--gold); color: var(--gold-2); }
.nav .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: .75rem; font-weight: 700; text-align: center; }
.announce { background: var(--red); color: #fff; text-align: center; font-size: .9rem; padding: 8px 12px; letter-spacing: .02em; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% -10%, #4a2a20 0%, transparent 60%), linear-gradient(180deg, var(--ink), var(--char)); color: var(--cream); padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 24px, var(--gold) 24px 28px, var(--green) 28px 52px, var(--gold) 52px 56px); opacity: .85; }
.hero .eyebrow { color: var(--gold); letter-spacing: .3em; text-transform: uppercase; font-size: .75rem; margin-bottom: 14px; }
.hero p { max-width: 640px; color: #d9cdbd; font-size: 1.05rem; }
.hero .badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .badges span { border: 1px solid var(--line); background: rgba(255,255,255,.03); padding: 6px 12px; border-radius: 999px; font-size: .8rem; color: var(--gold-2); }

/* ---------- product grid ---------- */
.section { padding: 40px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e4d9c9; margin-bottom: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid #eadfcf; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 0 rgba(0,0,0,.02); scroll-margin-top: 90px; }
.card.added { outline: 2px solid var(--gold); }
.card .img { aspect-ratio: 4/3; background: linear-gradient(135deg, #3b2a22, #1e1714); position: relative; display: grid; place-items: center; overflow: hidden; }
.card .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .ribbon { z-index: 1; }
.card .img .ph { font-family: var(--serif); color: var(--gold); font-size: 1.1rem; letter-spacing: .25em; text-transform: uppercase; opacity: .75; text-align: center; padding: 0 20px; }
.card .ribbon { position: absolute; top: 12px; left: 12px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 4px; }
.card .ribbon.gold { background: var(--gold); color: var(--ink); left: auto; right: 12px; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; }
.card .meta { font-size: .85rem; color: #7a6e62; }
.card .desc { font-size: .93rem; color: #4a4038; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.was { color: #9b8f82; text-decoration: line-through; font-size: .95rem; }
.save { color: var(--green); font-weight: 600; font-size: .85rem; }
.card form { display: flex; gap: 8px; align-items: center; }
.limit { font-size: .78rem; color: var(--red); }

/* ---------- forms & buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 8px; border: 1px solid transparent; background: var(--red); color: #fff; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--red-2); }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.gold:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; border-color: #d6c8b4; color: var(--text); }
.btn.ghost:hover { background: #f3ebde; }
.btn.dark { background: var(--ink); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ms { background: #fff; color: #222; border-color: #c9c9c9; font-weight: 600; padding: 13px 20px; }
.btn.ms:hover { background: #f4f4f4; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d6c8b4; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input[type=number].qty { width: 74px; text-align: center; }
textarea { min-height: 90px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
label.inline { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
label.inline input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.hint { font-size: .8rem; color: #7a6e62; font-weight: 400; margin-top: 4px; }
fieldset { border: 1px solid #e4d9c9; border-radius: var(--radius); padding: 6px 18px 18px; margin: 0 0 18px; background: #fff; }
legend { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; padding: 0 8px; }

/* ---------- panels/tables ---------- */
.page { padding: 34px 0 60px; }
.panel { background: #fff; border: 1px solid #eadfcf; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee3d4; vertical-align: top; font-size: .93rem; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #7a6e62; font-weight: 600; }
tr.total td { font-weight: 700; border-bottom: 0; font-size: 1.05rem; }
.table-wrap { overflow-x: auto; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.alert.err { background: #fbe9e7; border: 1px solid #efb7ae; color: #7d1f16; }
.alert.ok { background: #e8f3ec; border: 1px solid #b4d6c0; color: #1f4d30; }
.alert.warn { background: #fff5e0; border: 1px solid #ecd39b; color: #6b4e10; }
.alert ul { margin: 0; padding-left: 18px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eee3d4; color: #4a4038; white-space: nowrap; }
.pill.placed { background: #f3ebde; }
.pill.confirmed, .pill.packed { background: #e6eef8; color: #1d3f6e; }
.pill.on_truck { background: #fff0d6; color: #7a4d00; }
.pill.ready { background: #dff1e6; color: #1f5a35; }
.pill.picked_up { background: #e3e3e3; color: #444; }
.pill.cancelled { background: #f8dcd8; color: #7d1f16; }
.pill.pending { background: #f3ebde; }
.pill.exported { background: #fff0d6; color: #7a4d00; }
.pill.deducted { background: #dff1e6; color: #1f5a35; }
.pill.void { background: #e3e3e3; color: #666; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan { position: relative; }
.plan input { position: absolute; opacity: 0; }
.plan span { display: block; border: 1.5px solid #d6c8b4; border-radius: 8px; padding: 12px; cursor: pointer; background: #fff; font-weight: 500; }
.plan span b { display: block; font-family: var(--serif); font-size: 1.4rem; }
.plan input:checked + span { border-color: var(--red); box-shadow: 0 0 0 3px rgba(142,42,36,.12); }
.plan input:focus-visible + span { outline: 2px solid var(--gold); }
.authbox { background: #faf6ef; border: 1px solid #e4d9c9; border-radius: 8px; padding: 14px; font-size: .88rem; color: #4a4038; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid #eadfcf; border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: #7a6e62; text-transform: uppercase; letter-spacing: .08em; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--text); border: 1px solid #e4d9c9; background: #fff; font-size: .9rem; }
.admin-nav a.on { background: var(--ink); color: var(--gold-2); border-color: var(--ink); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar > * { flex: 0 0 auto; }
.toolbar label { margin: 0 0 4px; font-size: .78rem; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 500px at 70% 0%, #4a2a20, transparent 60%), var(--ink); padding: 20px; }
.login-card { width: 100%; max-width: 440px; background: var(--paper); border-radius: 14px; padding: 36px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.5); text-align: center; }
.login-card .brand-lg { font-family: var(--serif); font-size: 2rem; letter-spacing: .14em; font-weight: 600; color: var(--ink); }
.login-card .sub { color: var(--red); letter-spacing: .28em; text-transform: uppercase; font-size: .72rem; margin-bottom: 24px; }
.ms-logo { width: 20px; height: 20px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }

footer { border-top: 1px solid #e4d9c9; padding: 26px 0 40px; color: #7a6e62; font-size: .85rem; }

/* ---------- print (pick lists) ---------- */
@media print {
  .topbar, .announce, .admin-nav, .no-print, footer { display: none !important; }
  body { background: #fff; }
  .sheet { page-break-after: always; }
  .panel { border: 0; padding: 0; }
}
