/* Ai ZaxBot — products & services · promotions · bot knowledge · sales (Phase 2) + the product drawer.
   Only the theme tokens from index.html :root, so every theme (minimal / dark / light / emerald / rose / amber) works.
   Spacing on a 4/8px scale. Rendered by js/products.js. */

#view-ecom, #prod-drawer {
  --pc-good: color-mix(in srgb, var(--green) 62%, var(--ink));
  --pc-bad: color-mix(in srgb, var(--red) 75%, var(--ink));
  --pc-warn: color-mix(in srgb, var(--amber) 62%, var(--ink));
  --pc-info: color-mix(in srgb, var(--blue) 70%, var(--ink));
  font-variant-numeric: tabular-nums;
}
#view-ecom :focus-visible, #prod-drawer :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#view-ecom button:disabled, #prod-drawer button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
#view-ecom svg.bi, #prod-drawer svg.bi { margin-right: 0; }
#view-ecom .mono, #prod-drawer .mono { font-variant-numeric: tabular-nums; }
.pc-grow { flex: 1; }
.pc-muted { color: var(--muted); }
.pc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pc-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.pc-hint.good { color: var(--pc-good); } .pc-hint.warn { color: var(--pc-warn); }

/* ---------- shared controls ---------- */
.pc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pc-btn:hover { border-color: var(--accent); background: var(--hover); }
.pc-btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.pc-btn.danger { color: var(--pc-bad); border-color: color-mix(in srgb, var(--red) 40%, var(--line2)); }
.pc-btn.danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--card)); }
.pc-btn.accent { color: var(--accent); border-color: rgba(var(--accentRgb), .35); background: rgba(var(--accentRgb), .07); }
.pc-btn.accent:hover { background: rgba(var(--accentRgb), .13); border-color: var(--accent); }
.pc-btn svg.bi { width: 14px; height: 14px; }
#view-ecom button.primary, #prod-drawer button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; font-weight: 600; }
.pc-dangerbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 9px; border: none; background: var(--red); color: #fff; font-weight: 600; }
.pc-dangerbtn:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.pc-iconbtn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.pc-iconbtn:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
.pc-iconbtn svg { width: 16px; height: 16px; margin: 0; }
.pc-iconbtn.sm { width: 28px; height: 28px; border-radius: 7px; }
.pc-iconbtn.sm svg { width: 14px; height: 14px; }
.pc-iconbtn.danger:hover { color: var(--pc-bad); background: color-mix(in srgb, var(--red) 10%, transparent); }
.pc-iconbtn.ok { color: var(--pc-good); }
.pc-linkbtn { border: none; background: none; padding: 4px 6px; color: var(--accent); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
.pc-linkbtn:hover { background: rgba(var(--accentRgb), .08); }
.pc-linkbtn.muted { color: var(--muted); font-weight: 500; }
.pc-linkbtn.sm { font-size: 12px; padding: 2px 4px; }
.pc-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(var(--accentRgb), .25); border-top-color: var(--accent); animation: pcspin .8s linear infinite; flex: none; display: inline-block; }
button.primary .pc-spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes pcspin { to { transform: rotate(360deg); } }
.pc-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px 16px; color: var(--muted); font-size: 13px; }
.pc-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 999px; white-space: nowrap; color: var(--muted); background: var(--hover); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pc-chip svg.bi { width: 11px; height: 11px; }
.pc-chip.star { color: var(--pc-warn); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.pc-chip.svc { color: var(--pc-info); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.pc-chip.opt { font-weight: 500; }
.pc-chip.warn { color: var(--pc-warn); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pc-fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.pc-fchip:hover { color: var(--ink); border-color: var(--accent); }
.pc-fchip.on { color: var(--accent); background: rgba(var(--accentRgb), .1); border-color: rgba(var(--accentRgb), .35); font-weight: 600; }
.pc-fchip .mono { font-size: 11px; opacity: .8; }
.pc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; }
.pc-bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.pc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pc-empty.sm { padding: 20px 12px; }
.pc-empty b { color: var(--ink); font-size: 14px; }
.pc-empty > span:not(.pc-empty-i) { max-width: 440px; }
.pc-empty-i { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); background: rgba(var(--accentRgb), .1); }
.pc-empty-i svg { width: 22px; height: 22px; margin: 0; }
.pc-empty.good .pc-empty-i { color: var(--pc-good); background: color-mix(in srgb, var(--green) 12%, transparent); }
.pc-empty-a { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.pc-ch { display: flex; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pc-ch h3 { margin: 0; font-size: 15px; font-weight: 700; }
.pc-ch .sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pc-ch > .status { align-self: center; }
.pc-sectt { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin: 0 0 8px; }

/* ---------- tabs ---------- */
.pc-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.pc-tabs::-webkit-scrollbar { display: none; }
.pc-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pc-tabs button:hover { color: var(--ink); background: var(--hover); }
.pc-tabs button.on { color: var(--accent); background: rgba(var(--accentRgb), .11); }
.pc-tabs button svg.bi { width: 16px; height: 16px; }
.pc-tabn { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--hover); }
.pc-tabs button.on .pc-tabn { color: var(--accent); background: rgba(var(--accentRgb), .15); }
.pc-tabn.hot { color: #fff; background: var(--amber); }
.pc-tabn:empty { display: none; }
#view-ecom .pc-pane { display: none; }
#view-ecom .pc-pane.on { display: block; }

/* ---------- AI readiness summary ---------- */
.pc-ready { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.pc-ready[hidden] { display: none; }
.pc-ready-main { display: flex; align-items: center; gap: 14px; flex: 1 1 320px; min-width: 0; }
.pc-ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--hover) 0); }
.pc-ring.full { background: conic-gradient(var(--green) 100%, var(--hover) 0); }
.pc-ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.pc-ready-t { font-size: 15px; font-weight: 700; }
.pc-ready-t b { color: var(--accent); }
.pc-ready-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.pc-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line2)); background: color-mix(in srgb, var(--amber) 7%, var(--card)); color: var(--ink); font-size: 12.5px; }
.pc-tip b { color: var(--pc-warn); }
.pc-tip:hover { border-color: var(--amber); }
.pc-tip.on { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 18%, var(--card)); font-weight: 600; }
.pc-tip.clear { border-color: var(--line2); background: var(--card); color: var(--muted); }
.pc-tip.clear svg { width: 13px; height: 13px; }

