/* Irfan Farms admin — the new design (paper, ink, dark forest, lime; Bricolage Grotesque + Geist), loaded after admin.css.
   Layout: sticky dark-forest top bar with the pages in drop-down groups (no sub-tabs), content on off-white paper.
   The first block re-points site.css / admin.css tokens, so older rules pick up the new colours without being rewritten.
   Motion: colour/opacity/transform only, one easing. Everything new is adm- prefixed. */
body.adm-theme {
  --bg: #F3F2ED; --surface: #FFFFFF; --sand: #ECE9DF; --line: #E4E2DA; --line-2: #D3D0C5;
  --ink: #0B1410; --ink-2: #3E463F; --muted: #666C63;
  --navy: #0B1410; --navy-2: #0F221A; --navy-3: #173427; --on-navy: #C3CEC6; --on-navy-dim: #9FB0A5;
  --leaf: #1E5A36; --leaf-hi: #174A2C; --leaf-band: #0F221A; --leaf-soft: #E7F1D8; --leaf-ink: #1F4D22; --leaf-light: #D4F36C;
  --marigold: #D4F36C; --marigold-hi: #E2FA88; --warm: #6F8C1C; --warm-soft: #FFF3DC; --warm-ink: #6B3A0A;
  --red-soft: #F9E1DA; --red-ink: #8A2414;
  --display: "Bricolage Grotesque", system-ui, sans-serif; --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 12px; --r: 16px; --r-lg: 20px;
  --shadow: 0 20px 44px -18px rgba(11, 20, 16, .28);
  --adm-forest: #0F221A; --adm-moss: #173427; --adm-lime: #D4F36C; --adm-lime-hi: #E2FA88; --adm-on: #C3CEC6; --adm-dim: #8FA398;
  --adm-h: 60px; --adm-ease: cubic-bezier(.2, .7, .2, 1);
  display: block; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans);
}
.adm-theme :focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.adm-theme a { color: var(--ink); }
.adm-theme a:hover { color: var(--leaf); }
.adm-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.adm-top { position: sticky; top: 0; z-index: 60; background: var(--adm-forest); color: var(--adm-on); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.adm-top-in { max-width: 1440px; margin: 0 auto; height: var(--adm-h); display: flex; align-items: center; gap: 22px; padding: 0 clamp(16px, 2.6vw, 36px); }
.adm-theme .adm-top a { color: inherit; text-decoration: none; }
.adm-brand { flex: none; display: flex; align-items: center; gap: 10px; }
.adm-brand img { height: 32px; width: auto; }
.adm-brand span { padding: 2px 7px; border-radius: 6px; background: rgba(212, 243, 108, .14); color: var(--adm-lime); font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.adm-menu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.adm-right { flex: none; display: flex; align-items: center; gap: 10px; }
/* top-level items: group names (drop-downs) and single links */
.adm-tl { position: relative; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none;
  font: 500 13.5px var(--sans); color: var(--adm-on); cursor: pointer; white-space: nowrap; transition: background .2s var(--adm-ease), color .2s var(--adm-ease); }
.adm-theme .adm-top .adm-tl:hover, .adm-theme .adm-dd:hover > .adm-tl, .adm-theme .adm-dd:focus-within > .adm-tl, .adm-theme .adm-dd.open > .adm-tl { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-theme .adm-top .adm-tl[aria-current] { background: var(--adm-lime); color: var(--ink); font-weight: 600; }
.adm-caret { width: 14px; height: 14px; margin-right: -4px; opacity: .7; transition: transform .2s var(--adm-ease); }
.adm-dd:hover .adm-caret, .adm-dd.open .adm-caret { transform: rotate(180deg); }
.adm-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--adm-lime); color: var(--ink); font: 700 12px/18px var(--sans); text-align: center; }
.adm-tl[aria-current] .adm-count { background: var(--ink); color: var(--adm-lime); }
/* drop-down panels */
.adm-dd { position: relative; }
.adm-pop { position: absolute; top: 100%; left: 0; z-index: 70; min-width: 230px; display: grid; gap: 1px; margin-top: 8px; padding: 6px; border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 50px -18px rgba(11, 20, 16, .45), 0 0 0 1px rgba(11, 20, 16, .06);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s var(--adm-ease), transform .18s var(--adm-ease), visibility 0s .18s; }
.adm-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }   /* hover bridge across the gap */
.adm-dd:hover > .adm-pop, .adm-dd:focus-within > .adm-pop, .adm-dd.open > .adm-pop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.adm-pop-r { left: auto; right: 0; }
.adm-pop-k { padding: 6px 10px 4px; font: 500 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adm-pop a, .adm-pop button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--ink);
  font: 500 13.5px var(--sans); text-align: left; cursor: pointer; }
.adm-theme .adm-top .adm-pop a { color: var(--ink); }
.adm-pop span { flex: 1; min-width: 0; white-space: nowrap; }
.adm-pop .adm-ic { color: var(--muted); }
.adm-theme .adm-top .adm-pop :is(a, button):hover { background: var(--bg); color: var(--ink); }
.adm-pop :is(a, button):hover .adm-ic { color: var(--ink); }
.adm-theme .adm-top .adm-pop a[aria-current] { background: #EEF6D2; font-weight: 600; }
.adm-pop a[aria-current] .adm-ic { color: var(--leaf); }
.adm-pop .adm-count { background: var(--ink); color: var(--adm-lime); }
.adm-pop form { margin: 0; }
.adm-theme .adm-top .adm-pop .adm-out:hover { background: var(--red-soft); color: var(--red-ink); }
/* order finder */
.adm-find { position: relative; display: flex; align-items: center; width: 250px; }
.adm-find .adm-ic { position: absolute; left: 11px; z-index: 1; width: 15px; height: 15px; color: var(--adm-dim); pointer-events: none; }
.adm-theme .adm-top .adm-find input { flex: 1; min-width: 0; width: 100%; height: 36px; padding: 0 30px 0 33px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06);
  color: #fff; font: 400 13px var(--sans); }
.adm-theme .adm-top .adm-find input:focus { border-color: rgba(212, 243, 108, .55); box-shadow: none; background: rgba(255, 255, 255, .1); }
.adm-find input::placeholder { color: var(--adm-dim); }
.adm-find input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.adm-find kbd { position: absolute; right: 10px; padding: 0 5px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 5px; font: 500 12px/16px var(--sans); color: var(--adm-dim); pointer-events: none; }
.adm-find:focus-within kbd { display: none; }
/* user menu */
.adm-me-btn { padding: 0 6px 0 3px; }
.adm-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--adm-moss); color: var(--adm-lime); font: 700 13px var(--display); box-shadow: inset 0 0 0 1px rgba(212, 243, 108, .35); }
.adm-who { display: flex; flex-direction: column; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.adm-who strong { font: 600 13.5px var(--sans); }
.adm-who small { font-size: 12px; color: var(--muted); }
.adm-burger { display: none; }

/* narrower screens: the finder shrinks, then the menu becomes a sheet under the bar with every group open */
@media (max-width: 1240px) { .adm-find { width: 180px; } .adm-find kbd { display: none; } .adm-tl { padding: 0 10px; } .adm-top-in { gap: 14px; } }
@media (max-width: 1060px) {
  .adm-burger { order: -1; display: grid; place-items: center; width: 38px; height: 38px; margin-right: -6px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
  .adm-menu { position: absolute; top: var(--adm-h); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 14px 16px; background: var(--adm-forest);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); max-height: calc(100vh - var(--adm-h)); overflow-y: auto; }
  .adm-top.open .adm-menu { display: flex; }
  .adm-right { margin-left: auto; }
  .adm-menu .adm-dd > .adm-tl { display: none; }
  .adm-menu .adm-pop { position: static; opacity: 1; visibility: visible; transform: none; margin: 0; padding: 0; background: none; box-shadow: none; min-width: 0; }
  .adm-menu .adm-pop-k { color: var(--adm-dim); padding-top: 12px; }
  .adm-theme .adm-top .adm-menu .adm-pop a { color: var(--adm-on); }
  .adm-theme .adm-top .adm-menu .adm-pop a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .adm-theme .adm-top .adm-menu .adm-pop a[aria-current] { background: var(--adm-lime); color: var(--ink); }
  .adm-menu .adm-pop .adm-ic { color: var(--adm-dim); }
  .adm-menu > .adm-tl { border-radius: 9px; margin-top: 10px; }
}
@media (max-width: 600px) { .adm-find { display: none; } }

/* ---------- page frame ---------- */
.adm-body { min-width: 0; }
.adm-theme .admin-main { max-width: 1440px; margin: 0 auto; padding: 26px clamp(16px, 2.6vw, 36px) 72px; }
.adm-flash { position: fixed; z-index: 80; top: calc(var(--adm-h) + 12px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px);
  margin: 0; padding: 10px 10px 10px 16px; border-radius: 12px; font: 500 13.5px var(--sans); box-shadow: 0 16px 40px -14px rgba(11, 20, 16, .35); animation: adm-toast 6s var(--adm-ease) forwards; }
.adm-flash.flash-ok { background: var(--ink); color: #fff; }
.adm-flash.flash-ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--adm-lime); flex: none; }
.adm-flash button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .1); color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.adm-flash.flash-err button { background: rgba(0, 0, 0, .06); }
@keyframes adm-toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 5%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); visibility: hidden; } }
.adm-flash.flash-err { animation: adm-in .3s var(--adm-ease); }   /* errors stay until dismissed */
@keyframes adm-in { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- type ---------- */
.adm-theme .h1 { margin: 0 0 18px; font: 700 30px/1.05 var(--display); letter-spacing: -.04em; color: var(--ink); }
.adm-theme .h1 small { font: 500 14px var(--sans); letter-spacing: 0; color: var(--muted); }
.adm-theme .h2 { font: 700 22px/1.1 var(--display); letter-spacing: -.03em; color: var(--ink); }
.adm-theme .h2.sm { margin: 28px 0 12px; font-size: 20px; }
.adm-theme .h3 { font: 700 16px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); }
.adm-theme .small { font-size: 12.5px; }
.adm-theme .muted { color: var(--muted); }
.adm-theme .admin-head { margin-bottom: 16px; }
.adm-theme .admin-head .h1 { margin: 0; }

