/* Inventory workspace only. Matches the other staff dashboard pages. */
.lucky-inventory-page { --lucky-ui-bg:var(--lucky-page-bg); }
.lucky-inventory-page .main-panel { gap:0; }
.lucky-inventory-page .ops-tabs { position:static; }
.lucky-inventory-page .dashboard-shell .main-panel > nav.admin-section-tabs > .ops-tab { min-height:44px; }
.lucky-inventory-page .ops-content { display:grid; gap:14px; min-width:0; padding:0; }
.lucky-inventory-page :is(.inventory-header,.inventory-cycle-summary,#inventoryPanel,.inventory-history) { min-width:0; padding:16px 18px; border:1px solid var(--lucky-border); border-radius:10px; background:var(--lucky-surface); }
.lucky-inventory-page .inventory-header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.lucky-inventory-page h1 { margin:0; font-size:26px; color:var(--lucky-brown-deep); }
.lucky-inventory-page .inventory-header p { margin:6px 0 0; color:var(--lucky-text-muted); font-size:14px; line-height:1.6; }
.lucky-inventory-page .inventory-header-actions { display:flex; flex-shrink:0; gap:8px; }
.lucky-inventory-page .dashboard-shell :is(button,summary) { min-height:44px; }
.lucky-inventory-page .dashboard-shell button { padding:10px 14px; font-size:14px; }
.lucky-inventory-page .dashboard-shell :is(#addInventoryItem,#saveInventory) { --lucky-ui-component-bg:var(--lucky-yellow); --lucky-ui-component-border:1px solid var(--lucky-gold); --lucky-ui-component-color:var(--lucky-brown-deep); font-weight:700; }
.lucky-inventory-page .inventory-cycle-summary { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; }
.lucky-inventory-page .inventory-cycle-tabs { display:flex; padding:4px; border:1px solid var(--lucky-border); border-radius:8px; background:var(--lucky-white); gap:4px; }
.lucky-inventory-page .dashboard-shell .inventory-cycle-tabs button { --lucky-ui-component-bg:transparent; --lucky-ui-component-border:1px solid transparent; min-width:110px; min-height:44px; font-size:15px; }
.lucky-inventory-page .dashboard-shell .inventory-cycle-tabs button[aria-selected="true"] { --lucky-ui-component-bg:var(--lucky-yellow); --lucky-ui-component-color:var(--lucky-brown-deep); font-weight:700; }
.lucky-inventory-page .inventory-summary { display:flex; flex-wrap:wrap; gap:10px 28px; color:var(--lucky-text-muted); font-size:12px; }
.lucky-inventory-page .inventory-summary > span { display:grid; gap:4px; min-width:0; }
.lucky-inventory-page .inventory-summary strong { color:var(--lucky-brown); font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.lucky-inventory-page .inventory-list-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.lucky-inventory-page .inventory-list-heading h2 { margin:0; color:var(--lucky-brown-deep); font-size:18px; }
.lucky-inventory-page #inventoryItemCount { font-size:12px; color:var(--lucky-text-muted); }
.lucky-inventory-page .inventory-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.lucky-inventory-page .inventory-toolbar label { display:flex; align-items:center; gap:10px; color:var(--lucky-brown); font-size:14px; }
.lucky-inventory-page .inventory-toolbar input { --lucky-ui-component-bg:var(--lucky-white); --lucky-ui-component-radius:8px; min-width:0; min-height:44px; width:170px; font-size:16px; }
.lucky-inventory-page .inventory-toolbar p { margin:0; color:var(--lucky-text-muted); font-size:12px; line-height:1.6; }
.lucky-inventory-page #stockItems { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; }
.lucky-inventory-page .stock-item { display:grid; grid-template-columns:minmax(0,1fr) 130px; align-items:center; gap:12px; min-width:0; padding:10px 12px; border:1px solid var(--lucky-border); border-radius:8px; background:var(--lucky-white); }
.lucky-inventory-page .stock-copy { display:grid; gap:4px; min-width:0; }
.lucky-inventory-page .stock-name { color:var(--lucky-brown-deep); font-size:15px; font-weight:700; line-height:1.5; overflow-wrap:anywhere; }
.lucky-inventory-page .stock-previous { color:var(--lucky-text-muted); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.lucky-inventory-page .stock-item.is-empty { border-color:#d8a78a; background:#fff7eb; }
.lucky-inventory-page .stock-item.is-empty .stock-name::after { content:' · 零庫存'; color:#a64f2b; font-size:11px; font-weight:400; }
.lucky-inventory-page .stock-input { min-width:0; }
.lucky-inventory-page .stock-count-label { display:block; margin-bottom:3px; color:var(--lucky-text-muted); font-size:11px; }
.lucky-inventory-page .stock-number-field { display:grid; grid-template-columns:minmax(0,1fr) minmax(20px,auto); align-items:center; gap:6px; }
.lucky-inventory-page .stock-unit { max-width:62px; color:var(--lucky-brown-soft); font-size:12px; overflow-wrap:anywhere; }
.lucky-inventory-page .stock-item input[type="number"] { --lucky-ui-component-bg:var(--lucky-white); --lucky-ui-component-radius:6px; width:100%; min-width:0; height:44px; min-height:44px; padding:8px; font-size:16px; text-align:right; }
.lucky-inventory-page .inventory-footer { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:16px; margin-top:14px; }
.lucky-inventory-page .inventory-footer > label { display:block; min-width:0; color:var(--lucky-brown); font-size:13px; }
.lucky-inventory-page .inventory-footer label small { margin-left:4px; color:var(--lucky-text-muted); font-size:12px; }
.lucky-inventory-page #inventoryNote { --lucky-ui-component-bg:var(--lucky-white); --lucky-ui-component-radius:8px; margin-top:6px; width:100%; min-width:0; min-height:44px; font-size:16px; }
.lucky-inventory-page .inventory-savebar { display:flex; align-items:center; gap:12px; }
.lucky-inventory-page #inventoryProgress { margin:0; color:var(--lucky-text-muted); font-size:12px; white-space:nowrap; }
.lucky-inventory-page #saveInventory { min-height:46px; }
.lucky-inventory-page .inventory-status { margin:0; padding:10px 14px; border:1px solid var(--lucky-border); border-radius:8px; background:var(--lucky-warning-soft); color:var(--lucky-brown); font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.lucky-inventory-page .inventory-status:empty { display:none; }
.lucky-inventory-page .inventory-empty { padding:22px 12px; color:var(--lucky-text-muted); font-size:14px; line-height:1.8; text-align:center; }
.lucky-inventory-page .inventory-history { padding:0 18px; }
.lucky-inventory-page .inventory-history > summary { padding:14px 0; color:var(--lucky-brown-deep); font-size:16px; font-weight:700; cursor:pointer; }
.lucky-inventory-page #inventoryHistory { padding-bottom:16px; font-size:14px; color:var(--lucky-text-muted); }
.lucky-inventory-page .inventory-history-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--lucky-border); }
.lucky-inventory-page .inventory-history-row > div { min-width:0; overflow-wrap:anywhere; }
.lucky-inventory-page .inventory-history-row strong { color:var(--lucky-brown); }
.lucky-inventory-page .inventory-history-row small { display:block; margin-top:4px; color:var(--lucky-text-muted); font-size:12px; line-height:1.6; }
.lucky-inventory-page .inventory-history-row button { flex-shrink:0; }
.lucky-inventory-page .inventory-pagination { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px; margin-top:14px; }
.lucky-inventory-page :is(#itemDialog,#stocktakeDialog) { width:min(460px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); overflow-y:auto; padding:20px; border:1px solid var(--lucky-border); border-radius:10px; background:var(--lucky-surface); color:var(--lucky-brown-deep); }
.lucky-inventory-page :is(#itemDialog,#stocktakeDialog)::backdrop { background:#30251dad; }
.lucky-inventory-page #newItemForm { display:grid; gap:14px; margin:0; }
.lucky-inventory-page :is(#itemDialogTitle,#snapshotTitle) { margin:0; font-size:22px; }
.lucky-inventory-page .item-dialog-heading p { margin:6px 0 0; color:var(--lucky-text-muted); font-size:13px; line-height:1.7; }
.lucky-inventory-page #newItemForm label { display:grid; gap:6px; color:var(--lucky-brown); font-size:14px; }
.lucky-inventory-page #newItemForm :is(input,select) { width:100%; min-width:0; min-height:46px; padding:10px 12px; border:1px solid var(--lucky-border); border-radius:8px; background:var(--lucky-white); font-size:16px; }
.lucky-inventory-page .item-scope-hint { margin:-4px 0 0; color:var(--lucky-text-muted); font-size:12px; line-height:1.7; }
.lucky-inventory-page .item-dialog-actions { display:flex; justify-content:flex-end; gap:10px; }
.lucky-inventory-page :is(#itemDialog,#stocktakeDialog) button { min-height:44px; padding:10px 14px; border:1px solid var(--lucky-brown-soft); border-radius:8px; background:var(--lucky-surface); color:var(--lucky-brown-deep); font-size:14px; }
/* Dialogs sit outside dashboard-shell, beyond its shared legacy-style bridge. */
.lucky-inventory-page :is(#itemDialog,#stocktakeDialog) :is(input,select,button) { border:1px solid var(--lucky-border) !important; border-radius:8px !important; background:var(--lucky-white) !important; color:var(--lucky-brown-deep) !important; box-shadow:none !important; }
.lucky-inventory-page #itemDialog #saveNewItem { border-color:var(--lucky-gold) !important; background:var(--lucky-yellow) !important; font-weight:700; }
.lucky-inventory-page #stocktakeDialog { width:min(600px,calc(100vw - 24px)); }
.lucky-inventory-page .snapshot-heading { position:sticky; top:-20px; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; background:var(--lucky-surface); }
.lucky-inventory-page #snapshotMeta { margin:4px 0 12px; font-size:13px; overflow-wrap:anywhere; }
.lucky-inventory-page .snapshot-item { display:grid; grid-template-columns:minmax(0,1fr) minmax(65px,35%); gap:12px; padding:12px 0; border-top:1px solid var(--lucky-border); font-size:14px; }
.lucky-inventory-page .snapshot-item > * { min-width:0; overflow-wrap:anywhere; }
.lucky-inventory-page .snapshot-item strong { text-align:right; }
.lucky-inventory-page #snapshotNote { margin:12px 0 0; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.lucky-inventory-page :is(a,button,input,select,summary):focus-visible { outline:3px solid var(--lucky-gold); outline-offset:2px; }
.lucky-inventory-page :is(input,select) { scroll-margin-block:110px; }
.lucky-inventory-page [hidden] { display:none !important; }
@media(min-width:1101px) {
  .lucky-inventory-page .stock-count-label { display:none; }
}
@media(max-width:1100px) {
  .lucky-inventory-page #stockItems { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:680px) {
  .lucky-inventory-page .dashboard-shell .main-panel > nav.admin-section-tabs > .ops-tab { flex:1 1 0; min-width:0; padding:8px 2px; font-size:13px; white-space:nowrap; }
  .lucky-inventory-page .ops-content { gap:12px; }
  .lucky-inventory-page :is(.inventory-header,.inventory-cycle-summary,#inventoryPanel) { padding:14px; }
  .lucky-inventory-page .inventory-header { flex-wrap:wrap; gap:12px; }
  .lucky-inventory-page h1 { font-size:22px; }
  .lucky-inventory-page .inventory-header p { font-size:13px; }
  .lucky-inventory-page .inventory-header-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .lucky-inventory-page .inventory-cycle-tabs { width:100%; }
  .lucky-inventory-page .dashboard-shell .inventory-cycle-tabs button { min-width:0; flex:1; }
  .lucky-inventory-page .inventory-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; width:100%; }
  .lucky-inventory-page .inventory-summary strong { font-size:13px; }
  .lucky-inventory-page .inventory-toolbar { display:grid; }
  .lucky-inventory-page .inventory-toolbar label { display:grid; gap:6px; }
  .lucky-inventory-page .inventory-toolbar input { width:100%; }
  .lucky-inventory-page .stock-item { grid-template-columns:minmax(0,1fr) 112px; gap:10px; padding:10px; }
  .lucky-inventory-page .stock-name { font-size:14px; }
  .lucky-inventory-page .inventory-footer { display:block; }
  .lucky-inventory-page .inventory-savebar { justify-content:space-between; gap:8px; margin-top:12px; padding-top:12px; padding-bottom:env(safe-area-inset-bottom,0px); border-top:1px solid var(--lucky-border); }
  .lucky-inventory-page #saveInventory { flex:1; padding-inline:10px; }
  .lucky-inventory-page .inventory-history { padding-inline:14px; }
  .lucky-inventory-page :is(#itemDialog,#stocktakeDialog) { padding:16px; }
  .lucky-inventory-page .snapshot-heading { top:-16px; }
  .lucky-inventory-page .item-dialog-actions button { flex:1; }
}
