/* E-commerce Sales Analysis V31
   Universal touch/mouse table navigation, one Products menu,
   input-driven Inventory generation, and collision-free stacked messages. */
:root{
  --ecom-v31-green:#39ff14;
  --ecom-v31-pink:#ff1493;
  --ecom-v31-cyan:#26e6ff;
  --ecom-v31-yellow:#ffe600;
  --ecom-v31-black:#050506;
  --ecom-v31-paper:#f8fafc;
  --ecom-v31-pwa-clearance:76px;
  --ecom-v31-sonner-height:0px;
}

/* Hide only the duplicate CRUD Products trigger. The visible upper Products
   trigger controls that same management panel through the V31 bridge. */
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-duplicate-products-v31="true"]{
  display:none!important;
}

/* Every real table receives a viewport that works with touch, pen, mouse drag,
   keyboard arrows, trackpads, and ordinary scrollbars. */
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  overscroll-behavior-inline:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-x pan-y pinch-zoom!important;
  scrollbar-gutter:stable!important;
  scrollbar-width:auto!important;
  scrollbar-color:var(--ecom-v31-green) #050506!important;
  cursor:grab!important;
  outline:none!important;
  padding-bottom:.55rem!important;
  scroll-behavior:smooth!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]:focus-visible{
  outline:3px solid var(--ecom-v31-cyan)!important;
  outline-offset:3px!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"].is-dragging-v31{
  cursor:grabbing!important;
  scroll-behavior:auto!important;
  user-select:none!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]::-webkit-scrollbar{
  height:14px!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]::-webkit-scrollbar-track{
  background:#050506!important;
  border:1px solid #273244!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]::-webkit-scrollbar-thumb{
  min-width:72px!important;
  background:linear-gradient(90deg,var(--ecom-v31-green),var(--ecom-v31-cyan),var(--ecom-v31-pink))!important;
  border:3px solid #050506!important;
  border-radius:999px!important;
}

