/* 五金AI R11.6.6 · Tabler ERP Shell */
:root{--hw-sidebar:#132238;--hw-sidebar-active:#1d4f91;--hw-bg:#f3f6f9;--hw-border:#dce3eb;--hw-muted:#748399;--hw-radius:6px}html,body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",Arial,sans-serif!important}body.erp-tabler-shell{font-size:14px;background:var(--hw-bg)}.erp-sidebar{width:220px!important;background:var(--hw-sidebar)!important;border-right:0!important}.erp-sidebar .container-fluid{height:100%;display:flex;flex-direction:column;align-items:stretch;padding:0 12px}.erp-brand{height:72px!important;display:flex!important;align-items:center!important;gap:11px!important;padding:0 8px!important;margin:0!important;color:#fff!important}.erp-brand-mark{width:38px;height:38px;border-radius:8px;background:#fff;color:#132238;display:grid;place-items:center;font-weight:800;font-size:22px}.erp-brand-copy{display:grid;line-height:1.15}.erp-brand-copy strong{font-size:17px}.erp-brand-copy small{margin-top:4px;font-size:11px;color:#9caec2}.erp-sidebar .navbar-nav{gap:3px}.erp-sidebar .nav-link{min-height:42px;border-radius:6px;color:#d8e2ef!important;padding:9px 10px!important}.erp-sidebar .nav-link:hover{background:#1a2e48;color:#fff!important}.erp-sidebar .nav-link.active{background:var(--hw-sidebar-active)!important;color:#fff!important}.erp-sidebar .nav-link-icon{width:24px!important;color:#9fb3ca!important;text-align:center;font-size:14px}.erp-sidebar .nav-link.active .nav-link-icon{color:#fff!important}.erp-nav-section{padding:5px 10px 7px;color:#71869e;font-size:11px;font-weight:700;letter-spacing:.08em}.erp-sidebar-user{display:flex;align-items:center;gap:9px;border-top:1px solid rgba(255,255,255,.08);padding:14px 6px;margin-top:auto}.erp-sidebar-user-copy{display:grid;min-width:0;flex:1;color:#fff;line-height:1.2}.erp-sidebar-user-copy small{color:#879bb2;font-size:11px;margin-top:3px}.erp-logout{font-size:12px;color:#9fb3ca;text-decoration:none}.erp-page-wrapper{min-height:100vh;background:var(--hw-bg)}.erp-topbar{height:48px!important;min-height:48px!important;background:#fff!important;border-bottom:1px solid var(--hw-border)!important}.erp-page-header{margin:0!important;padding:14px 0 8px!important;background:#fff;border-bottom:1px solid var(--hw-border)}.erp-page-header .page-pretitle{font-size:12px;color:var(--hw-muted);margin-bottom:3px}.erp-page-header .page-title{font-size:22px!important;line-height:1.2;font-weight:700;color:#17263a}.erp-page-body{margin-top:0!important;padding-top:16px}.erp-page-container,.erp-topbar .container-xl,.erp-page-header .container-xl{max-width:1560px!important}.card{border-radius:var(--hw-radius)!important;border-color:var(--hw-border)!important;box-shadow:none!important}.card-header{min-height:50px!important}.card-title{font-size:16px!important}.btn{border-radius:6px!important;font-weight:600!important}.form-control,.form-select{border-radius:6px!important;min-height:38px!important}.table{font-size:13px}.table thead th{font-size:12px;color:#68798e;background:#f7f9fb!important}.card-table tbody td{padding-top:9px!important;padding-bottom:9px!important}.empty-state{padding:42px 20px;text-align:center;color:#8a98aa}.erp-kpi .card-body{padding:15px 16px!important}.erp-kpi .h2{font-size:24px!important}.erp-section-title{display:flex;align-items:end;justify-content:space-between;margin:18px 0 9px}.erp-section-title h3{font-size:16px;margin:0}.erp-section-title p{font-size:12px;color:var(--hw-muted);margin:3px 0 0}.erp-process-card>.card-body{padding:0!important}.erp-process-row{display:grid;grid-template-columns:42px 170px minmax(0,1fr);gap:14px;align-items:center;padding:14px 18px}.erp-process-row+.erp-process-row{border-top:1px solid #e5ebf1}.erp-step-index{width:30px;height:30px;border-radius:6px;background:#e8f1ff;color:#1769d2;display:grid;place-items:center;font-weight:700}.erp-step-copy{display:grid;line-height:1.25}.erp-step-copy strong{font-size:14px}.erp-step-copy span{font-size:11px;color:var(--hw-muted);margin-top:3px}.erp-doc-thumb{width:56px;height:56px;flex:0 0 56px;border:1px solid var(--hw-border);border-radius:6px;background:#f7f9fb;display:grid;place-items:center;overflow:hidden}.erp-doc-thumb img{width:100%;height:100%;object-fit:contain;cursor:zoom-in}.erp-approval-card .card-body{padding:12px!important}.erp-approval-card .card-footer{padding:9px 12px!important}.min-w-0{min-width:0}.erp-filter-pills .nav-link{font-size:13px;padding:7px 11px;border-radius:6px!important}.erp-product-photo{width:44px;height:44px;padding:0;border:1px solid var(--hw-border);border-radius:6px;background:#fff;overflow:hidden}.erp-product-photo img{width:100%;height:100%;object-fit:contain}.erp-inventory-kpis .card-body{padding:13px 14px!important}.erp-inventory-kpis a{text-decoration:none;color:inherit}.v137-warehouse-hero.rc4-hero{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:20px!important;padding:16px 18px!important;margin-bottom:12px!important;background:#fff!important;border:1px solid var(--hw-border)!important;border-radius:6px!important;box-shadow:none!important}.v137-warehouse-hero.rc4-hero h1{font-size:20px!important;margin:0 0 4px!important}.v137-warehouse-hero.rc4-hero p{margin:0!important;font-size:12px!important;color:var(--hw-muted)!important}.v137-hero-stats{display:flex!important;gap:8px!important}.v137-hero-stats span{min-width:92px!important;padding:8px 10px!important;border:1px solid var(--hw-border)!important;border-radius:6px!important;background:#f8fafc!important}.v137-action-strip.rc4-action-strip{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-bottom:12px!important}.v137-action{min-height:68px!important;padding:11px 13px!important;border-radius:6px!important;border:1px solid var(--hw-border)!important;background:#fff!important;box-shadow:none!important}.rc4-record-toolbar{display:grid!important;grid-template-columns:auto minmax(300px,1fr) auto!important;gap:12px!important;align-items:center!important;background:#fff!important;border:1px solid var(--hw-border)!important;border-radius:6px!important;padding:10px 12px!important;margin:12px 0!important}.rc4-record-toolbar form{display:flex!important;gap:7px!important}.v137-doc-row{border:1px solid var(--hw-border)!important;border-radius:6px!important;background:#fff!important;margin-bottom:7px!important;padding:10px 12px!important;box-shadow:none!important}.rc4-document-desk{border-radius:6px!important;box-shadow:none!important}.rc4-meta-grid{gap:10px 12px!important}.erp-image-modal{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.78);display:none;align-items:center;justify-content:center;padding:20px}.erp-image-modal.open{display:flex}.erp-image-shell{width:min(95vw,1600px);height:min(92vh,1000px);background:#fff;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.erp-image-head{display:flex;align-items:center;gap:7px;padding:10px 12px;border-bottom:1px solid var(--hw-border)}.erp-image-head b{margin-right:auto}.erp-image-stage{flex:1;overflow:auto;background:#eef2f6;text-align:center;padding:18px}.erp-image-stage img{max-width:none;display:inline-block;transform-origin:top center}@media(min-width:992px){.page-wrapper{margin-left:220px!important}}@media(max-width:991.98px){.erp-sidebar{width:100%!important}.erp-page-wrapper{margin-left:0!important}.erp-process-row{grid-template-columns:38px 1fr}.erp-step-copy{grid-column:2}.erp-step-main{grid-column:1/-1}.v137-action-strip.rc4-action-strip{grid-template-columns:1fr}.rc4-record-toolbar{grid-template-columns:1fr}}


/* ============================================================
   R11.6.6.1 · Form alignment pass
   Fixes: brand vertical alignment, metadata field heads, quick-create
   action position, inbound dialog width, item grid clipping/scroll.
   ============================================================ */

/* Brand: fixed visual box, no text floating into the topbar baseline. */
.erp-sidebar .erp-brand{
  height:64px!important;
  min-height:64px!important;
  padding:0 6px!important;
  gap:10px!important;
  overflow:hidden!important;
  border-bottom:1px solid rgba(255,255,255,.07)!important;
}
.erp-brand-mark{width:36px!important;height:36px!important;flex:0 0 36px!important;font-size:20px!important}
.erp-brand-copy{display:flex!important;flex-direction:column!important;justify-content:center!important;min-width:0!important;line-height:1.1!important}
.erp-brand-copy strong{font-size:16px!important;line-height:18px!important;margin:0!important;white-space:nowrap!important}
.erp-brand-copy small{font-size:10px!important;line-height:14px!important;margin:2px 0 0!important;white-space:nowrap!important}

/* Every metadata cell gets the same label row and the same control row. */
.rc4-meta-grid>label,
.rc4-meta-grid>.rc4-field-cell{
  display:grid!important;
  grid-template-rows:22px 42px auto!important;
  align-content:start!important;
  gap:5px!important;
  min-width:0!important;
  margin:0!important;
}
.rc4-meta-grid>label>.rc4-field-name,
.rc4-field-head{
  height:22px!important;
  min-height:22px!important;
  margin:0!important;
}
.rc4-field-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  min-width:0!important;
}
.rc4-field-head>.rc4-field-name{
  display:flex!important;
  align-items:center!important;
  height:22px!important;
  min-height:22px!important;
  margin:0!important;
  white-space:nowrap!important;
}
.rc4-meta-grid>label>input,
.rc4-meta-grid>label>select,
.rc4-meta-grid>.rc4-field-cell>input,
.rc4-meta-grid>.rc4-field-cell>select{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
}
.rc4-meta-grid>label>small,
.rc4-meta-grid>.rc4-field-cell>small{
  margin:0!important;
  min-height:15px!important;
}
.rc4-mini-link{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  height:22px!important;
  min-height:22px!important;
  padding:0!important;
  margin:0!important;
  line-height:22px!important;
  font-size:12px!important;
  flex:0 0 auto!important;
}