/* No sub-tabs any more: every page shows its own heading again (setup pages hid it under the old tab bar). */
.adm-theme .in-setup h1.h1 { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin: 0 0 16px; }
.adm-theme .in-setup .admin-head h1.h1 { margin: 0; }
.adm-theme .in-setup .admin-head { display: flex; justify-content: space-between; margin-bottom: 14px; }
.adm-theme .in-setup .prod-help { margin: -4px 0 12px; max-width: none; }

/* ---------- buttons ---------- */
.adm-theme .btn { min-height: 38px; padding: 0 16px; gap: 7px; border-radius: 999px; border-width: 1.5px; font: 600 13.5px/1 var(--sans); }
.adm-theme .btn .ic, .adm-theme .btn svg { width: 16px; height: 16px; }
.adm-theme .btn-lg { min-height: 44px; padding: 0 22px; font-size: 14.5px; }
.adm-theme .btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; margin-left: 0; }
.adm-theme :is(.btn-primary, .btn-accent, .btn-cream) { background: var(--adm-lime); color: var(--ink); }
.adm-theme :is(.btn-primary, .btn-accent, .btn-cream):hover { background: var(--adm-lime-hi); color: var(--ink); }
.adm-theme .btn-dark { background: var(--ink); color: #fff; }
.adm-theme .btn-dark:hover { background: var(--adm-moss); color: #fff; }
.adm-theme .btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--surface); }
.adm-theme .btn-outline:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.adm-theme .sm-btn { height: 30px; border-radius: 8px; border: 1px solid var(--line-2); font: 600 12.5px var(--sans); }
.adm-theme .sm-btn:hover, .adm-theme .sq-btn:hover:not(:disabled) { border-color: var(--ink); }
.adm-theme .sm-btn-navy { border-color: var(--ink); color: var(--ink); }
.adm-theme .sq-btn { border: 1px solid var(--line-2); }

/* ---------- inputs: compact ---------- */
.adm-theme :is(input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], input[type=password], input:not([type]), select) {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); font: 400 13.5px var(--sans); }
.adm-theme textarea { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); font: 400 13.5px/1.5 var(--sans); }
.adm-theme :is(input, textarea, select):focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(30, 90, 54, .14); }
.adm-theme .fld { gap: 5px; }
.adm-theme .fld label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.adm-theme .stack { gap: 12px; }
.adm-theme .check { font-size: 13px; font-weight: 500; }
.adm-theme .check input { accent-color: var(--leaf); }

