/* StockTakes workspace: list/detail and editor share data, not the generic adjustment queue. */
#view-stocktake {max-width:none;padding:16px 16px 90px;background:#eef3f9;}
#view-stocktake .st-page {font-family:Arial,'Segoe UI',sans-serif;color:#152b43;--font:Arial,'Segoe UI',sans-serif;--st-blue:#0070f4;--st-border:#ced9e7;--st-panel:#f7faff;}
#view-stocktake .st-head {display:grid;grid-template-columns:264px minmax(180px,1fr) auto;align-items:center;gap:12px;margin-bottom:14px;}
#view-stocktake .st-head h1 {font:700 24px/1.35 Arial,sans-serif;color:#101820;}
.st-toolbar,.st-detail-actions>div {display:flex;gap:8px;align-items:center;}
.st-icon,.st-button {appearance:none;border:1px solid var(--st-border,#ced9e7);border-radius:7px;background:#fff;color:#243b55;cursor:pointer;font:inherit;line-height:1.3;}
.st-button {padding:8px 12px;min-height:34px;}
.st-icon {display:inline-flex;align-items:center;justify-content:center;padding:7px;min-width:34px;min-height:34px;}
.st-icon svg {width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.65;}
.st-icon:hover,.st-button:hover {background:#edf5ff;border-color:#87b4ef;}
.st-icon:disabled,.st-button:disabled {opacity:.45;cursor:default;}
.st-blue,.st-blue:hover {background:var(--st-blue,#0070f4);border-color:var(--st-blue,#0070f4);color:#fff;font-weight:700;}
.st-primary-outline {border-color:var(--st-blue);color:var(--st-blue);}
.st-icon:focus-visible,.st-button:focus-visible {outline:2px solid #0070f4;outline-offset:2px;}
.st-link {border:0;background:none;color:#0070f4;padding:0;font:inherit;cursor:pointer;text-align:left;}
.st-link:hover {text-decoration:underline;}
.st-list-search,.st-product-search {display:flex;align-items:center;gap:8px;border:1px solid var(--st-border);background:var(--st-panel);border-radius:8px;padding:0 10px;min-width:0;}
.st-list-search input,.st-product-search input {border:0;background:transparent;box-shadow:none;min-width:0;padding:7px 0;}
.st-list-search>.st-menu>.st-icon,.st-product-search>.st-icon {border:0;background:transparent;}
.st-menu {position:relative;}
.st-menu summary {list-style:none;cursor:pointer;}
.st-menu summary::-webkit-details-marker {display:none;}
.st-menu-body,.st-date-choices {position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:230px;max-height:65vh;overflow:auto;padding:12px;background:#fff;border:1px solid #d3dfed;box-shadow:0 8px 30px #17365920;border-radius:8px;}
.st-menu-body>button {display:block;border:0;background:none;text-align:left;padding:8px;width:100%;cursor:pointer;font:inherit;}
.st-menu-body>button:hover {background:#edf5ff;}
.st-menu-body label {display:flex;align-items:center;gap:8px;padding:6px 0;color:#152b43;font-weight:400;}
.st-menu-body label:has(select) {display:grid;}
.st-menu-body input[type=checkbox] {margin:0;}
.st-feedback:empty {display:none;}
.st-feedback {padding:8px 0;display:flex;flex-wrap:wrap;align-items:center;gap:10px;overflow-wrap:anywhere;}
.st-error {color:#b4232c;}
.st-layout {display:grid;grid-template-columns:264px minmax(0,1fr);gap:12px;min-height:calc(100dvh - 160px);}
.st-filters {background:var(--st-panel);border-radius:8px;padding:16px 12px;}
.st-filters h2 {font-size:16px;line-height:1.4;color:#101820;margin:0 0 12px;font-weight:700;}
.st-date-row {display:flex;align-items:center;gap:8px;margin-bottom:10px;}
.st-date-row input[type=radio] {width:17px;height:17px;margin:0;accent-color:#0070f4;}
.st-date-menu {position:relative;flex:1;min-width:0;}
.st-date-menu>summary,.st-date-custom {padding:7px 10px;min-height:34px;border:1px solid var(--st-border);border-radius:7px;list-style:none;background:transparent;font-size:14px;cursor:pointer;}
.st-date-menu>summary::after {content:'›';float:right;}
.st-date-custom {flex:1;text-align:left;}
.st-date-choices {left:0;right:auto;min-width:270px;}
.st-date-choices>b {display:block;color:#718096;padding:8px;}
.st-date-choices>button {display:block;width:100%;background:none;border:0;text-align:left;padding:8px;cursor:pointer;font:inherit;}
.st-date-choices>button:hover {background:#edf5ff;}
.st-status-filters {margin-top:24px;}
.st-status-filters label {display:flex;align-items:center;gap:8px;margin:12px 0;font-size:14px;font-weight:400;color:#152b43;}
.st-status-filters input {width:16px;height:16px;margin:0;accent-color:#0070f4;}
.st-list {display:flex;flex-direction:column;min-width:0;min-height:0;}
.st-bulk {display:flex;gap:10px;align-items:center;padding:8px;background:#e5f0ff;flex-wrap:wrap;}
.st-table-scroll {overflow:auto;flex:1;min-height:0;max-height:calc(100dvh - 170px);scrollbar-gutter:stable;}
.st-table {border-spacing:0;border-collapse:separate;width:max(100%,1500px);table-layout:auto;font-size:14px;}
.st-table th {background:#e0edfd;color:#102b49;font-size:13px;white-space:nowrap;padding:14px 12px;text-align:left;font-weight:700;border-bottom:1px solid #d3dfed;}
.st-table th[tabindex] {cursor:pointer;}
.st-table th[aria-sort=ascending]::after {content:' ↑';color:#0070f4;}
.st-table th[aria-sort=descending]::after {content:' ↓';color:#0070f4;}
.st-table .st-check,.st-table .st-star {width:34px;min-width:34px;padding:8px;}
.st-check input {width:16px;height:16px;margin:0;accent-color:#0070f4;}
.st-star .st-icon {background:none;border:0;color:#8a9bae;min-width:24px;padding:0;}
.st-star .st-icon.is-starred {color:#cf9000;}
.st-star .is-starred svg {fill:#ffdc73;}
.st-record {background:#fff;cursor:pointer;}
.st-record td {padding:12px;border-bottom:1px solid #e3eaf3;white-space:nowrap;}
.st-record:hover,.st-record.is-open {background:#e9f3ff;}
.st-record:focus-visible {outline:2px solid #0070f4;outline-offset:-2px;}
.st-code {color:#102b49;}
.st-num {text-align:right!important;font-variant-numeric:tabular-nums;}
.st-detail-row>td {padding:0;vertical-align:top;}
.st-detail {background:#f7faff;border:1px solid #0070f4;position:sticky;left:0;width:var(--st-detail-width,900px);box-sizing:border-box;}
.st-detail-tabs {padding:0 24px;border-bottom:1px solid #d7e2ef;}
.st-detail-tabs>span {display:inline-block;padding:12px 0 10px;margin-right:24px;border-bottom:2px solid #0070f4;color:#0070f4;}
.st-detail-content {padding:18px 24px 22px;}
.st-detail-heading {display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px;}
.st-detail-heading h2 {font-size:21px;line-height:1.3;margin:0;}
.st-state {display:inline-block;padding:3px 7px;border-radius:4px;background:#edf1f7;font-size:14px;}
.st-state.balanced {color:#00834c;background:#dff5ec;}
.st-state.draft {color:#865400;background:#fff0d4;}
.st-state.cancelled {color:#a6333d;background:#fdebed;}
.st-detail-meta p {margin:8px 0;font-size:14px;}
.st-detail-table-wrap {overflow:auto;margin:40px 0 30px;}
.st-detail-table {width:100%;min-width:600px;border-collapse:collapse;font-size:14px;}
.st-detail-table th {padding:10px;background:#e8edf5;border-bottom:1px solid #cad6e7;text-align:left;}
.st-detail-table td {padding:8px 10px;}
.st-detail-table th:nth-child(n+3),.st-detail-table td:nth-child(n+3) {text-align:right;}
.st-detail-table input {background:transparent;min-height:34px;padding:6px 10px;font-size:14px;}
.st-detail-bottom {display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,.75fr);gap:30px;align-items:start;}
.st-detail-bottom textarea {height:128px;min-height:90px;background:transparent;}
.st-totals {display:grid;grid-template-columns:1fr auto;gap:14px 20px;margin:0;text-align:right;font-size:14px;}
.st-totals dd {margin:0;font-variant-numeric:tabular-nums;}
.st-detail-actions {display:flex;justify-content:space-between;padding:16px 24px;border-top:1px solid #e0e8f2;gap:12px;}
.st-detail-actions>div:first-child>.st-icon {background:none;border-color:transparent;}
.st-list-foot {display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:12px;}
.st-list-foot label {display:flex;align-items:center;gap:8px;color:#152b43;font-size:14px;font-weight:400;}
.st-list-foot select {width:auto;padding:4px 8px;min-height:30px;}
.st-paging {display:flex;align-items:center;gap:6px;}
.st-page-number {border:0;background:none;border-radius:5px;min-width:30px;min-height:30px;cursor:pointer;}
.st-page-number.active {background:#0070f4;color:#fff;}
.st-empty {text-align:center;padding:50px;background:#fff;}
.st-editor {display:flex;flex-direction:column;min-height:500px;height:calc(100dvh - 140px);gap:12px;}
.st-editor-head {display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.st-product-search {flex:1;min-width:220px;background:#fff;}
.st-editor-layout {display:grid;grid-template-columns:230px minmax(0,1fr);gap:14px;min-height:0;flex:1;overflow:auto;}
.st-editor-meta {background:#f7faff;padding:16px;border-radius:8px;display:flex;flex-direction:column;gap:18px;}
.st-editor-meta label {font-size:14px;}
.st-editor-meta textarea {min-height:120px;background:#fff;}
.st-editor-content {display:flex;flex-direction:column;min-width:0;min-height:0;background:#fff;position:relative;}
.st-editor-tabs {display:flex;gap:0;border-bottom:1px solid #d6e1f0;flex:none;}
.st-tab {border:0;border-bottom:2px solid transparent;padding:13px 16px;cursor:pointer;background:transparent;white-space:nowrap;font:inherit;}
.st-tab.active {color:#0070f4;border-color:#0070f4;}
.st-editor-table-wrap {overflow:auto;min-height:0;}
.st-editor-table {min-width:820px;width:100%;border-collapse:collapse;font-size:14px;}
.st-editor-table th {padding:12px 10px;white-space:nowrap;background:#e1edfd;font-size:13px;text-align:left;}
.st-editor-table td {padding:10px;border-bottom:1px solid #e6edf5;}
.st-editor-table input {width:100px;padding:7px 10px;text-align:right;}
.st-editor-table th:nth-child(3) {min-width:220px;}
.st-editor-name {min-width:220px;}
.st-editor-name img {width:38px;height:38px;object-fit:contain;float:left;margin-right:8px;}
.st-negative {color:#c32837;}
.st-editor-footer {display:flex;justify-content:space-between;gap:12px;flex:none;padding:8px 0;}
.st-editor-footer .st-button {min-width:145px;min-height:42px;}
.st-import-empty {flex:1;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:48px 16px;color:#66748a;}
.st-import-empty>p:first-child {font-size:20px;}
.st-product-results {position:absolute;top:44px;left:0;right:0;z-index:25;max-height:350px;overflow:auto;background:#fff;box-shadow:0 8px 30px #16385b26;border:1px solid #ced9e7;}
.st-product-option {display:block;width:100%;border:0;border-bottom:1px solid #e3ebf6;background:#fff;padding:12px;text-align:left;cursor:pointer;font:inherit;}
.st-product-option:hover {background:#edf5ff;}
.st-dialog .modal-body {max-height:65dvh;overflow:auto;}
.st-date-inputs {display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.st-calendar-nav {display:flex;justify-content:space-between;margin:12px 0;}
.st-calendars {display:grid;grid-template-columns:1fr 1fr;gap:20px;}
.st-calendar-heading {text-align:center;padding:10px;}
.st-calendar-grid {display:grid;grid-template-columns:repeat(7,1fr);gap:3px;}
.st-calendar-grid>b {font-size:12px;text-align:center;padding:6px 0;}
.st-calendar-day {background:none;border:0;border-radius:4px;min-height:30px;cursor:pointer;}
.st-calendar-day.selected {background:#0070f4;color:#fff;}
@media(max-width:1100px){#view-stocktake .st-head {grid-template-columns:230px minmax(150px,1fr) auto;}.st-layout{grid-template-columns:230px minmax(0,1fr);}.st-detail-bottom{gap:16px;}}
@media(max-width:850px){
 #view-stocktake {padding:12px 12px 100px;}
 #view-stocktake .st-head {grid-template-columns:minmax(0,1fr) auto;gap:10px;}
 #view-stocktake .st-head h1 {font-size:22px;}
 .st-toolbar {gap:5px;}.st-list-search{grid-column:1/-1;grid-row:2;}
 .st-layout{display:block;min-height:0;}.st-filters{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;padding:12px;}.st-filters>h2{grid-column:1;}.st-date-row{grid-column:1;}.st-status-filters{grid-column:2;grid-row:1/4;margin:0;}.st-status-filters label{font-size:13px;margin:10px 0;}.st-status-filters h2{margin-bottom:8px;}.st-list{margin-top:12px;}.st-table-scroll{max-height:none;min-height:220px;}.st-detail-content{padding:14px 12px;}.st-detail-tabs{padding:0 12px;}.st-detail-meta p{line-height:1.6;}.st-detail-table-wrap{margin:22px 0;}.st-detail-bottom{grid-template-columns:1fr;gap:16px;}.st-detail-bottom textarea{height:90px;}.st-detail-actions{padding:12px;gap:8px;}.st-detail-actions>div{gap:5px;flex-wrap:wrap;}.st-detail-actions .st-icon,.st-dialog .st-button{min-height:44px;min-width:40px;}.st-list-foot{flex-wrap:wrap;}.st-menu-body{max-width:calc(100vw - 32px);}.st-date-choices{min-width:240px;max-width:calc(100vw - 32px);}.st-editor{height:calc(100dvh - 145px);min-height:400px;}.st-editor-layout{display:block;}.st-editor-meta{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px;}.st-editor-meta label:last-child{grid-column:1/-1;}.st-editor-meta textarea{min-height:70px;}.st-editor-head .st-product-search{order:2;flex-basis:100%;}.st-editor-head>.st-button{font-size:13px;}.st-tab{padding:12px 8px;font-size:13px;}.st-editor-table-wrap{max-height:600px;}.st-editor-footer .st-button{min-width:130px;min-height:44px;}.st-import-empty{min-height:220px;}.st-calendars{gap:8px;}.st-calendar-day{min-height:30px;font-size:12px;}.st-feedback .st-button{min-height:44px;}
}
@media(max-width:850px){
 /* Keep the existing global chat/reminder shortcuts above the stocktake save bar. */
 body:has(#view-stocktake:not([hidden]) .st-editor:not([hidden])) :is(.chat-launcher,.reminder-launcher) {bottom:calc(var(--nav-h,calc(62px + env(safe-area-inset-bottom))) + 72px);}
}
@media(min-width:851px){body:has(#view-stocktake:not([hidden]) .st-editor:not([hidden])) :is(.chat-launcher,.reminder-launcher,.toasts){bottom:88px;}}
@media(max-width:850px){body:has(#view-stocktake:not([hidden]) .st-editor:not([hidden])) .toasts{bottom:calc(var(--nav-h,calc(62px + env(safe-area-inset-bottom))) + 72px);}}
#view-stocktake .st-editor{min-height:0;}
@media(min-width:851px){body:has(#view-stocktake:not([hidden]) .st-editor:not([hidden])) :is(.chat-launcher,.reminder-launcher,.toasts){bottom:148px;}}
@media(max-width:850px){body:has(#view-stocktake:not([hidden]) .st-editor:not([hidden])) :is(.chat-launcher,.reminder-launcher,.toasts){bottom:calc(var(--nav-h,calc(62px + env(safe-area-inset-bottom))) + 128px);}}
