/* ============ TOKENS — namespaced for inventory ============ */
:root{
  --inv-bg:           #0E0E11;
  --inv-surface:      #131318;
  --inv-surface-2:    #1C1C22;
  --inv-surface-3:    #232329;
  --inv-border:       #24242B;
  --inv-border-soft:  #1F1F26;
  --inv-text:         #E7E7EA;
  --inv-text-dim:     #8B8B95;
  --inv-text-muted:   #5F5F68;
  --inv-accent:       #F58220;
  --inv-accent-2:     #FF9A3C;
  --inv-accent-soft:  rgba(245,130,32,.12);
  --inv-accent-shadow:0 8px 24px -6px rgba(245,130,32,.55);
  --inv-grid-line:    rgba(255,255,255,.05);
 
  /* Bar chart palette */
  --inv-bar-shipped:  #4DA3FF;
  --inv-bar-reserved: #FFC23C;
  --inv-bar-stock:    #E84D6C;
 
  /* Donut palette */
  --inv-pie-1:        #FF5C8E;
  --inv-pie-2:        #8E5BC8;
  --inv-pie-3:        #F58220;
  --inv-pie-4:        #2DD4A4;
  --inv-pie-5:        #FFC23C;
  --inv-pie-6:        #4DA3FF;
 
  --inv-ease: cubic-bezier(.4,.14,.3,1);
}
[data-theme="light"]{
  --inv-bg:           #F6F6F8;
  --inv-surface:      #FFFFFF;
  --inv-surface-2:    #F1F1F4;
  --inv-surface-3:    #E8E8ED;
  --inv-border:       #E2E2E7;
  --inv-border-soft:  #EDEDF0;
  --inv-text:         #1A1A22;
  --inv-text-dim:     #6A6A75;
  --inv-text-muted:   #9A9AA5;
  --inv-grid-line:    rgba(0,0,0,.06);
}
 
.inv-root *,
.inv-root *::before,
.inv-root *::after{box-sizing:border-box}
 
html,body{margin:0;padding:0;background:transparent}
body{
  font-family:'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color:var(--inv-text);
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  transition:color .3s var(--inv-ease);
}
.inv-root button{font:inherit;color:inherit;border:0;cursor:pointer}
.inv-root input{font:inherit;color:inherit;background:transparent;border:0;outline:none}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#26262D;border-radius:6px}
[data-theme="light"] ::-webkit-scrollbar-thumb{background:#D6D6DC}
 
/* ============ PAGE ============ */
.inv-page{ padding:14px 4px;}
 
/* ============ GRID ============ */
.inv-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}
@media (max-width: 980px){
  .inv-grid{ grid-template-columns:1fr;}
}
 
/* ============ BLOCK ============ */
.inv-block{
  background:var(--inv-surface);
  border:1px solid var(--inv-border-soft);
  border-radius:16px;
  padding:22px;
  display:flex;
  flex-direction:column;
  min-height:380px;
  position:relative;
  transition:background-color .3s var(--inv-ease), border-color .3s var(--inv-ease);
}
.inv-block__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  flex-wrap:wrap;
  min-height:38px;
}
.inv-block__actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-left:auto;
}
.inv-block__title-group{ display:flex; flex-direction:column; gap:4px;}
.inv-block__title{
  font-size:20px;
  font-weight:700;
  letter-spacing:-.01em;
  margin:0;
  color:var(--inv-text);
  flex-shrink:0;
}
.inv-block__subtitle{
  font-size:12.5px;
  color:var(--inv-text-dim);
  font-weight:500;
}
 
/* ============ EXPORT (download) ============ */
.inv-export{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:36px;
  padding:0 14px;
  border:1px solid var(--inv-border);
  border-radius:999px;
  color:var(--inv-text);
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  transition:background .15s var(--inv-ease), border-color .15s var(--inv-ease);
  white-space:nowrap;
}
.inv-export:hover{ background:var(--inv-surface-2); border-color:var(--inv-text-muted);}
.inv-export svg{ width:13px;height:13px;}
.inv-export__caret{
  width:11px !important;
  height:11px !important;
  color:var(--inv-text-dim);
  transition:transform .25s var(--inv-ease);
  margin-left:-2px;
}
.inv-export-box.is-active .inv-export__caret{ transform:rotate(180deg);}
.inv-export-box.is-active .inv-export{
  border-color:var(--inv-accent);
  background:var(--inv-accent-soft);
}
 