/* Full-page outbound form: predictable 4-column rhythm. */
.rc4-document-desk .rc4-meta-grid{
  grid-template-columns:repeat(4,minmax(180px,1fr))!important;
  column-gap:14px!important;
  row-gap:10px!important;
  align-items:start!important;
}
.rc4-document-desk .rc4-span-2{grid-column:span 2!important}
.v137-full-label{margin-top:8px!important}
.v137-full-label>.rc4-field-name{height:22px!important;display:flex!important;align-items:center!important;margin:0 0 5px!important}

/* Inbound modal: 760px was too narrow for a 4-column ERP form + product table. */
.v137-dialog.rc4-dialog{
  width:min(1080px,calc(100vw - 48px))!important;
  max-width:1080px!important;
  max-height:92vh!important;
  overflow:hidden!important;
  border-radius:10px!important;
}
.v137-dialog.rc4-dialog form{
  max-height:92vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:18px!important;
}
.v137-dialog.rc4-dialog header{
  margin:0 0 12px!important;
  padding:0 0 10px!important;
  border-bottom:1px solid #e5ebf1!important;
}
.v137-dialog.rc4-dialog .rc4-meta-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  column-gap:14px!important;
  row-gap:10px!important;
  align-items:start!important;
}

/* Product rows: header and rows use one shared, fitting grid. */
.v137-dialog.rc4-dialog .rc4-line-shell{
  width:100%!important;
  max-width:100%!important;
  overflow:visible!important;
}
.v137-dialog.rc4-dialog .rc4-manual-grid{
  grid-template-columns:34px minmax(300px,1.8fr) 132px 112px minmax(150px,.85fr) 42px!important;
  gap:8px!important;
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.v137-dialog.rc4-dialog .rc4-line-header,
.v137-dialog.rc4-dialog .rc4-line-row{
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.v137-dialog.rc4-dialog .rc4-line-row input{
  min-width:0!important;
  width:100%!important;
}
.v137-dialog.rc4-dialog .v137-outbound-lines-head{
  margin-top:14px!important;
  min-height:38px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
}
.v137-dialog.rc4-dialog .rc4-head-actions{flex-wrap:nowrap!important}
.v137-dialog.rc4-dialog .rc4-head-actions .btn{white-space:nowrap!important}
.v137-dialog.rc4-dialog .v137-full-label{margin-top:10px!important}
.v137-dialog.rc4-dialog .rc4-finance-box{margin-top:12px!important}
.v137-dialog.rc4-dialog footer{
  position:sticky!important;
  bottom:-18px!important;
  z-index:5!important;
  margin:14px -18px -18px!important;
  padding:12px 18px!important;
  background:rgba(255,255,255,.98)!important;
  border-top:1px solid #e5ebf1!important;
}

/* Wide desktop product-entry table: keep headers exactly over controls. */
.rc4-document-desk .rc4-outbound-grid.with-cost{
  grid-template-columns:34px minmax(300px,1.7fr) 92px 140px 108px 98px minmax(160px,.85fr) 44px!important;
  gap:8px!important;
}
.rc4-document-desk .rc4-line-header,
.rc4-document-desk .rc4-line-row{box-sizing:border-box!important;width:100%!important}

/* Tablet: modal changes to 2 columns instead of compressing four labels into each other. */
@media(max-width:1180px){
  .v137-dialog.rc4-dialog{width:min(900px,calc(100vw - 32px))!important}
  .v137-dialog.rc4-dialog .rc4-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .rc4-document-desk .rc4-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .rc4-document-desk .rc4-span-2{grid-column:span 2!important}
}
@media(max-width:760px){
  .erp-sidebar .erp-brand{height:58px!important;min-height:58px!important}
  .v137-dialog.rc4-dialog{width:calc(100vw - 12px)!important;max-width:none!important;margin:6px!important}
  .v137-dialog.rc4-dialog form{padding:12px!important}
  .v137-dialog.rc4-dialog .rc4-meta-grid,
  .rc4-document-desk .rc4-meta-grid{grid-template-columns:1fr!important}
  .rc4-document-desk .rc4-span-2{grid-column:auto!important}
  .v137-dialog.rc4-dialog .rc4-line-shell{overflow-x:auto!important}
  .v137-dialog.rc4-dialog .rc4-manual-grid{min-width:760px!important}
  .v137-dialog.rc4-dialog footer{bottom:-12px!important;margin:14px -12px -12px!important;padding:10px 12px!important}
}


/* ============================================================
   R11.6.6.2 · Required marker + brand/version alignment
   Root cause:
   .rc4-meta-grid label already has flex-direction:column.
   The supplier/customer label is itself a <label>, so changing only
   display:flex left flex-direction as column and pushed * below text.
   ============================================================ */

/* Required markers: same baseline on ALL rc4 business forms. */
.rc4-field-head > label.rc4-field-name{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  gap:3px!important;
  width:auto!important;
  height:22px!important;
  min-height:22px!important;
  margin:0!important;
  line-height:22px!important;
  white-space:nowrap!important;
}
.rc4-meta-grid label > .rc4-field-name,
.rc4-finance-grid label > .rc4-field-name,
.rc4-finance-summary label > .rc4-field-name,
.v137-full-label > .rc4-field-name{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:3px!important;
  width:max-content!important;
  max-width:100%!important;
  white-space:nowrap!important;
}
.rc4-field-name > b,
.rc4-field-name > i,
.rc4-line-header i{
  display:inline!important;
  position:static!important;
  float:none!important;
  width:auto!important;
  min-width:0!important;
  height:auto!important;
  margin:0 0 0 2px!important;
  padding:0!important;
  align-self:center!important;
  line-height:1!important;
  font-size:1em!important;
  color:#ef4444!important;
  font-style:normal!important;
  font-weight:700!important;
  transform:none!important;
}

/* Quick-create button stays in the same 22px label row. */
.rc4-field-head{
  min-height:22px!important;
  height:22px!important;
  align-items:center!important;
}
.rc4-field-head .rc4-mini-link{
  align-self:center!important;
  line-height:22px!important;
}

/* Brand/version: fixed compact block, no clipping and no forgotten build label. */
.erp-sidebar .container-fluid{
  padding-left:10px!important;
  padding-right:10px!important;
}
.erp-sidebar .erp-brand{
  width:100%!important;
  max-width:100%!important;
  height:64px!important;
  min-height:64px!important;
  padding:0 4px!important;
  margin:0!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  overflow:hidden!important;
}
.erp-brand-mark{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  flex:0 0 36px!important;
}
.erp-brand-copy{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:calc(100% - 46px)!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:flex-start!important;
  overflow:hidden!important;
}
.erp-brand-copy strong{
  display:block!important;
  width:100%!important;
  margin:0!important;
  line-height:18px!important;
  font-size:16px!important;
  white-space:nowrap!important;
}
#hardwareAiVersionLabel{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:5px!important;
  width:100%!important;
  min-width:0!important;
  margin:2px 0 0!important;
  line-height:13px!important;
  font-size:9.5px!important;
  letter-spacing:-.01em!important;
  white-space:nowrap!important;
  color:#9fb2c8!important;
  overflow:hidden!important;
}
#hardwareAiVersionLabel .erp-build-no{
  color:#c4d3e3!important;
  font-weight:600!important;
  flex:0 0 auto!important;
}