body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:.5rem!important;
  margin:.4rem 0 .5rem!important;
  color:#dbeafe!important;
  font:900 .72rem/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
  letter-spacing:.045em!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31__label{
  margin-right:auto!important;
  color:#ffffff!important;
  white-space:normal!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31 button{
  width:42px!important;
  min-width:42px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:2px solid var(--ecom-v31-cyan)!important;
  border-radius:8px!important;
  background:#050506!important;
  color:#ffffff!important;
  box-shadow:3px 3px 0 var(--ecom-v31-green)!important;
  font:950 1.2rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31 button:hover,
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31 button:focus-visible{
  background:var(--ecom-v31-green)!important;
  color:#050506!important;
  outline:2px solid #ffffff!important;
  outline-offset:2px!important;
}

/* Data Generator: four balanced settings and a real Inventory action. */
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-generation-grid-v31="true"]{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:1rem!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-setting-v31{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:.5rem!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-setting-v31 label{
  color:#111827!important;
  font-weight:900!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-setting-v31 input{
  width:100%!important;
  min-width:0!important;
  height:2.5rem!important;
  border:2px solid #111827!important;
  background:#ffffff!important;
  color:#050506!important;
  font-weight:900!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-generate-inventory-v31{
  min-height:42px!important;
  border:2px solid var(--ecom-v31-cyan)!important;
  background:#050506!important;
  color:#ffffff!important;
  box-shadow:4px 4px 0 var(--ecom-v31-green)!important;
  font-weight:950!important;
  touch-action:manipulation!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-generate-inventory-v31:hover,
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-generate-inventory-v31:focus-visible{
  background:var(--ecom-v31-green)!important;
  color:#050506!important;
  outline:2px solid #ffffff!important;
  outline-offset:2px!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-generate-inventory-v31[disabled]{
  opacity:.65!important;
  cursor:wait!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-helper-v31{
  flex:1 1 100%!important;
  width:100%!important;
  margin:.25rem 0 0!important;
  padding:.7rem .85rem!important;
  border-left:4px solid var(--ecom-v31-cyan)!important;
  background:#eefaff!important;
  color:#07101f!important;
  font:850 .77rem/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-summary-card-v31{
  display:flex!important;
  flex-direction:column!important;
  gap:.75rem!important;
  min-width:0!important;
  padding:1.5rem!important;
  border:1px solid #dbeafe!important;
  border-radius:.75rem!important;
  background:#ffffff!important;
  color:#07101f!important;
  box-shadow:0 1px 3px rgba(15,23,42,.1)!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-summary-card-v31 small{
  color:#475569!important;
  font-weight:800!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-summary-card-v31 strong{
  color:#07101f!important;
  font-size:1.875rem!important;
  line-height:1!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-inventory-summary-card-v31 span{
  align-self:flex-start!important;
  padding:.28rem .55rem!important;
  border:1px solid #a5b4fc!important;
  border-radius:999px!important;
  background:#eef2ff!important;
  color:#1e3a8a!important;
  font-size:.72rem!important;
  font-weight:900!important;
}

/* One collision-aware stack for V31 messages. Sonner keeps its own stack below it. */
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] [data-sonner-toaster][data-y-position="bottom"]{
  bottom:max(var(--ecom-v31-pwa-clearance),calc(env(safe-area-inset-bottom) + var(--ecom-v31-pwa-clearance)))!important;
  z-index:2147482500!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-stack-v31{
  position:fixed!important;
  z-index:2147482600!important;
  right:max(18px,env(safe-area-inset-right))!important;
  bottom:max(
    calc(var(--ecom-v31-pwa-clearance) + var(--ecom-v31-sonner-height) + 14px),
    calc(env(safe-area-inset-bottom) + var(--ecom-v31-pwa-clearance) + var(--ecom-v31-sonner-height) + 14px)
  )!important;
  width:min(440px,calc(100vw - 36px))!important;
  max-height:calc(100dvh - 180px)!important;
  display:flex!important;
  flex-direction:column-reverse!important;
  align-items:stretch!important;
  gap:.7rem!important;
  overflow-y:auto!important;
  pointer-events:none!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-v31{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:.9rem 1rem!important;
  border:2px solid var(--ecom-v31-green)!important;
  border-radius:14px!important;
  background:#050506!important;
  color:#ffffff!important;
  box-shadow:5px 5px 0 var(--ecom-v31-pink),0 0 28px rgba(57,255,20,.15)!important;
  font:900 .82rem/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
  overflow-wrap:anywhere!important;
  pointer-events:auto!important;
  animation:ecom-toast-in-v31 .22s ease both!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-v31[data-kind="error"]{
  border-color:#ff4d6d!important;
  box-shadow:5px 5px 0 var(--ecom-v31-yellow)!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-v31[data-kind="info"]{
  border-color:var(--ecom-v31-cyan)!important;
}
@keyframes ecom-toast-in-v31{
  from{opacity:0;transform:translateY(12px) scale(.98)}
  to{opacity:1;transform:none}
}

body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal-backdrop{
  position:fixed!important;
  z-index:2147483000!important;
  inset:0!important;
  display:grid!important;
  place-items:center!important;
  padding:1rem!important;
  background:rgba(0,0,0,.78)!important;
  backdrop-filter:blur(8px)!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal{
  width:min(520px,100%)!important;
  padding:1.25rem!important;
  border:2px solid var(--ecom-v31-green)!important;
  border-radius:16px!important;
  background:#050506!important;
  color:#ffffff!important;
  box-shadow:8px 8px 0 var(--ecom-v31-pink)!important;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal h3{
  margin:0 0 .65rem!important;
  color:var(--ecom-v31-green)!important;
  font-weight:950!important;
  text-transform:uppercase!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal p{
  margin:.45rem 0!important;
  color:#ffffff!important;
  line-height:1.5!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal-actions{
  display:flex!important;
  justify-content:flex-end!important;
  gap:.7rem!important;
  margin-top:1rem!important;
  flex-wrap:wrap!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal-actions button{
  min-height:42px!important;
  padding:.65rem 1rem!important;
  border:2px solid #ffffff!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  cursor:pointer!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal-actions .confirm{
  background:var(--ecom-v31-green)!important;
  color:#050506!important;
  box-shadow:4px 4px 0 var(--ecom-v31-pink)!important;
}
body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-v31-modal-actions .cancel{
  background:#111827!important;
  color:#ffffff!important;
}

@media(max-width:900px){
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-generation-grid-v31="true"]{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:640px){
  :root{--ecom-v31-pwa-clearance:70px}
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-generation-grid-v31="true"]{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31{
    align-items:flex-start!important;
    flex-wrap:wrap!important;
  }
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root .ecom-table-touch-tools-v31__label{
    flex:1 1 calc(100% - 100px)!important;
  }
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-stack-v31{
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    width:auto!important;
    max-height:calc(100dvh - 165px)!important;
  }
}
@media(prefers-reduced-motion:reduce){
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] #root [data-ecom-touch-scroll-v31="true"]{scroll-behavior:auto!important}
  body[data-project-key="ECOMMERCE_SALES_ANALYSIS"] .ecom-toast-v31{animation:none!important}
}
