body { margin: 0; font-family: Arial, sans-serif; display: flex; height: 100vh; overflow: hidden; background: #edf2f8; }
label { font-size: 10px; }

button {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#f8f8f8, #e0e0e0);
  font-size: 12px; border: 1px solid #888; border-radius: 6px;
  padding: 10px 14px; font-weight: bold; cursor: pointer;
  box-shadow: 0 2px 0 #aaa, 0 6px 8px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.file-input { display: none; }
.file-upload {
  display: inline-block; padding: 10px 12px; background: #dfe6f2;
  border: 2px solid #000; font-weight: bold; cursor: pointer;
}
.file-upload:hover { background: #cfd9ef; }
#fileName { display: block; margin-top: 1px; font-size: 10px; color: #555; }

/* =========================
   RESIZABLE PANELS
========================= */
#storeSceneBackground {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  overflow: hidden;
}
#storeCustomBackgroundImage {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  transition: opacity 180ms ease;
}
#storeSceneBackground.custom-background-active #storeCustomBackgroundImage {
  opacity: 1;
}
#storeSceneBackground.custom-background-active .store-scene {
  opacity: 0;
}
#leftPanel,
.v-resizer,
#workspace {
  position: relative;
  z-index: 1;
}
#leftPanel { display:flex; flex-direction:row; height:100vh; overflow:hidden; border-right:1px solid #ccc; }
#controls {
  width: 230px; min-width: 140px; max-width: 560px;
  padding: 12px; background:#f4f4f4; border-right:1px solid #ccc;
  height:100vh; overflow:auto; box-sizing:border-box;
  display:flex; flex-direction:column;
}
#controls.controls-collapsed {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding: 6px 4px;
}
#controls.controls-collapsed > *:not(h2) {
  display: none !important;
}
#controls.controls-collapsed h2 {
  margin: 0;
  justify-content: center !important;
}
#controls.controls-collapsed h2 span {
  display: none !important;
}
#parkingLotPanel {
  width: 380px; min-width: 180px; max-width: 780px;
  padding: 10px; background:#e9eef6; border-right:1px solid #ccc;
  height:100vh; overflow:auto; box-sizing:border-box;
}
#workspace { flex:1; position:relative; height:100vh; overflow:auto; background:#fff; }
.v-resizer {
  width: 6px; cursor: col-resize; user-select:none;
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.12), rgba(0,0,0,0.06));
  flex: 0 0 6px;
}
.v-resizer:hover { background: rgba(79,107,237,0.25); }

canvas { border:1px solid #999; display:block; margin:10px; }

.store-background-toggle-box {
  margin: 6px 0 10px;
  padding: 10px;
  border: 1px solid #d8e0ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #fcfdff 0%, #f3f7ff 100%);
}
.store-background-toggle-title {
  font-size: 12px;
  font-weight: 900;
  color: #1d2a43;
  margin-bottom: 8px;
}
.store-background-toggle-btn {
  width: 100%;
  margin-bottom: 0 !important;
}
.default-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 10px;
}
.default-overview-grid > .card {
  height: 100%;
  box-sizing: border-box;
}
.default-branding-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.default-image-dropzone,
.custom-background-preview-box {
  width: 100%;
  min-height: 150px;
  border: 2px solid #b7bfd0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef3f9 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  caret-color: transparent;
}
.default-image-dropzone:focus,
.custom-background-preview-box:focus {
  outline: none;
  border-color: #4f6bed;
  box-shadow: 0 0 0 3px rgba(79,107,237,0.18);
}
.default-image-dropzone-img,
.custom-background-preview-box img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.default-image-dropzone-img {
  object-fit: contain;
  padding: 10px;
  box-sizing: border-box;
}
.default-image-dropzone-text,
#customBackgroundPreviewPlaceholder {
  font-size: 11px;
  font-weight: 800;
  color: #5d6880;
  text-align: center;
  padding: 8px;
  white-space: normal;
  line-height: 1.25;
  max-width: 86%;
}
.custom-background-preview-shell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.custom-background-preview-viewbox {
  position: absolute;
  inset: 12px 18px;
  border: 2px solid rgba(255,255,255,0.92);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(18,34,52,0.28), inset 0 0 0 1px rgba(18,34,52,0.16);
  pointer-events: none;
}
.custom-background-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.custom-background-actions .mini-btn {
  flex: 1 1 0;
  padding: 0 10px;
  margin: 0;
}

