/* KraSSell Warehouse v7 — production rework queue and Finance dashboard cards */
body.krv7-on #root .content{padding-right:392px!important}
body.krv7-on #root .content-inner{max-width:none!important;margin-left:0!important;margin-right:0!important}
body.krv7-on #root .orders{max-width:none}
body.krv7-on #root .order-card{width:100%}
#krv7-rail{position:fixed;right:14px;top:79px;bottom:16px;width:355px;background:linear-gradient(155deg,#fff,#f8faff);z-index:350;border:1px solid #dfe8f7;box-shadow:0 22px 58px #1a407b21;border-radius:23px;display:flex;flex-direction:column;color:#203353;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;overflow:hidden;transition:width .24s ease,transform .24s ease}
#krv7-rail .krv7-rail-top{padding:18px 17px 14px;border-bottom:1px solid #edf1f8;display:flex;align-items:center;justify-content:space-between}
.krv7-headline{display:flex;align-items:center;gap:11px}.krv7-logo{width:42px;height:42px;display:grid;place-items:center;border-radius:14px;color:#fff;background:linear-gradient(125deg,#1883ff,#65b1ff);font-weight:900;font-size:29px;box-shadow:0 7px 22px #1883ff36}
.krv7-headline strong{font-size:17px;display:block;letter-spacing:-.3px}.krv7-headline small{display:block;color:#8291a6;font-size:11px;margin-top:3px}
.krv7-fold{background:#f0f5fc;border:none;color:#52647d;border-radius:12px;width:31px;height:31px;cursor:pointer;font-size:19px;transition:.2s}.krv7-fold:hover{background:#dfeeff}
.krv7-summary{display:flex;align-items:center;justify-content:space-between;padding:13px 17px;font-size:13px;border-bottom:1px solid #edf1f8;color:#53647a}.krv7-summary b{color:#165fca;font-size:17px}.krv7-dot{width:8px;height:8px;background:#ff9a43;border-radius:50%;display:inline-block;box-shadow:0 0 0 4px #fff2e7;margin-right:5px}.krv7-sync{font-size:10px;color:#a0acc0}
.krv7-list{overflow-y:auto;min-height:0;flex:1;padding:13px 11px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin}
.krv7-item{display:flex;gap:9px;padding:12px 10px;border-radius:16px;background:white;border:1px solid #e7edf5;box-shadow:0 5px 18px #193c6b0a;transition:transform .2s,opacity .2s,box-shadow .2s}
.krv7-item:hover{box-shadow:0 7px 23px #193c6b17;transform:translateY(-1px)}.krv7-item.done{background:#f5f8fc;opacity:.67}
.krv7-item-check{padding-top:2px}.krv7-item-check input{width:20px;height:20px;accent-color:#1883ff;cursor:pointer}.krv7-status{font-weight:800;color:#f09742}
.krv7-item-content{flex:1;min-width:0}.krv7-item-line{display:flex;gap:7px;align-items:center;justify-content:space-between}.krv7-item-line b{font-size:13px;overflow-wrap:anywhere}.krv7-item-line span{white-space:nowrap;color:#96a3b6;font-size:10px}.krv7-item.done .krv7-item-line b{text-decoration:line-through}
.krv7-item-sub{font-size:11px;color:#8998ad;margin-top:5px}.krv7-note{font-size:12px;color:#55647e;line-height:1.3;margin:6px 0}
.krv7-crops{margin-top:10px;display:flex;gap:7px;flex-wrap:wrap}.krv7-crops button{border:1px solid #e4eaf5;border-radius:10px;overflow:hidden;padding:2px;background:#fff;cursor:pointer;transition:.18s}.krv7-crops button:hover{transform:scale(1.05);border-color:#1883ff}.krv7-crops img{display:block;width:66px;height:65px;object-fit:contain}
.krv7-state{font-size:11px;font-weight:750;color:#bd6b22;margin-top:9px}.krv7-item.done .krv7-state{color:#42906b}
.krv7-bottom{border-top:1px solid #edf1f8;padding:13px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:#8291a6}
.krv7-clear{padding:11px 12px;border:1px solid #d7e2f0;background:#fff;border-radius:11px;color:#486180;font-size:12px;font-weight:800;cursor:pointer;transition:.2s}.krv7-clear:hover:not(:disabled){background:#eef5ff;color:#1661cb}.krv7-clear:disabled{opacity:.5;cursor:not-allowed}
.krv7-empty{padding:46px 12px 22px;display:flex;flex-direction:column;gap:8px;text-align:center;color:#8291a6}.krv7-empty>span{font-size:36px;color:#55aa81}.krv7-empty strong{font-size:13px;color:#5e6f86}.krv7-empty small{font-size:11px}
#krv7-rail.folded{width:55px;height:53px;top:79px;bottom:auto;border-radius:14px;overflow:hidden}
#krv7-rail.folded .krv7-headline,#krv7-rail.folded .krv7-summary,#krv7-rail.folded .krv7-list,#krv7-rail.folded .krv7-bottom{display:none}
#krv7-rail.folded .krv7-rail-top{padding:10px}#krv7-rail.folded .krv7-fold{width:33px;height:32px}
body.krv7-on:has(#krv7-rail.folded) #root .content{padding-right:24px!important}
#krv7-alert{position:fixed;top:85px;left:50%;transform:translateX(-50%);z-index:2500;min-width:285px;max-width:min(520px,80vw);background:linear-gradient(120deg,#f97316,#ffab4f);border:1px solid #f5b574;border-radius:17px;padding:14px 13px;display:flex;gap:13px;align-items:center;color:#fff;box-shadow:0 15px 46px #d96c2145;animation:krv7-alert-in .26s ease}
.krv7-alert-icon{display:grid;place-items:center;width:40px;height:40px;flex:none;background:#fff3;color:#fff;border-radius:12px;font-size:23px;font-weight:900}
#krv7-alert strong{font-weight:900;font-size:16px;display:block}#krv7-alert span{display:block;font-size:12px;opacity:.92;margin-top:2px}#krv7-alert button{margin-left:auto;border:0;border-radius:12px;background:#fff4;color:white;cursor:pointer;font-size:22px;width:32px;height:32px}
@keyframes krv7-alert-in{from{opacity:0;transform:translate(-50%,-20px)}to{opacity:1;transform:translate(-50%,0)}}
#krv7-select{position:fixed;z-index:2600;background:#1883ff18;border:2px solid #1883ff;border-radius:4px;box-shadow:0 0 0 100vmax #00000005;pointer-events:none}
#krv7-quick{position:fixed;z-index:2650;display:flex;gap:7px;background:#fff;border-radius:14px;padding:8px;box-shadow:0 14px 42px #09245e40;border:1px solid #e6ebf7;animation:krv7-slide .2s ease}
#krv7-quick button{border:0;border-radius:10px;padding:11px;color:#28567f;font-weight:800;cursor:pointer;font-size:12px;background:#f1f7ff;white-space:nowrap}
#krv7-quick .krv7-quick-send{background:#1883ff;color:#fff}
#krv7-tray{position:fixed;z-index:2650;bottom:25px;left:50%;transform:translateX(-50%);width:min(540px,calc(100vw - 22px));padding:17px;background:#fff;color:#243752;border:1px solid #dce6f7;box-shadow:0 22px 70px #132d5570;border-radius:20px;animation:krv7-slide .25s ease}
@keyframes krv7-slide{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
.krv7-tray-top,.krv7-tray-info,.krv7-tray-actions{display:flex;justify-content:space-between;align-items:center;gap:10px}
.krv7-tray-top strong{font-size:16px}.krv7-tray-top button{background:#f4f6fa;border:0;border-radius:10px;width:29px;height:29px;cursor:pointer}.krv7-tray-info{margin:10px 0;font-size:12px}.krv7-tray-info select{border-radius:8px;border:1px solid #d7e2f0;padding:6px}
.krv7-tray-img{display:flex;gap:8px;overflow-x:auto;padding:7px 0}.krv7-tray-img>div{position:relative;flex:none}.krv7-tray-img img{width:70px;height:74px;border-radius:11px;object-fit:contain;background:#f7faff;border:1px solid #e8eff8}.krv7-tray-img>div button{position:absolute;right:-4px;top:-4px;background:#ed6a65;color:#fff;border:0;border-radius:50%;width:19px;height:19px;cursor:pointer}
#krv7-note{box-sizing:border-box;width:100%;margin:9px 0 12px;border:1px solid #dce6f2;border-radius:10px;padding:10px;outline:0}.krv7-tray-actions button{border:0;border-radius:11px;padding:12px;background:#eef3f9;color:#4a5a70;font-weight:850;cursor:pointer}.krv7-tray-actions .krv7-send{background:linear-gradient(120deg,#1883ff,#3da1ff);color:#fff;box-shadow:0 9px 24px #1883ff38}
#krv7-viewer{position:fixed;inset:0;z-index:3000;background:#0e1c34bf;display:grid;place-items:center;padding:18px}
.krv7-viewbox{background:#fff;color:#203353;border-radius:20px;padding:18px;max-width:min(920px,95vw);max-height:92vh;display:flex;flex-direction:column;gap:12px;box-shadow:0 26px 90px #0007}
.krv7-viewhead{display:flex;gap:18px;justify-content:space-between;align-items:center}.krv7-viewhead strong{font-size:17px}.krv7-viewhead small{display:block;color:#8798ae;margin-top:3px}.krv7-viewhead button{border:0;border-radius:11px;background:#eef3f8;padding:7px 12px;font-size:21px;cursor:pointer}
.krv7-big-image{object-fit:contain;min-height:130px;max-height:66vh;max-width:84vw}.krv7-view-thumbs{display:flex;gap:7px;justify-content:center}.krv7-view-thumbs button{border:2px solid #e6ebf3;border-radius:9px;padding:2px;background:#fff;cursor:pointer}.krv7-view-thumbs button.active{border-color:#1883ff}.krv7-view-thumbs img{width:55px;height:50px;object-fit:contain}
#krv7-balance-panel{margin:0 0 18px;padding:17px;border:1px solid #e5eaf4;border-radius:17px;background:linear-gradient(120deg,#fff,#f8fbff)}
.krv7-balance-title{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:13px}.krv7-balance-title strong{font-size:18px;font-weight:850;color:#1b2b43}.krv7-balance-title span{font-size:12px;color:#8091a9}
.krv7-balance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.krv7-balance-card{background:#fff;border:1px solid #e2eafa;border-radius:14px;padding:16px 14px}.krv7-balance-name{font-size:13px;color:#65748c;font-weight:760}.krv7-balance-value{font-size:24px;line-height:1.5;font-weight:950;color:#203f7a;margin-top:4px;white-space:nowrap}.krv7-balance-foot{font-size:11px;color:#8290a7;line-height:1.4}.krv7-balance-warn{color:#bf782f}
@media(max-width:1320px){body.krv7-on #root .content{padding-right:24px!important}#krv7-rail{top:auto;bottom:14px;width:min(355px,calc(100vw - 30px));height:62vh;box-shadow:0 12px 46px #132d5540}#krv7-rail.folded{width:55px;top:auto;bottom:14px;height:53px} .krv7-balance-grid{grid-template-columns:1fr}}
@media(max-width:700px){#krv7-rail{bottom:12px;height:55vh;width:calc(100vw - 24px)}#krv7-rail.folded{width:50px;height:52px}.krv7-balance-value{font-size:20px}#krv7-quick{flex-direction:column}}

/* KraSSell Warehouse v7.1.4 — expanded draft fragments & photo visibility */
#krv7-tray{width:min(640px,calc(100vw - 20px));max-height:min(470px,65dvh);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
#krv7-tray .krv7-tray-img{gap:12px;padding:10px 4px 9px;scrollbar-width:thin;}
#krv7-tray .krv7-tray-img img{width:164px;height:176px;max-width:none;object-fit:contain;}
#krv7-tray .krv7-tray-img>div button{right:0;top:0;width:25px;height:25px;font-size:15px;z-index:1;}
/* While adding subsequent fragments, the ENTIRE photograph must remain above
   the draft tray, not just its upper part. Applies to either photo viewer. */
body.krv714-draft-visible #lightbox,
body.krv714-draft-visible #product-gallery{align-items:flex-start!important;justify-content:center!important;overflow-y:auto!important;padding-top:14px!important;padding-bottom:calc(var(--krv714-tray-height,360px) + 36px)!important;}
body.krv714-draft-visible #lightbox .lightbox-panel,
body.krv714-draft-visible #product-gallery .product-gallery-panel{height:auto!important;max-height:none!important;flex:none!important;}
body.krv714-draft-visible #lightbox .lightbox-image,
body.krv714-draft-visible #product-gallery .product-gallery-image{
  max-height:max(100px,calc(100dvh - var(--krv714-tray-height,360px) - 154px))!important;
  width:auto!important;height:auto!important;object-fit:contain!important;
}
body.krv714-draft-visible #product-gallery .product-gallery-image-wrap{height:auto!important;max-height:none!important;min-height:0!important;flex:none!important;}
@media(max-width:700px){
  #krv7-tray{bottom:8px;padding:12px;max-height:66dvh;}
  #krv7-tray .krv7-tray-img img{width:126px;height:138px;}
  #krv7-tray .krv7-tray-actions{gap:6px;}
  #krv7-tray .krv7-tray-actions button{padding:10px 8px;font-size:12px;}
}

/* KraSSell Warehouse v7.1.5.1 — restore compact draft tray; do not enlarge it. */
#krv7-tray .krv715-collapse{
  margin-left:auto;white-space:nowrap;width:auto;height:32px;
  padding:0 10px;font-size:12px;color:#2361a6;background:#eef6ff;
}
#krv7-tray.krv715-compact{max-height:220px;}
#krv7-tray.krv715-compact .krv7-tray-img{display:none;}
@media(max-width:700px){#krv7-tray .krv715-collapse{font-size:11px;padding:0 7px;}}

/* Enlarge ONLY the thumbnails in the persistent rework queue.
   v7.1.3 sets 52x52; x3 = 156x156. !important overrides v71.css,
   which loads after this stylesheet. Keep images inside narrow cards. */
#krv7-rail .krv7-crops{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;}
#krv7-rail .krv7-crops button{max-width:100%;box-sizing:border-box;}
#krv7-rail .krv7-crops img{
  display:block;width:156px!important;height:156px!important;
  max-width:100%!important;object-fit:contain;
  background:#f7faff;border-radius:8px;
}

/* KraSSell Warehouse v7.1.5.2 — 40% smaller rework previews and draft tray.
   Queue: 156 -> 94px. Draft: 164x176 -> 98x106px, 640 -> 384px.
   This keeps the product photo visible while selecting damaged fragments. */
#krv7-rail .krv7-crops{display:flex;flex-wrap:wrap;gap:7px;align-items:flex-start;}
#krv7-rail .krv7-crops button{max-width:100%;box-sizing:border-box;}
#krv7-rail .krv7-crops img{
  display:block;width:94px!important;height:94px!important;
  max-width:100%!important;object-fit:contain;
  background:#f7faff;border-radius:8px;
}
#krv7-tray{
  box-sizing:border-box!important;
  width:min(384px,calc(100vw - 20px))!important;
  max-height:min(285px,55dvh)!important;
  padding:11px!important;
  bottom:12px!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
}
#krv7-tray .krv7-tray-img{
  gap:8px!important;
  padding:5px 2px 6px!important;
}
#krv7-tray .krv7-tray-img img{
  width:98px!important;height:106px!important;
  max-width:none!important;max-height:none!important;
  object-fit:contain!important;
}
#krv7-tray .krv7-tray-img>div button{
  top:0!important;right:0!important;
  width:22px!important;height:22px!important;
  font-size:13px!important;
}
#krv7-tray .krv7-tray-top strong{font-size:14px;}
#krv7-tray .krv7-tray-info{margin:6px 0;}
#krv7-tray #krv7-note{margin:6px 0 8px;padding:8px;}
#krv7-tray .krv7-tray-actions button{
  padding:9px 10px!important;font-size:12px!important;
  min-height:36px;line-height:1.3;
}
#krv7-tray.krv715-compact{max-height:180px!important;}
@media(max-width:700px){
  #krv7-tray{width:min(384px,calc(100vw - 16px))!important;padding:10px!important;bottom:8px!important;}
  #krv7-tray .krv7-tray-img img{width:76px!important;height:83px!important;}
  #krv7-tray .krv7-tray-actions{gap:6px;}
  #krv7-tray .krv7-tray-actions button{padding:9px 7px!important;}
}