/* Keep the first form row visually aligned even when a field has a quick-create action. */
.rc4-meta-grid > .rc4-field-cell,
.rc4-meta-grid > label{
  min-width:0!important;
}

/* R11.6.8.32 unified warehouse record search */
.r116832-records{background:#fff;border:1px solid var(--hw-border);border-radius:6px;padding:12px;margin:12px 0 10px}.r116832-record-head{display:grid;grid-template-columns:minmax(180px,.55fr) minmax(420px,1.45fr);gap:14px;align-items:center}.r116832-record-head>div{display:flex;flex-direction:column;gap:3px}.r116832-record-head>div>b{font-size:15px}.r116832-record-head>div>small{font-size:11px;color:var(--hw-muted)}.r116832-record-search{display:flex;gap:7px;min-width:0}.r116832-record-search input[type=search]{flex:1;min-width:0;border:1px solid var(--hw-border);border-radius:6px;padding:8px 11px;background:#fff}.r116832-filter-desktop{display:flex;flex-direction:column;gap:8px;margin-top:11px;padding-top:10px;border-top:1px solid #edf1f5}.r116832-filter-line{display:flex;align-items:center;gap:10px}.r116832-filter-line>span{width:36px;flex:0 0 36px;color:#738196;font-size:12px}.r116832-pills{display:flex;gap:6px;align-items:center}.r116832-pills.wrap{flex-wrap:wrap}.r116832-pills a,.r116832-pills button{display:inline-flex;align-items:center;justify-content:center;min-height:31px;padding:6px 11px;border:1px solid #dce3eb;border-radius:999px;background:#fff;color:#46566c;text-decoration:none;font-size:12px;cursor:pointer}.r116832-pills a.active,.r116832-pills button.active{background:#132238;border-color:#132238;color:#fff}.r116832-custom-dates{display:none;align-items:end;gap:7px;margin-left:46px}.r116832-custom-dates.show{display:flex}.r116832-custom-dates label{display:flex;flex-direction:column;gap:3px;font-size:11px;color:#738196}.r116832-custom-dates input{border:1px solid var(--hw-border);border-radius:6px;min-height:35px;padding:6px 8px;background:#fff}.r116832-filter-mobile{display:none}.r116832-doc-row.history{background:#fbfcfe}.r116832-doc-row.history .v137-doc-state{background:#eef2f7;color:#55657a}.r116832-doc-main,.r116832-doc-goods{min-width:0}.r116832-doc-main b,.r116832-doc-goods strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.r116832-doc-main small,.r116832-doc-goods small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.r116832-doc-list .v137-doc-row{grid-template-columns:84px minmax(260px,1.1fr) minmax(280px,.9fr) 18px}
@media(max-width:991.98px){.r116832-records{padding:10px;margin:10px 0}.r116832-record-head{grid-template-columns:1fr;gap:9px}.r116832-record-head>div>small{display:none}.r116832-record-search{width:100%}.r116832-record-search input[type=search]{font-size:13px}.r116832-filter-desktop{display:none}.r116832-filter-mobile{display:block;margin-top:8px;border-top:1px solid #edf1f5;padding-top:8px}.r116832-filter-mobile summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border:1px solid var(--hw-border);border-radius:6px;background:#f8fafc;font-weight:700;cursor:pointer}.r116832-filter-mobile summary::-webkit-details-marker{display:none}.r116832-filter-mobile summary small{font-weight:500;color:#6f7e91;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.r116832-mobile-filter-body{display:flex;flex-direction:column;gap:12px;padding:11px 2px 2px}.r116832-mobile-filter-body>div{display:flex;flex-direction:column;gap:7px}.r116832-mobile-custom{display:grid;grid-template-columns:1fr auto 1fr;gap:6px;align-items:center}.r116832-mobile-custom input{min-width:0;border:1px solid var(--hw-border);border-radius:6px;padding:7px 8px}.r116832-mobile-custom .btn{grid-column:1/-1}.r116832-doc-list .v137-doc-row{grid-template-columns:72px minmax(0,1fr) 18px;gap:8px;padding:10px}.r116832-doc-list .v137-doc-row>div:nth-child(3){display:none}.r116832-doc-main b{font-size:13px}.r116832-doc-main small{font-size:11px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.r116832-doc-list .v137-doc-state{font-size:11px;padding:4px 7px}.r116832-pills a,.r116832-pills button{min-height:32px;padding:6px 10px}}

/* R11.6.8.33 confirmed AI archive record projection + party compact polish */