/* ---------- surfaces ---------- */
.adm-theme .card { padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); }
.adm-theme .table-wrap { border-radius: 14px; border: 1px solid var(--line); }
.adm-theme .card .table-wrap { border: 0; }
.adm-theme .tbl { font-size: 13px; }
.adm-theme .tbl th { padding: 9px 12px; font: 500 12px var(--sans); letter-spacing: .08em; color: var(--muted); background: #FAFAF7; }
.adm-theme .tbl.plain th { background: none; }
.adm-theme .tbl td { padding: 9px 12px; }
.adm-theme .tbl tbody tr:hover { background: #F7F8F2; }
.adm-theme .warn { font-weight: 500; }

/* chips / badges: calm tints, ink text */
.adm-theme .badge { padding: 2px 8px; border-radius: 6px; font: 600 12px/1.5 var(--sans); }
.adm-theme .badge-amber { background: #FFF1D6; color: #6B3A0A; }
.adm-theme .badge-blue { background: #E1ECE6; color: #173427; }
.adm-theme .badge-green { background: #E6F4C9; color: #2F4A0A; }
.adm-theme .badge-red { background: #F9E1DA; color: #8A2414; }
.adm-theme .dl-flat, .adm-theme .dl-new { background: #ECEBE4; }
.adm-theme .dl { font: 600 12px var(--sans); }

/* filter pills */
.adm-theme .seg { gap: 4px; }
.adm-theme .seg a { padding: 5px 11px; border: 1px solid var(--line-2); background: var(--surface); font: 500 12.5px/1.4 var(--sans); color: var(--ink-2); }
.adm-theme .seg a:hover { border-color: var(--ink); color: var(--ink); }
.adm-theme .seg a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.adm-theme .rep-tabs a, .adm-theme .sub-tabs a { font: 500 13.5px var(--sans); }
.adm-theme .rep-tabs a[aria-current], .adm-theme .sub-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ---------- KPI tiles ---------- */
.adm-theme .kpis { gap: 10px; margin-bottom: 18px; }
.adm-theme .kpi { padding: 14px 16px; border-radius: 14px; gap: 2px; }
.adm-theme .kpi span { font-size: 12px; color: var(--muted); }
.adm-theme .kpi strong { font: 700 24px/1.15 var(--display); letter-spacing: -.03em; color: var(--ink); }
.adm-theme .kpi small { font-size: 12px; }
.adm-theme .kpi-warn { background: #FFF6E3; border-color: #F1DDB0; }
.adm-theme .kpi-list { font: 600 14px/1.3 var(--sans) !important; letter-spacing: 0; }
.adm-theme .db-hero { background: var(--adm-forest); border-color: var(--adm-forest); color: #fff; }
.adm-theme .db-hero span, .adm-theme .db-hero .muted { color: var(--adm-on); }
.adm-theme .db-hero strong { color: var(--adm-lime); }

/* Needs-attention tiles: white with a coloured count; zero tiles fade back */
.adm-theme .attn { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.adm-theme .attn strong { font: 700 22px var(--display); letter-spacing: -.03em; }
.adm-theme .attn-amber { background: #FFF8E8; border-color: #F0DDB2; } .adm-theme .attn-amber strong { color: #8A4B0B; }
.adm-theme .attn-blue { background: #F1F6EE; border-color: #D2E1CC; } .adm-theme .attn-blue strong { color: var(--leaf); }
.adm-theme .attn-red { background: #FDF0EC; border-color: #F0CABD; } .adm-theme .attn-red strong { color: #B42318; }
.adm-theme a.attn:hover { border-color: var(--ink); color: var(--ink); }

/* Order pill in the list, order code on its page */
.adm-theme .od-code { font: 700 26px var(--display); letter-spacing: -.035em; color: var(--ink); }
.adm-theme .od-h { font: 600 13px var(--sans); color: var(--ink); }
.adm-theme .od-name { font: 700 17px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); }
.adm-theme .od-title > .badge-amber { background: var(--adm-lime); border-color: var(--adm-lime); color: var(--ink); }
.adm-theme .od-title > .badge-blue { background: var(--adm-moss); border-color: var(--adm-moss); }
.adm-theme .od-title > .badge-green { background: var(--leaf); border-color: var(--leaf); }
.adm-theme .od-title > .badge { font: 600 12.5px var(--sans); }
.adm-theme .od-side { top: 20px; }
.adm-theme .rep-card .h3 { font-size: 15px; }
.adm-theme .rep-title { font-size: 30px; }

/* Users & roles, products and photo cards: ink instead of the old navy rings */
.adm-theme .role-list a[aria-current] { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--adm-lime), 0 0 0 1px var(--ink); }
.adm-theme .perm-mod legend, .adm-theme .lot-fields legend, .adm-theme .stock-sum h3 { font-family: var(--display); color: var(--ink); }
.adm-theme .slide-card.is-first { border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf); }
.adm-theme .slide-tag { background: var(--ink); color: var(--adm-lime); font-family: var(--sans); }
.adm-theme .slide-n { font-family: var(--sans); color: var(--ink); }
.adm-theme .dz-link, .adm-theme .prod-edit, .adm-theme .rep-table-view summary, .adm-theme .slide-text summary { color: var(--ink); }
.adm-theme .prod-plus, .adm-theme .dz-plus { color: var(--leaf); }
.adm-theme .prod-dlg { border-radius: 18px; background: #F8F7F3; }
.adm-theme .denied { margin: 60px auto; }


/* ---------- Dashboard ---------- */
.adm-theme .db-top { margin-bottom: 16px; }
.adm-theme .db-title { margin: 0; font-size: 30px; }
.adm-theme .db-kpis .kpi strong { font: 700 24px/1.15 var(--display); letter-spacing: -.03em; }
.adm-theme .db-hero strong { font-size: 28px; color: var(--adm-lime); }
.adm-theme .db-hero small.muted { color: var(--adm-on); }
.adm-theme .db-hero .dl-down { background: rgba(255, 180, 163, .16); color: #FFB4A3; }
.adm-theme .db-hero .dl-up { background: rgba(212, 243, 108, .16); color: var(--adm-lime); }
/* Needs attention: two tidy rows of four — the order pipeline, then money and follow-ups */
.adm-theme .db-attn .h3 { font-size: 15px; margin: 0 0 8px; }
.adm-theme .db-attn ul { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.adm-theme .attn { padding: 9px 12px; }
.adm-theme .attn span { font: 600 12.5px/1.25 var(--sans); }
.adm-theme .attn-zero { opacity: 1; background: transparent; border-style: dashed; }
.adm-theme .attn-zero strong { color: #B5B8AE; }
.adm-theme .attn-zero span { color: var(--muted); }
@media (max-width: 700px) { .adm-theme .db-attn ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-theme .db-rank li i { background: var(--leaf); }
.adm-theme .db-rank li::after { background: #ECEBE4; }
.adm-theme .au-site { height: 32px; border-color: var(--line-2); color: var(--ink); font: 500 12.5px var(--sans); background: var(--surface); }
.adm-theme .au-site:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Reports: data colours follow the theme (forest for the main series; orange stays as the contrast series) ---------- */
.adm-theme :is(.sb-1, .pipe-bar i, .thru i, .share i, .bullet i:not(.over)) { background: var(--leaf); }
.adm-theme :is(.sb-bar, .pipe-bar, .thru, .share, .bullet) { background: #ECEBE4; }
.adm-theme .spark polyline { stroke: var(--leaf); }
.adm-theme .spark polygon { fill: rgba(30, 90, 54, .10); }
.adm-theme .heat-c { background: #F0EFE9; }
.adm-theme .heat-c.l1 { background: #E6F4C9; } .adm-theme .heat-c.l2 { background: #BFDDA0; }
.adm-theme .heat-c.l3 { background: #5E9A5E; color: #fff; } .adm-theme .heat-c.l4 { background: #1E5A36; color: #fff; }
.adm-theme .sla-snap > div { background: #F0EFE9; }
.adm-theme .sla-total td, .adm-theme .rep-tbl tfoot td { background: #F7F6F1; }
.adm-theme .owed > div { border-color: var(--line-2); }
.adm-theme .owed strong { font-family: var(--display); color: var(--ink); letter-spacing: -.02em; }

/* ---------- Page heading with a slim stat line (Orders, and any page that wants one) ---------- */
.adm-pagehead { align-items: flex-end; }
.adm-stats { display: flex; flex-wrap: wrap; margin: 0; }
.adm-stats > div { display: flex; flex-direction: column; gap: 1px; padding: 0 18px; border-left: 1px solid var(--line-2); }
.adm-stats > div:first-child { border-left: 0; }
.adm-stats dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.adm-stats dd { margin: 0; font: 700 17px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.adm-stats dd small { font: 500 12px var(--sans); letter-spacing: 0; color: var(--muted); }

/* ---------- Orders list ---------- */
.adm-theme .seg a.seg-n { opacity: 1; margin-left: 0; font-weight: 500; }
.adm-theme .seg-badge { position: static; display: inline-block; min-width: 0; height: auto; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #ECEBE4; color: var(--ink);
  font: 600 12px/17px var(--sans); box-shadow: none; }
.adm-theme .seg a[aria-current] .seg-badge { background: var(--adm-lime); color: var(--ink); }
.adm-theme .toolbar { margin-bottom: 10px; }
.adm-theme .toolbar .search-box input#q { height: 34px; border-radius: 999px; }
.adm-theme .to-no { font: 600 12px var(--sans); letter-spacing: .01em; border-radius: 6px; }
.adm-theme .d-today { background: var(--adm-lime); color: var(--ink); }
.adm-theme .d-yday { background: #E1ECE6; color: #173427; }
.adm-theme .to-trk { border-color: var(--ink); border-width: 1px; border-radius: 6px; }
.adm-theme .to-trk-co { background: var(--ink); font: 600 12px var(--sans); }
.adm-theme .to-trk-no { color: var(--ink); font-weight: 600; }
.adm-theme .search-clear:hover { background: #ECEBE4; }

/* Compact fields that had their own sizes before the theme's general input rule (it is more specific, so they are restated) */
.adm-theme .od-form :is(input, select) { height: 34px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.adm-theme .sla-in input { width: 78px; height: 30px; padding: 0 8px; border-radius: 8px; text-align: right; }
.adm-theme .role-pick select { height: 32px; padding: 0 8px; border-radius: 8px; width: auto; }
.adm-theme .interval-form select { height: 34px; width: auto; }
.adm-theme .tbl input:not([type=checkbox]):not([type=radio]) { height: 34px; }

/* ---------- Order page ---------- */
.adm-theme .od-title > .badge-blue { color: #fff; }
.adm-theme .od-title > .badge-green { color: #fff; }
.adm-theme .od-title > .badge-red { color: #fff; }
.adm-theme .od-cust { padding: 10px 4px; }
.adm-theme .od-ck { font-size: 12px; }
.adm-theme .od-back { color: var(--muted); text-decoration: none; }
.adm-theme .od-back:hover { color: var(--ink); }

/* ---------- Website setup ---------- */
.adm-theme .in-setup .sm-btn { height: 28px; padding: 0 8px; border-radius: 7px; font-size: 12px; }
.adm-theme .in-setup .sq-btn { width: 28px; height: 28px; border-radius: 7px; }
.adm-theme #top-strip { max-width: 760px; }
.adm-theme #top-strip .btn { align-self: flex-start; }
.adm-theme .in-setup .slide-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.adm-theme .slide-actions > form:first-child { flex: none; display: flex; gap: 4px; }
.adm-theme .slide-actions > :last-child { margin-left: auto; }

/* ---------- Sign in + change password (admin/login.php, admin/password.php): adm-auth ---------- */
body.adm-theme.admin-login { display: grid; align-items: stretch; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; padding: 0; background: var(--bg); }
.adm-auth-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: clamp(28px, 5vw, 64px); color: var(--adm-on); background: radial-gradient(120% 90% at 0% 0%, var(--adm-moss) 0%, var(--adm-forest) 55%, #0B1410 100%); }
.adm-auth-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(212, 243, 108, .06) 46px 47px); }   /* cane rows */
.adm-auth-brand::after { content: ""; position: absolute; z-index: -1; right: -180px; bottom: -200px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 243, 108, .2), transparent); }
.adm-auth-logo { align-self: flex-start; }
.adm-auth-logo img { display: block; height: 46px; width: auto; }
.adm-auth-hero h2 { margin: 0; font: 700 clamp(38px, 5vw, 64px)/1.02 var(--display); letter-spacing: -.045em; color: #fff; }
.adm-auth-hero h2 em { font-style: normal; color: var(--adm-lime); }
.adm-auth-hero p { max-width: 40ch; margin: 18px 0 0; font-size: 16px; line-height: 1.55; color: var(--adm-on); }
.adm-auth-points { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.adm-auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #fff; }
.adm-auth-points .adm-ic { box-sizing: border-box; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(212, 243, 108, .12); color: var(--adm-lime); }
.adm-auth-foot { font-size: 12.5px; color: var(--adm-dim); }

.adm-auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 56px); }
.adm-auth-box { display: flex; flex-direction: column; gap: 18px; width: min(400px, 100%); }
.adm-auth-eyebrow { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf-ink); font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.adm-auth-box h1 { margin: 0; font: 700 clamp(28px, 3vw, 34px)/1.08 var(--display); letter-spacing: -.04em; color: var(--ink); }
.adm-auth-sub { margin: -8px 0 0; font-size: 15px; color: var(--muted); }
.adm-auth-alert { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.adm-auth-alert.ok { background: var(--leaf-soft); color: var(--leaf-ink); }
.adm-auth-alert.err { background: var(--red-soft); color: var(--red-ink); }
.adm-auth-alert.warn { background: var(--warm-soft); color: var(--warm-ink); font-weight: 500; }

.adm-auth-form { display: flex; flex-direction: column; gap: 16px; }
.adm-auth-field { display: flex; flex-direction: column; gap: 7px; }
.adm-auth-field > label { font: 600 13px var(--sans); color: var(--ink-2); }
.adm-auth-input { position: relative; display: flex; align-items: center; }
.adm-auth-input > .adm-ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.adm-theme .adm-auth-input input[type] { width: 100%; height: 50px; padding: 0 46px 0 44px; border: 1.5px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--ink);
  font: 500 15.5px var(--sans); transition: border-color .15s var(--adm-ease), box-shadow .15s var(--adm-ease); }
.adm-theme .adm-auth-input input[type]:hover { border-color: #B9B5A8; }
.adm-theme .adm-auth-input input[type]:focus { outline: 0; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(30, 90, 54, .14); }
.adm-theme .adm-auth-input input[type]:user-invalid { border-color: var(--red-ink); }
.adm-theme .adm-auth-input input[type].adm-auth-plain { padding-right: 14px; }
.adm-auth-eye { position: absolute; right: 6px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.adm-auth-eye:hover { background: var(--sand); color: var(--ink); }
.adm-auth-eye .off, .adm-auth-eye[aria-pressed="true"] .on { display: none; }
.adm-auth-eye[aria-pressed="true"] .off { display: block; }
.adm-auth-hint { min-height: 1.2em; margin: 0; font-size: 12.5px; color: var(--muted); }
.adm-auth-hint[hidden] { display: none; }
.adm-auth-hint.warn { color: var(--warm-ink); font-weight: 600; }
.adm-auth-hint.bad { color: var(--red-ink); }
.adm-auth-hint:not(.bad):not(.warn):not(:empty) { color: var(--leaf-ink); }
.adm-auth-submit { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--adm-forest); color: #fff;
  font: 600 15.5px var(--sans); cursor: pointer; transition: background .15s var(--adm-ease), transform .15s var(--adm-ease); }
.adm-auth-submit:hover { background: var(--adm-moss); }
.adm-auth-submit:active { transform: translateY(1px); }
.adm-auth-submit .adm-ic { color: var(--adm-lime); }
.adm-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; color: var(--muted); }
.adm-auth-links a { color: var(--ink-2); text-underline-offset: 3px; }
.adm-auth-help { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }

/* strength meter */
.adm-auth-meter { display: flex; align-items: center; gap: 10px; }
.adm-auth-meter-bar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.adm-auth-meter-bar i { height: 5px; border-radius: 3px; background: var(--line); transition: background .2s var(--adm-ease); }
.adm-auth-meter[data-level="1"] i:nth-child(-n+1) { background: #D9534F; }
.adm-auth-meter[data-level="2"] i:nth-child(-n+2) { background: #E8A33D; }
.adm-auth-meter[data-level="3"] i:nth-child(-n+3) { background: #8DB63C; }
.adm-auth-meter[data-level="4"] i:nth-child(-n+4) { background: var(--leaf); }
.adm-auth-meter-label { min-width: 48px; font: 600 12px var(--sans); color: var(--muted); text-align: right; }

/* change password: a card with a dark side panel (what makes a good password) and the form */
.adm-pw { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); max-width: 880px; margin: 8px auto 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.adm-pw-side { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 18px; padding: clamp(24px, 3.5vw, 40px); color: var(--adm-on);
  background: radial-gradient(120% 90% at 0% 0%, var(--adm-moss) 0%, var(--adm-forest) 70%); }
.adm-pw-side::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(212, 243, 108, .06) 46px 47px); }
.adm-pw-badge { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(212, 243, 108, .14); color: var(--adm-lime); }
.adm-pw-badge .adm-ic { width: 24px; height: 24px; }
.adm-pw-side h2 { margin: 0; font: 700 24px/1.15 var(--display); letter-spacing: -.035em; color: #fff; }
.adm-pw-side p { margin: 0; font-size: 14px; line-height: 1.55; }
.adm-pw-rules { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.adm-pw-rules li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--adm-on); transition: color .2s var(--adm-ease); }
.adm-pw-rules li::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid rgba(195, 206, 198, .45);
  background: center / 12px no-repeat transparent; transition: background-color .2s var(--adm-ease), border-color .2s var(--adm-ease); }
.adm-pw-rules li[data-ok="1"] { color: #fff; }
.adm-pw-rules li[data-ok="1"]::before { border-color: var(--adm-lime); background-color: var(--adm-lime);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F221A' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.adm-pw-form { display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3.5vw, 40px); }
.adm-pw-form h1 { margin: 0; font: 700 clamp(26px, 3vw, 32px)/1.1 var(--display); letter-spacing: -.04em; }
.adm-pw-who { display: flex; align-items: center; gap: 10px; margin: -6px 0 2px; font-size: 14px; color: var(--muted); }
.adm-pw-who b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--adm-forest); color: var(--adm-lime); font: 700 13px var(--sans); }
.adm-pw-who strong { color: var(--ink); }

@media (max-width: 899px) {
  body.adm-theme.admin-login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .adm-auth-brand { gap: 14px; padding: 22px 20px 44px; }
  .adm-auth-logo img { height: 38px; }
  .adm-auth-hero h2 { font-size: 30px; }
  .adm-auth-hero p, .adm-auth-points, .adm-auth-foot { display: none; }
  .adm-auth-main { position: relative; align-items: flex-start; margin-top: -22px; padding: 28px 20px 40px; border-radius: 24px 24px 0 0; background: var(--bg); }
  .adm-pw { grid-template-columns: 1fr; }
  .adm-pw-side { gap: 14px; padding: 20px 22px 22px; }
  .adm-pw-side > p, .adm-pw-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) { .adm-theme .adm-auth-input input[type], .adm-auth-submit, .adm-pw-rules li, .adm-pw-rules li::before, .adm-auth-meter-bar i { transition: none; } }
.adm-theme .rep-tabs-bare { border-bottom: 0; margin-bottom: 8px; }   /* Sales page: no section tabs, only the CSV link */

/* ================= Batches & stock (admin/batches.php, admin/batch.php) — bt- / bd- ================= */
/* stock bar: sold · taken out · left, as parts of what was received */
.bt-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: #ECEBE4; }
.bt-bar i { display: block; height: 100%; }
.bt-sold { background: var(--leaf); }
.bt-out { background: #E0A04A; }
.bt-left { background: #A9D34A; }
.bt-k { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; vertical-align: 0; }
.bt-key { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.bt-key .bt-k { margin-left: 10px; }
.bt-key .bt-k:first-child { margin-left: 0; }
.bt-help { margin: -8px 0 14px; font-size: 12.5px; color: var(--muted); }
.bt-help summary { width: max-content; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.bt-help p { max-width: 760px; margin: 6px 0 0; }

/* per-product stock cards */
.bt-stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-bottom: 10px; }
.adm-theme a.bt-prod { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: border-color .2s var(--adm-ease); }
.adm-theme a.bt-prod:hover { border-color: var(--ink); color: var(--ink); }
.bt-prod.is-cur { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bt-prod.is-off { opacity: .75; }
.bt-prod-h { display: flex; flex-direction: column; line-height: 1.25; }
.bt-prod-h strong { font: 700 16px var(--display); letter-spacing: -.02em; }
.bt-prod-h small, .bt-ready small { font-size: 12px; color: var(--muted); }
.bt-ready { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.bt-ready b { font: 700 24px var(--display); letter-spacing: -.03em; color: var(--leaf); }
.bt-prod .bt-bar { grid-column: 1 / -1; }
.bt-cells { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font: 600 13.5px var(--sans); }
.bt-cells small { display: block; font: 500 12px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bt-none { margin: 4px 2px 14px; font-size: 12.5px; color: var(--muted); }
.bt-none a { font-weight: 600; }
.bt-filter { margin: 0 2px 10px; font-size: 13px; color: var(--muted); }

/* batch table */
.bt-tbl td { vertical-align: middle; }
.bt-tbl th small { font-size: 12px; letter-spacing: 0; text-transform: none; }
.bt-row { cursor: pointer; }
.adm-theme .bt-code { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #ECEBE4; color: var(--ink); font: 600 12px var(--sans); letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.adm-theme .bt-code:hover { background: var(--adm-lime); color: var(--ink); }
.bt-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.bt-stockcell { min-width: 150px; }
.bt-amt { display: block; margin-bottom: 4px; white-space: nowrap; }
.bt-flags { white-space: nowrap; }
.bt-flag { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; font-size: 12px; color: #A3A69C; }
.bt-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.bt-flag.on { color: var(--leaf); font-weight: 600; }
.bt-flag.on::before { background: currentColor; }

/* one batch: head, numbers, two columns */
.bd-head { margin-top: 4px; }
.bd-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.bd-prod { font: 600 13px var(--sans); color: var(--muted); }
.bd-alert { margin: 0 0 12px; }
.bd-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.bd-kpis > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 16px; border-left: 1px solid var(--line); }
.bd-kpis > div:first-child { border-left: 0; }
.bd-kpis small { font: 500 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bd-kpis b { font: 700 21px/1.2 var(--display); letter-spacing: -.03em; white-space: nowrap; }
.bd-kpis span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-kpis .bd-left b { color: var(--leaf); }
.bd-kpis .bt-bar { margin-top: 6px; }
.bd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.bd-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bd-side { position: sticky; top: calc(var(--adm-h) + 14px); max-height: calc(100vh - var(--adm-h) - 28px); overflow-y: auto; border-radius: 16px; scrollbar-width: thin; }
.bd-new { max-width: 760px; }
.bd-new .bd-side { position: static; max-height: none; overflow: visible; }
.adm-theme .bd-card { padding: 16px 18px; }
.bd-card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.bd-card-h .h3 { margin: 0; }
.bd-card-h .h3 .muted { font: 400 12px var(--sans); letter-spacing: 0; }
.bd-hint { font-size: 12px; color: #8A4B0B; }

/* stock form: one row */
.bd-stockform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px; margin-bottom: 8px; border-radius: 12px; background: #F7F6F1; }
.bd-stockform .fld { flex: 1 1 130px; min-width: 0; }
.bd-stockform .bd-amt { flex: 0 1 120px; }
.bd-stockform .bd-note { flex: 2 1 180px; }
.bd-stockform .fld[hidden] { display: none; }
.adm-theme .bd-stockform :is(input, select) { height: 34px; }
.adm-theme .bd-stockform .btn { min-height: 34px; }
.bd-kind { display: flex; padding: 3px; border-radius: 10px; background: #ECEBE4; }
.bd-kind label { position: relative; cursor: pointer; }
.bd-kind input { position: absolute; opacity: 0; pointer-events: none; }
.bd-kind span { display: block; padding: 5px 10px; border-radius: 8px; font: 600 12.5px var(--sans); color: var(--muted); white-space: nowrap; }
.bd-kind input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 20, 16, .12); }
.bd-kind input:focus-visible + span { outline: 2px solid var(--leaf); }
.adm-theme .bd-log td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bd-log tr:last-child td { border-bottom: 0; }
.bd-log .sl-amt { width: 1%; white-space: nowrap; }
.adm-theme .bd-showall { padding: 6px 0 0; font-size: 12.5px; }

/* where it went */
.adm-theme .bd-orders td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.bd-orders tr:last-child td { border-bottom: 0; }
.bd-wa { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink); }
.bd-wa svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.adm-theme .bd-wa:hover { border-color: var(--leaf); color: var(--leaf); }

/* record: log a step + compact timeline */
.bd-stepform { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; margin-bottom: 12px; border-radius: 12px; background: #F7F6F1; }
.bd-stepform[hidden] { display: none; }
.bd-stepform .span-2 { grid-column: span 2; }
.adm-theme .bd-stepform :is(input, select) { height: 34px; }
.adm-theme .bd-stepform input[type=file] { height: auto; padding: 6px 0; border: 0; background: none; font-size: 12px; }
.bd-stepgo { display: flex; align-items: flex-end; }
.bd-tl { list-style: none; margin: 0; padding: 0; }
.bd-tl li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.bd-tl li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: #DCE6D2; }
.bd-tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: #fff; }
.bd-tl-dot svg { width: 15px; height: 15px; }
.bd-tl-body { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; font-size: 13px; }
.bd-tl-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.bd-tl-top strong { font: 700 14px var(--display); letter-spacing: -.01em; }
.bd-tl-top .muted { font-size: 12px; }
.bd-tl-top form { margin-left: auto; }
.adm-theme .bd-tl-top .link-btn { padding: 0; font-size: 12px; }
.bd-tl-body p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.bd-tl-photo { display: block; width: 180px; border-radius: 10px; overflow: hidden; }
.bd-tl-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* details: summary list, then the form */
.bd-dl { margin: 0; }
.bd-dl[hidden] { display: none; }
.bd-dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.bd-dl > div:first-child { border-top: 0; padding-top: 0; }
.bd-dl dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.bd-dl dd { margin: 0; }
.bd-dates ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.bd-dates li { display: flex; justify-content: space-between; gap: 8px; }
.bd-dates li > span:first-child { color: var(--muted); }
.bd-dates li > span:first-child::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; border: 1px solid #B5B8AE; vertical-align: 1px; box-sizing: border-box; }
.bd-dates li.on > span:first-child::before { background: var(--leaf); border-color: var(--leaf); }
.bd-story { color: var(--ink-2); line-height: 1.5; }
.bd-form[hidden] { display: none; }
.bd-fs-k { margin: 14px 0 6px; font: 500 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bd-form .plain-fieldset > .bd-fs-k:first-of-type { margin-top: 0; }
.bd-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.bd-form .span-2 { grid-column: span 2; }
.adm-theme .bd-form :is(input, select) { height: 34px; }
.bd-form .check { grid-column: span 2; font-size: 12.5px; }
.bd-formgo { display: flex; gap: 8px; margin-top: 14px; }
.bd-new .bd-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1180px) { .bd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bd-kpis > div:nth-child(4) { border-left: 0; } .bd-kpis > div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 1060px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } .bd-side { position: static; max-height: none; } .bd-stepform { grid-template-columns: 1fr 1fr; } }
.bt-cells small { white-space: nowrap; }
.adm-theme .btn[hidden] { display: none; }
.bd-card { scroll-margin-top: calc(var(--adm-h) + 14px); }   /* #stock / #orders / #log land below the sticky bar */

/* ----- Batch page v2: details as a timeline under the code, one stock & orders ledger, record beside it ----- */
.bd-life { margin: -6px 0 14px; }
.bd-origin { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.bd-origin b { font-weight: 600; color: var(--ink); }
.bd-origin i { font-style: normal; color: #B5B8AE; }
.bd-dateline { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; }
.bd-dateline li { position: relative; display: flex; flex-direction: column; gap: 1px; padding-top: 18px; padding-right: 8px; }
.bd-dateline li::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: var(--line-2); }   /* the line */
.bd-dateline li.done::before { background: var(--leaf); }
.bd-dateline li:last-child::before { right: auto; width: 0; }
.bd-dateline li.done:has(+ li:not(.done))::before { background: linear-gradient(90deg, var(--leaf) 40%, var(--line-2) 40%); }
.bd-dl-dot { position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); box-sizing: border-box; }
.bd-dateline .done .bd-dl-dot { background: var(--leaf); border-color: var(--leaf); }
.bd-dateline .ahead .bd-dl-dot { border-color: var(--leaf); }
.bd-dateline .bb.ahead .bd-dl-dot { border-color: #E0A04A; }
.bd-dateline small { font: 500 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bd-dateline b { font: 600 14px var(--sans); color: var(--ink); white-space: nowrap; }
.bd-dateline .unset b { color: #B5B8AE; font-weight: 500; }
.bd-storyline { max-width: 820px; margin: 10px 0 0; font-size: 13px; font-style: italic; color: var(--ink-2); }

.bd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bd-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.bd-recnote { margin: -6px 0 10px; }

/* one ledger */
.bd-log td { vertical-align: middle; }
.bd-log .bt-code { font-size: 12px; }
.bd-kindtag { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 600 12px var(--sans); white-space: nowrap; }
.bd-kindtag.in { background: #E6F4C9; color: #2F4A0A; }
.bd-kindtag.adj { background: #FFF1D6; color: #6B3A0A; }
.bd-log tr.bd-intake td, .bd-log tr.bd-adjust td { background: #FBFBF8; }
.bd-log .bd-act { width: 1%; }
.bd-log td.r .bt-sub { margin-top: 0; }

/* record in the side column: stacked form */
.bd-stepform { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bd-stepgo .btn { width: 100%; }
.bd-tl-top { justify-content: space-between; }
.bd-tl-meta { font-size: 12px; }

/* edit pop-up and the new-batch page share the form */
.bd-dlg { width: min(760px, calc(100vw - 32px)); }
.bd-dlg .bd-form { padding: 16px 18px 18px; }
.bd-new { max-width: 820px; }
.bd-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bd-form .span-3 { grid-column: 1 / -1; }
.bd-form .check { grid-column: 1 / -1; }
.bd-form .bd-dategrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bd-dlg .bd-formgo { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding: 12px 18px; background: #F8F7F3; border-top: 1px solid var(--line); }
@media (max-width: 1180px) { .bd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } .bd-kpis > div:nth-child(n) { border-top: 0; } .bd-kpis > div:nth-child(4) { border-left: 1px solid var(--line); } }
@media (max-width: 760px) { .bd-dateline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; } .bd-form .form-grid, .bd-form .bd-dategrid { grid-template-columns: 1fr 1fr; } }
.bt-lead { margin: -8px 0 14px; max-width: 780px; }

/* ----- New batch (batch.php without an id): numbered steps + sticky summary ----- */
.nb { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.nb-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.adm-theme .nb-step { padding: 16px 18px; }
.nb-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 16px var(--display); letter-spacing: -.02em; }
.nb-h > span { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--adm-lime); font: 700 12px var(--sans); }
.nb-h small { font: 400 12px var(--sans); letter-spacing: 0; color: var(--muted); }
.fld label small, .nb-lbl small { font-weight: 400; color: var(--muted); }
.nb-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.adm-theme .nb :is(input:not([type=checkbox]):not([type=radio]), select) { height: 36px; }

/* 1 · product cards */
.nb-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.nb-prod { position: relative; cursor: pointer; }
.nb-prod input { position: absolute; opacity: 0; pointer-events: none; }
.nb-prod > span { display: flex; flex-direction: column; gap: 2px; height: 100%; box-sizing: border-box; padding: 10px 12px 10px 34px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color .2s var(--adm-ease), background .2s var(--adm-ease); }
.nb-prod > span::before { content: ""; position: absolute; left: 12px; top: 13px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); box-sizing: border-box; background: var(--surface); }
.nb-prod strong { font: 600 14px var(--sans); }
.nb-prod small { font-size: 12px; color: var(--muted); }
.nb-prod:hover > span { border-color: var(--ink); }
.nb-prod input:checked + span { border-color: var(--ink); background: #F6FBE6; box-shadow: inset 0 0 0 1px var(--ink); }
.nb-prod input:checked + span::before { border: 4px solid var(--ink); background: var(--adm-lime); }
.nb-prod input:focus-visible + span { outline: 2px solid var(--leaf); outline-offset: 2px; }

/* 2 · origin, 4 · quality */
.nb-grid { display: grid; gap: 10px 12px; }
.nb-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nb-grid-q { grid-template-columns: auto minmax(0, 1fr); align-items: end; }
.nb-span { grid-column: 1 / -1; }
.nb-q { width: max-content; }
.nb-q span { padding: 6px 12px; }

/* 3 · timeline: five dates on one line, joined like the batch page's timeline */
.nb-dates { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; }
.nb-dates li { position: relative; display: flex; flex-direction: column; gap: 5px; padding-top: 20px; }
.nb-dates li::before { content: ""; position: absolute; left: 0; right: -10px; top: 5px; height: 2px; background: var(--line-2); }
.nb-dates li:last-child::before { right: 100%; }
.nb-dates label { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-dates li.has-date .bd-dl-dot { background: var(--leaf); border-color: var(--leaf); }   /* set by the page script as dates are filled */
.nb-dates li.has-date:has(+ li.has-date)::before { background: var(--leaf); }

/* shop switches */
.nb-switch { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.nb-switch input { position: absolute; opacity: 0; pointer-events: none; }
.nb-switch i { position: relative; flex: none; width: 32px; height: 18px; margin-top: 1px; border-radius: 999px; background: #C9C6BC; transition: background .2s var(--adm-ease); }
.nb-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s var(--adm-ease); }
.nb-switch input:checked + i { background: var(--leaf); }
.nb-switch input:checked + i::after { transform: translateX(14px); }
.nb-switch input:focus-visible + i { outline: 2px solid var(--leaf); outline-offset: 2px; }
.nb-switch span { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.nb-switch small { font-size: 12px; color: var(--muted); }
.nb-switch:has(input:checked) { border-color: #CFE3B0; background: #F6FBE6; }

/* summary */
.nb-side { position: sticky; top: calc(var(--adm-h) + 14px); }
.adm-theme .nb-sum { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.nb-sum #code { font: 600 15px var(--sans); letter-spacing: .02em; }
.nb-unit { display: flex; align-items: stretch; }
.adm-theme .nb-unit input { border-radius: 10px 0 0 10px; }
.nb-unit span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 10px 10px 0; background: #F7F6F1; font-size: 13px; color: var(--muted); }
.nb-check { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 2px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.nb-check li { display: flex; align-items: center; gap: 8px; }
.nb-check li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid #C9C6BC; box-sizing: border-box; }
.nb-check li.ok { color: var(--ink); }
.nb-check li.ok::before { border: 0; background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat; }
.nb-verdict { margin: 0; padding: 8px 10px; border-radius: 10px; background: #F7F6F1; font-size: 12px; color: var(--ink-2); }
.nb-verdict.yes { background: #EEF6D2; color: #2F4A0A; font-weight: 600; }
.nb-go { width: 100%; }
.adm-theme .nb-cancel { align-self: center; margin-top: -4px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 1180px) { .nb-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .nb { grid-template-columns: minmax(0, 1fr); } .nb-side { position: static; } .nb-dates { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nb-dates li::before { display: none; } }
.nb-grid-q { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ================= Readability and touch (admin) =================
   1) Text never drops below 12px (the older rules above were raised to 12px in place; this covers what site.css sets).
   2) Filter pills, small buttons and links in lists get a comfortable tap size on touch screens, and a little more height with a mouse.
   3) On phones, wide tables become stacked cards (assets/admin-ui.js adds .is-stack and a data-label on each cell). */
.adm-theme :is(small, .small) { font-size: max(12px, .85em); }   /* never below 12px, still smaller than its parent */
.adm-theme :is(.badge, .seg-n, .seg-badge, .sla-chip, .dl, .tbl th) { font-size: 12px; }
.adm-theme .badge { font-size: 12px; }
.adm-theme .seg a, .adm-theme .rep-tabs a, .adm-theme .sub-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; }
.adm-theme .sq-btn { min-width: 34px; min-height: 34px; }
.adm-theme .slide-actions button { min-height: 34px; }

@media (pointer: coarse), (max-width: 720px) {
  .adm-theme .seg a, .adm-theme .rep-tabs a, .adm-theme .sub-tabs a { min-height: 44px; padding-inline: 14px; }
  .adm-theme .btn-sm, .adm-theme .link-btn, .adm-theme .sq-btn, .adm-theme .slide-actions button { min-height: 44px; min-width: 44px; }
  .adm-theme .link-btn { display: inline-flex; align-items: center; padding-inline: 8px; }
  .adm-theme :is(td, li, .rep-head, .small) > a:not(.btn):not(.badge) { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
  .adm-theme summary { min-height: 44px; display: flex; align-items: center; }
}

@media (max-width: 720px) {
  .adm-theme .table-wrap.is-stack-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .adm-theme .tbl.is-stack, .adm-theme .tbl.is-stack tbody, .adm-theme .tbl.is-stack tr, .adm-theme .tbl.is-stack td { display: block; width: auto; }
  .adm-theme .tbl.is-stack thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .adm-theme .tbl.is-stack tbody tr { margin: 0 0 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .adm-theme .tbl.is-stack tbody tr:hover { background: var(--surface); }
  .adm-theme .tbl.is-stack td { display: block; padding: 7px 0; border: 0; text-align: right; white-space: normal; overflow: hidden; }
  .adm-theme .tbl.is-stack td[data-label]::before { content: attr(data-label); float: left; margin-right: 16px; max-width: 46%; font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .adm-theme .tbl.is-stack td:first-child { display: block; padding-top: 0; font-size: 15px; font-weight: 600; text-align: left; }
  .adm-theme .tbl.is-stack td:first-child::before { display: none; }
  .adm-theme .tbl.is-stack td.is-blank { display: none; }
  .adm-theme .tbl.is-stack td[colspan] { display: block; text-align: left; }
  .adm-theme .tbl.is-stack td > * { min-width: 0; }
  .adm-theme .tbl.is-stack td form, .adm-theme .tbl.is-stack td .btn-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .adm-theme .tbl-orders td { white-space: normal; }
  .adm-theme .tbl.is-stack td :is(.badge, .sla-chip, .pill) { white-space: normal; text-align: left; }
  .adm-theme .tbl-orders .to-items { max-width: none; overflow: visible; text-overflow: clip; }
  .adm-theme .tbl.is-stack td:first-child a { white-space: normal; }
}


/* Touch: the last small controls (row actions, search clear, Apply, date boxes, back links) */
@media (pointer: coarse), (max-width: 720px) {
  .adm-theme .row-act, .adm-theme .sm-btn, .adm-theme .in-setup .sm-btn, .adm-theme .enq-act .sm-btn { min-height: 44px; }
  .adm-theme .search-clear { width: 36px; height: 36px; }
  .adm-theme .rep-range .rd, .adm-theme .rep-range .rep-custom .sm-btn { height: 44px; }
  .adm-theme .rep-back { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (pointer: coarse), (max-width: 720px) {
  .adm-theme .rs-search input { min-height: 44px; }
}
/* Text links inside table cells and list headers get a larger click area without changing the layout */
.adm-theme .tbl td > a:not(.btn):not(.badge), .adm-theme .db-recent td a, .adm-theme .rep-head > a { display: inline-block; padding: 4px 3px; margin: -4px -3px; }

/* ================= Pack sizes & prices (admin/products.php): pk- ================= */
.adm-theme .pk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin: 4px 0 18px; }
.adm-theme .pk-title h1 { margin: 0; }
.adm-theme .pk-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.adm-theme .pk-sub b { color: var(--ink); font-weight: 600; }
.adm-theme .pk-add-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; background: var(--adm-forest); color: #fff; font: 600 14.5px var(--sans); cursor: pointer; transition: background .15s var(--adm-ease), transform .15s var(--adm-ease); }
.adm-theme .pk-add-btn::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--adm-lime); color: var(--adm-forest); font: 700 17px/1 var(--sans); }
.adm-theme .pk-add-btn:hover { background: var(--adm-moss); }
.adm-theme .pk-add-btn:active { transform: translateY(1px); }

.adm-theme .pk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 14px; }
.adm-theme .pk-tabs { display: flex; flex: 1 1 360px; gap: 6px; min-width: 0; padding: 2px; overflow-x: auto; scrollbar-width: thin; }
.adm-theme .pk-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink); font: 500 14px var(--sans); text-decoration: none; white-space: nowrap; }
.adm-theme .pk-tab:hover { border-color: var(--ink-2); color: var(--ink); }
.adm-theme .pk-tab b { padding: 1px 8px; border-radius: 999px; background: var(--sand); color: var(--ink-2); font: 600 12px var(--sans); }
.adm-theme .pk-tab[aria-current] { border-color: var(--adm-forest); background: var(--adm-forest); color: #fff; }
.adm-theme .pk-tab[aria-current] b { background: var(--adm-lime); color: var(--adm-forest); }
.adm-theme .pk-search { position: relative; flex: 0 1 280px; margin-left: auto; }
.adm-theme .pk-search input[type][type][type] { width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666C63' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px center / 18px no-repeat; font: 500 14.5px var(--sans); }
.adm-theme .pk-search input[type][type][type]:focus { outline: 0; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(30, 90, 54, .14); }

.adm-theme .pk-help { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); }
.adm-theme .pk-help summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--leaf); font-weight: 600; cursor: pointer; }
.adm-theme .pk-help p { max-width: 820px; margin: 8px 0 0; line-height: 1.55; }

.adm-theme .pk-group { margin: 0 0 26px; }
.adm-theme .pk-group[hidden], .adm-theme .pk-item[hidden], .adm-theme .pk-none[hidden] { display: none; }
.adm-theme .pk-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 2px 10px; }
.adm-theme .pk-group-h h2 { margin: 0; font: 700 19px var(--display); letter-spacing: -.025em; }
.adm-theme .pk-group-meta { flex: 1; font-size: 13px; color: var(--muted); }
.adm-theme .pk-mini { min-height: 34px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.adm-theme .pk-mini:hover { border-color: var(--leaf); color: var(--leaf); }

.adm-theme .pk-rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.adm-theme .pk-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto 56px; align-items: center; gap: 8px 18px; width: 100%; padding: 12px 14px 12px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s var(--adm-ease), box-shadow .15s var(--adm-ease); }
.adm-theme .pk-row:hover { border-color: var(--line-2); box-shadow: 0 12px 26px -18px rgba(11, 20, 16, .4); }
.adm-theme .pk-row:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.adm-theme .pk-item.is-off .pk-row { background: #FAF9F5; }
.adm-theme .pk-item.is-off :is(.pk-thumb, .pk-main, .pk-price) { opacity: .55; }
.adm-theme .pk-item.just-saved .pk-row { animation: justSaved 2.4s ease; }
.adm-theme .pk-thumb { display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border-radius: 14px; background: var(--sand); color: var(--muted); }
.adm-theme .pk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-theme .pk-thumb .adm-ic { width: 24px; height: 24px; }
.adm-theme .pk-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-theme .pk-name { font: 600 16px/1.25 var(--sans); color: var(--ink); }
.adm-theme .pk-sub2 { overflow: hidden; font-size: 13px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.adm-theme .pk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.adm-theme .pk-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--sand); color: var(--ink-2); font: 500 12px/1.5 var(--sans); }
.adm-theme .pk-chip-badge { background: var(--warm-soft); color: var(--warm-ink); font-weight: 600; }
.adm-theme .pk-price { display: flex; flex-direction: column; gap: 2px; min-width: 112px; text-align: right; }
.adm-theme .pk-price strong { font: 700 20px/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.adm-theme .pk-price small { font-size: 12.5px; color: var(--muted); }
.adm-theme .pk-state { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.adm-theme .pk-go { justify-self: end; color: var(--leaf); font: 600 13.5px var(--sans); }
.adm-theme .pk-row:hover .pk-go { text-decoration: underline; text-underline-offset: 3px; }

.adm-theme .pk-add-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: 18px; background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; }
.adm-theme .pk-add-card:hover { border-color: var(--leaf); background: #fff; }
.adm-theme .pk-add-card strong { display: block; font: 600 15px var(--sans); color: var(--ink); }
.adm-theme .pk-add-card small { font-size: 13px; color: var(--muted); }
.adm-theme .pk-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--leaf-soft); color: var(--leaf); font: 700 24px/1 var(--sans); }
.adm-theme .pk-add { margin: 4px 0 0; }
.adm-theme .pk-none { margin: 24px 0; text-align: center; color: var(--muted); }
.adm-theme .pk-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; border: 1.5px dashed var(--line-2); border-radius: 20px; text-align: center; }
.adm-theme .pk-empty strong { font: 700 20px var(--display); }
.adm-theme .pk-empty p { margin: 0 0 12px; color: var(--muted); }

/* Edit pop-up */
.adm-theme .pk-dlg { width: min(940px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border-radius: 24px; }
.adm-theme .pk-dlg .dlg-head { gap: 14px; padding: 16px 22px; }
.adm-theme .pk-dlg .dlg-head .h3 { font: 700 20px var(--display); letter-spacing: -.02em; }
.adm-theme .pk-dlg .dlg-head .prod-thumb { width: 44px; height: 44px; border-radius: 12px; }
.adm-theme .pk-dlg .dlg-x { width: 40px; height: 40px; }
.adm-theme .pk-dlg .pk-form { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 22px; }
.adm-theme .pk-dlg .pk-photo img, .adm-theme .pk-dlg .pk-photo > span { width: 210px; height: 210px; border-radius: 16px; }
.adm-theme .pk-dlg .pk-photo-tip { font-size: 12px; line-height: 1.4; color: var(--muted); }
.adm-theme .pk-dlg .pk-fields { gap: 14px 14px; }
.adm-theme .pk-dlg .pk-sec-h { grid-column: 1 / -1; margin: 10px 0 -4px; padding-top: 10px; border-top: 1px solid var(--line); font: 700 12px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.adm-theme .pk-dlg .pk-sec-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.adm-theme .pk-dlg .pk-fields label { font: 600 13px var(--sans); color: var(--ink-2); }
.adm-theme .pk-dlg .pk-fields :is(input:not([type=checkbox]):not([type=file]), select) { height: 46px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
.adm-theme .pk-dlg .pk-fields textarea { border-radius: 12px; font-size: 14.5px; }
.adm-theme .pk-dlg .pk-actions { margin: 6px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); background: #FBFAF6; }
.adm-theme .pk-dlg .pk-actions .btn { min-height: 46px; padding: 0 22px; border-radius: 999px; font-size: 14.5px; }
.adm-theme .pk-dlg .pk-actions .btn-primary { border-color: var(--adm-forest); background: var(--adm-forest); color: #fff; }
.adm-theme .pk-dlg .pk-actions .btn-primary:hover { background: var(--adm-moss); }

@media (max-width: 899px) {
  .adm-theme .pk-search { flex: 1 1 100%; margin-left: 0; }
}
@media (max-width: 720px) {
  .adm-theme .pk-head { align-items: stretch; }
  .adm-theme .pk-add-btn { justify-content: center; width: 100%; }
  .adm-theme .pk-row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "thumb main price" "state state state"; padding: 12px; }
  .adm-theme .pk-thumb { grid-area: thumb; width: 56px; height: 56px; }
  .adm-theme .pk-main { grid-area: main; }
  .adm-theme .pk-price { grid-area: price; min-width: 0; }
  .adm-theme .pk-state { grid-area: state; flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); }
  .adm-theme .pk-go { display: none; }
  .adm-theme .pk-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .adm-theme .pk-dlg .pk-form { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .adm-theme .pk-dlg .pk-photo { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
  .adm-theme .pk-dlg .pk-photo img, .adm-theme .pk-dlg .pk-photo > span { width: 96px; height: 96px; }
  .adm-theme .pk-dlg .pk-photo .upload-btn { flex: 1 1 140px; width: auto; }
  .adm-theme .pk-dlg .pk-photo-tip { flex-basis: 100%; }
  .adm-theme .pk-dlg .pk-fields { grid-template-columns: 1fr; }
  .adm-theme .pk-dlg .pk-fields > * { grid-column: 1 / -1; }
  .adm-theme .pk-dlg .pk-actions { position: sticky; bottom: 0; padding-bottom: 12px; }
}

/* Top menu: a slimmer highlight pill for the current page */
.adm-top .adm-tl { height: 30px; padding: 0 10px; font-size: 13.5px; }
.adm-theme .adm-top .adm-tl[aria-current] { border-radius: 8px; font-weight: 600; }

/* Pack sizes & prices as one compact table (admin/products.php): a row each, click anywhere on it to edit */
.adm-theme .pk-tbl { width: 100%; }
.adm-theme .pk-tbl th, .adm-theme .pk-tbl td { padding: 7px 10px; vertical-align: middle; font-size: 13px; }
.adm-theme .pk-tbl tbody tr.pk-item { cursor: pointer; }
.adm-theme .pk-tbl tbody tr.pk-item:hover { background: #FBFAF6; }
.adm-theme .pk-tbl tbody tr[hidden] { display: none; }
.adm-theme .pk-tbl tr.pk-item.is-off td:not(:nth-last-child(-n+3)) { opacity: .55; }
.adm-theme .pk-tbl .pk-c-img { width: 44px; padding-right: 0; }
.adm-theme .pk-tbl .pk-thumb { width: 34px; height: 34px; border-radius: 8px; }
.adm-theme .pk-tbl .pk-thumb .adm-ic { width: 16px; height: 16px; }
.adm-theme .pk-tbl .pk-name { display: block; font: 600 13.5px/1.25 var(--sans); }
.adm-theme .pk-tbl .pk-sub2 { display: block; max-width: 280px; font-size: 11.5px; }
.adm-theme .pk-tbl .pk-pp { display: block; font-size: 11px; color: var(--muted); }
.adm-theme .pk-tbl .pk-chip { padding: 1px 8px; font-size: 11.5px; }
.adm-theme .pk-tbl .vis-toggle, .adm-theme .pk-tbl .st-chip { white-space: nowrap; }
.pk-edit { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pk-edit:hover { background: #ECEBE4; color: var(--leaf); }
.pk-edit .adm-ic { width: 17px; height: 17px; stroke: currentColor; }
.adm-theme .pk-search { display: flex; align-items: center; }
.adm-theme .pk-search input[type][type][type] { padding-right: 40px; }
.adm-theme .pk-search input::-webkit-search-cancel-button { display: none; }
.pk-reset { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.pk-reset[hidden] { display: none; }
.pk-reset:hover { background: #ECEBE4; color: var(--ink); }
.pk-reset .adm-ic { width: 16px; height: 16px; stroke: currentColor; }

/* Listings page: smaller, squarer buttons (product tabs, Add, search) */
.adm-theme .pk-tabs { gap: 5px; padding: 1px; }
.adm-theme .pk-tab { min-height: 30px; padding: 0 10px; gap: 6px; border-radius: 8px; font-size: 13px; }
.adm-theme .pk-tab b { padding: 0 6px; border-radius: 6px; font-size: 11px; line-height: 1.6; }
.adm-theme .pk-add-btn { height: 34px; padding: 0 14px 0 10px; gap: 6px; border-radius: 9px; font-size: 13px; }
.adm-theme .pk-add-btn::before { width: 18px; height: 18px; border-radius: 6px; font-size: 14px; }
.adm-theme .pk-search input[type][type][type] { height: 34px; border-radius: 9px; font-size: 13px; background-position-x: 12px; padding-left: 36px; }
.adm-theme .pk-mini { min-height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.adm-theme .pk-bar { gap: 8px 12px; margin-bottom: 10px; }
.adm-theme .pk-help { margin-top: 18px; }
/* Listings: one row — search at the left, the product tabs at the right (Add stays in the heading) */
.adm-theme .pk-bar { flex-wrap: nowrap; }
.adm-theme .pk-bar .pk-search { order: 1; flex: 0 1 300px; min-width: 180px; margin-left: 0; }
.adm-theme .pk-bar .pk-tabs { order: 2; flex: 0 1 auto; margin-left: auto; min-width: 0; justify-content: flex-end; }
@media (max-width: 900px) { .adm-theme .pk-bar { flex-wrap: wrap; } .adm-theme .pk-bar .pk-tabs { order: 1; flex: 1 1 100%; justify-content: flex-start; margin-left: 0; } .adm-theme .pk-bar .pk-search { order: 2; flex: 1 1 200px; } }
/* Listings: tabs at the left, search box at the right; the summary line sits under them */
.adm-theme .pk-bar .pk-tabs { order: 1; flex: 1 1 auto; margin-left: 0; justify-content: flex-start; }
.adm-theme .pk-bar .pk-search { order: 2; flex: 0 1 300px; margin-left: auto; }
.adm-theme .pk-summary { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .adm-theme .pk-bar .pk-tabs { flex: 1 1 100%; } .adm-theme .pk-bar .pk-search { flex: 1 1 100%; margin-left: 0; } }
.adm-theme .pk-summary { margin: 4px 0 18px; padding: 2px 0; }
.adm-theme .pk-bar { margin-bottom: 14px; }

/* Add / edit listing pop-up: compact fields */
.adm-theme .pk-dlg { width: min(780px, calc(100vw - 32px)); border-radius: 16px; }
.adm-theme .pk-dlg .dlg-head { gap: 10px; padding: 10px 16px; }
.adm-theme .pk-dlg .dlg-head .h3 { font-size: 16px; }
.adm-theme .pk-dlg .dlg-head .prod-thumb { width: 34px; height: 34px; border-radius: 9px; }
.adm-theme .pk-dlg .dlg-x { width: 32px; height: 32px; }
.adm-theme .pk-dlg .pk-form { grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 14px 16px; }
.adm-theme .pk-dlg .pk-photo img, .adm-theme .pk-dlg .pk-photo > span { width: 140px; height: 140px; border-radius: 12px; }
.adm-theme .pk-dlg .pk-photo .upload-btn { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.adm-theme .pk-dlg .pk-photo-tip { font-size: 11px; }
.adm-theme .pk-dlg .pk-fields { gap: 8px 10px; }
.adm-theme .pk-dlg .pk-fields .fld { gap: 3px; }
.adm-theme .pk-dlg .pk-sec-h { margin: 4px 0 -2px; padding-top: 8px; font-size: 11px; }
.adm-theme .pk-dlg .pk-fields label { font-size: 12px; }
.adm-theme .pk-dlg .pk-fields :is(input:not([type=checkbox]):not([type=file]), select) { height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.adm-theme .pk-dlg .pk-fields textarea { padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.adm-theme .pk-dlg .pk-fields small { font-size: 11px; }
.adm-theme .pk-dlg .pk-fields .check { font-size: 13px; }
.adm-theme .pk-dlg .pk-actions { margin-top: 2px; padding-top: 10px; gap: 8px; }
.adm-theme .pk-dlg .pk-actions .btn { min-height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
/* Listings table: row numbers (they renumber while a search hides rows) */
.adm-theme .pk-tbl tbody { counter-reset: pkrow; }
.adm-theme .pk-tbl tbody tr.pk-item { counter-increment: pkrow; }
.adm-theme .pk-tbl .pk-n { width: 34px; padding-right: 0; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.adm-theme .pk-tbl td.pk-n::before { content: counter(pkrow); }

/* Add / edit listing pop-up, redesigned: 12-column grid so related fields share a row; tick and buttons together in the footer */
.adm-theme .pk-dlg { width: min(820px, calc(100vw - 32px)); }
.adm-theme .pk-dlg .pk-form { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 16px 18px 0; align-items: start; }
.adm-theme .pk-dlg .pk-photo img, .adm-theme .pk-dlg .pk-photo > span { width: 150px; height: 150px; }
.adm-theme .pk-dlg .pkf { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.adm-theme .pk-dlg .pkf > .c3, .adm-theme .pk-dlg .pkf-lot > .c3 { grid-column: span 3; }
.adm-theme .pk-dlg .pkf > .c6, .adm-theme .pk-dlg .pkf-lot > .c6 { grid-column: span 6; }
.adm-theme .pk-dlg .pkf > .c9 { grid-column: span 9; }
.adm-theme .pk-dlg .pkf > .c12, .adm-theme .pk-dlg .pkf-lot > .c12 { grid-column: 1 / -1; }
.adm-theme .pk-dlg .pkf .fld { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; }
.adm-theme .pk-dlg .pkf .fld > label { margin: 0; font: 600 12px/1.2 var(--sans); color: var(--ink-2); }
.adm-theme .pk-dlg .pkf .fld > label .muted { font-weight: 500; }
.adm-theme .pk-dlg .pkf :is(input:not([type=checkbox]):not([type=file]), select) { box-sizing: border-box; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.adm-theme .pk-dlg .pkf textarea { box-sizing: border-box; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.adm-theme .pk-dlg .pkf .fld-hint { margin: -4px 0 0; min-height: 0; font-size: 11.5px; }
.adm-theme .pk-dlg .pkf .fld-hint:empty { display: none; }
.adm-theme .pk-dlg .pkf .lot-fields { margin: 2px 0 0; padding: 10px 12px 12px; border-radius: 10px; }
.adm-theme .pk-dlg .pkf .lot-fields[hidden] { display: none; }
.adm-theme .pk-dlg .pkf .lot-fields legend { font-size: 13px; }
.adm-theme .pk-dlg .pkf-neg { align-self: end; min-height: 36px; font-size: 13px; }
.adm-theme .pk-dlg .pkf .pk-actions { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 6px -18px 0 -168px; padding: 10px 18px; border-top: 1px solid var(--line); background: #FBFAF6; }
.adm-theme .pk-dlg .pkf .pkf-meta { margin-right: auto; font-size: 12px; color: var(--muted); }
.adm-theme .pk-dlg .pkf .pk-actions .check { margin: 0 4px 0 0; }
.adm-theme .pk-dlg .pkf .pk-actions .btn { min-height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
@media (max-width: 760px) {
  .adm-theme .pk-dlg .pkf > .c3, .adm-theme .pk-dlg .pkf-lot > .c3 { grid-column: span 6; }
  .adm-theme .pk-dlg .pkf > .c6, .adm-theme .pk-dlg .pkf > .c9, .adm-theme .pk-dlg .pkf-lot > .c6 { grid-column: 1 / -1; }
  .adm-theme .pk-dlg .pkf .pk-actions { margin: 6px -16px 0 -16px; flex-wrap: wrap; }
}
/* Gallery: photos just picked show as tiles right beside "+ Add photos" */
.adm-theme .lg-newitem { cursor: default; border-color: var(--leaf); }
.adm-theme .lg-newitem span { padding: 2px 6px; color: var(--leaf); font-size: 11px; line-height: 1.25; }
.adm-theme .lg-newitem img { height: 60px; }
/* Gallery tiles sit side by side in a row (the grid rule above made every .fld a column) */
.adm-theme .pk-dlg .pkf .fld.lot-gallery { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.adm-theme .pk-dlg .pkf .fld.lot-gallery .lg-k { flex: 1 0 100%; }
.adm-theme .pk-dlg .pkf .fld.lot-gallery .lg-item, .adm-theme .pk-dlg .pkf .fld.lot-gallery .lg-add { flex: 0 0 92px; }
.adm-theme .pk-dlg .pkf .fld .pkf-neg { align-self: flex-start; min-height: 0; margin: 4px 0 0; font-size: 12px; }
.adm-theme .pk-dlg .pkf .fld .pkf-neg[hidden] { display: none; }
.adm-theme .pk-dlg { width: min(960px, calc(100vw - 32px)); }