.store-scene {
  position: absolute;
  inset: 0;
  transition: opacity 180ms ease;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.92) 0 5.8%, transparent 7.2%),
    radial-gradient(circle at 38% 10%, rgba(255,255,255,0.9) 0 5.4%, transparent 6.8%),
    radial-gradient(circle at 58% 10%, rgba(255,255,255,0.9) 0 5.4%, transparent 6.8%),
    radial-gradient(circle at 78% 12%, rgba(255,255,255,0.92) 0 5.8%, transparent 7.2%),
    linear-gradient(180deg, #d7e1ea 0%, #eef4f8 14%, #d3dbe3 14.1%, #c7d0d8 36%, #b7c1ca 36.1%, #cfd6dd 52%, #b7bfc8 52.1%, #95a0aa 63%, #727d88 78%, #5a626c 100%);
}
.store-scene::before,
.store-scene::after {
  content: "";
  position: absolute;
  inset: 0;
}
.store-scene::before {
  background:
    linear-gradient(90deg, rgba(49,61,74,0.24) 0 8.5%, transparent 11% 89%, rgba(49,61,74,0.24) 91.5% 100%),
    linear-gradient(180deg, rgba(255,255,255,0.34) 0 17%, transparent 17% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.22) 0 1px, transparent 1px 140px),
    linear-gradient(180deg, transparent 0 54%, rgba(16,24,34,0.2) 66%, rgba(10,16,23,0.36) 100%);
  mix-blend-mode: soft-light;
  opacity: 0.92;
}
.store-scene::after {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0 28%, transparent 40% 100%),
    radial-gradient(ellipse at 50% 32%, rgba(255,255,255,0.34) 0 10%, transparent 48%),
    radial-gradient(ellipse at 50% 78%, rgba(0,0,0,0.18) 0 24%, transparent 70%);
  opacity: 0.88;
}
.store-scene-header-band {
  position: absolute;
  left: 31%;
  top: 11%;
  width: 38%;
  height: 11%;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(44,56,69,0.96) 0%, rgba(28,38,49,0.94) 100%);
  box-shadow: 0 18px 34px rgba(8, 15, 23, 0.28), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.store-scene-coolers {
  position: absolute;
  left: 57%;
  right: 6%;
  top: 21%;
  height: 31%;
  border-radius: 10px 10px 18px 18px;
  background:
    linear-gradient(180deg, rgba(241,247,252,0.98) 0%, rgba(205,215,226,0.98) 100%),
    repeating-linear-gradient(90deg,
      rgba(247,250,253,0.94) 0 15%,
      rgba(105,118,132,0.94) 15% 16.2%,
      rgba(231,238,245,0.96) 16.2% 31%,
      rgba(105,118,132,0.94) 31% 32.2%);
  box-shadow: inset 0 0 0 2px rgba(100,113,126,0.3), 0 18px 28px rgba(13, 21, 31, 0.18);
  transform: perspective(1400px) rotateY(-18deg);
  transform-origin: left center;
}
.store-scene-aisles {
  position: absolute;
  left: 10%;
  right: 12%;
  top: 30%;
  height: 30%;
  background:
    linear-gradient(90deg,
      rgba(74,86,100,0.72) 0 8%,
      rgba(214,221,228,0.16) 8% 14%,
      transparent 14% 36%,
      rgba(74,86,100,0.72) 36% 45%,
      rgba(214,221,228,0.18) 45% 50%,
      transparent 50% 70%,
      rgba(74,86,100,0.76) 70% 80%,
      rgba(214,221,228,0.18) 80% 85%,
      transparent 85% 100%),
    linear-gradient(180deg, rgba(33,44,55,0.08) 0%, rgba(15,24,34,0.36) 100%);
  transform: perspective(1350px) rotateX(73deg);
  transform-origin: center top;
  filter: blur(0.7px);
  opacity: 0.94;
}
.store-scene-counter {
  position: absolute;
  left: 17%;
  top: 24%;
  width: 18%;
  height: 15%;
  border-radius: 10px 10px 14px 14px;
  background:
    linear-gradient(180deg, rgba(89,102,116,0.96) 0%, rgba(50,61,72,0.94) 100%);
  box-shadow: 0 16px 28px rgba(9, 15, 22, 0.22);
  transform: perspective(1200px) rotateY(12deg);
}
.store-scene-register-glow {
  position: absolute;
  left: 21%;
  top: 21%;
  width: 10%;
  height: 7%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(141,235,255,0.9) 0%, rgba(128,224,246,0.28) 34%, transparent 72%);
  filter: blur(7px);
}
.store-scene-floor {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 44%;
  background:
    linear-gradient(180deg, rgba(224,230,236,0.2) 0 12%, rgba(116,127,138,0.34) 12% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 2px, transparent 2px 102px),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.16) 0 2px, transparent 2px 62px),
    linear-gradient(90deg, rgba(74,84,95,0.12) 0 32%, rgba(255,255,255,0.08) 50%, rgba(74,84,95,0.12) 68% 100%);
  transform: perspective(1280px) rotateX(78deg);
  transform-origin: center top;
  box-shadow: inset 0 40px 48px rgba(255,255,255,0.08);
}
.store-scene-lot {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 10%;
  height: 18%;
  background:
    linear-gradient(90deg,
      rgba(63,74,87,0.68) 0 19%,
      transparent 19% 26%,
      rgba(63,74,87,0.68) 26% 46%,
      transparent 46% 54%,
      rgba(63,74,87,0.68) 54% 74%,
      transparent 74% 81%,
      rgba(63,74,87,0.68) 81% 100%),
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(28,38,49,0.28) 100%);
  transform: perspective(1180px) rotateX(78deg);
  transform-origin: center top;
  opacity: 0.64;
  filter: blur(0.6px);
}
.store-scene-sign {
  position: absolute;
}
.store-scene-sign-primary {
  left: 50%;
  top: 12.6%;
  width: min(28vw, 340px);
  height: 8.4%;
  transform: translateX(-50%);
}
.store-scene-sign-window {
  left: 34%;
  top: 24%;
  width: min(12vw, 150px);
  height: 6.8%;
}
.store-scene-sign-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(236,241,247,0.98) 100%);
  box-shadow: 0 10px 18px rgba(8, 14, 22, 0.24), inset 0 0 0 1px rgba(137,151,167,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.store-scene-sign-window-frame {
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(246,250,255,0.94) 0%, rgba(225,233,242,0.9) 100%);
  box-shadow: 0 8px 14px rgba(8, 14, 22, 0.16), inset 0 0 0 1px rgba(149,163,178,0.75);
}
.store-scene-sign-frame img {
  display: none;
  width: calc(100% - 16px);
  height: calc(100% - 14px);
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.18));
}
.store-scene-sign-frame [data-store-bg-logo-placeholder] {
  font-size: clamp(12px, 1.3vw, 20px);
  font-weight: 900;
  color: #4d5b71;
  letter-spacing: 0;
  text-align: center;
  padding: 0 8px;
}

body.store-background-enabled #storeSceneBackground {
  opacity: 1;
}
body.store-background-enabled #parkingLotPanel,
body.store-background-enabled #workspace {
  background: transparent;
}
body.store-background-enabled #parkingLotPanel {
  box-shadow: inset -1px 0 0 rgba(168, 184, 202, 0.45);
}
body.store-background-enabled #parkingLotItems .parking-wrap {
  background: rgba(247, 250, 255, 0.84);
  box-shadow: 0 10px 16px rgba(21, 33, 48, 0.1);
}
body.store-background-enabled #shelfBreakdownPanel {
  background: rgba(248, 251, 255, 0.9);
  backdrop-filter: blur(4px);
}
body.store-background-enabled #workspace canvas {
  border-color: rgba(80, 96, 114, 0.66);
  box-shadow: 0 18px 36px rgba(14, 22, 34, 0.14);
}
body.store-background-enabled #workspaceLogoSlot {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(239,244,250,0.9) 100%);
}

