:root {
  --bg: #f7f6f1;
  --paper: #fffefb;
  --ink: #171714;
  --muted: #6c6a63;
  --line: #ddd9cf;
  --accent: #315f46;
  --accent-soft: #e9f0ea;
  --danger: #8b3535;
  --shadow: 0 18px 55px rgba(35, 37, 31, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 34px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(247,246,241,.9); border-bottom: 1px solid rgba(221,217,207,.85); }
.nav { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; font-weight:750; letter-spacing:-.02em; }
.brandmark { width:38px; height:38px; border-radius:50%; border:1px solid var(--ink); display:grid; place-items:center; font-family:Georgia,serif; font-size:14px; }
.navlinks { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.btn { border:1px solid var(--ink); background:transparent; color:var(--ink); border-radius:999px; padding:10px 15px; transition:.2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background:var(--ink); color:white; }
.btn.soft { border-color:var(--line); background:var(--paper); }
.btn.danger { border-color:#cfb1b1; color:var(--danger); }
.hero { padding:80px 0 46px; display:grid; grid-template-columns: 1.1fr .9fr; gap:50px; align-items:end; }
.eyebrow { text-transform:uppercase; letter-spacing:.15em; font-size:12px; color:var(--muted); font-weight:700; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(48px, 7vw, 92px); font-weight:400; line-height:.95; letter-spacing:-.04em; margin:12px 0 24px; }
.hero-copy { max-width:620px; font-size:18px; line-height:1.65; color:#4f4d47; }
.hero-card { background:var(--paper); border:1px solid var(--line); border-radius:26px; padding:28px; box-shadow:var(--shadow); }
.hero-card h3 { margin:0 0 12px; font-family:Georgia,serif; font-size:28px; font-weight:400; }
.hero-card p { color:var(--muted); line-height:1.55; }
.section { padding:40px 0 80px; }
.section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.section-head h2 { margin:0; font-family:Georgia,serif; font-weight:400; font-size:42px; letter-spacing:-.03em; }
.filters { display:flex; gap:8px; flex-wrap:wrap; }
.chip { border:1px solid var(--line); border-radius:999px; background:transparent; padding:8px 12px; font-size:13px; }
.chip.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:18px; }
.card { background:var(--paper); border:1px solid var(--line); border-radius:20px; overflow:hidden; min-width:0; display:flex; flex-direction:column; }
.card-media { aspect-ratio: 4/3; background:#eeece5; position:relative; overflow:hidden; }
.card-media img { width:100%; height:100%; object-fit:cover; display:block; }
.placeholder { width:100%; height:100%; display:grid; place-items:center; color:#9a978f; font-family:Georgia,serif; font-size:20px; text-align:center; padding:20px; }
.badge { position:absolute; top:12px; left:12px; background:rgba(255,255,255,.9); border:1px solid rgba(0,0,0,.08); padding:6px 9px; border-radius:999px; font-size:11px; }
.card-body { padding:18px; display:flex; flex-direction:column; gap:12px; flex:1; }
.card-title { display:flex; justify-content:space-between; gap:12px; align-items:start; }
.card h3 { margin:0; font-size:20px; font-weight:650; letter-spacing:-.02em; }
.detail { color:var(--muted); font-size:14px; min-height:20px; }
.price { font-weight:750; font-size:18px; }
.price.locked { font-weight:500; font-size:14px; color:var(--muted); }
.qtyrow { display:flex; gap:8px; margin-top:auto; }
.qtyrow input { width:80px; border:1px solid var(--line); border-radius:12px; padding:10px; background:white; }
.notice { border:1px solid var(--line); background:var(--paper); border-radius:16px; padding:14px 16px; color:#504e48; }
.notice.ok { background:var(--accent-soft); border-color:#c9d9cc; }
.notice.error { background:#f8eaea; border-color:#e4c2c2; color:#6d2525; }
.modal-backdrop { position:fixed; inset:0; background:rgba(10,10,8,.45); z-index:60; display:none; align-items:center; justify-content:center; padding:18px; }
.modal-backdrop.open { display:flex; }
.modal { width:min(680px,100%); max-height:90vh; overflow:auto; background:var(--paper); border-radius:24px; padding:26px; box-shadow:0 30px 90px rgba(0,0,0,.22); }
.modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.modal h2 { font-family:Georgia,serif; font-weight:400; font-size:34px; margin:0; }
.iconbtn { border:0; background:transparent; font-size:26px; line-height:1; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.field { display:flex; flex-direction:column; gap:6px; }
.field.full { grid-column:1/-1; }
.field label { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:700; }
.field input, .field select, .field textarea { width:100%; border:1px solid var(--line); border-radius:12px; padding:11px 12px; background:white; color:var(--ink); }
.field textarea { min-height:100px; resize:vertical; }
.form-actions { margin-top:18px; display:flex; gap:10px; justify-content:flex-end; }
.cartbar { position:fixed; left:50%; bottom:18px; transform:translateX(-50%); width:min(720px,calc(100% - 28px)); background:#161714; color:white; z-index:30; border-radius:18px; padding:14px 18px; display:none; align-items:center; justify-content:space-between; gap:14px; box-shadow:0 18px 55px rgba(0,0,0,.26); }
.cartbar.show { display:flex; }
.cartbar .btn { border-color:white; color:white; }
.cart-list { display:grid; gap:10px; margin:14px 0 18px; }
.cart-item { display:flex; justify-content:space-between; gap:15px; padding-bottom:10px; border-bottom:1px solid var(--line); }
.muted { color:var(--muted); }
footer { border-top:1px solid var(--line); padding:34px 0 60px; color:var(--muted); font-size:14px; }

/* Admin */
.admin-shell { width:min(1240px,calc(100% - 30px)); margin:0 auto; padding:28px 0 70px; }
.admin-head { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:24px; }
.admin-head h1 { font-size:54px; margin:0; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.tab { border:1px solid var(--line); border-radius:999px; padding:9px 14px; background:var(--paper); }
.tab.active { background:var(--ink); color:#fff; }
.panel { display:none; }
.panel.active { display:block; }
.admin-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:14px; }
.admin-card { background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:18px; }
.admin-card h3 { margin:0 0 6px; }
.admin-card .row { display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.product-admin-card { display:grid; grid-template-columns:100px 1fr auto; gap:14px; align-items:center; }
.product-admin-card img { width:100px; height:82px; object-fit:cover; border-radius:12px; background:#eee; }
.status { display:inline-flex; align-items:center; border-radius:999px; padding:5px 9px; font-size:12px; background:#eee; }
.status.approved, .status.delivered, .status.confirmed { background:#e4f0e6; color:#2f6240; }
.status.pending, .status.submitted { background:#f3eddb; color:#715f2a; }
.status.declined, .status.suspended, .status.cancelled { background:#f4e3e3; color:#793535; }
.order-items { margin-top:10px; border-top:1px solid var(--line); padding-top:10px; display:grid; gap:5px; font-size:14px; }
.small { font-size:13px; }
.empty { padding:30px; border:1px dashed var(--line); border-radius:16px; color:var(--muted); text-align:center; }
.loading { padding:40px 0; color:var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns:1fr; padding-top:52px; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-grid { grid-template-columns:1fr; }
  .product-admin-card { grid-template-columns:76px 1fr; }
  .product-admin-card img { width:76px; height:76px; }
  .product-admin-card .admin-actions { grid-column:1/-1; }
}
@media (max-width: 590px) {
  .shell { width:min(100% - 22px,1180px); }
  .nav { height:auto; padding:12px 0; align-items:flex-start; }
  .navlinks { gap:6px; }
  .btn { padding:9px 12px; font-size:13px; }
  .grid { grid-template-columns:1fr; }
  .section-head { align-items:start; flex-direction:column; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .hero { padding-top:42px; }
  .hero h1 { font-size:56px; }
  .cartbar { align-items:flex-start; }
}


/* Customer dashboard */
.dashboard-summary { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:stretch; }
.dashboard-stat { min-width:110px; border:1px solid var(--line); background:#fff; border-radius:16px; padding:14px 16px; display:flex; flex-direction:column; justify-content:center; }
.dashboard-stat strong { font-family:Georgia,serif; font-size:28px; font-weight:400; }
.dashboard-section { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
.customer-orders { display:grid; gap:12px; }
.customer-order-card { border:1px solid var(--line); background:#fff; border-radius:16px; padding:16px; }
.status.shipped { background:#e8eef8; }
@media (max-width:620px){ .dashboard-summary{grid-template-columns:1fr}.dashboard-stat{min-width:0} }