/* ---------- layout: categories | table ---------- */
.pc-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 16px; align-items: start; }
.pc-cats { padding: 12px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.pc-cats-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; font-size: 12px; color: var(--muted); }
.pc-cats-h b { font-weight: 700; letter-spacing: .02em; }
.pc-catlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-catlist li { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pc-cat { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.pc-cat:hover { background: var(--hover); border-color: transparent; }
.pc-cat.on { background: rgba(var(--accentRgb), .1); color: var(--accent); font-weight: 600; border-color: rgba(var(--accentRgb), .22); }
.pc-cat .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-cat .n { font-size: 11.5px; color: var(--muted); }
.pc-cat.on .n { color: var(--accent); }
.pc-catlist li:nth-child(2) { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.pc-cattools { display: inline-flex; flex: none; }
.pc-cats.editing .pc-cat .n { display: none; }
.pc-catedit { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.pc-catedit input { flex: 1; min-width: 0; padding: 7px 9px; font-size: 13px; }
.pc-catedit.add { margin-top: 6px; }
.pc-cat-add { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; margin-top: 6px; padding: 0 10px; border: 1px dashed var(--line2); border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; }
.pc-cat-add:hover { color: var(--accent); border-color: var(--accent); }
.pc-cats .pc-hint { padding: 8px 4px 0; }
.pc-main { padding: 16px; min-width: 0; }

/* toolbar */
.pc-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-search { display: flex; align-items: center; gap: 7px; flex: 1 1 240px; max-width: 360px; height: 38px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 9px; background: var(--input); color: var(--faint); cursor: text; }
.pc-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accentRgb), .16); }
.pc-search svg { width: 16px; height: 16px; flex: none; }
.pc-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: none; background: transparent; box-shadow: none !important; font-size: 13px; }
.pc-search.sm { height: 34px; max-width: none; flex: none; }
.pc-toolbar select { height: 38px; padding: 0 30px 0 10px; font-size: 13px; }
.pc-menuwrap { position: relative; }
.pc-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: none; flex-direction: column; gap: 2px; min-width: 230px; padding: 6px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgba(0,0,0,.12); }
.pc-menu.open { display: flex; }
.pc-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border: none; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.pc-menu button:hover { background: var(--hover); }
.pc-menu button.danger { color: var(--pc-bad); }
.pc-menu button[hidden] { display: none; }