@media (max-width: 1080px) {
  .default-overview-grid {
    grid-template-columns: 1fr;
  }
}

.background-editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  padding: 14px;
  height: 100%;
  box-sizing: border-box;
}
.background-editor-stage-wrap {
  min-width: 0;
  min-height: 0;
  border: 1px solid #ced8e8;
  border-radius: 8px;
  background: #eef4fb;
  padding: 12px;
  box-sizing: border-box;
}
.background-editor-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(176,188,204,0.26) 25%, transparent 25%, transparent 75%, rgba(176,188,204,0.26) 75%),
    linear-gradient(45deg, rgba(176,188,204,0.26) 25%, transparent 25%, transparent 75%, rgba(176,188,204,0.26) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}
.background-editor-image {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}
.background-editor-viewbox {
  position: absolute;
  inset: 48px 72px;
  border: 3px solid rgba(255,255,255,0.96);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(15,23,35,0.28), inset 0 0 0 1px rgba(15,23,35,0.18);
  pointer-events: none;
}
.background-editor-viewbox-label {
  position: absolute;
  top: -30px;
  left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15,23,35,0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.background-editor-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 16px;
  font-weight: 800;
  color: #516078;
}
.background-editor-controls {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ced8e8;
  border-radius: 8px;
  background: #f8fbff;
  box-sizing: border-box;
}
.background-editor-controls label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
  color: #334155;
}
.background-editor-controls input[type="range"] {
  width: 100%;
  margin: 0;
}
.background-editor-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.background-editor-actions .mini-btn {
  width: 100% !important;
  margin: 0;
}
@media (max-width: 980px) {
  .background-editor-shell {
    grid-template-columns: 1fr;
  }
  .background-editor-stage {
    min-height: 360px;
  }
}

/* =========================
   ACCORDION
========================= */
.section-toggle {
  width:100%; padding:8px 14px; background:#f2f2f2; border:2px solid #000;
  font-size:12px; font-weight:bold; text-align:left; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  box-sizing:border-box;
}
.section-toggle::after { content:"▶"; font-size:10px; }
.section-toggle:not(.collapsed)::after { content:"▼"; }
.section-panel { padding:6px; border:1px solid #ccc; border-top:none; background:#f7f9fd; }
.section-panel.collapsed { display:none; }
.section-split-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: stretch;
}
.section-split-row .section-toggle {
  margin-bottom: 0;
  min-width: 0;
  flex: 1 1 50%;
}
.section-split-row .section-toggle.split-left {
  flex: 1 1 50%;
  width: calc(50% - 3px);
}
.section-split-row .section-toggle.split-right {
  flex: 1 1 50%;
  width: calc(50% - 3px);
}

#controls input[type="text"],
#controls input[type="number"],
#controls input[type="search"],
#controls select,
#controls button { width:100%; height:28px; margin-bottom:8px; box-sizing:border-box; }

#controls select { border-radius:4px; border:1px solid #ccc; padding:2px 6px; font-size:12px; background:#fff; }
#controls input[type="radio"] { width:auto; height:auto; margin:0; }
#controls .section-split-row .section-toggle {
  width: auto !important;
  margin-bottom: 0 !important;
  height: 28px;
  padding: 6px 8px;
}

#quickAddPanel label {
  font-size: 10px;
  margin-bottom: 2px;
}
#quickAddPanel input[type="text"],
#quickAddPanel input[type="number"],
#quickAddPanel select,
#quickAddPanel button {
  height: 24px !important;
  margin-bottom: 4px !important;
  font-size: 11px;
}
#quickAddPanel .file-upload {
  padding: 6px 8px;
  font-size: 11px;
}
#quickAddPanel #fileName {
  margin-bottom: 4px;
}

#promoManagerPanel,
#rebateManagerPanel {
  margin-top: 0;
}
.promo-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.promo-toolbar .mini-btn {
  height: 24px;
  padding: 0 8px;
  font-size: 10px;
  width: auto !important;
  margin-bottom: 0 !important;
}
.promo-grid-wrap {
  border: 1px solid #d7e0ef;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  max-height: 245px;
}
.promo-grid {
  display: grid;
  grid-template-columns: 130px 150px 72px 72px 110px 98px 92px 92px 92px 84px 180px;
  gap: 6px;
  align-items: center;
  min-width: 1240px;
  font-size: 11px;
}
.promo-grid-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3ff;
  font-weight: 900;
  border-bottom: 1px solid #d7e3fb;
  padding: 6px;
}
.promo-row {
  display: grid;
  grid-template-columns: 130px 150px 72px 72px 110px 98px 92px 92px 92px 84px 180px;
  gap: 6px;
  align-items: center;
  min-width: 1240px;
  padding: 5px 6px;
  border-bottom: 1px solid #edf1f8;
  font-size: 11px;
  background: #fff;
}
.promo-row:last-child {
  border-bottom: none;
}
.promo-row > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.promo-empty {
  padding: 8px;
  font-size: 11px;
  color: #566178;
}
.promo-form-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.promo-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 6px 8px;
}
.promo-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  font-weight: 800;
  color: #2f3d56;
}
.promo-form-grid input,
.promo-form-grid select {
  height: 24px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 11px;
  box-sizing: border-box;
}
.promo-form-actions {
  display: flex;
  gap: 6px;
}
.promo-form-actions .mini-btn {
  height: 24px;
  width: auto !important;
  padding: 0 10px;
  margin-bottom: 0 !important;
}

@media (max-width: 980px) {
  .promo-form-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

/* =========================
   PARKING LOT (scoped + no white boxes)
========================= */

#parkingLotItems{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 6px;
  justify-items: center;
  align-items: start;
  padding: 4px;
}

