/* Shared hierarchy for the warehouse, developer workspace and Windows shell.
   Local display preferences and the scanner's measured type size stay active. */
:root {
  --text-dim: var(--text-muted);
  --ui-action: var(--btn-primary);
  --ui-action-hover: var(--btn-primary-hover);
  --ui-control-height: 44px;
}
body .warehouse-app .topbar { min-height: 80px; padding: 15px 28px; gap: 16px; }
body .warehouse-app .topbar h1 { font-size: var(--fs-page); line-height: 1.2; }
body .warehouse-app .topbar p { font-size: var(--fs-body); line-height: 1.4; color: var(--text-dim); }
body .warehouse-app .workspace { padding: 24px 28px 64px; }
body .warehouse-app .online { padding: 8px 12px; font-size: var(--fs-secondary); }
body .warehouse-app .top-status { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
body .warehouse-app .topbar :is(button.btn,.warehouse-primary,.warehouse-secondary) { min-height: var(--ui-control-height); font-size: var(--fs-body); }
body .warehouse-app .topbar .cash-shift-button { min-height: var(--ui-control-height); font-size: var(--fs-body); }
body .warehouse-app .nav button { min-height: 40px; }
body:not(.warehouse-login-active) .warehouse-app .workspace :is(input:not(#search):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea) {
  min-height: var(--ui-control-height); min-width: 0; max-width: 100%; font-size: var(--fs-body); line-height: 1.3;
}
body:not(.warehouse-login-active) .warehouse-app .workspace :is(input[type=number],input[inputmode=decimal],input[data-decimal]) { font-weight: 650; font-variant-numeric: tabular-nums; }
body:not(.warehouse-login-active) .warehouse-app .workspace input[type=search] { min-height: 46px; }
body:not(.warehouse-login-active) .warehouse-app .workspace :is(input[type=checkbox],input[type=radio]) { width: 20px; height: 20px; accent-color: var(--ui-action); flex-shrink: 0; }
body:not(.warehouse-login-active) :is(.workspace,.manager-dialog) .smart-select .smart-trigger { min-height: var(--ui-control-height); font-size: var(--fs-body); line-height: 1.3; }
body .smart-popover .smart-search-input { min-height: var(--ui-control-height); font-size: var(--fs-body); }
body .smart-popover .smart-option { min-height: var(--ui-control-height); font-size: var(--fs-body); }
body :is(.warehouse-primary,.btn-primary),body :is(.manager-controls,.manager-dialog,.workspace) :is(.btn.btn-primary,.warehouse-primary) { background: var(--ui-action); border-color: var(--ui-action); color: var(--btn-primary-text); }
body :is(.warehouse-primary,.btn-primary):hover,body :is(.manager-controls,.manager-dialog,.workspace) :is(.btn.btn-primary,.warehouse-primary):hover { background: var(--ui-action-hover); border-color: var(--ui-action-hover); }
body :is(.warehouse-primary,.warehouse-secondary,.manager-dialog .btn) { min-height: var(--ui-control-height); font-size: var(--fs-body); line-height: 1.3; }
body .manager-dialog .modal { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 24px); overflow: hidden; }
body .manager-dialog [hidden] { display: none !important; }
body .manager-dialog :is(.modal-header,.modal-footer) { flex: 0 0 auto; background: var(--surface); }
body .manager-dialog .modal-header { padding: 16px 20px; }
body .manager-dialog .modal-title { font-size: var(--fs-section); font-weight: 700; line-height: 1.3; }
body .manager-dialog .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; font-size: var(--fs-body); line-height: 1.5; }
body .manager-dialog .modal-footer { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--paper-line); }
body .manager-dialog .delivery-close-check { width: 100%; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface-2); color: var(--ink); }
body .manager-dialog .delivery-close-check p { margin: 0 0 10px; font-size: var(--fs-body); }
body .manager-dialog .delivery-close-check>div { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
body .manager-dialog .modal-close { min-width: 40px; min-height: 40px; justify-content: center; }
body .manager-dialog label { color: var(--ink-soft); font-size: var(--fs-secondary); font-weight: 650; line-height: 1.4; }
body .manager-dialog :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea) {
  min-height: var(--ui-control-height); min-width: 0; max-width: 100%;
  padding: 10px 12px; font-size: var(--fs-body); font-weight: 500; line-height: 1.3;
}
body .manager-dialog textarea { min-height: 84px; resize: vertical; }
body .manager-dialog :is(input[type=number],input[inputmode=decimal],input[data-decimal]) { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
body .manager-dialog :is(input[type=checkbox],input[type=radio]) { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--ui-action); }
body .manager-dialog .manager-error { padding: 12px 14px; border: 1px solid var(--danger-solid); border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: var(--fs-body); font-weight: 600; }
body .manager-dialog .manager-error[hidden] { display: none; }
body :is(button,input:not(#search):not(#delivery-scan),select,textarea,a[href]):focus-visible { outline: 2px solid var(--ui-action); outline-offset: 3px; }
body :is(input,select,textarea)[aria-invalid=true] { border: 2px solid var(--danger-solid); }
body .manager-dialog :is(.form-row,.warehouse-form-grid)>* { min-width: 0; }
body .manager-dialog.delivery-sheet :is([data-f=qty],[data-f=receivedQuantity]) { min-height: 48px; font-size: var(--fs-section); font-weight: 700; }
body .manager-dialog.delivery-sheet .dlv-items { max-height: none; overflow: visible; border: 0; }
body .manager-dialog.delivery-sheet :is(.dlv-editor-intro,.dlv-scan-hint,.dlv-entry-card header small) { color: var(--text-dim); font-size: var(--fs-secondary); }
body .manager-dialog.delivery-sheet .dlv-entry-card header strong { font-size: var(--fs-body); line-height: 1.4; }
body .manager-dialog.delivery-sheet .dlv-entry-value strong { font-size: var(--fs-page); font-variant-numeric: tabular-nums; }
body .manager-dialog.delivery-sheet :is(.dlv-document-meta,.dlv-bulk-footer) { color: var(--text-mid); font-size: var(--fs-secondary); }
body .manager-dialog.delivery-sheet .dlv-document-tools>.btn-primary { background: var(--surface-2); border-color: var(--ui-action); color: var(--accent-text); }
/* Delivery row cells are placed by class in delivery-workflow.css (receipt column order).
   0.3.3: every cell is one one-line label (.dlv-field-label) over one control of the
   shared control height, so all labels share one top line and all controls one
   baseline, in the wide row and in the 4- and 2-column fallbacks alike. */
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-entry-card { --dlv-control-height: var(--ui-control-height); align-items: start; }
body .manager-dialog.delivery-sheet .dlv-document-fields :is(.dlv-entry-fields,.dlv-entry-prices)>:is(label,.dlv-entry-value),
body .manager-dialog.delivery-sheet .dlv-document-fields .dr-expiry-group>label:not(.dr-no-expiry) { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; min-width: 0; margin: 0; padding: 0; align-self: start; color: var(--text-mid); font-size: var(--fs-secondary); }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-field-label { display: block; height: 16px; margin: 0; overflow: hidden; color: var(--text-mid); font-size: var(--fs-secondary); font-weight: 650; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
body .manager-dialog.delivery-sheet .dlv-document-fields :is(.dlv-entry-fields,.dlv-entry-prices) :is(input:not([type=checkbox]):not([type=radio]),select) { height: var(--dlv-control-height); min-height: var(--dlv-control-height); margin: 0; }
body .manager-dialog.delivery-sheet .dlv-document-fields :is(.dlv-entry-fields,.dlv-entry-prices) .dlv-c-unit select { min-width: 96px; padding: 8px 4px 8px 8px; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-c-exp input[type=date] { padding-inline: 8px 6px; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-blank-card>header { align-self: start; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-line-article { gap: 4px; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-line-article input { height: var(--dlv-control-height); min-height: var(--dlv-control-height); }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-field-value { display: flex; align-items: center; height: var(--dlv-control-height); margin: 0; color: var(--ink); font-size: var(--fs-body); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-qty { display: grid; grid-template-columns: 32px 1fr 32px; gap: 3px; align-items: stretch; min-width: 0; height: var(--dlv-control-height); }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-qty button { width: auto; min-width: 0; height: var(--dlv-control-height); margin: 0; border-radius: 8px; font-size: var(--fs-section); line-height: 1; }
/* Room for 6 digits plus 3 decimals (123456.789); the − / + buttons replace the spinner. */
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-qty input[data-f] { min-width: calc(8ch + 12px); padding-inline: 6px; font-size: var(--fs-section); font-weight: 700; text-align: right; appearance: textfield; -moz-appearance: textfield; }
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-qty input[data-f]::-webkit-inner-spin-button,
body .manager-dialog.delivery-sheet .dlv-document-fields .dlv-qty input[data-f]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
body .management-page .warehouse-field { font-size: var(--fs-secondary); }
body .management-page .warehouse-table-wrap th { font-size: var(--fs-secondary); }
body .management-page .warehouse-table-wrap td { font-size: var(--fs-body); }
body .management-page .warehouse-table-wrap td strong { font-size: var(--fs-body); }
body .management-page .warehouse-table-wrap td small { color: var(--text-dim); font-size: var(--fs-secondary); }
body .team-member h3 { font-size: var(--fs-body); }
body .team-member-identity p,body .team-status { font-size: var(--fs-secondary); }
body .cash-dialog :is(.cash-amount,.cash-money,.cash-total) { font-variant-numeric: tabular-nums; }
body .document-total button:not(:disabled) { background: var(--ui-action); color: var(--btn-primary-text); }
body .document-total button:not(:disabled):hover { background: var(--ui-action-hover); }
body .document-line .line-actions button { min-width: 36px; min-height: 36px; }
@media (pointer: coarse) {
  body .warehouse-app .nav button,body .document-line .line-actions button { min-height: 44px; }
  body .document-line .line-actions button { min-width: 44px; }
}
@media (max-width: 700px) {
  body .warehouse-app .topbar { min-height: 72px; padding: 12px 16px; gap: 10px; }
  body .warehouse-app .topbar h1 { font-size: var(--fs-page); }
  body .warehouse-app .topbar p { font-size: var(--fs-secondary); }
  body .warehouse-app .workspace { padding: 18px 16px 68px; }
  body .warehouse-app .online { font-size: var(--fs-secondary); padding: 7px 9px; }
  body .manager-dialog .modal-header,body .manager-dialog .modal-footer { padding: 12px 14px; }
  body .manager-dialog .modal-body { padding-inline: 14px; }
}
@media (max-width: 560px) {
  body .manager-dialog .form-row { grid-template-columns: minmax(0,1fr); }
  body .manager-dialog .modal-footer>.btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  body .manager-dialog,body .manager-dialog .modal { animation: none; }
}
