/* GFLEX Stage 040 — calm, consistent workflow actions and accessible Excel chooser.
   Builds on Stage 039. No changes to RPC/API calls, event handlers or input IDs. */

/* Default actions: balanced blue instead of blanket red. Specificity and
   !important match the older Stage039 UI-only stylesheet. */
#appRoot section.panel button.action,
#appRoot section.panel button.finishLoadBtn,
#appRoot section.panel button.routeMoveBtn,
#appRoot section.panel button.routingFixBtn,
#appRoot section.panel button.routingTransferBtn,
#appRoot section.panel button.deliverBtn,
#appRoot section.panel button.returnBtn,
#appRoot section.panel button.returnConfirmBtn {
  background:linear-gradient(135deg,#327fca 0%,#2364ad 100%)!important;
  border:1px solid #397fc6!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  box-shadow:0 4px 12px rgba(22,77,138,.16)!important;
  border-radius:10px!important;
  font-weight:850!important;
}

/* A success/complete action is teal, clear from both blue and red. */
#appRoot section.panel #processExpectedExcelBtn,
#appRoot section.panel #processPrepareExcelBtn,
#appRoot section.panel #verifyExpectedBtn,
#appRoot section.panel #checkIncomingTransferBtn,
#appRoot section.panel #finishLoadBtn,
#appRoot section.panel #dhlDispatchBtn,
#appRoot section.panel #saveMissingExpectedInfoBtn,
#appRoot section.panel #saveAdminUserBtn,
#appRoot section.panel #saveAdminRolePermissionsBtn,
#appRoot section.panel #addAdminLocationBtn,
#appRoot section.panel button.finishLoadBtn {
  background:linear-gradient(135deg,#179e94,#08746f)!important;
  border-color:#25aaa3!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 4px 12px rgba(5,111,105,.15)!important;
}

/* Red only for deliberately prominent handover/dispatch actions.
   The approved warehouse home keeps its familiar prominent primary CTA. */
#appRoot section.panel #officePrepareBtn,
#appRoot section.panel #officeQuickFocusBtn,
#appRoot section.panel #sendBranchTransferBtn {
  background:linear-gradient(135deg,#ed4452,#d72439)!important;
  border-color:#ef5565!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 4px 13px rgba(190,34,56,.16)!important;
}

/* Utility / exports / back: subtle slate, not an action alert. */
#appRoot section.panel button.refreshBtn,
#appRoot section.panel button.exportBtn,
#appRoot section.panel button.smallExport,
#appRoot section.panel button.excelSecondaryBtn,
#appRoot section.panel button.routingToggleBtn,
#appRoot section.panel button.backBtn,
#appRoot section.panel button.adminMiniBtn,
#appRoot section.panel button.handoffFailureClear,
#appRoot section.panel button.courierControlMiniBtn {
  background:#243e5d!important;
  border:1px solid #59708b!important;
  color:#eaf2ff!important;
  -webkit-text-fill-color:#eaf2ff!important;
  box-shadow:none!important;
  border-radius:9px!important;
}
#appRoot section.panel button.refreshBtn *,
#appRoot section.panel button.exportBtn *,
#appRoot section.panel button.smallExport *,
#appRoot section.panel button.excelSecondaryBtn *,
#appRoot section.panel button.routingToggleBtn *,
#appRoot section.panel button.backBtn *,
#appRoot section.panel button.adminMiniBtn *,
#appRoot section.panel button.courierControlMiniBtn * {
  color:#eaf2ff!important;
  -webkit-text-fill-color:#eaf2ff!important;
}
#appRoot section.panel button.refreshBtn:not(:disabled):hover,
#appRoot section.panel button.exportBtn:not(:disabled):hover,
#appRoot section.panel button.smallExport:not(:disabled):hover,
#appRoot section.panel button.excelSecondaryBtn:not(:disabled):hover,
#appRoot section.panel button.adminMiniBtn:not(:disabled):hover {
  background:#305578!important;
  filter:none!important;
}
#appRoot section.panel button:disabled {
  opacity:.53!important;
  filter:grayscale(.25)!important;
  cursor:not-allowed!important;
  transform:none!important;
}

/* Native file controls retain the original ID and 'change' listener.
   A proper label calls the same file picker, including on iPhone/Safari. */
#appRoot #expectedImportBox .fileDrop,
#appRoot #prepare .fileDrop {
  border:1px dashed #7896bb!important;
  border-radius:12px!important;
  background:rgba(15,39,67,.66)!important;
  padding:15px!important;
}
#appRoot #expectedExcelFile,
#appRoot #prepareExcelFile {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
  opacity:0!important;
  border:0!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
#appRoot .gflex040FileChooser {
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:wrap!important;
  gap:9px 12px!important;
  min-height:48px!important;
  width:100%!important;
  padding:12px 14px!important;
  border:1px solid #7aa8d8!important;
  background:linear-gradient(135deg,#285c96,#194a81)!important;
  border-radius:10px!important;
  color:#fff!important;
  cursor:pointer!important;
  font-size:14px!important;
  font-weight:900!important;
  line-height:1.25!important;
  box-shadow:0 3px 9px rgba(10,33,62,.13)!important;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
}
#appRoot .gflex040FileChooser:hover {
  background:linear-gradient(135deg,#3171b5,#215895)!important;
  border-color:#abd3ff!important;
}
#appRoot .gflex040FileChooser:active {transform:translateY(1px)}
#appRoot .gflex040FileChooserIcon {font-size:20px!important;line-height:1;}
#appRoot .gflex040FileChooserText {color:#fff!important;-webkit-text-fill-color:#fff!important;}
#appRoot .gflex040FileChooserExtension {
  margin-left:auto!important;
  color:#c5dfff!important;
  -webkit-text-fill-color:#c5dfff!important;
  font-size:12px!important;
  font-weight:650!important;
  white-space:nowrap;
}
#appRoot .fileDrop:has(#expectedExcelFile:focus-visible) .gflex040FileChooser,
#appRoot .fileDrop:has(#prepareExcelFile:focus-visible) .gflex040FileChooser,
#appRoot .gflex040FileChooser:focus-visible {
  outline:3px solid #ffc764!important;
  outline-offset:3px!important;
}
#appRoot #expectedImportBox #expectedExcelFileName,
#appRoot #prepare #prepareExcelFileName {
  color:#edf5ff!important;
  -webkit-text-fill-color:#edf5ff!important;
  opacity:1!important;
  font-weight:750!important;
  font-size:13px!important;
  line-height:1.5!important;
  overflow-wrap:anywhere!important;
}
#appRoot #expectedImportBox .fileDrop .mini,
#appRoot #expectedImportBox .fileDrop .excelHelp,
#appRoot #prepare .fileDrop .excelHelp {
  color:#c9d9ee!important;
  -webkit-text-fill-color:#c9d9ee!important;
}
#appRoot #expectedImportBox .fileDrop .mini strong,
#appRoot #expectedImportBox .fileDrop .excelHelp strong,
#appRoot #prepare .fileDrop .excelHelp strong {
  color:#f1f7ff!important;
}
@media(max-width:600px){
  #appRoot .gflex040FileChooserExtension{font-size:11px!important;margin-left:0!important}
  #appRoot .gflex040FileChooser{padding:11px 12px!important;gap:8px!important}
}
/* Site UI version only; server 038 remains unchanged. */
#appRoot .testVersion::after{content:" · UI 040"!important;font-weight:950;color:#e2edff!important;}