#parkingLotItems .parking-wrap{
  width: 74px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 3px;
  justify-items: center;
  border-radius: 12px;
  padding: 4px 3px 3px;
  transition: box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

#parkingLotItems .parking-wrap.parking-wrap-selected{
  background: rgba(26, 153, 74, 0.08);
  box-shadow: 0 0 0 1px rgba(56, 161, 105, 0.5), 0 0 12px rgba(74, 222, 128, 0.28);
}

#parkingLotItems img.parking-item{
  width: 68px;
  height: 50px;
  object-fit: contain;
  display: block;
  cursor: grab;
  user-select: none;

  /* remove the “white box” look */
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#parkingLotItems img.parking-item:active{
  cursor: grabbing;
}

#parkingLotItems .parking-item-fallback{
  width: 68px;
  height: 50px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:6px;
  box-sizing:border-box;
  font-size:9px;
  font-weight:800;
  color:#222;
  background:#ffffff;
  border:1px solid #b8c2d0;
  border-radius:6px;
  cursor:grab;
  user-select:none;
}

#parkingLotItems .parking-tag{
  min-width: 28px;
  height: 12px;
  padding: 0 3px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}


/* =========================
   SAVED PLANOGRAMS
========================= */
#savePlanogramPanel { background:#f9f9f9; border-radius:6px; }
.planogram-list { max-height:160px; overflow:auto; border:1px solid #ddd; background:#fff; padding:4px; }
.planogram-item { display:flex; align-items:center; gap:6px; padding:6px; font-size:12px; cursor:pointer; border-radius:4px; }
.planogram-item:hover { background:#eef3ff; }
.saved-planogram-group { margin-top: 8px; }
.saved-planogram-group-title {
  font-size: 12px;
  font-weight: 900;
  color: #223659;
  margin: 0 0 4px;
}
.planogram-item-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.planogram-item-copy.scanned {
  width: 100%;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px;
}
.planogram-photo-thumb {
  width: 54px;
  min-width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid #c7d5ec;
  background: #eef3fb;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}
.planogram-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.planogram-photo-thumb-empty {
  font-size: 9px;
  line-height: 1.1;
  font-weight: 900;
  color: #647898;
  text-align: center;
  padding: 4px;
}
.planogram-copy-main {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}
.planogram-section-badge,
.planogram-store-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}
.planogram-section-badge {
  background: #dfe9ff;
  color: #17335d;
  border: 1px solid #9bb4ea;
}
.planogram-store-badge {
  background: #eef5e6;
  color: #30521d;
  border: 1px solid #a5c48d;
}
.planogram-item-text {
  color: #20314f;
  font-size: 9px;
  line-height: 1.25;
}
.planogram-preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f8fe;
  padding: 12px;
  overflow: auto;
}
.planogram-preview-body img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid #c7d5ec;
  background: #fff;
  box-shadow: 0 8px 30px rgba(17, 38, 78, 0.12);
}
.planogram-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 32, 58, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 36px rgba(0,0,0,0.24);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.planogram-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.planogram-toast.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}
.save-actions { display:flex; gap:6px; margin-top:8px; }
.save-actions button { height:24px; font-size:11px; padding:0 6px; border-radius:4px; }
.primary-btn { background:#4f6bed; color:#fff; border:none; }
.secondary-btn { background:#eee; border:1px solid #ccc; }
.danger-btn { background:#ffe9e9; border:1px solid #d55; color:#b00; font-weight:900; }

/* =========================
   WORKSPACE BUTTONS (lower-left)
========================= */
#workspaceControls {
  position:absolute; left:16px; bottom:220px; z-index:30;
  display:flex; flex-direction:column; gap:8px; pointer-events:none;
}
#workspaceControls button { width:86px; height:30px; padding:0; pointer-events:auto; border-radius:6px; }
#workspaceControls .small { width:44px; }

#shelfBreakdownPanel {
  margin: 10px;
  margin-top: 0;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
  min-width: 760px;
}
#shelfBreakdownPanel h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
}
.shelf-breakdown-head,
.shelf-breakdown-row {
  display: grid;
  grid-template-columns: 170px 150px 1fr 80px 80px 80px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.shelf-breakdown-head {
  font-weight: 900;
  padding: 6px 8px;
  border: 1px solid #dbe4f3;
  border-radius: 6px;
  background: #edf3ff;
}
.shelf-breakdown-gondola {
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e1edff;
  border: 1px solid #c8dbfb;
  font-size: 12px;
  font-weight: 900;
}
.shelf-breakdown-row {
  padding: 5px 8px;
  border-bottom: 1px solid #e8eef8;
}
.shelf-breakdown-row:last-child {
  border-bottom: none;
}
.shelf-breakdown-empty {
  margin-top: 8px;
  font-size: 12px;
  color: #556079;
}

.gondola-header-dims-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 4px;
}

.gondola-header-dims-card {
  border: 1px solid #d9e3f5;
  border-radius: 12px;
  padding: 8px;
  background: #f8fbff;
}

.gondola-header-dims-card-title {
  font-size: 12px;
  font-weight: 900;
  color: #334155;
  margin-bottom: 6px;
}

.gondola-header-dims-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.gondola-header-dims-grid label {
  display: grid;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
}

