/* Back-of-house admin — shares the HD tokens, leaner chrome than the portal. */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--hd-cream);
  color: var(--hd-black);
  min-height: 100vh;
}
.mono { font-family: var(--font-mono); }
.num { text-align: right; }
/* numbers use the sans font now (plain zero); keep digits aligned in tables */
table, .stat-v, .mg-table, .cat-table { font-variant-numeric: tabular-nums; }
.dim { color: var(--hd-light); }
.strong { font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  letter-spacing: .04em; border: 0; border-radius: var(--radius);
  padding: 11px 18px; cursor: pointer; transition: var(--trans);
}
.btn-primary { background: var(--hd-orange); color: #fff; width: 100%; }
.btn-primary:hover { background: #e85c00; }
.btn-secondary { background: var(--hd-black); color: #fff; }
.btn-secondary:hover { background: var(--hd-grey); }
.btn-secondary:disabled { opacity: .6; cursor: default; }
.link-btn {
  background: none; border: 0; color: #ccc; font-family: var(--font-body);
  font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: var(--radius);
}
.link-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── Password gate ───────────────────────────────────── */
#gate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--hd-dark);
  display: flex; align-items: center; justify-content: center;
}
.gate-card {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 38px 34px; width: 360px; max-width: 92vw; text-align: center;
}
.gate-logo { font-family: var(--font-display); font-size: 34px; letter-spacing: .03em; color: var(--hd-black); }
.gate-sub { color: var(--hd-light); font-size: 13px; margin-bottom: 26px; }
.gate-card label, .pw-form label {
  display: block; text-align: left; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--hd-mid); margin-bottom: 6px;
}
.gate-card input, .pw-form input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: var(--font-body);
  border: 1.5px solid var(--input-border); border-radius: var(--radius);
  margin-bottom: 16px; background: var(--row-alt);
}
.gate-card input:focus, .pw-form input:focus { outline: none; border-color: var(--hd-orange); background: #fff; }
.gate-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ── Header ──────────────────────────────────────────── */
#ah {
  background: var(--hd-black); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 30;
}
.ah-left { display: flex; align-items: center; gap: 14px; }
.ah-title { font-family: var(--font-display); font-size: 24px; letter-spacing: .04em; }
.ah-title span { color: var(--hd-orange); }
.ah-cycle {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--hd-orange); color: #fff; padding: 4px 10px; border-radius: 20px;
}
.ah-right { display: flex; align-items: center; gap: 6px; }

/* ── Layout ──────────────────────────────────────────── */
#admin { max-width: 1280px; margin: 0 auto; padding: 24px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: #fff; border: 1px solid var(--table-border); border-radius: 6px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.stat-l { font-size: 12px; color: var(--hd-light); text-transform: uppercase; letter-spacing: .04em; }
.stat-v { font-family: var(--font-display); font-size: 30px; letter-spacing: .02em; line-height: 1; }
.stat-v.orange { color: var(--hd-orange); }

