
:root{--sfm-green:#0b6f4e;--sfm-green2:#095d42;--sfm-bg:#f5f7f8;--sfm-border:#dfe5e8;--sfm-text:#182126}
.sfmsta-panel{box-sizing:border-box;max-width:1100px;margin:20px auto;background:var(--sfm-bg);color:var(--sfm-text);font-family:inherit}.sfmsta-panel *{box-sizing:border-box}
.sfmsta-btn{border:1px solid var(--sfm-border);border-radius:8px;background:#fff;color:#2b353b;padding:9px 12px;cursor:pointer;font-size:14px}.sfmsta-btn.primary{background:var(--sfm-green);border-color:var(--sfm-green);color:#fff}.sfmsta-btn.primary:hover{background:var(--sfm-green2)}.sfmsta-btn.neutral:hover{background:#eef2f3}
.sfmsta-start{max-width:560px;padding:28px;background:#fff;border:1px solid var(--sfm-border);border-radius:14px}.sfmsta-start h2{margin:0 0 6px}.sfmsta-start p{margin:0 0 18px;color:#657078}.sfmsta-start label,.sfmsta-box label{display:block;font-size:12px;font-weight:700;margin:10px 0}.sfmsta-start input,.sfmsta-box input,.sfmsta-box select,.sfmsta-box textarea,.sfmsta-lock input{display:block;width:100%;margin-top:5px;padding:10px;border:1px solid #cdd7dc;border-radius:8px;font:inherit;background:#fff}.sfmsta-start button{width:100%;margin-top:12px}
.sfmsta-lock{max-width:450px;padding:24px;background:#fff;border:1px solid var(--sfm-border);border-radius:14px}.sfmsta-lock h2{margin:0 0 6px}.sfmsta-lock input{margin-bottom:10px}
.sfmsta-manager-head{background:var(--sfm-green);color:#fff;padding:14px 16px;border-radius:14px 14px 0 0}.sfmsta-manager-head h2{margin:0;font-size:22px}.sfmsta-manager-head p{margin:3px 0 0;font-size:12px;opacity:.9}.sfmsta-alert{margin:10px;padding:10px;border-radius:8px;background:#fff}.sfmsta-alert.success{border-left:4px solid var(--sfm-green)}.sfmsta-alert.error{border-left:4px solid #b42318}
.sfmsta-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px}.sfmsta-box{background:#fff;border:1px solid var(--sfm-border);border-radius:10px;padding:12px}.sfmsta-box h3{margin:0 0 8px;font-size:16px}.sfmsta-box .check{display:flex;gap:7px;align-items:center}.sfmsta-box .check input{width:auto;margin:0}.sfmsta-box textarea{min-height:70px}
.sfmsta-bulk{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 10px}.sfmsta-cat,.sfmsta-sub{background:#fff;border:1px solid var(--sfm-border);border-radius:10px;margin:7px 12px;overflow:hidden}.sfmsta-cat>summary,.sfmsta-sub>summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;padding:10px 12px}.sfmsta-cat>summary::-webkit-details-marker,.sfmsta-sub>summary::-webkit-details-marker{display:none}.sfmsta-cat>summary{font-size:17px;font-weight:800}.sfmsta-sub>summary{font-size:14px;font-weight:800;background:#fbfcfd;border-top:1px solid #edf1f3}.sfmsta-cat>summary b,.sfmsta-sub>summary b{font-size:9px;background:#eef6ef;color:var(--sfm-green);padding:4px 7px;border-radius:999px}.sfmsta-products{display:flex;flex-direction:column}.sfmsta-product-card{display:grid;grid-template-columns:20px 20px 34px minmax(0,1fr) auto auto;gap:7px;align-items:center;padding:7px 9px;border-top:1px solid #edf1f3}.sfmsta-select-product{width:17px;height:17px}.sfmsta-product-image{width:34px;height:34px;border:1px solid #e2e7e9;border-radius:8px;display:flex;align-items:center;justify-content:center;overflow:hidden;font-weight:800}.sfmsta-product-image img{width:100%;height:100%;object-fit:cover}.sfmsta-product-info strong{display:block;font-size:13px;line-height:1.1}.sfmsta-product-info small{display:block;color:#778189;font-size:9px;margin-top:2px}.sfmsta-edit{font-size:10px;text-decoration:none;border:1px solid var(--sfm-border);border-radius:7px;padding:6px 8px;color:#253038;background:#fff}.sfmsta-status-toggle{border:0;background:transparent;display:flex;align-items:center;gap:5px;cursor:pointer;font:inherit;white-space:nowrap;justify-self:end}.sfmsta-status-toggle span{width:32px;height:18px;border-radius:999px;background:#b9c1c6;position:relative;display:inline-block}.sfmsta-status-toggle span:after{content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;border-radius:50%;background:#fff;transition:.15s}.sfmsta-status-toggle.on span{background:var(--sfm-green)}.sfmsta-status-toggle.on span:after{left:16px}.sfmsta-status-toggle em{font-style:normal;font-size:10px;color:#647077}
.sfmsta-stocktake{background:#f7f8f9}.sfmsta-stocktake header{display:flex;justify-content:space-between;align-items:center;padding:12px;background:var(--sfm-green);color:#fff;border-radius:12px 12px 0 0}.sfmsta-stocktake h1{margin:0;font-size:21px}.sfmsta-stocktake header small{font-size:10px}.sfmsta-tools{display:flex;gap:7px;padding:8px}.sfmsta-tools input{flex:1;min-width:0;border:1px solid var(--sfm-border);border-radius:9px;padding:10px;font:inherit}.sfmsta-stock-cat,.sfmsta-stock-sub{margin:6px 8px;background:#fff;border:1px solid var(--sfm-border);border-radius:10px;overflow:hidden}.sfmsta-stock-cat>summary,.sfmsta-stock-sub>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;padding:9px 10px}.sfmsta-stock-cat>summary::-webkit-details-marker,.sfmsta-stock-sub>summary::-webkit-details-marker{display:none}.sfmsta-stock-cat>summary{font-weight:800;font-size:16px}.sfmsta-stock-sub>summary{font-weight:800;font-size:13px;background:#fbfcfd;border-top:1px solid #edf1f3}.sfmsta-stock-cat>summary b,.sfmsta-stock-sub>summary b{font-size:9px;color:var(--sfm-green);background:#eef6ef;border-radius:999px;padding:3px 6px}.sfmsta-stock-cat>summary i,.sfmsta-stock-sub>summary i{font-style:normal}.sfmsta-stock-row{padding:6px 7px;border-top:1px solid #edf1f3}.sfmsta-stock-main{display:flex;align-items:center;gap:7px;min-width:0}.sfmsta-stock-image{width:30px;height:30px;min-width:30px;border:1px solid #e2e7e9;border-radius:7px;display:flex;align-items:center;justify-content:center;overflow:hidden;font-size:11px;font-weight:800}.sfmsta-stock-image img{width:100%;height:100%;object-fit:cover}.sfmsta-stock-main strong{display:block;font-size:12px;line-height:1.05}.sfmsta-stock-main small{display:block;font-size:8px;color:#778189}.sfmsta-stock-state{margin-left:auto;font-size:10px}.sfmsta-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:5px}.sfmsta-fields label{font-size:8px;font-weight:800}.sfmsta-fields select{width:100%;height:33px;min-height:33px;border:1px solid #cad4da;border-radius:8px;background:#fff;padding:4px;font:inherit;font-size:11px}.sfmsta-skip{margin-top:4px;border:0;background:transparent;color:#647077;font-size:9px;padding:4px;cursor:pointer}.sfmsta-stock-row.skipped{background:#fafafa;opacity:.75}.sfmsta-bottom{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;padding:8px;background:#fff;border-top:1px solid var(--sfm-border)}.sfmsta-bottom .sfmsta-btn{width:100%}
.sfmsta-modal{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;padding:12px;z-index:9999}.sfmsta-modal.show{display:flex}.sfmsta-modal>div{width:min(620px,100%);max-height:88vh;overflow:auto;background:#fff;border-radius:12px;padding:14px}.sfmsta-review-row{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid #edf1f3}.sfmsta-review-row small{display:block;color:#778189}.sfmsta-report-toolbar{display:flex;justify-content:space-between;align-items:center;padding:10px}.sfmsta-print-sheet{background:#fff;padding:22px;max-width:900px;margin:0 auto}.sfmsta-print-sheet h1{margin:0 0 10px}.sfmsta-print-sheet h2{margin:14px 0 8px}.sfmsta-report-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}.sfmsta-report-cols p{margin:2px 0;font-size:11px}
@media(max-width:700px){.sfmsta-panel{margin:0;width:100%}.sfmsta-editor-grid{grid-template-columns:1fr;padding:7px}.sfmsta-box{padding:9px}.sfmsta-bulk{padding:0 7px 7px;display:grid;grid-template-columns:1fr 1fr}.sfmsta-bulk .sfmsta-btn{width:100%;font-size:10px;min-height:36px}.sfmsta-cat,.sfmsta-sub{margin-left:7px;margin-right:7px}.sfmsta-product-card{grid-template-columns:19px 19px 30px minmax(0,1fr);align-items:start}.sfmsta-product-image{width:30px;height:30px}.sfmsta-edit,.sfmsta-status-toggle{grid-column:4}.sfmsta-edit{justify-self:start}.sfmsta-status-toggle{justify-self:start}.sfmsta-stocktake header{padding:10px 9px}.sfmsta-stocktake header .sfmsta-btn{font-size:9px;padding:6px 8px}.sfmsta-tools{padding:7px}.sfmsta-tools input{font-size:16px}.sfmsta-fields select{font-size:11px}.sfmsta-print-sheet{padding:12px}.sfmsta-report-cols{gap:10px}}
@media print{.no-print,.sfmsta-report-toolbar{display:none!important}.sfmsta-print-sheet{max-width:none;margin:0;padding:12px}.sfmsta-report-cols{grid-template-columns:1fr 1fr}.sfmsta-print-sheet h1{font-size:16px}.sfmsta-print-sheet h2{font-size:12px}}

/* v1.1.0 — Import/Export UI */
.sfmsta-import-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:12px;padding:12px}
.sfmsta-format{background:#f5f7f8;border:1px solid #e1e6e9;border-radius:8px;padding:9px;font-size:11px;margin:8px 0}
.sfmsta-format code{display:block;margin-top:5px;white-space:normal;word-break:break-word;color:#3e474d}
.sfmsta-muted{font-size:11px;color:#758087}
.sfmsta-import-result{margin-top:10px;padding:9px;border-radius:8px;display:none}
.sfmsta-import-result.success{display:block;border-left:4px solid #0b6f4e;background:#eef6ef}
.sfmsta-import-result.error{display:block;border-left:4px solid #b42318;background:#fff1f0}
@media(max-width:700px){
 .sfmsta-import-grid{grid-template-columns:1fr;padding:7px}
 .sfmsta-import-panel .sfmsta-box{padding:9px}
}

/* v1.2.0 — database reset */
.sfmsta-reset-notice{border-left:4px solid #b32d2e}

/* v1.2.1 — isolate the rebuilt app from theme/page CSS */
.sfmsta-panel,
.sfmsta-panel *{box-sizing:border-box}
.sfmsta-panel{font-size:16px;line-height:1.4}
.sfmsta-stocktake .sfmsta-stock-row,
.sfmsta-stocktake .sfmsta-stock-row *{white-space:normal;word-break:normal}
.sfmsta-stocktake select,
.sfmsta-stocktake option{font:inherit}
.sfmsta-stocktake .sfmsta-fields select{display:block!important;visibility:visible!important;opacity:1!important}
.sfmsta-stocktake .sfmsta-fields{display:grid!important}
.sfmsta-stocktake .sfmsta-stock-row{display:block!important}
.sfmsta-stocktake .sfmsta-stock-main{display:flex!important}

/* v1.2.2 — hard isolation from legacy Stock Take shortcode/theme styles */
.sfmsta-stocktake,
.sfmsta-stocktake *{
    box-sizing:border-box;
}
.sfmsta-stocktake{
    width:100%;
    max-width:1100px;
    margin-left:auto;
    margin-right:auto;
    position:relative;
    clear:both;
    overflow:hidden;
}
.sfmsta-stocktake .sfmsta-stock-row{
    clear:both;
    overflow:hidden;
}
.sfmsta-stocktake .sfmsta-stock-row select{
    display:block;
    width:100%;
    max-width:100%;
    color:#182126;
    background:#fff;
}
.sfmsta-stocktake .sfmsta-stock-row option{
    color:#182126;
    background:#fff;
}
.sfmsta-stocktake .sfmsta-stock-row .sfmsta-fields label{
    display:block;
    min-width:0;
}

/* v1.2.3 — robust stock row markup */
.sfmsta-stocktake .sfmsta-stock-row{display:block!important;position:relative}
.sfmsta-stocktake .sfmsta-fields{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
.sfmsta-stocktake .sfmsta-field-wrap{display:flex!important;flex-direction:column!important;min-width:0!important}
.sfmsta-stocktake .sfmsta-field-wrap>label{display:block!important;margin:0 0 3px!important;font-size:8px!important;font-weight:800!important}
.sfmsta-stocktake .sfmsta-field-wrap>select{display:block!important;width:100%!important;height:34px!important;min-height:34px!important;max-height:34px!important;box-sizing:border-box!important;border:1px solid #cad4da!important;border-radius:8px!important;background:#fff!important;padding:4px 28px 4px 8px!important;font:inherit!important;font-size:11px!important;color:#182126!important;overflow:hidden!important;white-space:nowrap!important;}
.sfmsta-stocktake .sfmsta-skip{display:inline-block!important}
@media(max-width:700px){
 .sfmsta-stocktake .sfmsta-fields{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important}
 .sfmsta-stocktake .sfmsta-field-wrap>select{display:block!important;width:100%!important;height:34px!important;min-height:34px!important;max-height:34px!important;box-sizing:border-box!important;border:1px solid #cad4da!important;border-radius:8px!important;background:#fff!important;padding:4px 28px 4px 8px!important;font:inherit!important;font-size:11px!important;color:#182126!important;overflow:hidden!important;white-space:nowrap!important;}
}

/* v1.2.4 — NEVER style <option> as a block; keep native dropdown behaviour */
.sfmsta-stocktake .sfmsta-field-wrap select option{
  display:initial!important;
  position:static!important;
  visibility:visible!important;
  opacity:1!important;
  padding:initial!important;
  white-space:normal!important;
}
.sfmsta-stocktake .sfmsta-field-wrap select:not(:focus){
  overflow:hidden!important;
}

/* v1.2.6 — Product Manager hierarchy fields */
.sfmsta-form-help{margin:2px 0 10px;font-size:10px;color:#69757b}
.sfmsta-manager #sfmsta-subcategory{margin-top:5px}

/* v1.2.7 — stocktake save feedback + compact Not Needed button */
.sfmsta-stocktake .sfmsta-stock-row{
    transition:background-color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sfmsta-stocktake .sfmsta-stock-row.sfmsta-saving{
    background:#fffdf4!important;
}
.sfmsta-stocktake .sfmsta-stock-row.sfmsta-saved{
    background:#eef8f1!important;
    box-shadow:inset 4px 0 0 #0b6f4e;
}
.sfmsta-stocktake .sfmsta-stock-row.sfmsta-saved .sfmsta-stock-product strong{
    color:#0b6f4e!important;
}
.sfmsta-stocktake .sfmsta-stock-row.sfmsta-save-error{
    background:#fff4f3!important;
    box-shadow:inset 4px 0 0 #b42318;
}
.sfmsta-stocktake .sfmsta-skip{
    display:block!important;
    width:max-content!important;
    min-width:0!important;
    margin:5px 0 0 auto!important;
    padding:5px 9px!important;
    border:1px solid #cad4da!important;
    border-radius:7px!important;
    background:#fff!important;
    color:#536068!important;
    font-size:9px!important;
    line-height:1.1!important;
}
.sfmsta-stocktake .sfmsta-skip:hover{
    border-color:#0b6f4e!important;
    color:#0b6f4e!important;
    background:#f7fbf8!important;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped{
    background:#f4f6f6!important;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped .sfmsta-stock-product strong{
    color:#6a747a!important;
}
@media(max-width:700px){
    .sfmsta-stocktake .sfmsta-skip{
        padding:5px 8px!important;
        font-size:8.5px!important;
    }
}

/* v1.2.9 — Product Manager single form layout */
.sfmsta-single-form{padding:12px}
.sfmsta-single-form .sfmsta-box{max-width:none}
.sfmsta-single-form .sfmsta-form-row{margin-bottom:10px}
.sfmsta-single-form .sfmsta-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sfmsta-single-form .sfmsta-three{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.sfmsta-single-form label{display:block;font-size:11px;font-weight:700}
.sfmsta-single-form input,.sfmsta-single-form select,.sfmsta-single-form textarea{
  display:block;width:100%;margin-top:4px;padding:9px;border:1px solid #cad4da;border-radius:8px;background:#fff;font:inherit;
}
.sfmsta-single-form textarea{min-height:74px;resize:vertical}
.sfmsta-checkline{display:flex!important;align-items:center;gap:7px;margin:8px 0;font-size:11px!important}
.sfmsta-checkline input{width:auto!important;margin:0!important}
.sfmsta-form-actions{display:flex;gap:7px;margin-top:10px}
.sfmsta-form-actions .sfmsta-btn{text-decoration:none}
.sfmsta-inline-category{margin:0 12px 10px;background:#fff;border:1px solid var(--sfm-border);border-radius:10px;padding:8px 10px}
.sfmsta-inline-category summary{cursor:pointer;font-weight:700;font-size:12px;color:#0b6f4e}
.sfmsta-inline-category-form{display:grid;grid-template-columns:1fr 1fr 150px auto;gap:8px;align-items:end;padding-top:10px}
.sfmsta-inline-category-form label{font-size:10px;font-weight:700}
.sfmsta-inline-category-form input,.sfmsta-inline-category-form select{width:100%;margin-top:4px;padding:8px;border:1px solid #cad4da;border-radius:7px}
@media(max-width:700px){
 .sfmsta-single-form{padding:7px}
 .sfmsta-single-form .sfmsta-two,.sfmsta-single-form .sfmsta-three{grid-template-columns:1fr}
 .sfmsta-inline-category{margin:0 7px 7px}
 .sfmsta-inline-category-form{grid-template-columns:1fr}
}

/* v1.3.0 — 6-hour session + guided stocktake */
.sfmsta-session-timer{margin:0 0 10px;padding:9px 12px;border-radius:8px;background:#f5f7f7;border:1px solid #d9e0e0;font-size:12px;text-align:center}
.sfmsta-session-timer strong{color:#0b6f4e}
.sfmsta-stock-row.sfmsta-next-product{outline:2px solid #0b6f4e;outline-offset:2px}
.sfmsta-stocktake.sfmsta-sequence-complete .sfmsta-bottom{box-shadow:0 0 0 2px rgba(11,111,78,.18)}

/* v1.3.1 drag ordering */
.sfmsta-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin-right:6px;border:1px solid #d8e0e4;border-radius:6px;color:#0b6f4e;cursor:grab;font-style:normal;user-select:none;touch-action:none}.sfmsta-drag-handle:active{cursor:grabbing}.sfmsta-product-drag{float:left;margin:10px 8px 0 0}.ui-sortable-placeholder{visibility:visible!important;min-height:44px;background:#eef8f1;border:2px dashed #0b6f4e;border-radius:8px;margin:6px 0}

/* v1.3.2 — reliable Product Manager drag-and-drop ordering */
.sfmsta-order-status{
  margin:8px 12px;
  padding:8px 10px;
  border-radius:8px;
  background:#f4f6f6;
  color:#536068;
  font-size:11px;
  transition:opacity .2s ease,transform .2s ease;
}
.sfmsta-order-status.show{background:#eef8f1;color:#0b6f4e}
.sfmsta-order-status.error{background:#fff4f3;color:#b42318}
.sfmsta-manager .sfmsta-drag-handle{
  cursor:grab!important;
  user-select:none;
  touch-action:none;
  padding:4px 7px;
  margin-right:6px;
  border-radius:6px;
  color:#0b6f4e;
  background:#eef8f1;
  font-style:normal;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.sfmsta-manager .sfmsta-drag-handle:active{cursor:grabbing!important}
.sfmsta-manager .ui-sortable-helper{opacity:.85;box-shadow:0 6px 18px rgba(0,0,0,.14)}
.sfmsta-manager .ui-sortable-placeholder{
  visibility:visible!important;
  min-height:42px;
  border:2px dashed #0b6f4e;
  border-radius:8px;
  background:#f7fcf8;
}

/* v1.3.3: Stock Take is not draggable */
.sfmsta-stocktake .sfmsta-drag-handle{display:none!important;}

/* v1.3.4 — Product Manager ordering for categories, subcategories and products */
.sfmsta-manager .sfmsta-cat>summary,
.sfmsta-manager .sfmsta-sub>summary{
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr) auto!important;
  column-gap:7px!important;
}
.sfmsta-manager .sfmsta-category-drag{
  margin:0!important;
  float:none!important;
  align-self:center!important;
}
.sfmsta-manager .sfmsta-sortable-categories,
.sfmsta-manager .sfmsta-sortable-subcategories,
.sfmsta-manager .sfmsta-sortable-products{
  touch-action:pan-y;
}


/* v1.3.5 — clean Stock Take accordion layout */
.sfmsta-stocktake .sfmsta-drag-handle,
.sfmsta-stocktake .sfmsta-category-drag,
.sfmsta-stocktake .sfmsta-product-drag{
  display:none!important;
}

.sfmsta-stocktake .sfmsta-stock-cat,
.sfmsta-stocktake .sfmsta-stock-sub{
  display:block!important;
  clear:both!important;
  width:auto!important;
  float:none!important;
  position:relative!important;
}

.sfmsta-stocktake .sfmsta-stock-cat > summary,
.sfmsta-stocktake .sfmsta-stock-sub > summary{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto 18px!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  box-sizing:border-box!important;
  cursor:pointer!important;
}

.sfmsta-stocktake .sfmsta-stock-cat > summary > span,
.sfmsta-stocktake .sfmsta-stock-sub > summary > span{
  min-width:0!important;
}

.sfmsta-stocktake .sfmsta-stock-cat > summary > i,
.sfmsta-stocktake .sfmsta-stock-sub > summary > i{
  justify-self:end!important;
  transition:transform .18s ease!important;
}

.sfmsta-stocktake .sfmsta-stock-cat[open] > summary > i,
.sfmsta-stocktake .sfmsta-stock-sub[open] > summary > i{
  transform:rotate(180deg)!important;
}

/* Keep each subcategory and its products as one clean accordion block */
.sfmsta-stocktake .sfmsta-stock-sub{
  margin:6px 8px!important;
}

.sfmsta-stocktake .sfmsta-stock-products{
  display:block!important;
  width:100%!important;
  box-sizing:border-box!important;
}


/* v1.3.8 — Product Manager: keep actions/toggle on the far right */
.sfmsta-manager .sfmsta-product-card{
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  gap:8px!important;
  float:none!important;
  clear:both!important;
}
.sfmsta-manager .sfmsta-product-drag{
  flex:0 0 26px!important;
  width:26px!important;
  height:26px!important;
  margin:0!important;
  float:none!important;
}
.sfmsta-manager .sfmsta-select-product{
  flex:0 0 17px!important;
  width:17px!important;
  height:17px!important;
  margin:0!important;
}
.sfmsta-manager .sfmsta-product-image{
  flex:0 0 34px!important;
  width:34px!important;
  height:34px!important;
  margin:0!important;
}
.sfmsta-manager .sfmsta-product-info{
  flex:1 1 auto!important;
  min-width:0!important;
  margin:0!important;
}
.sfmsta-manager .sfmsta-product-actions{
  margin-left:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex:0 0 auto!important;
  min-width:max-content!important;
}
.sfmsta-manager .sfmsta-edit,
.sfmsta-manager .sfmsta-status-toggle{
  position:static!important;
  float:none!important;
  grid-column:auto!important;
  grid-row:auto!important;
  margin:0!important;
  justify-self:auto!important;
  align-self:center!important;
}
.sfmsta-manager .sfmsta-status-toggle{
  display:flex!important;
  align-items:center!important;
  white-space:nowrap!important;
}
@media(max-width:700px){
  .sfmsta-manager .sfmsta-product-card{
    gap:6px!important;
    flex-wrap:nowrap!important;
  }
  .sfmsta-manager .sfmsta-product-info small{display:none!important;}
  .sfmsta-manager .sfmsta-product-actions{gap:5px!important;}
  .sfmsta-manager .sfmsta-status-toggle em{display:none!important;}
  .sfmsta-manager .sfmsta-edit{padding:5px 6px!important;}
}

.sfmsta-stocktake .sfmsta-skip{
  border:1px solid #e53935!important;background:#fff!important;color:#e53935!important;
}
.sfmsta-stocktake .sfmsta-skip.is-skipped{
  border-color:#cad4da!important;background:#fff!important;color:#536068!important;
}

/* v1.5.1 — completion counts and missing navigation */
.sfmsta-overall-progress{
  display:flex;justify-content:space-between;align-items:center;
  margin:0 8px 6px;padding:8px 10px;border:1px solid var(--sfm-border);
  border-radius:8px;background:#fff;font-size:11px;
}
.sfmsta-overall-progress strong{color:var(--sfm-green);font-variant-numeric:tabular-nums}
.sfmsta-stocktake .sfmsta-progress{min-width:42px;text-align:center;font-variant-numeric:tabular-nums}
.sfmsta-review-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.sfmsta-review-total{padding:7px 0;margin:0}
.sfmsta-review-group{border:1px solid var(--sfm-border);border-radius:8px;overflow:hidden;margin:6px 0}
.sfmsta-review-group-btn{width:100%;display:flex;justify-content:space-between;border:0;background:#fff;padding:9px 10px;font:inherit;font-weight:700;cursor:pointer}
.sfmsta-review-group-btn strong{color:var(--sfm-green)}
.sfmsta-review-missing{display:grid;gap:5px;padding:7px;background:#fafafa;border-top:1px solid #edf1f3}
.sfmsta-review-missing-title{font-size:10px;font-weight:700;color:#778189;text-transform:uppercase}
.sfmsta-missing-item{padding:7px 8px;text-align:left;border:1px solid #e53935;border-radius:7px;background:#fff7f7;color:#c62828;cursor:pointer}
.sfmsta-review-complete{margin-top:7px;padding:9px;border-radius:8px;background:#eef8f1;color:var(--sfm-green);font-weight:700}
.sfmsta-stock-row.sfmsta-complete{background:#fbfdfb!important}
.sfmsta-stock-row.sfmsta-next-product{background:#f3fbf6!important;box-shadow:inset 4px 0 0 var(--sfm-green)}

/* v1.5.3 — polished submitted state */
.sfmsta-submitted-card{
  min-height:360px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:40px 24px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--sfm-border);
}
.sfmsta-submitted-icon{
  width:72px;height:72px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:#eef8f1;color:var(--sfm-green);
  font-size:42px;font-weight:800;
  border:2px solid #b8dfc4;
  margin-bottom:16px;
}
.sfmsta-submitted-card h2{margin:0 0 8px;font-size:26px;color:#17352a}
.sfmsta-submitted-card p{margin:0 0 18px;color:#66727a}
.sfmsta-submitted-status{
  padding:9px 13px;border-radius:8px;
  background:#eef8f1;color:var(--sfm-green);
  font-weight:700;font-size:13px;margin-bottom:22px;
}

/* v1.5.4 — Edit Product delete action */
.sfmsta-form-actions .sfmsta-btn.danger{
  background:#c62828!important;
  border:1px solid #c62828!important;
  color:#fff!important;
}
.sfmsta-form-actions .sfmsta-btn.danger:hover{
  background:#a91f1f!important;
  border-color:#a91f1f!important;
  color:#fff!important;
}
@media(max-width:700px){
  .sfmsta-form-actions{flex-wrap:wrap}
  .sfmsta-form-actions .sfmsta-btn.danger{width:100%}
}

/* v1.5.5 — clean Product Manager product card layout */
.sfmsta-manager .sfmsta-product-card{
  display:grid!important;
  grid-template-columns:28px 22px 40px minmax(0,1fr) 150px!important;
  align-items:center!important;
  column-gap:8px!important;
  width:100%!important;
  min-height:60px!important;
  padding:8px 10px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
.sfmsta-manager .sfmsta-product-card > *{
  float:none!important;
  clear:none!important;
  position:static!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-product-drag{
  grid-column:1!important;grid-row:1!important;
  width:26px!important;height:26px!important;
  margin:0!important;justify-self:center!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-select-product{
  grid-column:2!important;grid-row:1!important;
  width:17px!important;height:17px!important;
  margin:0!important;justify-self:center!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-product-image{
  grid-column:3!important;grid-row:1!important;
  width:38px!important;height:38px!important;
  margin:0!important;justify-self:start!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-product-info{
  grid-column:4!important;grid-row:1!important;
  min-width:0!important;width:auto!important;margin:0!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-product-info strong,
.sfmsta-manager .sfmsta-product-card .sfmsta-product-info small{
  display:block!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-product-actions{
  grid-column:5!important;grid-row:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  width:150px!important;min-width:150px!important;
  margin:0!important;padding:0!important;
  white-space:nowrap!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-edit{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
  margin:0!important;
}
.sfmsta-manager .sfmsta-product-card .sfmsta-status-toggle{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:5px!important;
  flex:0 0 auto!important;
  width:auto!important;min-width:78px!important;
  margin:0!important;padding:0!important;
  white-space:nowrap!important;
}
@media(max-width:760px){
  .sfmsta-manager .sfmsta-product-card{
    grid-template-columns:24px 20px 36px minmax(0,1fr) 120px!important;
    column-gap:6px!important;padding:7px 8px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-product-actions{
    width:120px!important;min-width:120px!important;gap:5px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-status-toggle{
    min-width:66px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-status-toggle em{
    font-size:9px!important;
  }
}
@media(max-width:560px){
  .sfmsta-manager .sfmsta-product-card{
    grid-template-columns:22px 18px 32px minmax(0,1fr) 62px!important;
    column-gap:5px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-product-actions{
    width:62px!important;min-width:62px!important;gap:4px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-edit{
    font-size:9px!important;padding:4px 5px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-status-toggle{
    min-width:30px!important;
  }
  .sfmsta-manager .sfmsta-product-card .sfmsta-status-toggle em{
    display:none!important;
  }
}

.sfmsta-form-actions .sfmsta-btn.danger{
  background:#c62828!important;
  border:1px solid #c62828!important;
  color:#fff!important;
}
.sfmsta-form-actions .sfmsta-btn.danger:hover{
  background:#a91f1f!important;
  border-color:#a91f1f!important;
}

/* v1.5.6 — progress status + bright Not Needed */
.sfmsta-stocktake .sfmsta-progress{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  min-width:78px!important;
  justify-content:center!important;
}
.sfmsta-stocktake .sfmsta-progress-count{font-variant-numeric:tabular-nums}
.sfmsta-stocktake .sfmsta-progress-state{
  font-style:normal!important;
  font-size:8px!important;
  letter-spacing:.2px!important;
  padding:3px 5px!important;
  border-radius:999px!important;
  background:#fff3cd!important;
  color:#856404!important;
}
.sfmsta-stocktake .sfmsta-group-complete>summary .sfmsta-progress-state{
  background:#d9f6e1!important;
  color:#0b6f4e!important;
}
.sfmsta-stocktake .sfmsta-group-complete>summary{
  background:#f1fbf4!important;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped{
  background:#e7f8ed!important;
  border-left:4px solid #0b6f4e!important;
  transition:background .2s ease,border-color .2s ease;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped .sfmsta-stock-product strong{
  color:#0b6f4e!important;
}
.sfmsta-stocktake .sfmsta-skip{
  border:1px solid #e53935!important;
  background:#fff!important;
  color:#e53935!important;
}
.sfmsta-stocktake .sfmsta-skip:hover{
  background:#ffe9e9!important;
}
.sfmsta-stocktake .sfmsta-skip.is-skipped{
  border-color:#0b6f4e!important;
  background:#fff!important;
  color:#0b6f4e!important;
}

/* v1.5.7 — Not Needed is a completed stocktake item */
.sfmsta-stocktake .sfmsta-stock-row.skipped{
  background:#dff7e7!important;
  border-left:5px solid #0b6f4e!important;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped .sfmsta-stock-state{
  color:#0b6f4e!important;
  font-weight:800!important;
}
.sfmsta-stocktake .sfmsta-stock-row.skipped .sfmsta-stock-product strong{
  color:#0b6f4e!important;
}

/* v1.5.21 — Active Stock Take cards */
.sfmsta-session-list{max-width:1100px;margin:28px auto;padding:22px;background:#f7faf8;border:1px solid #dbe6e0;border-radius:14px;box-sizing:border-box}
.sfmsta-session-list-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.sfmsta-session-list-head h2{margin:0;color:#16231e;font-size:28px;line-height:1.15}
.sfmsta-session-list-head p{margin:7px 0 0;color:#66736c;font-size:14px}
.sfmsta-live-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border-radius:999px;background:#e7f6ed;color:#0b6f4e;font-size:11px;font-weight:800;letter-spacing:.4px}
.sfmsta-session-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
.sfmsta-session-card{display:block;text-decoration:none!important;color:#17221d!important;background:#fff;border:1px solid #d8e3dd;border-radius:12px;padding:17px 18px;box-shadow:0 2px 8px rgba(14,44,31,.06);transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.sfmsta-session-card:hover,.sfmsta-session-card:focus{transform:translateY(-2px);border-color:#0b6f4e;box-shadow:0 7px 18px rgba(14,44,31,.12);outline:none}
.sfmsta-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sfmsta-card-top strong{font-size:18px;line-height:1.25}
.sfmsta-card-status{font-size:10px;font-weight:800;color:#0b6f4e;background:#e7f6ed;border-radius:999px;padding:5px 8px;white-space:nowrap}
.sfmsta-card-meta{display:flex;justify-content:space-between;gap:10px;margin-top:8px;color:#6b7771;font-size:12px}
.sfmsta-card-progress{margin-top:15px}
.sfmsta-card-progress-line{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#52615a}
.sfmsta-card-progress-line b{color:#24342d}
.sfmsta-card-progress-track{height:8px;margin-top:7px;background:#eaf0ed;border-radius:999px;overflow:hidden}
.sfmsta-card-progress-track i{display:block;height:100%;background:#0b6f4e;border-radius:999px}
.sfmsta-card-footer{display:flex;align-items:center;justify-content:space-between;margin-top:15px;padding-top:12px;border-top:1px solid #edf1ef;font-size:12px;color:#6b7771}
.sfmsta-card-footer em{font-style:normal;font-weight:800;color:#0b6f4e}
.sfmsta-empty{padding:18px;background:#fff;border:1px dashed #cbd8d1;border-radius:10px;color:#637069}
@media(max-width:600px){
  .sfmsta-session-list{margin:16px 8px;padding:15px}
  .sfmsta-session-list-head h2{font-size:22px}
  .sfmsta-session-list-head{align-items:flex-start}
  .sfmsta-card-top strong{font-size:16px}
}

/* v1.5.23 — Subcategory Not Needed */
.sfmsta-stocktake .sfmsta-stock-sub>summary{position:relative}
.sfmsta-stocktake .sfmsta-sub-no-need{
  margin-left:auto;
  flex:0 0 auto;
  border:1px solid #ff4b6e;
  background:#ff4b6e;
  color:#fff;
  border-radius:6px;
  padding:4px 8px;
  min-height:26px;
  font-size:10px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
}
.sfmsta-stocktake .sfmsta-sub-no-need:hover{filter:brightness(.94)}
.sfmsta-stocktake .sfmsta-sub-no-need:disabled{opacity:.7;cursor:wait}
.sfmsta-stocktake .sfmsta-sub-no-need.is-complete{
  border-color:#0b6f4e;
  background:#0b6f4e;
}
.sfmsta-stocktake .sfmsta-sub-no-need.is-working{background:#8d9b95;border-color:#8d9b95}
@media(max-width:600px){
  .sfmsta-stocktake .sfmsta-sub-no-need{padding:4px 7px;font-size:9px}
}
