/* Fern & Field back office (orders.html, stock.html, sales.html). */
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin.woff2") format("woff2"); font-weight: 100 1000; font-display: block; }
:root {
  --bg: #f4efe6; --cream: #fbf8f2; --surface: #ffffff; --ink: #2a2520; --ink-2: #5d554c; --ink-3: #8a8073;
  --line: #e9e1d4; --line-2: #dcd2c2; --clay: #b5532f; --clay-bg: #f6e5dc; --moss: #4f6b4a; --moss-d: #3c5438; --moss-bg: #e6ede2;
  --serif: "Instrument Serif", Georgia, serif; --sans: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.mb-chat { --mb-accent: #4f6b4a; }
.mb-feed-list li { background: var(--bg); }
.mb-ico { background: var(--moss-bg); color: var(--moss); }

.oshell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.oside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 20px 14px 16px; background: #2f3a2d; color: #dfe6d8; overflow-y: auto; }
.olog { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; }
.olog svg { width: 30px; height: 30px; fill: none; stroke: #cfe0c4; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.olog span { display: flex; flex-direction: column; gap: 4px; font: 400 23px/1 var(--serif); color: #fff; }
.olog small { font: 600 10px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: #b9cdb0; }
.onav { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-weight: 500; color: #dfe6d8; }
.onav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.onav:hover { background: rgba(255,255,255,.07); color: #fff; }
.onav[aria-current="page"] { background: rgba(207,224,196,.16); color: #fff; }
.onav.ext { font-size: 13.5px; color: #b9cdb0; }
.onav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e8b089; color: #3b1d0e; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.oside hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 10px 8px; }
.oside .grow { flex: 1; }
.ome { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; }
.ome b { display: block; color: #fff; font-size: 14px; }
.ome small { font-size: 12px; color: #b9cdb0; }
.av-m { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--clay); color: #fff; font-weight: 700; font-size: 13px; flex: none; }

.omain { padding: 22px 28px 48px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.otop { display: none; }
.ohead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
.ohead h1 { font: 400 42px/1 var(--serif); letter-spacing: -.015em; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 20px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.btn.pri { background: var(--moss); color: #fff; }
.btn.pri:hover { background: var(--moss-d); }
.btn.line { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.ck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ck div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ck dt { font-size: 12.5px; color: var(--ink-3); }
.ck dd { font: 400 34px/1 var(--serif); }
.ogrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.orail { display: flex; flex-direction: column; gap: 16px; }
.ch { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ch h2 { font: 400 24px/1.1 var(--serif); }
.ch span { font-size: 12.5px; color: var(--ink-3); }
.ch .r { margin-left: auto; }
.muted { color: var(--ink-3); font-size: 13px; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 14px; background: var(--moss-bg); box-shadow: inset 0 0 0 1px #c7d6c0; font-size: 13.5px; }
.callout.bad { background: var(--clay-bg); box-shadow: inset 0 0 0 1px #e8c3b0; }
.callout a { margin-left: auto; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--ink-2); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.new { background: var(--clay-bg); color: var(--clay); }
.st.packed { background: var(--moss-bg); color: var(--moss); }
.st.picked { background: #ece8e1; color: var(--ink-3); }
.st.low { background: var(--clay-bg); color: var(--clay); }
.st.out { background: var(--ink); color: #fff; }
.st.ord { background: #e7ecf3; color: #3b5578; }
.st.sale { background: #f7ecc9; color: #7a5a00; }
.fresh { animation: fresh 2.6s ease-out; }
@keyframes fresh { from { background: rgba(79,107,74,.22); } }

/* orders board */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.col { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.55); border: 1px solid var(--line); min-width: 0; }
.col > header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col > header b { font-weight: 700; }
.col > header span { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.oc { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; }
.oc:hover { border-color: var(--line-2); box-shadow: 0 6px 16px -12px rgba(42,37,32,.4); }
.oc .top { display: flex; align-items: baseline; gap: 8px; }
.oc .top b { font-weight: 700; font-size: 14.5px; }
.oc .top span { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.oc .it { font-size: 13px; color: var(--ink-2); }
.oc .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--ink-3); }
.oc .meta .slot { font-weight: 700; color: var(--ink); }
.oc .gift { color: var(--clay); font-weight: 600; }
.oc .thumbs { display: flex; gap: 4px; }
.oc .thumbs img, .oc .thumbs .art { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.oc .thumbs .art svg { width: 70%; height: 70%; }
.oc.fresh-new { background: color-mix(in srgb, var(--clay) 8%, #fff); }

/* stock + products */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.srch { flex: 1; min-width: 180px; }
.srch input { width: 100%; min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid var(--line-2); background: var(--cream); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 4px 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; }
.pr { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pr img, .pr .art { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; }
.pr .art svg { width: 66%; height: 66%; }
.pr span { display: flex; flex-direction: column; min-width: 0; }
.pr b { font-weight: 600; }
.pr small { font-size: 12px; color: var(--ink-3); }
.cnt { font: 400 24px/1 var(--serif); }
.cnt.low { color: var(--clay); }
.bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; width: 90px; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--moss); }
.bar i.low { background: var(--clay); }
.tbl s { color: var(--ink-3); margin-right: 4px; }
.art { display: grid; place-items: center; }
.art svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dlv { display: grid; gap: 8px; }
.dlv li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dlv li b { margin-left: auto; font-weight: 700; }

/* sales */
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 220px; padding-top: 10px; }
.chart .d { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; width: 100%; justify-content: center; }
.chart .bars i { display: block; width: 42%; max-width: 30px; border-radius: 6px 6px 2px 2px; background: var(--moss); min-height: 3px; }
.chart .bars i.prev { background: var(--line-2); }
.chart .bars i.today { background: var(--clay); }
.chart b { font-size: 12px; font-variant-numeric: tabular-nums; }
.chart span { font-size: 12px; color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.top5 { display: grid; gap: 8px; }
.top5 li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.top5 em { font: 400 20px/1 var(--serif); color: var(--ink-3); }
.top5 .n { text-align: right; font-weight: 700; }
.top5 .n small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.catbars { display: grid; gap: 10px; }
.catbars li { display: grid; gap: 4px; }
.catbars li div { display: flex; justify-content: space-between; font-size: 13px; }
.catbars .bar { width: 100%; height: 8px; }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* sheet, drawer, toast, fields */
.ov { position: fixed; inset: 0; z-index: 70; background: rgba(42,37,32,.42); display: none; }
.ov.on { display: block; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); padding: 24px 24px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; box-shadow: -24px 0 60px rgba(0,0,0,.18); }
.sheet h2 { font: 400 30px/1.05 var(--serif); padding-right: 48px; }
.sheet h3 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.sheet .sub { color: var(--ink-2); margin-top: -6px; }
.sheet form { display: grid; gap: 12px; }
.sh-x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 10px; font-size: 26px; line-height: 1; color: var(--ink-3); }
.sh-x:hover { background: var(--bg); }
.sh-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-acts > * { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); } .kv dd { font-weight: 600; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld input, .fld select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--cream); font-size: 15px; }
.fld input:focus, .fld select:focus { outline: 2px solid var(--moss); outline-offset: -1px; }
.ck2 { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ck2 input { width: 20px; height: 20px; accent-color: var(--moss); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
[aria-invalid="true"] { border-color: #b42318 !important; }
.err { color: #b42318; font-weight: 600; font-size: 13px; }
.toast { position: fixed; left: 50%; top: 18px; z-index: 80; transform: translate(-50%, -12px); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(42,37,32,.42); display: none; }
.scrim.on { display: block; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); align-items: center; justify-content: center; flex: none; }
.menu-btn i, .menu-btn i::before, .menu-btn i::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); position: relative; }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; }
.menu-btn i::before { top: -6px; } .menu-btn i::after { top: 6px; }

@media (max-width: 1180px) {
  .ogrid { grid-template-columns: 1fr; }
  .ck { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .split2 { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .oshell { display: block; }
  .menu-btn { display: inline-flex; }
  .oside[data-drawer] { position: fixed; top: 0; left: 0; bottom: 0; z-index: 65; width: min(290px, 84vw); height: 100dvh; transform: translateX(-104%); transition: transform .22s ease-out; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .oside[data-drawer].open { transform: none; }
  .otop { display: flex; align-items: center; gap: 12px; }
  .otop b { font: 400 22px/1 var(--serif); }
  .otop span { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
  .omain { padding: 14px 16px 96px; gap: 14px; }
  .ohead h1 { font-size: 34px; }
  .ck dd { font-size: 28px; }
  .ogrid > .orail { order: -1; }
  .sheet { top: auto; left: 0; width: 100%; max-height: 88dvh; border-radius: 18px 18px 0 0; padding: 20px 16px 24px; }
  .row2 { grid-template-columns: 1fr; }
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { border: 0; padding: 0; white-space: normal; }
  .tbl.stack td.wide { grid-column: 1 / -1; }
  .tbl.stack td.hide-sm { display: none; }
  .chart { gap: 4px; }
  .chart b { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
*, *::before, *::after { font-style: normal !important; }
.tbl td.pills { white-space: normal; min-width: 120px; }
.tbl td.pills .st { margin: 2px 4px 2px 0; }
.chart { height: 236px; }
.legend { margin-top: 14px; }
@media (max-width: 720px) { .tbl.stack td.n .bar { margin-left: auto; } }