/* bulk bar */
.pc-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; margin-bottom: 12px; border-radius: 12px; border: 1px solid rgba(var(--accentRgb), .3); background: rgba(var(--accentRgb), .07); }
.pc-bulk[hidden] { display: none; }
.pc-bulk-n { font-size: 13px; }
.pc-bulk-n b { color: var(--accent); }
.pc-bulk-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pc-bulk select { height: 30px; padding: 0 26px 0 8px; font-size: 12.5px; border-radius: 9px; }

/* table */
.pc-tablewrap { overflow-x: auto; margin: 0 -4px; position: relative; } /* relative: keeps the absolutely-positioned .pc-sr labels inside the scroller */
.pc-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.pc-table th { padding: 8px 10px; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
.pc-table td { padding: 10px; border-top: none; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.pc-table tbody tr:last-child td { border-bottom: none; }
.pc-table tbody tr:hover td { background: var(--hover); }
.pc-table th.num, .pc-table td.num { text-align: right; }
.pc-sort { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; border: none; background: none; color: inherit; font: inherit; font-weight: 600; }
.pc-sort:hover, .pc-sort.on { color: var(--ink); }
.pc-sort .caret { display: inline-flex; opacity: .45; }
.pc-sort .caret svg { width: 12px; height: 12px; }
.pc-sort.on .caret { opacity: 1; color: var(--accent); }
.pc-ptable .c-chk { width: 36px; padding-right: 0; }
.pc-ptable .c-img { width: 56px; }
.pc-ptable .c-act { width: 1%; white-space: nowrap; text-align: right; }
.pc-ptable .c-status { white-space: nowrap; }
.pc-ptable input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.pc-ptable tr.sel td { background: rgba(var(--accentRgb), .06); }
.pc-ptable tr.pc-off td.c-img, .pc-ptable tr.pc-off td.c-name, .pc-ptable tr.pc-off td.c-price, .pc-ptable tr.pc-off td.c-stock { opacity: .55; }
.pc-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--card2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--faint); vertical-align: middle; }
.pc-thumb.sm { width: 32px; height: 32px; border-radius: 8px; }
.pc-thumb svg { width: 18px; height: 18px; }
.pc-thumb.sm svg { width: 14px; height: 14px; }
.pc-name { display: block; max-width: 340px; padding: 0; border: none; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; line-height: 1.4; cursor: pointer; }
.pc-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pc-chips-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pc-desc { margin-top: 3px; max-width: 360px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-stock.low { color: var(--pc-warn); font-weight: 600; }
.pc-stock.no { color: var(--pc-bad); font-weight: 600; }
.pc-rpill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pc-warn); white-space: nowrap; }
.pc-rpill .mono { font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 14%, transparent); }
.pc-rpill .pc-rmiss { color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.pc-rpill.ok { color: var(--pc-good); font-weight: 600; }
.pc-rpill.ok svg { width: 14px; height: 14px; }
#view-ecom .switch .lbl { min-width: 46px; }
.pc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pc-pager { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- modals (import / FAQ editor / confirm) ---------- */
.pc-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 16, .5); backdrop-filter: blur(2px); opacity: 0; transition: opacity .16s; }
.pc-modal[hidden] { display: none; }
.pc-modal.open { opacity: 1; }
.pc-dialog { width: 520px; max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.3); color: var(--ink); }
.pc-dialog.wide { width: 760px; }
.pc-dialog.sm { width: 420px; }
.pc-dh { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.pc-dh h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; }
.pc-db { padding: 16px 20px; overflow-y: auto; }
.pc-db h3 { margin: 0 0 6px; font-size: 16px; }
.pc-db p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.pc-df { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.pc-dialog.sm .pc-df { border-top: none; padding-top: 4px; }
.pc-err { color: var(--pc-bad); font-size: 12.5px; }
.pc-toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 16px); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--card); font-size: 13px; font-weight: 500; box-shadow: 0 12px 32px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.pc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pc-toast.err { background: var(--red); color: #fff; }

/* CSV import */
.pc-csvdrop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--line2); border-radius: 14px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.pc-csvdrop svg { width: 28px; height: 28px; color: var(--accent); }
.pc-csvdrop b { color: var(--ink); font-size: 14px; }
.pc-csvdrop:hover, .pc-csvdrop.drag, .pc-csvdrop:focus-visible { border-color: var(--accent); background: rgba(var(--accentRgb), .05); }
.pc-csvguide { margin-top: 16px; }
.pc-csvguide table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.pc-csvguide td { padding: 6px 8px; border-top: 1px solid var(--line); font-size: 12.5px; vertical-align: top; }
.pc-csvguide td:first-child { white-space: nowrap; color: var(--muted); }
.pc-csvguide code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--hover); color: var(--ink); }
.pc-csvfile { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.pc-csvfile svg { width: 18px; height: 18px; color: var(--accent); }
.pc-csvcats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.pc-csvtable { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; }
.pc-csvtable .pc-table th { position: sticky; top: 0; background: var(--card); }
.pc-act { display: inline-flex; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pc-act.new { color: var(--pc-good); background: color-mix(in srgb, var(--green) 13%, transparent); }
.pc-act.upd { color: var(--pc-info); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.pc-act.err { color: var(--pc-bad); background: color-mix(in srgb, var(--red) 11%, transparent); }
.pc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pc-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); }
.pc-kpi b { font-size: 20px; font-weight: 700; line-height: 1.2; }
.pc-kpi span { font-size: 12px; color: var(--muted); }
.pc-kpi.good b { color: var(--pc-good); } .pc-kpi.info b { color: var(--pc-info); } .pc-kpi.bad b { color: var(--pc-bad); } .pc-kpi.warn b { color: var(--pc-warn); }
.pc-askerr { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: var(--pc-bad); background: color-mix(in srgb, var(--red) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--red) 25%, var(--line)); }
.pc-askerr svg.bi { width: 15px; height: 15px; margin-top: 1px; }

