/* =========================================================
   Zander88LLC — store dashboard
   Layout modelled on a clean owner dashboard; colours, type and
   logo follow the Zander88LLC storefront.
   ========================================================= */
:root {
  --bg: #f7f5f0;
  --surface: #fff;
  --subtle: #f2eee6;
  --line: #e7e0d5;
  --line-2: #d8d1c5;
  --text: #171716;
  --text-2: #3a3833;
  --muted: #6a665f;
  --faint: #9a948a;
  --brand: #6d2bd0;
  --brand-2: #5b20b6;
  --brand-tint: #f4eefd;
  --olive: #3f5628;
  --olive2: #6f873f;
  --forest: #1d2b12;
  --ok: #2f6b1f;   --ok-bg: #edf5e6;
  --warn: #9a5b00; --warn-bg: #fdf5e3;
  --bad: #b42318;  --bad-bg: #fdf1ef;
  --info: #6d2bd0; --info-bg: #f4eefd;
  --grad: linear-gradient(145deg, #6d2bd0, #8c5be4);
  --r: 10px;
  --r-lg: 16px;
  --sh: 0 1px 2px rgba(42, 35, 25, .05);
  --sh-lg: 0 24px 48px -14px rgba(31, 35, 25, .28);
  --side: 252px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 13px; }
.grow { flex: 1; }
.eyebrow { color: var(--olive); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Buttons + fields ---------- */
.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--sh);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--subtle); }
.btn.primary { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(109, 43, 208, .22); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(109, 43, 208, .3); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; }
.btn.danger-ghost { border-color: transparent; box-shadow: none; color: var(--bad); padding: 0 10px; }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 16px; height: 16px; }
.link-btn.center { justify-content: center; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-2); }
.icon-btn:hover { background: var(--subtle); }
.fld { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.fld input, .fld select, .fld textarea, .select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: #fff;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  box-shadow: var(--sh);
  transition: border-color .15s, box-shadow .15s;
}
.fld textarea { resize: vertical; line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.help { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.select, .fld select {
  appearance: none;
  padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a665f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center/16px;
}
.select { width: auto; height: 40px; min-height: 0; font-size: 14px; border-radius: 999px; padding-left: 14px; }
.unit { position: relative; display: block; }
.unit em { position: absolute; top: 50%; transform: translateY(-50%); left: 12px; font-style: normal; font-weight: 500; color: var(--muted); pointer-events: none; }
.unit.pre input { padding-left: 26px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--subtle); cursor: pointer; }
.switch-row b { display: block; font-weight: 600; font-size: 14px; color: var(--text); }
.switch-row small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.switch { position: relative; flex: none; width: 42px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--olive2); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.alert { padding: 10px 12px; border-radius: var(--r); font-size: 13.5px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- Sign in ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(140, 91, 228, .12), transparent 380px),
    radial-gradient(circle at 92% 92%, rgba(111, 135, 63, .15), transparent 380px),
    var(--bg);
}
.auth-card {
  width: min(410px, 100%);
  display: grid;
  gap: 14px;
  padding: 32px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--sh-lg);
  text-align: center;
}
.auth-logo { justify-self: center; }
.auth-logo img { width: 130px; height: auto; }
.auth-card h1 { font-family: var(--serif); font-size: 28px; letter-spacing: -.5px; }
.auth-card > p { color: var(--muted); margin-top: -8px; }
.auth-card .fld { text-align: left; }
.pass { position: relative; display: block; }
.pass input { padding-right: 46px; }
.pass .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; color: var(--muted); }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; }
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; text-decoration: none; }
.brand-logo { display: grid; place-items: center; width: 52px; height: 40px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo.sm { width: 44px; height: 32px; }
.brand b { display: block; font-size: 15px; color: var(--text); }
.brand small { display: block; color: var(--muted); font-size: 12.5px; margin-top: -2px; }
.nav { display: grid; gap: 2px; }
.nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}
.nav button svg { color: var(--muted); }
.nav button:hover { background: var(--subtle); }
.nav button.on { background: var(--brand-tint); color: var(--brand); }
.nav button.on svg { color: var(--brand); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.soft { background: var(--subtle); color: var(--muted); }
.nav button.on .badge.soft { background: #fff; color: var(--brand); }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot a, .side-foot button, .store-state {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  text-align: left;
}
.side-foot a:hover, .side-foot button:hover { background: var(--subtle); }
.side-foot svg { color: var(--muted); }
.store-state i { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: #4caf2a; box-shadow: 0 0 0 3px #dff0d2; }
.store-state.off i { background: var(--warn); box-shadow: 0 0 0 3px #fbe8bf; }
.mtop { display: none; }
.main { margin-left: var(--side); padding: 30px clamp(20px, 3vw, 40px) 120px; max-width: calc(1260px + var(--side)); min-width: 0; }
.tabbar { display: none; }

/* ---------- Page header ---------- */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.ph h1 span { color: var(--brand); }
.ph p { color: var(--muted); margin-top: 3px; }
.ph-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.search input { width: 270px; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; box-shadow: var(--sh); font-size: 14px; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 15.5px; font-weight: 700; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 2px; }
.empty .btn { margin-top: 12px; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--warn-bg); border: 1px solid #f3dfae; color: #7a4a00; font-size: 14px; }
.notice svg { margin-top: 2px; }
.notice code, .settings code { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .05); }

/* ---------- Segmented tabs ---------- */
.seg { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: #ece7dd; border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(31, 35, 25, .12); }
.seg button em { font-style: normal; font-size: 12px; color: var(--faint); font-weight: 600; }
.seg button.on em { color: var(--brand); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.hidden-p { background: var(--subtle); color: var(--muted); }

/* ---------- Home ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { position: relative; padding: 16px 18px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); transition: border-color .15s, transform .15s; }
button.stat:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.6px; margin-top: 4px; line-height: 1.1; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stat svg { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); }
.stat.hot b { color: var(--bad); }
.stat.hot svg { background: var(--bad-bg); color: var(--bad); }
.stat.feature { background: radial-gradient(circle at 100% 0, rgba(140, 91, 228, .32), transparent 210px), linear-gradient(150deg, #10170d, #1a2613); border-color: transparent; color: #fff; }
.stat.feature span, .stat.feature small { color: #c7cfbe; }
.stat.feature svg { background: rgba(255, 255, 255, .1); color: #d6c3fa; }
.chart-card { margin-bottom: 16px; }
.chart { padding: 18px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; border-bottom: 1px solid var(--line); }
.bars span { flex: 1; min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #8c5be4, #6d2bd0); }
.bars span.zero { background: var(--subtle); }
.bars span:hover { filter: brightness(1.1); }
.axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 12px; }
.chart-empty { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 170px; padding: 20px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--bg); color: var(--muted); text-align: center; }
.chart-empty b { color: var(--text-2); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; align-items: start; }
.mini-list { list-style: none; margin: 0; padding: 6px; }
.mini { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; }
button.mini:hover { background: var(--subtle); }
.mini .thumb { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); object-fit: contain; padding: 2px; }
.mini .av { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-weight: 700; font-size: 14px; }
.mini b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini small { grid-column: 2; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini strong, .mini .pill { grid-row: 1 / 3; grid-column: 3; font-size: 14px; }
.att-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 6px; }
.att-sum button { padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); text-align: left; }
.att-sum button:hover { border-color: var(--line-2); }
.att-sum b { display: block; font-family: var(--serif); font-size: 20px; }
.att-sum small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-a { display: flex; gap: 12px; align-items: flex-start; padding: 16px; text-align: left; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); transition: border-color .15s, transform .15s; }
.quick-a:hover { border-color: var(--line-2); transform: translateY(-1px); }
.quick-a > svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); }
.quick-a b { display: block; font-size: 14px; }
.quick-a small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Orders ---------- */
.orders { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.o-list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; }
.o-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; width: 100%; padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); transition: background .12s; }
.o-row:last-child { border-bottom: 0; }
.o-row:hover { background: #fcfaf6; }
.o-row.on { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.o-row .who { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-row .amt { font-weight: 700; font-size: 14.5px; text-align: right; }
.o-row .meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-row .pill { justify-self: end; }
.o-row .ago { grid-column: 1 / -1; color: var(--faint); font-size: 12px; }
.o-detail { position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); }
.od-empty { display: grid; place-items: center; align-content: center; min-height: 320px; padding: 24px; color: var(--muted); text-align: center; }
.od-empty svg { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--faint); stroke-width: 1.4; }
.od-empty b { color: var(--text-2); }
.od-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.od-h h2 { font-size: 19px; font-weight: 700; }
.od-h p { color: var(--muted); font-size: 13px; }
.od-h .back { display: none; }
.od-sec { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.od-sec:last-child { border-bottom: 0; }
.od-sec h3 { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 4px 0; font-size: 14px; }
.kv svg { color: var(--faint); margin-top: 1px; }
.kv a { color: var(--brand); text-decoration: none; font-weight: 600; }
.kv a:hover { text-decoration: underline; }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: var(--text-2); }
.sum-row.total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 700; color: var(--text); }
.od-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; }
.t-head, .t-row { display: grid; grid-template-columns: 56px minmax(0, 2.4fr) minmax(0, 1.1fr) 90px 150px 40px; gap: 14px; align-items: center; padding: 0 18px; }
.t-head { height: 42px; background: #faf8f3; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.t-row { min-height: 72px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); transition: background .12s; }
.t-row:last-child { border-bottom: 0; }
.t-row:hover { background: #fcfaf6; }
.t-row .thumb { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); object-fit: contain; padding: 3px; }
.t-row .name b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.t-row .name small { display: block; color: var(--muted); font-size: 12.5px; }
.t-row .name small.warn { color: var(--warn); }
.t-row .cat { color: var(--text-2); font-size: 13.5px; text-transform: capitalize; }
.t-row .price { font-weight: 700; }
.t-row .state { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.t-row .go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--faint); }
.t-row .go:hover { background: var(--subtle); color: var(--text); }
.cat-table .t-head, .cat-table .t-row { grid-template-columns: 56px minmax(0, 2fr) 110px 110px 110px; }
.table-foot { margin-top: 12px; }
.table-foot button { margin-left: 6px; }

/* ---------- Categories form ---------- */
.cat-form { margin-bottom: 16px; }
.cat-form-b { display: grid; gap: 14px; padding: 18px; }
.uploader { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-actions { display: flex; justify-content: flex-end; }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 14px; }
.set { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; padding: 22px; }
.set-h h2 { font-size: 16px; font-weight: 700; }
.set-h p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.set-b { display: grid; gap: 10px; align-content: start; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.set-line b { display: block; font-size: 14px; }
.set-line small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Product editor (sheet) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(16, 23, 13, .45); backdrop-filter: blur(4px); animation: fade .2s ease; }
.sheet { width: min(640px, 100%); height: 100%; display: flex; flex-direction: column; background: #fff; box-shadow: var(--sh-lg); animation: slide .28s var(--ease); }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-family: var(--serif); font-size: 26px; letter-spacing: -.5px; }
.sheet-b { flex: 1; overflow-y: auto; padding: 4px 22px 22px; }
.sheet-sec { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; justify-items: start; }
.sheet-sec:last-of-type { border-bottom: 0; }
.sheet-sec h3 { font-size: 14px; font-weight: 700; }
.sheet-sec > .help { margin-top: -8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.grid2 .full { grid-column: 1 / -1; }
.grid2.tight { gap: 10px; }
.sheet-f { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fff; }
.image-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; }
.image-picker:empty { display: none; }
.uploader .image-picker { width: auto; grid-template-columns: repeat(auto-fill, 96px); }
.image-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.image-tile img { width: 100%; height: 100%; object-fit: contain; }
.image-tile button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--bad); }
.image-tile button svg { width: 14px; height: 14px; }
.image-tile .main-tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 10px); padding: 12px 20px; border-radius: 999px; background: var(--forest); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--sh-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stats, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-head, .t-row { grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1fr) 80px 130px 34px; }
}
@media (max-width: 960px) {
  .side { display: none; }
  .mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 12px 0 14px; padding-top: env(safe-area-inset-top); background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mtop strong { flex: 1; font-size: 16px; }
  .main { margin-left: 0; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--brand); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 4px); margin: 0; height: 18px; min-width: 18px; font-size: 11px; }
  .home-grid, .orders { grid-template-columns: 1fr; }
  .o-detail { position: static; max-height: none; }
  .orders.detail-open .o-list { display: none; }
  .orders:not(.detail-open) .o-detail { display: none; }
  .od-h .back { display: grid; }
  .set { grid-template-columns: 1fr; gap: 12px; }
  .search input { width: 100%; }
  .ph-tools { width: 100%; }
  .ph-tools .search { flex: 1; min-width: 180px; }
  .t-head { display: none; }
  .t-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "img name go" "img meta state"; gap: 4px 12px; padding: 12px 14px; }
  .t-row .thumb { grid-area: img; }
  .t-row .name { grid-area: name; }
  .t-row .cat { display: none; }
  .t-row .price { grid-area: meta; font-size: 13.5px; }
  .t-row .state { grid-area: state; justify-self: end; }
  .t-row .go { grid-area: go; justify-self: end; }
  .cat-table .t-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "img name act" "img meta act"; }
  .cat-table .t-row > :nth-child(3) { grid-area: meta; }
  .cat-table .t-row > :nth-child(4) { display: none; }
  .cat-table .t-row > :nth-child(5) { grid-area: act; }
  .modal { justify-content: stretch; }
  .sheet { width: 100%; }
}
@media (max-width: 560px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 24px; }
  .stat svg { display: none; }
  .quick { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .att-sum { grid-template-columns: 1fr; }
  .ph h1 { font-size: 26px; }
  .sheet-f .btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* long env-var names wrap instead of widening the page */
.set, .set-b, .set-line > div { min-width: 0; }
.set-line { flex-wrap: wrap; }
.settings code, .notice code, .empty code { overflow-wrap: anywhere; }