/* ── Controls ────────────────────────────────────────── */
.controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.controls .spacer { flex: 1; }
#search {
  flex: 0 1 320px; padding: 10px 14px; font-size: 14px; font-family: var(--font-body);
  border: 1.5px solid var(--input-border); border-radius: var(--radius); background: #fff;
}
#search:focus { outline: none; border-color: var(--hd-orange); }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--table-border); border-radius: var(--radius); overflow: hidden; }
.seg button {
  border: 0; background: none; padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--hd-mid); font-family: var(--font-body);
}
.seg button.active { background: var(--hd-black); color: #fff; }

/* ── Table ───────────────────────────────────────────── */
.table-wrap { background: #fff; border: 1px solid var(--table-border); border-radius: 6px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--section-bg); color: var(--hd-grey); text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 14px; border-bottom: 1px solid var(--table-border); white-space: nowrap;
}
thead th.num { text-align: right; }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--row-alt); }
#orders-body tr { cursor: pointer; transition: background var(--trans); }
#orders-body tr:hover { background: var(--row-hover); }
.store { font-weight: 600; }
.pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 20px;
}
.pill.submitted { background: #E3F0E4; color: var(--success); }
.pill.draft { background: #F0EAD8; color: var(--note-text); }
.pill.changes { background: #FBE4D4; color: #B5561E; }
.row-view {
  border: 1px solid var(--hd-border); background: #fff; color: var(--hd-black);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius); cursor: pointer;
}
.row-view:hover { background: var(--hd-black); color: #fff; }
.row-del {
  border: 1px solid #e2b8b8; background: #fff; color: #b3272d;
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius); cursor: pointer; margin-left: 4px;
}
.row-del:hover { background: #b3272d; color: #fff; border-color: #b3272d; }
.pill.none, .pill[style] { background: #efece4; color: var(--hd-light); }
.empty { padding: 40px; text-align: center; color: var(--hd-light); }

/* ── Overlays / modals ───────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.overlay.open { display: flex; }
.detail-box {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 1080px; max-width: 96vw; max-height: 90vh; display: flex; flex-direction: column;
}
.pw-box { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); width: 400px; max-width: 94vw; }
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--table-border);
}
.detail-head h2 { font-family: var(--font-display); font-size: 26px; letter-spacing: .02em; }
.detail-meta { font-size: 13px; color: var(--hd-mid); margin-top: 4px; }
.detail-actions { display: flex; align-items: center; gap: 12px; }
.modal-x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--hd-light); line-height: 1; }
.modal-x:hover { color: var(--hd-black); }
.detail-body { overflow: auto; padding: 8px 24px 24px; }
#detail-table thead th { position: sticky; top: 0; }

/* ── Change password form ────────────────────────────── */
.pw-form { padding: 22px 24px 26px; }
.pw-msg { font-size: 13px; min-height: 18px; margin: 4px 0 12px; }
.pw-msg.err { color: var(--danger); }
.pw-msg.ok { color: var(--success); }

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid var(--table-border); }
.tabs button {
  border: 0; background: none; padding: 12px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; color: var(--hd-light); font-family: var(--font-body);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button.active { color: var(--hd-black); border-bottom-color: var(--hd-orange); }

/* ── Catalogue editor ────────────────────────────────── */
.cat-select {
  padding: 10px 14px; font-size: 14px; font-family: var(--font-body);
  border: 1.5px solid var(--input-border); border-radius: var(--radius); background: #fff;
  max-width: 280px;
}
.cat-select:focus { outline: none; border-color: var(--hd-orange); }
#cat-search { flex: 0 1 300px; padding: 10px 14px; font-size: 14px; border: 1.5px solid var(--input-border); border-radius: var(--radius); background: #fff; }
#cat-search:focus { outline: none; border-color: var(--hd-orange); }
.cat-hint { font-size: 13px; color: var(--hd-light); margin: 2px 0 16px; }

.cat-section { margin-bottom: 22px; }
.cat-section-head {
  background: var(--hd-black); color: #fff; font-family: var(--font-display);
  font-size: 17px; letter-spacing: .03em; padding: 9px 16px; border-radius: 5px 5px 0 0;
}
.cat-section-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.cat-section-head .cat-count-badge { color: var(--hd-orange); font-family: var(--font-body); font-size: 12px; font-weight: 600; }
.cat-chevron { color: #fff; font-size: 12px; transition: transform var(--trans); display: inline-block; }
.cat-section.collapsed .cat-chevron { transform: rotate(-90deg); }
.cat-section.collapsed .cat-table { display: none; }
.add-prod-btn {
  margin-left: auto; font-family: var(--font-body); font-size: 12px; font-weight: 600;
  background: var(--hd-orange); color: #fff; border: 0; border-radius: var(--radius);
  padding: 5px 12px; cursor: pointer;
}
.add-prod-btn:hover { background: #e85c00; }
.cat-table { background: #fff; border: 1px solid var(--table-border); border-top: 0; }
.cat-table tbody tr { cursor: pointer; }
.cat-table tbody tr:hover { background: var(--row-hover); }
.cat-thumb { width: 42px; height: 42px; object-fit: contain; border-radius: 4px; background: var(--row-alt); display: block; }
td.missing { color: var(--danger); font-weight: 700; font-size: 12px; }

/* ── Live master grid ────────────────────────────────── */
.mg-auto { font-size: 13px; color: var(--hd-mid); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.mg-wrap { max-height: calc(100vh - 200px); overflow: auto; border: 1px solid var(--table-border); border-radius: 6px; background: #fff; }
.mg-table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.mg-table th, .mg-table td { border-right: 1px solid var(--row-alt); border-bottom: 1px solid var(--row-alt); padding: 7px 10px; white-space: nowrap; background: #fff; }
.mg-table thead th { position: sticky; top: 0; z-index: 3; background: var(--hd-black); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: bottom; }
.mg-table .mg-desc { white-space: normal; min-width: 220px; max-width: 320px; }
.mg-table .ctr { text-align: center; }
.mg-dealer { text-align: center; min-width: 84px; }
.mg-dealer span { display: block; font-size: 11px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.mg-dealer small { display: block; font-weight: 400; color: var(--hd-gold-light); text-transform: none; }
.mg-total { text-align: center; background: var(--hd-grey) !important; }
.mg-table tbody .mg-total { background: var(--note-bg) !important; font-weight: 700; }
/* sticky first two columns */
.mg-sticky { position: sticky; z-index: 2; }
.mg-c1 { left: 0; min-width: 56px; }
.mg-c2 { left: 56px; min-width: 96px; box-shadow: 1px 0 0 var(--table-border); }
.mg-table thead .mg-sticky { z-index: 4; }
.mg-table tbody td.mg-c1, .mg-table tbody td.mg-c2 { background: var(--row-alt); }
.mg-q { text-align: center; min-width: 64px; color: #bbb; }
.mg-q.has { color: var(--hd-orange); font-weight: 700; background: var(--row-hover); }
.mg-band td { position: sticky; left: 0; background: var(--section-bg) !important; font-family: var(--font-display); font-size: 14px; letter-spacing: .02em; color: var(--hd-grey); padding: 6px 12px; }

/* ── Item editor modal ───────────────────────────────── */
.item-box { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); width: 720px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.item-body { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 22px 24px; overflow: auto; }
.item-img-col { display: flex; flex-direction: column; gap: 8px; }
.item-img {
  width: 100%; aspect-ratio: 1; background: var(--row-alt) center/contain no-repeat;
  border: 1.5px dashed var(--input-border); border-radius: 6px; cursor: pointer;
}
.item-img:focus { outline: none; border-color: var(--hd-orange); box-shadow: 0 0 0 3px rgba(255,102,0,.15); }
.paste-hint { font-size: 11px; color: var(--hd-light); line-height: 1.35; }
.paste-hint b { color: var(--hd-orange); }
.img-btn-row { display: flex; gap: 8px; }
.img-btn-row .btn-secondary { flex: 1; padding: 8px 6px; font-size: 12px; }
.it-upload-msg, .it-msg { font-size: 12px; min-height: 16px; color: var(--hd-mid); }
.it-upload-msg.ok { color: var(--success); }

/* ── Crop / edit image modal ─────────────────────────── */
.crop-box { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); width: 640px; max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; }
.crop-body { padding: 16px 20px; overflow: auto; }
.crop-stage { width: 100%; height: 52vh; background: #1d1d1d; border-radius: 6px; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; }
.crop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.crop-tools .btn-secondary { padding: 7px 12px; font-size: 14px; min-width: 40px; }
.crop-tools .seg { margin-left: auto; }
.crop-tools .seg button { padding: 7px 12px; font-size: 12px; }
.it-upload-msg.err, .it-msg.err { color: var(--danger); }
.it-msg.ok { color: var(--success); }
.item-fields label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--hd-mid); margin: 12px 0 5px; }
.item-fields label:first-child { margin-top: 0; }
.item-fields input {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: var(--font-body);
  border: 1.5px solid var(--input-border); border-radius: var(--radius); background: var(--row-alt);
}
.item-fields input:focus { outline: none; border-color: var(--hd-orange); background: #fff; }
.item-fields input[readonly] { background: #efe9dd; color: var(--hd-mid); }
.item-fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--table-border); }

@media (max-width: 860px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .controls { flex-wrap: wrap; }
  #search { flex: 1 1 100%; }
  .item-body { grid-template-columns: 1fr; }
}

/* ── Production Planner (live on-screen view) ───────────────────────────── */
#mg-grid { padding: 10px 12px; }
.pp-section { background: #1a1a1a; color: #ff6600; font-weight: 700; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; padding: 8px 14px; margin: 16px 0 8px; border-radius: 4px; position: sticky; top: 0; z-index: 3; }
.pp-section:first-child { margin-top: 0; }
.pp-design { background: #fff; border: 1px solid #e6e0d6; border-radius: 8px; margin: 0 0 12px; overflow-x: auto; }
.pp-dhead { padding: 8px 12px; background: #faf7f2; border-bottom: 1px solid #ece5d9; font-size: 13.5px; white-space: nowrap; }
.pp-dhead .mono { color: #b15a00; font-weight: 700; margin-right: 6px; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pp-table th, .pp-table td { border: 1px solid #ece5d9; padding: 4px 7px; text-align: center; white-space: nowrap; }
.pp-table thead th { background: #2a2622; color: #eee; font-weight: 600; font-size: 11px; }
.pp-table th.pp-store, .pp-table td.pp-store { text-align: left; min-width: 180px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.pp-table td.has { background: #fff3e0; color: #b15a00; font-weight: 700; }
.pp-table .pp-tot { font-weight: 700; background: #f6f1e8; }
/* Vivid Excel colours: green = Qty Needed, black = Stock on Hand, blue = NEED TO ORDER */
.pp-table tr.pp-needed td { background: #92D050; color: #10300f; font-weight: 800; }
.pp-table tr.pp-soh td { background: #000; color: #fff; font-weight: 700; }
.pp-table tr.pp-order td { background: #00B0F0; color: #04293b; font-weight: 800; }
.pp-table tr.pp-needed td.pp-store, .pp-table tr.pp-order td.pp-store { color: #04293b; }
.pp-table tr.pp-soh td.pp-store { color: #fff; }
.pp-dimw { color: #cfcfcf; font-weight: 400; }
.pp-noord { color: #b0a; opacity: .55; font-size: 11px; font-weight: 600; margin-left: 6px; }
/* Designs with no orders: kept in the list, but faded to very faint versions of
   the same colours. Hover to bring back to full strength. */
.pp-design.pp-faded { opacity: .4; transition: opacity .15s ease; }
.pp-design.pp-faded:hover { opacity: 1; }
.pp-flat tr.sk-empty td { color: #c2bcb0; }
.pp-flat tr.sk-empty td.mono { color: #b3ac9f; }

/* Sub-tabs (Read Me First / All Dealer Orders / Production Planner / Summary) */
.pp-subtabs { display: flex; gap: 4px; margin: 12px 0 6px; border-bottom: 2px solid var(--table-border); flex-wrap: wrap; }
.pp-subtabs button { background: none; border: none; border-bottom: 3px solid transparent; padding: 9px 16px; font-family: var(--font-body); font-size: 13.5px; font-weight: 700; color: var(--hd-mid); cursor: pointer; margin-bottom: -2px; }
.pp-subtabs button:hover { color: var(--hd-black); }
.pp-subtabs button.active { color: var(--hd-orange); border-bottom-color: var(--hd-orange); }
.pp-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; flex-wrap: wrap; }
.ok-msg { color: #1a7d1a; font-weight: 700; font-size: 12.5px; }
.err-msg { color: #c0392b; font-weight: 700; font-size: 12.5px; }

/* Read Me First panel */
.pp-readme { background: #fff; border: 1px solid var(--table-border); border-radius: 8px; padding: 22px 26px; max-width: 920px; }
.pp-readme h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: 1px; color: var(--hd-black); margin: 0 0 2px; }
.pp-readme .rm-sub { color: var(--hd-mid); margin: 0 0 18px; }
.pp-readme h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--hd-orange); margin: 22px 0 8px; }
.pp-readme p { line-height: 1.5; color: #333; margin: 0 0 6px; }
.rm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rm-card { background: var(--hd-cream); border: 1px solid var(--table-border); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rm-card.hot { background: #00B0F0; border-color: #00B0F0; }
.rm-card.hot .rm-n, .rm-card.hot .rm-l { color: #042b3c; }
.rm-card .rm-n { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--hd-black); }
.rm-card .rm-l { font-size: 11.5px; color: var(--hd-mid); font-weight: 600; }
.rm-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.rm-key { padding: 6px 12px; border-radius: 5px; font-weight: 700; font-size: 12.5px; }
.pp-key-green { background: #92D050; color: #10300f; }
.pp-key-black { background: #000; color: #fff; }
.pp-key-blue { background: #00B0F0; color: #04293b; }
.rm-list { margin: 4px 0 0; padding-left: 20px; line-height: 1.7; color: #333; }

/* Flat tables (All Dealer Orders, Summary by Design) */
.pp-flatwrap { overflow: auto; border: 1px solid var(--table-border); border-radius: 6px; background: #fff; }
.pp-flat { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-flat th, .pp-flat td { border: 1px solid #ece5d9; padding: 5px 8px; text-align: center; }
.pp-flat thead th { position: sticky; top: 0; background: #D9D9D9; color: #1a1a1a; font-weight: 700; font-size: 11px; z-index: 2; }
.pp-flat td.pp-desc, .pp-flat th.pp-desc { text-align: left; min-width: 200px; white-space: normal; }
.pp-flat td.pp-store, .pp-flat th.pp-store { text-align: left; min-width: 170px; }
.pp-flat td.mono { text-align: left; }
.pp-flat td.has { background: #fff3e0; color: #b15a00; font-weight: 700; }
.pp-flat td.pp-tot { font-weight: 700; background: #f6f1e8; }
.pp-flat th.pp-need, .pp-flat td.pp-need { background: #00B0F0; color: #04293b; font-weight: 800; }
.pp-flat td.pp-nostk { color: #c0392b; font-weight: 700; }

.it-readonly { padding: 9px 10px; background: #f3efe8; border: 1px solid var(--input-border, #d8d2c6); border-radius: 4px; font-size: 12.5px; color: #555; min-height: 38px; }

/* Order edit history (timestamps) in the detail modal */
.d-audit { margin-top: 18px; border-top: 1px solid var(--table-border); padding-top: 12px; }
.d-audit-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--hd-mid); margin-bottom: 8px; }
.d-audit-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #ece5d9; font-size: 12.5px; }
.d-audit-row:last-child { border-bottom: none; }
.d-audit-ev { font-weight: 600; color: #333; }
.d-audit-ev::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #bbb; margin-right: 8px; vertical-align: middle; }
.d-audit-ev.ev-submit::before { background: #1a7d1a; }
.d-audit-ev.ev-save_changes::before { background: var(--hd-orange); }
.d-audit-ev.ev-create::before { background: #00B0F0; }
.d-audit-ev.ev-clear::before { background: var(--danger, #c0392b); }
.d-audit-at { color: #999; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Back prints admin (minimums + gallery) */
.bpa-moq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.bpa-cat { background: #fff; border: 1px solid var(--table-border); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bpa-cat-label { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; color: var(--hd-dark); text-transform: uppercase; }
.bpa-moq { display: flex; align-items: center; gap: 8px; }
.bpa-moq input { width: 90px; padding: 8px 10px; border: 1.5px solid var(--input-border); border-radius: 6px; font-size: 16px; font-weight: 700; text-align: center; }
.bpa-moq input:focus { outline: none; border-color: var(--hd-orange); }
.bpa-moq span { font-size: 12px; color: var(--hd-mid); }
.bpa-save { align-self: flex-start; }
.bpa-h { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--hd-mid); margin: 20px 0 8px; }
.bpa-galcat { font-family: var(--font-display); font-size: 16px; letter-spacing: 1px; color: var(--hd-dark); text-transform: uppercase; border-left: 4px solid var(--hd-orange); padding-left: 10px; margin: 16px 0 10px; }
.bpa-galcat:first-child { margin-top: 0; }
.bpa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.bpa-card { border: 1px solid var(--table-border); border-radius: 7px; padding: 5px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.bpa-img { aspect-ratio: 1/1; background: #faf7f2; border-radius: 5px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bpa-img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.bpa-code { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-align: center; color: #555; }

/* ── Addresses tab ─────────────────────────────────────── */
#addr-table td { vertical-align: top; }
.addr-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.addr-badge.chg { background: #fdecdc; color: #b15a00; }
.addr-badge.none { background: transparent; color: var(--hd-light); font-weight: 400; }
.addr-chg-cell { background: #fff7ee; }
tr.addr-row-click { cursor: pointer; }
tr.addr-row-click:hover td { background: #fff3e0; }
.addr-note-cell { max-width: 300px; }
.addr-note { display: inline-block; background: #fff8e6; border: 1px solid #f0e0b0; border-radius: 6px; padding: 4px 8px; font-size: 12px; color: #5c4a1a; white-space: pre-wrap; max-width: 280px; line-height: 1.35; vertical-align: top; }
/* history diff */
.hd-block { border: 1px solid var(--input-border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fafafa; }
.hd-head { font-size: 13px; margin-bottom: 8px; }
.hd-row { display: grid; grid-template-columns: 120px 1fr 20px 1fr; gap: 6px 10px; align-items: baseline; font-size: 13px; padding: 3px 0; }
.hd-k { color: var(--hd-light); font-weight: 700; }
.hd-b { color: #999; text-decoration: line-through; }
.hd-arr { color: var(--hd-orange); text-align: center; font-weight: 700; }
.hd-a { color: var(--hd-black); font-weight: 600; }