.gondola-header-dims-grid input {
  width: 100%;
  max-width: 84px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #bfd0ec;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

/* =========================
   SIMPLE LIST ROWS
========================= */
.product-row {
  display:flex; justify-content:flex-start; align-items:flex-start; gap:10px;
  margin:8px 0; padding:6px; border:1px solid #d7dbe6; border-radius:6px; background:#fff;
}
.product-row .product-main {
  display:grid;
  grid-template-columns: 40px 1fr;
  gap:8px;
  align-items:start;
  min-width:0;
}
.product-row .product-main .product-text {
  min-width:0;
}
.product-row .product-main .product-name {
  font-size:12px;
  font-weight:900;
  line-height:1.2;
}
.product-row .product-main .product-upc {
  font-size:11px;
  color:#444;
}
.product-row .product-main .product-flags {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:4px;
  align-items:center;
}
.product-row .pl-add-btn {
  height:16px;
  min-width:24px;
  padding:0 4px;
  font-size:9px;
  border-radius:6px;
  line-height:1;
}
.product-row .pl-add-btn[disabled] {
  opacity:0.6;
  cursor:default;
}
.product-thumb img { width:36px; height:36px; object-fit:contain; border-radius:4px; border:1px solid #ccc; background:#fff; }

.pl-manager-controls {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:6px;
}
.pl-manager-controls select,
.pl-manager-controls input {
  width:100%;
  height:28px;
  box-sizing:border-box;
}

/* =========================
   MODALS
========================= */
.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:999; display:none; }
.modal {
  position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
  width:min(980px, calc(100vw - 40px)); height:min(740px, calc(100vh - 40px));
  background:#fff; border:2px solid #000; border-radius:10px; z-index:1000;
  display:none; box-shadow:0 12px 40px rgba(0,0,0,0.35); overflow:hidden;
}
#setupModal.modal {
  width:min(1680px, calc(100vw - 128px));
  height:min(820px, calc(100vh - 24px));
}
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; background:#f2f2f2; border-bottom:1px solid #ccc; }
.modal-title { font-weight:900; font-size:14px; }
.modal-close { width:32px; height:32px; border-radius:8px; font-weight:900; cursor:pointer; }
.modal-body { height:calc(100% - 54px); display:flex; flex-direction:column; }
.modal-tabs { display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid #ddd; background:#fafafa; }
.tab-btn { height:30px; padding:0 10px; border-radius:8px; border:1px solid #999; background:#fff; font-size:12px; cursor:pointer; font-weight:800; }
.tab-btn.active { background:#4f6bed; color:#fff; border-color:#4f6bed; }
.modal-content { padding:12px; overflow:auto; flex:1; }
.gondola-build-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gondola-build-section {
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  background: #f7f9ff;
  padding: 10px;
}
.gondola-build-label {
  font-size: 13px;
  font-weight: 900;
  color: #1c2a44;
  margin-bottom: 8px;
}
.gondola-build-radio-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
}
.gondola-build-help {
  margin-top: 6px;
  font-size: 11px;
  color: #5b6579;
}
.gondola-build-dims {
  display: grid;
  gap: 10px;
}
.gondola-build-dims.same {
  grid-template-columns: minmax(0, 1fr);
}
.gondola-build-dims.per-bay {
  grid-template-columns: 1fr;
}
.gondola-build-dim-card {
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.gondola-build-dim-card-title {
  font-size: 12px;
  font-weight: 900;
  color: #1c2a44;
  margin-bottom: 8px;
}
.gondola-build-dim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 190px));
  column-gap: 16px;
  row-gap: 8px;
  justify-content: start;
  align-items: start;
}
.gondola-build-dim-grid.single {
  grid-template-columns: repeat(2, minmax(0, 190px));
}
.gondola-build-dim-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  min-width: 0;
}
.gondola-build-dim-grid input {
  width: 100%;
  max-width: 120px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #c8d2e6;
  padding: 0 10px;
  box-sizing: border-box;
  font-size: 12px;
}
@media (max-width: 620px) {
  .gondola-build-dim-grid,
  .gondola-build-dim-grid.single {
    grid-template-columns: 1fr;
  }
}
.gondola-build-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.gondola-build-save {
  background: #4f6bed;
  color: #fff;
  border-color: #4f6bed;
}