.inv-export-box{ position:relative;}
.inv-export-list{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:260px;
  background:var(--inv-surface-2);
  border:1px solid var(--inv-border);
  border-radius:12px;
  padding:6px;
  box-shadow:0 18px 40px rgba(0,0,0,.45);
  z-index:55;
  opacity:0;
  transform:translateY(-6px) scale(.97);
  pointer-events:none;
  transition:opacity .2s var(--inv-ease), transform .2s var(--inv-ease);
}
.inv-export-list.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.inv-export-list__row{
  display:flex;
  gap:11px;
  width:100%;
  padding:9px 11px;
  border-radius:9px;
  text-align:left;
  align-items:center;
  transition:background .15s var(--inv-ease);
}
.inv-export-list__row:hover{ background:var(--inv-surface-3);}
.inv-export-list__icon{
  width:32px;height:32px;
  display:grid;place-items:center;
  background:var(--inv-accent-soft);
  color:var(--inv-accent);
  border-radius:8px;
  flex-shrink:0;
}
.inv-export-list__icon svg{ width:16px;height:16px;}
.inv-export-list__text{ display:flex; flex-direction:column; min-width:0;}
.inv-export-list__name{
  font-size:13px;
  font-weight:600;
  color:var(--inv-text);
}
.inv-export-list__hint{
  font-size:11px;
  color:var(--inv-text-dim);
  margin-top:2px;
}
 
/* ============ CHART AREA ============ */
.inv-canvas-box{
  position:relative;
  flex:1;
  max-height:280px;
}
.inv-canvas-box canvas{ width:100% !important; height:100% !important;}
 
/* ============ MARKERS (legend) ============ */
.inv-markers{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:18px;
  margin:6px 0 4px;
  font-size:12.5px;
  color:var(--inv-text-dim);
}
.inv-markers--bottom{ margin:6px 0 0;}
.inv-marker{ display:inline-flex; align-items:center; gap:8px;}
.inv-marker__bullet{
  width:10px;
  height:10px;
  border-radius:50%;
  flex-shrink:0;
  transition:opacity .15s var(--inv-ease), filter .15s var(--inv-ease);
}
.inv-marker--clickable{
  cursor:pointer;
  user-select:none;
  padding:4px 9px;
  margin:-4px -1px;
  border-radius:7px;
  transition:background .15s var(--inv-ease), color .15s var(--inv-ease), opacity .15s var(--inv-ease);
  outline:none;
}
.inv-marker--clickable:hover{ background:var(--inv-surface-2); color:var(--inv-text);}
.inv-marker--clickable:focus-visible{ box-shadow:0 0 0 2px var(--inv-accent);}
.inv-marker--clickable.is-off{
  opacity:.45;
  text-decoration:line-through;
  text-decoration-color:var(--inv-text-muted);
  text-decoration-thickness:1.5px;
}
.inv-marker--clickable.is-off .inv-marker__bullet{
  opacity:.4;
  filter:grayscale(.6);
}
 
/* ============ RANGE PICKER ============ */
.inv-range{ position:relative; z-index:5;}
.inv-range__btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:36px;
  padding:0 12px 0 14px;
  background:var(--inv-surface-2);
  border:1px solid var(--inv-border-soft);
  border-radius:11px;
  color:var(--inv-text);
  font-size:12.5px;
  font-weight:600;
  transition:background .18s var(--inv-ease), border-color .18s var(--inv-ease);
  white-space:nowrap;
}
.inv-range__btn:hover{
  background:var(--inv-surface-3);
  border-color:var(--inv-border);
}
.inv-range.has-value .inv-range__btn{ border-color:var(--inv-accent);}
.inv-range__icon{
  width:16px;height:16px;
  color:var(--inv-accent);
  flex-shrink:0;
}
.inv-range__text{ flex:1; letter-spacing:-.005em;}
.inv-range__caret{
  width:14px;height:14px;
  color:var(--inv-text-dim);
  transition:transform .25s var(--inv-ease);
  flex-shrink:0;
}
.inv-range.is-expanded .inv-range__caret{ transform:rotate(180deg);}
 