/* ---------- product drawer ---------- */
#prod-drawer { width: 860px; max-width: 100vw; background: var(--card); }
#prod-drawer .dh { padding: 14px 16px 14px 20px; }
#prod-drawer .dh .x { margin-left: auto; font-size: inherit; padding: 0; width: 34px; height: 34px; }
#prod-drawer .db { padding: 0; gap: 0; }
#prod-drawer .df { align-items: center; gap: 8px; padding: 12px 20px; }
#prod-drawer .df .status { color: var(--pc-bad); font-size: 12.5px; }
.pc-dgrid { display: grid !important; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.pc-dform { padding: 18px 20px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pc-dside { position: sticky; top: 0; padding: 18px 20px; border-left: 1px solid var(--line); background: var(--card2); min-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.pc-sect { display: flex; flex-direction: column; gap: 12px; }
.pc-sect + .pc-sect { padding-top: 20px; border-top: 1px solid var(--line); }
.pc-sect .pc-sectt { margin: 0; }
#prod-drawer label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
#prod-drawer label input, #prod-drawer label select, #prod-drawer label textarea { color: var(--ink); }
#prod-drawer textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
#prod-drawer .grid2 { gap: 12px; }
#np-stock-wrap.off { opacity: .45; }
.pc-opt-note { font-weight: 500; color: var(--faint); margin-left: 4px; }
.pc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-seg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); text-align: left; }
.pc-seg button b { font-size: 13px; }
.pc-seg button small { font-size: 11.5px; color: var(--muted); }
.pc-seg button.on { border-color: var(--accent); background: rgba(var(--accentRgb), .07); }
.pc-seg button.on b { color: var(--accent); }
.pc-catnew { display: flex; gap: 6px; margin-top: 6px; }
.pc-catnew input { flex: 1; min-width: 0; }
/* options builder */
.pc-opt { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); display: flex; flex-direction: column; gap: 8px; }
.pc-opt-h { display: flex; gap: 6px; align-items: center; }
.pc-opt-h input { flex: 1; min-width: 0; font-weight: 600; }
.pc-vals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; min-height: 40px; border: 1px solid var(--line2); border-radius: 9px; background: var(--input); }
.pc-vals:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accentRgb), .16); }
.pc-vals input { flex: 1 1 140px; min-width: 120px; padding: 4px 6px; border: none; background: transparent; box-shadow: none !important; font-size: 13px; }
.pc-val { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 9px; height: 26px; border-radius: 999px; background: rgba(var(--accentRgb), .1); color: var(--ink); font-size: 12.5px; font-weight: 500; max-width: 100%; }
.pc-val button { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 50%; background: transparent; color: var(--muted); }
.pc-val button:hover { background: rgba(var(--accentRgb), .18); color: var(--ink); }
.pc-val button svg { width: 12px; height: 12px; }
#np-opt-add { align-self: flex-start; }
#np-opt-add[hidden] { display: none; }
/* featured + upsell */
#prod-drawer label.pc-switchrow { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pc-switchrow > span:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pc-switchrow b { color: var(--ink); font-size: 13px; }
.pc-switchrow small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pc-sub { font-size: 13px; font-weight: 600; color: var(--ink); }
.pc-sub small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.pc-upsel { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-upsel:empty { display: none; }
.pc-uplist { display: flex; flex-direction: column; gap: 2px; }
.pc-uprow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
.pc-uprow:hover { background: var(--hover); border-color: transparent; }
.pc-uprow img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; }
.pc-uprow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-uprow .pr { color: var(--muted); font-size: 12px; }
.pc-uprow > svg { width: 14px; height: 14px; color: var(--accent); }
#np-img-row { display: flex; align-items: center; gap: 10px; }
#np-img-row[hidden] { display: none; }
#np-img-row .pthumb { width: 56px; height: 56px; }
#np-drop .imgbtn { display: inline-flex; flex-direction: row; font-size: 13px; }
#np-drop .pc-hint { margin-top: 6px; }
/* chat-card preview (mirrors the LINE flex bubble) */
.pc-cardprev { display: flex; justify-content: center; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 5%, var(--bg)); border: 1px solid var(--line); }
.pc-bubble { width: 220px; border-radius: 14px; overflow: hidden; background: #fff; color: #111; box-shadow: 0 4px 16px rgba(0,0,0,.12); border: 1px solid rgba(0,0,0,.06); }
.pc-bubble img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.pc-noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1 / 1; background: #f1f1f4; color: #8a8a99; font-size: 12px; }
.pc-noimg svg { width: 26px; height: 26px; }
.pc-bb { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 4px; }
.pc-bb b { font-size: 13.5px; line-height: 1.35; word-break: break-word; }
.pc-bp { font-size: 13.5px; color: #6366f1; font-weight: 600; }
.pc-ba { font-size: 12px; }
.pc-ba.ok { color: #0e9f6e; } .pc-ba.no { color: #dc2626; }
.pc-bf { padding: 8px 12px 12px; }
.pc-bf span { display: block; padding: 8px; border-radius: 8px; background: #6366f1; color: #fff; text-align: center; font-size: 13px; font-weight: 600; }
.pc-readyrow-t { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pc-readyrow-t b { color: var(--accent); }
.pc-readychecks { display: flex; flex-direction: column; gap: 4px; }
.pc-readychecks span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pc-readychecks span.ok { color: var(--pc-good); }
.pc-readychecks svg { width: 14px; height: 14px; }
.pc-readychecks .pc-dot { margin: 0 3px; }
/* ask the AI */
.pc-ask { padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pc-ask .pc-sectt { margin: 0; }
.pc-askrow { display: flex; gap: 6px; }
.pc-askrow input { flex: 1; min-width: 0; font-size: 13px; }
.pc-askq, .pc-aska { max-width: 92%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.pc-askq { align-self: flex-end; margin-left: auto; background: var(--hover); border-bottom-right-radius: 4px; }
.pc-aska { background: rgba(var(--accentRgb), .1); border-bottom-left-radius: 4px; margin-top: 6px; }
#np-ask-out { display: flex; flex-direction: column; }
#np-ask-out .pc-loading { padding: 12px; justify-content: flex-start; }
.pc-askcards { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pc-minicard { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 12px; }
.pc-minicard img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }
.pc-minicard div { display: flex; flex-direction: column; min-width: 0; }
.pc-minicard b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-minicard span { color: var(--muted); }

/* ---------- promotions ---------- */
.pc-promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pc-promo { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card2); }
.pc-promo.live { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.pc-promo.ended { opacity: .7; }
.pc-promo-h { display: flex; align-items: center; gap: 2px; }
.pc-promo h4 { margin: 2px 0 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.pc-promo p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pc-promo-f { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.pc-promo-f svg.bi { width: 13px; height: 13px; }
.pc-pstate { display: inline-flex; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.pc-pstate.live { color: var(--pc-good); background: color-mix(in srgb, var(--green) 13%, transparent); }
.pc-pstate.soon { color: var(--pc-info); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.pc-pstate.ended { color: var(--muted); background: var(--hover); }

/* ---------- bot knowledge ---------- */
.pc-kb { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pc-kb-side { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pc-kb-main { grid-column: 1; grid-row: 1; min-width: 0; }
.pc-faqgrp + .pc-faqgrp { margin-top: 16px; }
.pc-faqgrp h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.pc-faqgrp h4 .mono { font-weight: 600; color: var(--faint); }
.pc-faq { display: flex; align-items: flex-start; gap: 8px; padding: 10px 4px; border-top: 1px solid var(--line); }
.pc-faq-b { flex: 1; min-width: 0; }
.pc-faq .q { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.pc-faq .a { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.pc-faq-act { display: flex; flex: none; }
.pc-gaps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pc-gap { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.pc-gap:first-child { border-top: none; padding-top: 0; }
.pc-gap-q { font-size: 13.5px; font-weight: 600; line-height: 1.45; word-break: break-word; }
.pc-gap-m { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.pc-gap-m .chico { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.pc-gap-a { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pc-gapquote { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--amber) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); font-size: 13px; line-height: 1.5; }
.pc-gapquote svg.bi { width: 15px; height: 15px; margin-top: 2px; color: var(--pc-warn); }
.pc-persona { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 12px; border-radius: 10px; background: rgba(var(--accentRgb), .07); font-size: 12.5px; }
.pc-persona svg.bi { color: var(--accent); }
.pc-pmeter { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.pc-pmeter .pc-bar { flex: 1; }
.pc-plist { list-style: none; margin: 0 0 12px; padding: 0; }
.pc-plist li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pc-plist li > svg, .pc-plist li > .pc-dot { margin-top: 4px; }
.pc-plist li > svg { width: 14px; height: 14px; color: var(--pc-good); flex: none; }
.pc-plist li div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pc-plist small { font-size: 12px; color: var(--muted); line-height: 1.45; word-break: break-word; }
#pc-profile > .pc-btn { width: 100%; }

/* ---------- sales ---------- */
.pc-salestable .c-share { width: 22%; min-width: 100px; }
.pc-sitem { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc-sitem > div { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.pc-sitem small { font-size: 11.5px; }
#pc-pane-sales .pc-ch select { height: 36px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pc-kb { grid-template-columns: minmax(0, 1fr); }
  .pc-kb-side, .pc-kb-main { grid-column: 1; grid-row: auto; }
  .pc-dgrid { grid-template-columns: minmax(0, 1fr); }
  .pc-dside { position: static; border-left: none; border-top: 1px solid var(--line); }
  #prod-drawer { width: 560px; }
  .pc-ptable .pc-rmiss { display: none; }
}
@media (max-width: 900px) {
  .pc-layout { grid-template-columns: minmax(0, 1fr); }
  .pc-cats { position: static; max-height: none; padding: 10px; }
  .pc-cats:not(.editing) .pc-catlist { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: thin; }
  .pc-cats:not(.editing) .pc-catlist li { flex: none; }
  .pc-cats:not(.editing) .pc-catlist li:nth-child(2) { margin: 0; padding: 0; border: none; }
  .pc-cats:not(.editing) .pc-cat { border: 1px solid var(--line2); border-radius: 999px; min-height: 36px; }
  .pc-cats:not(.editing) .pc-cat-add { width: auto; display: inline-flex; }
}
@media (max-width: 720px) {
  .pc-main { padding: 12px; }
  .pc-search { max-width: none; flex-basis: 100%; }
  .pc-toolbar select { flex: 1 1 140px; }
  .pc-toolbar .pc-grow { display: none; }
  .pc-bulk-acts { margin-left: 0; }
  /* product table → stacked cards */
  .pc-ptable thead { display: none; }
  .pc-ptable, .pc-ptable tbody { display: block; }
  .pc-ptable tr { display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto; grid-template-areas: "chk img name act" "chk img price stock" "chk img ready status"; gap: 2px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .pc-ptable tbody tr:last-child { border-bottom: none; }
  .pc-ptable td { display: block; padding: 0; border: none !important; background: none !important; }
  .pc-ptable .c-chk { grid-area: chk; width: auto; padding-top: 2px; }
  .pc-ptable .c-img { grid-area: img; width: auto; }
  .pc-ptable .c-name { grid-area: name; min-width: 0; }
  .pc-ptable .c-price { grid-area: price; align-self: center; }
  .pc-ptable .c-stock { grid-area: stock; align-self: center; text-align: right; }
  .pc-ptable .c-ready { grid-area: ready; align-self: center; }
  .pc-ptable .c-status { grid-area: status; align-self: center; justify-self: end; }
  .pc-ptable .c-act { grid-area: act; width: auto; }
  .pc-ptable .pc-desc, .pc-name { max-width: none; }
  .pc-ptable .c-act .pc-iconbtn { width: 40px; height: 40px; }
  #prod-drawer { width: 100vw; }
  .pc-dform, .pc-dside { padding: 16px; }
  #prod-drawer .grid2 { grid-template-columns: 1fr; }
  .pc-seg { grid-template-columns: 1fr; }
  .pc-dialog { max-height: calc(100dvh - 16px); }
  .pc-modal { padding: 8px; align-items: flex-end; }
  .pc-tabs button { padding: 0 12px; font-size: 13px; }
  .pc-iconbtn.sm { width: 36px; height: 36px; }
  .pc-cat, .pc-fchip, .pc-tip { min-height: 40px; }
  .pc-btn.sm { min-height: 36px; }
}
@media (max-width: 420px) {
  .pc-tabs button svg.bi { display: none; }
  .pc-ready { padding: 14px; }
  .pc-promos { grid-template-columns: minmax(0, 1fr); }
}

/* Staff (AGENT) can't change categories or import — the server refuses; hide the controls. */
.is-staff #pc-cats [data-catmode], .is-staff #pc-cats .pc-cat-add { display: none !important; }