.card { border:1px solid #ddd; border-radius:10px; padding:10px; background:#fff; margin-bottom:10px; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.row input[type="text"] { height:30px; padding:4px 8px; border-radius:8px; border:1px solid #ccc; font-size:12px; flex:1; min-width:220px; box-sizing:border-box; }
.row textarea { width:100%; min-height:90px; padding:8px; border-radius:8px; border:1px solid #ccc; font-size:12px; box-sizing:border-box; resize:vertical; }
.mini-btn { height:26px; padding:0 10px; font-size:12px; border-radius:8px; cursor:pointer; }
.setup-split { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#panelSite .setup-split { grid-template-columns: 1fr 1.6fr 0.5fr; }
#panelSite .site-setup-card { padding: 8px; min-height: 96px; }
#panelSite .site-setup-card .row input[type="text"] { height: 24px; }
#panelSite .site-setup-card .row .mini-btn { height: 22px; padding: 0 8px; }
#panelSite .site-setup-help { font-size: 11px !important; line-height: 1.2; margin-bottom: 4px !important; }
#panelSite .site-setup-textarea { min-height: 28px !important; max-height: 34px; font-size: 11px; }
#panelSite .site-logo-upload { display:inline-flex; align-items:center; justify-content:center; height:24px; padding:0 8px; font-size:11px; }
#panelSite .site-paste-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:4px; }
#panelSite .site-paste-actions { display:flex; gap:4px; }
#panelSite .site-paste-actions .mini-btn { height:20px; padding:0 6px; font-size:10px; margin:0; }

.company-logo-slot {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 108px;
  height: 74px;
  z-index: 32;
  border: 1px solid #9aa6bd;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(240,244,250,0.98) 100%);
  box-shadow: 0 8px 18px rgba(25, 41, 69, 0.12), inset 0 0 0 1px rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: block;
  pointer-events: auto;
  overflow: hidden;
}
.startup-loader.is-hidden {
  display: none;
}
.startup-loader.is-fading {
  pointer-events: none;
}
.startup-loader-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.78) 0%, rgba(234,241,251,0.82) 35%, rgba(189,204,227,0.92) 100%),
    linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(214,225,241,0.95) 100%);
  backdrop-filter: blur(8px);
  transition: opacity 520ms ease;
}
.startup-loader.is-fading .startup-loader-backdrop {
  opacity: 0;
}
.startup-loader-sign {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(34vw, 360px);
  min-width: 250px;
  aspect-ratio: 1.5;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  pointer-events: none;
}
.startup-loader-sign-body {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform-style: preserve-3d;
}
.startup-loader-sign-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -18%;
  height: 26%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(30,46,72,0.28) 0%, rgba(30,46,72,0.12) 45%, rgba(30,46,72,0) 78%);
  filter: blur(10px);
  opacity: 0.9;
  transform: translateZ(-1px);
  animation: startupLoaderShadowPulse 1.8s ease-in-out infinite;
}
.startup-loader-sign-frame {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(240,244,250,0.96) 100%);
  border: 3px solid rgba(144,163,194,0.95);
  box-shadow:
    10px 26px 42px rgba(28,42,70,0.24),
    inset 0 2px 0 rgba(255,255,255,0.95),
    inset 0 -10px 18px rgba(151,170,200,0.16);
  overflow: hidden;
}
.startup-loader-sign-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(169,187,212,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.startup-loader-sign-frame::after {
  content: "";
  position: absolute;
  left: 14%;
  top: 8%;
  width: 72%;
  height: 26%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.76) 0%, rgba(255,255,255,0.08) 100%);
  filter: blur(2px);
}
.startup-loader-sign img,
#startupLoaderLogoPlaceholder {
  position: relative;
  z-index: 1;
}
.startup-loader-sign img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 18px;
}
#startupLoaderLogoPlaceholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b5e7c;
  text-align: center;
}
.startup-loader-message {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 10px 20px rgba(39,57,89,0.12);
  transition: opacity 240ms ease, transform 320ms ease;
}
.startup-loader-message-text {
  color: #314563;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.startup-loader-progress {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(206,217,233,0.95) 0%, rgba(182,196,218,0.98) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.82),
    inset 0 -1px 2px rgba(72,92,126,0.18);
}
.startup-loader-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(61,99,160,0) 0%, rgba(108,160,235,0.35) 14%, rgba(240,248,255,0.98) 50%, rgba(108,160,235,0.35) 86%, rgba(61,99,160,0) 100%);
  box-shadow:
    0 0 20px rgba(79,125,194,0.58),
    0 0 8px rgba(201,228,255,0.85),
    inset 0 1px 0 rgba(255,255,255,0.72);
  animation: startupLoaderProgress 2.2s ease-in-out infinite alternate;
}
body.startup-loading #leftPanel,
body.startup-loading #workspace,
body.startup-loading #storeSceneBackground {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 760ms ease,
    filter 760ms ease,
    transform 760ms cubic-bezier(0.22, 0.8, 0.2, 1);
}
body.startup-revealing #leftPanel,
body.startup-revealing #workspace,
body.startup-revealing #storeSceneBackground {
  opacity: 1;
  filter: blur(0);
  transform: none;
}
.startup-loader.is-fading .startup-loader-message {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}
.startup-loader-sign.is-spinning .startup-loader-sign-body {
  animation: startupLoaderSpin 2.8s linear infinite;
}
.startup-loader-sign.is-settling .startup-loader-sign-body {
  animation: startupLoaderSettle 320ms ease-out forwards;
}
@keyframes startupLoaderSpin {
  0% { transform: perspective(1400px) rotateX(10deg) rotateY(0deg) rotateZ(-1deg); }
  25% { transform: perspective(1400px) rotateX(13deg) rotateY(90deg) rotateZ(0deg); }
  50% { transform: perspective(1400px) rotateX(10deg) rotateY(180deg) rotateZ(1deg); }
  75% { transform: perspective(1400px) rotateX(7deg) rotateY(270deg) rotateZ(0deg); }
  100% { transform: perspective(1400px) rotateX(10deg) rotateY(360deg) rotateZ(-1deg); }
}
@keyframes startupLoaderSettle {
  0% { transform: perspective(1400px) rotateX(8deg) rotateY(0deg) scale(1); }
  100% { transform: perspective(1400px) rotateX(0deg) rotateY(0deg) scale(1); }
}
@keyframes startupLoaderShadowPulse {
  0%, 100% { transform: translateZ(-1px) scale(0.92); opacity: 0.72; }
  50% { transform: translateZ(-1px) scale(1.02); opacity: 0.95; }
}
@keyframes startupLoaderProgress {
  0% { transform: translateX(-18%); }
  100% { transform: translateX(258%); }
}
@media (max-width: 700px) {
  .startup-loader-sign {
    width: min(64vw, 320px);
    min-width: 220px;
  }
  .startup-loader-message-text {
    font-size: 11px;
    letter-spacing: 0.06em;
  }
}
.company-logo-slot.has-logo { border-color: #a8b5cc; background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(243,246,251,0.99) 100%); }
.company-logo-slot img {
  display: none;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.company-logo-slot .company-logo-text,
#workspaceCompanyLogoPlaceholder,
#fpCompanyLogoPlaceholder {
  font-size: 11px;
  font-weight: 800;
  color: #58647e;
  text-align: center;
  padding: 4px;
}
.fp-company-logo-slot {
  z-index: 60;
  left: 10px;
  top: 10px;
  width: 96px;
  height: 62px;
}

.fp-stylebar {
  position: absolute;
  z-index: 90;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 4px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #aebbd4;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
.fp-stylebar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 800;
  color: #25324a;
}
.fp-stylebar select {
  height: 16px;
  min-width: 34px;
  font-size: 9px;
}
.fp-stylebar button {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  font-size: 9px;
  border-radius: 3px;
  box-shadow: none;
}
.fp-fixture-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fp-section-inline-toggle {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  border-radius: 4px !important;
}
.fp-radius-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.fp-radius-controls button {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
}
.fp-section-picker {
  position: absolute;
  z-index: 91;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.fp-section-picker > button {
  display: none;
}
.fp-section-picker-list {
  width: min(420px, calc(100vw - 80px));
  max-height: 196px;
  overflow: auto;
  border: 1px solid #aebbd4;
  border-radius: 8px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.fp-section-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 22px;
  padding: 0 7px;
  border: 1px solid #c2cee3;
  border-radius: 4px;
  background: #f7faff;
  font-size: 9px;
  font-weight: 800;
  color: #233148;
}
.fp-section-picker-item:last-child {
  margin-bottom: 0;
}
.fp-section-picker-empty {
  font-size: 8px;
  font-weight: 800;
  color: #445473;
  padding: 2px 4px;
}
.fp-swatch-grid {
  display: grid;
  grid-template-columns: repeat(8, 10px);
  gap: 2px;
}
.fp-swatch-row {
  display: flex;
  gap: 2px;
}
.fp-swatch-btn {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  border: 1px solid #3f4d66;
  border-radius: 2px !important;
  padding: 0 !important;
}
.fp-swatch-btn.active {
  outline: 1px solid #1d2e45;
  outline-offset: 1px;
}

.fp-tool-rail {
  position: sticky;
  top: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.fp-tool-rail .mini-btn {
  width: 100%;
  height: 24px;
  padding: 0 6px;
  font-size: 10px;
}

.fp-legend-sticky {
  position: absolute;
  right: 8px;
  bottom: 38px;
  z-index: 80;
  background: rgba(255,255,255,0.92);
  border: 1px solid #aebbd4;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.35;
  color: #1f2f45;
  min-width: 150px;
}

.fp-designer-layout {
  display: grid;
  grid-template-columns: 280px 160px 1fr;
  gap: 10px;
}
.fp-designer-layout.fp-controls-collapsed {
  grid-template-columns: 40px 160px 1fr;
}
.fp-designer-layout.fp-tools-collapsed {
  grid-template-columns: 280px 40px 1fr;
}
.fp-designer-layout.fp-controls-collapsed.fp-tools-collapsed {
  grid-template-columns: 40px 40px 1fr;
}
.fp-designer-controls {
  padding: 8px;
  min-width: 0;
}
.fp-designer-controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.fp-designer-controls-head .mini-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  font-size: 11px;
}
.fp-designer-layout.fp-controls-collapsed .fp-designer-controls {
  overflow: hidden;
}
.fp-designer-layout.fp-controls-collapsed .fp-designer-controls > *:not(.fp-designer-controls-head) {
  display: none;
}
.fp-designer-layout.fp-controls-collapsed .fp-designer-controls-head {
  justify-content: center;
}
.fp-designer-layout.fp-controls-collapsed .fp-designer-controls-head > div {
  display: none;
}

.fp-tools-column {
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-height: 640px;
  min-width: 0;
}
.fp-tools-column-head {
  font-size: 10px;
  font-weight: 900;
  color: #233148;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.fp-tools-column-head .mini-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  font-size: 11px;
}
.fp-designer-layout.fp-tools-collapsed .fp-tools-column {
  overflow: hidden;
}
.fp-designer-layout.fp-tools-collapsed .fp-tools-column > *:not(.fp-tools-column-head) {
  display: none;
}
.fp-designer-layout.fp-tools-collapsed .fp-tools-column-head {
  justify-content: center;
}
.fp-designer-layout.fp-tools-collapsed .fp-tools-column-head > span {
  display: none;
}

.fp-section-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.fp-section-select-row select {
  width: 100%;
  min-width: 0;
}
.fp-designer-controls input,
.fp-designer-controls select {
  min-width: 0;
}

.fp-add-preview-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.fp-orient-preview {
  border: 1px solid #bcc9df;
  border-radius: 8px;
  background: #f8fbff;
  height: 42px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fp-orient-preview-rect {
  width: 40px;
  height: 21px;
  border: 2px solid #2f62c9;
  background: rgba(66,133,244,0.18);
  border-radius: 4px;
}
.fp-orient-preview-text {
  position: absolute;
  inset: 4px 4px 12px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  color: #233148;
  line-height: 0.95;
  pointer-events: none;
  overflow: hidden;
}
.fp-orient-preview-dims {
  position: absolute;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  color: #233148;
  background: rgba(248, 251, 255, 0.9);
  padding: 0 2px;
  border-radius: 3px;
}

.list { border:1px solid #ddd; border-radius:10px; padding:6px; max-height:320px; overflow:auto; background:#fff; }
.list-header {
  display:grid; grid-template-columns: 1fr 260px auto; gap:10px;
  padding:8px; border:1px solid #eee; border-radius:8px; background:#fff;
  font-size:12px; font-weight:900; margin-bottom:8px;
}
.list-item {
  display:grid; grid-template-columns: 1fr 260px auto; gap:10px; align-items:center;
  padding:8px; border:1px solid #eee; border-radius:8px; background:#fafafa; margin:6px 0;
  font-size:12px;
}
#sectionsList .list-item { margin:3px 0; }
#panelMerch .merch-sections-header,
#sectionsList .list-item {
  grid-template-columns: minmax(0, 1fr) 110px 260px auto;
}
.merch-cooler-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.list-item:hover { background:#eef3ff; border-color:#d9e2ff; }
.nacs-group {
  background:#eaf3ff;
  border:1px solid #cfe0ff;
  border-radius:10px;
  padding:6px;
  margin:8px 0;
}
.nacs-row {
  margin:4px 0;
  background:#f8fbff;
}
.subcat-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.subcat-select-wrap > select {
  width: 100%;
  padding-right: 22px;
  box-sizing: border-box;
}
.subcat-help-inside {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border: 1px solid #1f2f45;
  border-radius: 999px;
  color: #1f2f45;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  pointer-events: none;
}
.pd-image-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-image-box {
  width: 72px;
  height: 72px;
  border: 1px solid #9aa7bf;
  border-radius: 8px;
  background: #eef3fb;
  color: #22314a;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  box-sizing: border-box;
  cursor: pointer;
  overflow: hidden;
}
.pd-image-box img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.pd-deal-wrap {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}
.pd-deal-highlight {
  background: #e8f6e8;
  border: 1px solid #b7dcb7;
  border-radius: 8px;
  padding: 6px 8px;
}
#productDetailModal .modal-header {
  padding: 6px 8px;
}
#productDetailModal {
  display: none;
  flex-direction: column;
  height: auto !important;
  max-height: calc(100vh - 24px);
}
#productDetailModal > div:last-child {
  display: block;
}
#productDetailModal .modal-title {
  font-size: 13px;
}
#productDetailModal .modal-close {
  width: 28px;
  height: 28px;
}
#productDetailBody {
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.pd-zoom-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 28, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}
.pd-zoom-modal {
  position: relative;
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 16px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(174, 187, 212, 0.9);
  background: #fff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-zoom-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #9aa7bf;
  background: linear-gradient(180deg, #ffffff 0%, #e9eef7 100%);
  font-size: 20px;
  font-weight: 900;
}
.pd-zoom-image-wrap {
  min-height: 220px;
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-zoom-image-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 12px;
}
.pd-deal-promo { grid-column: 1; grid-row: 1; }
.pd-deal-contract { grid-column: 1; grid-row: 2; }
.pd-deal-rebate { grid-column: 2; grid-row: 1; }
#productDetailBody .list-header {
  padding: 5px 6px;
  margin-bottom: 0;
  font-size: 11px;
}
#productDetailBody .list-item {
  margin: 2px 0;
  padding: 4px 5px;
  gap: 5px;
}
#productDetailBody input,
#productDetailBody select {
  height: 18px !important;
  font-size: 10px;
  padding: 0 5px;
}
#productDetailModal .mini-btn {
  height: 22px;
  padding: 0 8px;
  font-size: 10px;
}
.pd-detail-wrap { display:flex; flex-direction:column; gap:3px; }
.pd-top-row {
  display:grid;
  grid-template-columns: 68px 1fr;
  gap:5px;
  align-items:start;
}
.pd-top-row > div:last-child {
  min-width: 0;
}
.pd-mini-label { font-size:10px; font-weight:800; color:#2e3c55; margin-bottom:2px; }
.pd-mini-value { font-size:11px; line-height:1.2; word-break:break-word; }
.pd-mini-value-strong { font-weight:800; }
.pd-mini-input { width:100%; box-sizing:border-box; }
.pd-flat-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: 16px !important;
  cursor: pointer;
}
.pd-input-strong {
  font-weight:800;
}
.pd-flat-input.editing {
  border: 1px solid #9aa7bf !important;
  background: #fff !important;
  padding: 0 5px !important;
  cursor: text;
}
.pd-flat-select-wrap {
  cursor: pointer;
}
.pd-flat-select {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: 16px !important;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.pd-inline-grid {
  display:grid;
  grid-template-columns: 74px 1fr;
  gap:3px 5px;
  align-items:center;
}
.pd-inline-grid > div { font-size:10px; line-height:1.1; }
.pd-inline-values {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.pd-inline-inputs {
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  align-items:end;
}
.pd-inline-field {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:10px;
  font-weight:700;
}
.pd-inline-field input {
  width:72px;
}
.pd-inline-check {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.pd-image-box.compact {
  width:64px;
  height:64px;
}
.left { display:flex; gap:8px; align-items:center; min-width:0; }
.name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:360px; }

.dims { display:flex; gap:6px; align-items:center; }
.mini-num { width:78px; height:26px; border-radius:8px; border:1px solid #ccc; padding:0 8px; font-size:12px; box-sizing:border-box; background:#fff; }

/* =========================
   PRODUCT MANAGER GRID (5 cols, scroll shows ~3 rows)
========================= */
.pm-filters {
  display:grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) 1fr;
  gap:8px; align-items:center; margin-bottom:10px;
}
.pm-filters select, .pm-filters input {
  height:30px; border-radius:8px; border:1px solid #ccc; padding:0 10px; font-size:12px; box-sizing:border-box; width:100%;
}
.pm-grid-wrap {
  border:1px solid #ddd; border-radius:12px; background:#fff; padding:10px;
  height:420px; overflow:auto; box-sizing:border-box;
}
.pm-grid { display:grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap:10px; }
.pm-card {
  border:1px solid #e4e7f2; border-radius:12px; padding:10px; background:#fbfcff;
  display:flex; flex-direction:column; gap:6px; min-height:130px; box-sizing:border-box;
}
.pm-top { display:grid; grid-template-columns: 48px 1fr; gap:8px; align-items:start; }
.pm-media { display:flex; flex-direction:column; align-items:center; gap:3px; }
.pm-thumb { width:40px; height:40px; border:1px solid #ccc; border-radius:8px; object-fit:contain; background:#fff; }
.pm-name { font-size:12px; font-weight:900; line-height:1.1; }
.pm-meta { font-size:10px; color:#444; line-height:1.1; }
.pm-flags { display:flex; flex-direction:column; gap:2px; align-items:center; width:100%; min-height:10px; }
.pm-flag { font-size:9px; font-weight:900; border:1px solid #000; border-radius:999px; padding:1px 4px; background:#fff; line-height:1; }
.pm-radio { display:grid; grid-template-columns: 1fr 1fr; gap:3px; font-size:11px; }
.pm-radio label { display:flex; gap:6px; align-items:center; font-size:11px; font-weight:800; }
.pm-radio .promo { grid-column: 1; grid-row: 1; }
.pm-radio .rebate { grid-column: 2; grid-row: 1; }
.pm-radio .contract { grid-column: 1; grid-row: 2; }
.pm-actions { margin-top:auto; display:grid; grid-template-columns: 1fr 1fr 1fr; gap:4px; }
.pm-actions button { height:20px; border-radius:8px; padding:0; font-size:10px; }

.app-build-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  line-height: 1;
  min-height: 20px;
  box-sizing: border-box;
}

.runtime-image-dial-row {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.runtime-image-dial {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #c8d5ea;
  border-radius: 999px;
  background: #fff;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.runtime-image-dial-title {
  font-size: 10px;
  font-weight: 800;
  color: #2a3d5c;
}

.runtime-image-dial-count {
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  border: 1px solid #8fa6c8;
  background: #eef4ff;
  color: #0f2748;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