/* Panel */
.inv-range__panel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:320px;
  background:var(--inv-surface-2);
  border:1px solid var(--inv-border);
  border-radius:14px;
  padding:14px;
  box-shadow:0 18px 40px rgba(0,0,0,.45);
  z-index:50;
  opacity:0;
  transform:translateY(-6px) scale(.97);
  pointer-events:none;
  transition:opacity .2s var(--inv-ease), transform .2s var(--inv-ease);
}
.inv-range__panel.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
 
/* Quick-pick chips */
.inv-quickpicks{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:12px;
}
.inv-quickpick{
  height:42px;
  padding:0 14px;
  background:var(--inv-surface);
  border:1px solid var(--inv-border-soft);
  border-radius:11px;
  font-size:13.5px;
  font-weight:500;
  color:var(--inv-text-dim);
  transition:background .18s var(--inv-ease), color .18s var(--inv-ease), border-color .18s var(--inv-ease);
}
.inv-quickpick:hover{
  color:var(--inv-text);
  border-color:var(--inv-border);
  background:var(--inv-surface-3);
}
.inv-quickpick.is-picked{
  background:rgba(245,130,32,.20);
  color:var(--inv-accent);
  border-color:var(--inv-accent);
  font-weight:600;
}
[data-theme="light"] .inv-quickpick.is-picked{ background:rgba(245,130,32,.14);}
 
.inv-range__sep{
  height:1px;
  background:var(--inv-border-soft);
  margin:6px 0 12px;
  border:0;
}
.inv-range__fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.inv-range__field{ display:flex; flex-direction:column; gap:6px;}
.inv-range__field label{
  font-size:11.5px;
  color:var(--inv-text-muted);
  font-weight:600;
  padding-left:2px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.inv-range__field input{
  height:42px;
  padding:0 12px;
  background:var(--inv-surface);
  border:1px solid var(--inv-border-soft);
  border-radius:10px;
  font-size:13px;
  color:var(--inv-text);
  font-family:inherit;
  outline:none;
  transition:border-color .15s var(--inv-ease);
  color-scheme:dark;
  appearance:none;
  -webkit-appearance:none;
}
[data-theme="light"] .inv-range__field input{ color-scheme:light;}
.inv-range__field input:focus{ border-color:var(--inv-accent);}
.inv-range__field input::-webkit-calendar-picker-indicator{
  cursor:pointer;
  opacity:.6;
  filter:invert(.6);
}
[data-theme="light"] .inv-range__field input::-webkit-calendar-picker-indicator{ filter:none;}
 
/* Footer of panel */
.inv-range__bottom{ display:flex; gap:10px;}
.inv-btn-clear{
  flex:1;
  height:46px;
  background:var(--inv-surface);
  color:var(--inv-text);
  font-weight:600;
  font-size:14px;
  border:1px solid var(--inv-border);
  border-radius:999px;
  transition:background .15s var(--inv-ease), border-color .15s var(--inv-ease);
}
.inv-btn-clear:hover{
  background:var(--inv-surface-3);
  border-color:var(--inv-text-muted);
}
.inv-btn-confirm{
  flex:1.4;
  height:46px;
  background:linear-gradient(180deg, var(--inv-accent-2), var(--inv-accent));
  color:#fff;
  font-weight:700;
  font-size:14px;
  border-radius:999px;
  box-shadow:var(--inv-accent-shadow);
  transition:opacity .15s var(--inv-ease), transform .12s var(--inv-ease);
}
.inv-btn-confirm:hover{ opacity:.95;}
.inv-btn-confirm:active{ transform:translateY(1px);}
 
/* Mobile */
@media (max-width: 780px){
  .inv-block{ padding:18px 16px 16px; min-height:320px;}
  .inv-block__title{ font-size:17px;}
  .inv-canvas-box{ min-height:240px;}
  .inv-range__panel{ width:min(320px, calc(100vw - 60px));}
  .inv-range__btn{ font-size:12px; padding:0 10px 0 12px; gap:8px;}
}