/* AVP V5.55 — Invoice-family linear workspace
   Removes the legacy document-left / admin-sidebar-right composition. */

/* The document and its controls now share one reading column. */
body.app-shell .invoice-layout.invoice-layout-linear{
  display:block!important;
  width:100%!important;
  max-width:1180px!important;
  margin:0 auto!important;
}
body.app-shell .invoice-layout.invoice-layout-linear>.invoice-paper{
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  margin:0!important;
  box-shadow:none!important;
  border:1px solid #dce5df!important;
  border-radius:10px!important;
}
body.app-shell .invoice-layout.invoice-layout-linear>.invoice-editor-linear{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  margin:22px 0 0!important;
  padding:0!important;
}

/* One clear handoff from document to operational controls. */
body.app-shell .invoice-management-head{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:24px!important;
  margin:0!important;
  padding:18px 2px 14px!important;
  border-top:1px solid #d8e2db!important;
  border-bottom:1px solid #d8e2db!important;
}
body.app-shell .invoice-management-head>span{
  flex:0 0 auto!important;
  color:#6b916d!important;
  font-size:9px!important;
  font-weight:850!important;
  letter-spacing:.11em!important;
}
body.app-shell .invoice-management-head>h2{
  flex:0 0 auto!important;
  margin:0!important;
  color:#173529!important;
  font-size:18px!important;
  line-height:1.2!important;
  letter-spacing:-.35px!important;
}
body.app-shell .invoice-management-head>p{
  flex:1 1 auto!important;
  max-width:650px!important;
  margin:0 0 1px auto!important;
  color:#6b7b71!important;
  font-size:11px!important;
  line-height:1.45!important;
  text-align:right!important;
}

/* Live balance becomes a compact full-width status strip, not a side card. */
body.app-shell .invoice-editor-linear>.invoice-current-account{
  display:grid!important;
  grid-template-columns:auto 1fr auto!important;
  align-items:center!important;
  gap:18px!important;
  margin:14px 0 0!important;
  padding:13px 16px!important;
  border:0!important;
  border-radius:8px!important;
  box-shadow:none!important;
  background:#173a2b!important;
}
body.app-shell .invoice-editor-linear>.invoice-current-account small{
  grid-column:auto!important;
  margin:0!important;
  font-size:9px!important;
  letter-spacing:.08em!important;
}
body.app-shell .invoice-editor-linear>.invoice-current-account strong{
  justify-self:start!important;
  font-size:14px!important;
}
body.app-shell .invoice-editor-linear>.invoice-current-account span{
  justify-self:end!important;
  font-size:11.5px!important;
}

/* Admin controls read as sections in one register rather than floating cards. */
body.app-shell .invoice-editor-linear>.panel,
body.app-shell .invoice-editor-linear>.invoice-sharing,
body.app-shell .invoice-editor-linear>form,
body.app-shell .invoice-editor-linear>details{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:18px 2px!important;
  border:0!important;
  border-bottom:1px solid #dfe7e1!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.app-shell .invoice-editor-linear>.panel:last-child,
body.app-shell .invoice-editor-linear>details:last-child,
body.app-shell .invoice-editor-linear>form:last-child{
  border-bottom:0!important;
}
body.app-shell .invoice-editor-linear>.panel>.panel-heading{
  margin:0 0 12px!important;
  padding:0!important;
  border:0!important;
}
body.app-shell .invoice-editor-linear>.panel>.panel-heading h2{
  font-size:14px!important;
}
body.app-shell .invoice-editor-linear>.panel>.panel-heading p{
  max-width:820px!important;
  margin-top:3px!important;
}

/* Access controls become aligned rows instead of green blocks. */
body.app-shell .invoice-editor-linear>.invoice-sharing{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"title action" "copy action"!important;
  gap:4px 22px!important;
  align-items:center!important;
}
body.app-shell .invoice-editor-linear>.invoice-sharing>strong{
  grid-area:title!important;
  color:#244d34!important;
  font-size:13px!important;
}
body.app-shell .invoice-editor-linear>.invoice-sharing>p{
  grid-area:copy!important;
  margin:0!important;
  max-width:760px!important;
  color:#68786e!important;
  font-size:11px!important;
  line-height:1.45!important;
}
body.app-shell .invoice-editor-linear>.invoice-sharing>form{
  grid-area:action!important;
  margin:0!important;
  min-width:220px!important;
}
body.app-shell .invoice-editor-linear>.invoice-sharing>form .btn{
  width:100%!important;
}
body.app-shell .invoice-editor-linear>.invoice-sharing.customer-release{
  background:transparent!important;
}

/* Notices inside invoice administration should inform, not become another card. */
body.app-shell .invoice-editor-linear .notice{
  margin:0 0 12px!important;
  padding:11px 12px!important;
  border-radius:7px!important;
  box-shadow:none!important;
}
body.app-shell .invoice-editor-linear .helper-note{
  margin:0 0 10px!important;
  border-radius:7px!important;
}

/* Finance/credit summaries form one compact strip. */
body.app-shell .invoice-editor-linear .metric-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:0!important;
  margin:0 0 14px!important;
  overflow:hidden!important;
  border:1px solid #dfe7e1!important;
  border-radius:8px!important;
  background:#fff!important;
}
body.app-shell .invoice-editor-linear .metric-grid>.metric{
  min-height:78px!important;
  margin:0!important;
  padding:12px 14px!important;
  border:0!important;
  border-right:1px solid #e7ede9!important;
  border-radius:0!important;
  background:#fff!important;
  box-shadow:none!important;
}
body.app-shell .invoice-editor-linear .metric-grid>.metric:last-child{
  border-right:0!important;
}
body.app-shell .invoice-editor-linear .metric-grid>.metric strong{
  font-size:18px!important;
}

/* Revision/credit builders stay within the same column and don't float. */
body.app-shell .invoice-editor-linear :is(.invoice-revise-disclosure,.credit-builder,.nested-adjustment,.danger-disclosure){
  max-width:none!important;
  box-shadow:none!important;
}
body.app-shell .invoice-editor-linear .credit-route-picker{
  margin:0 0 12px!important;
  border-radius:8px!important;
  box-shadow:none!important;
}

/* Print remains document-only. */
@media print{
  body.app-shell .invoice-layout.invoice-layout-linear{max-width:none!important;margin:0!important}
  body.app-shell .invoice-editor-linear{display:none!important}
  body.app-shell .invoice-layout.invoice-layout-linear>.invoice-paper{border:0!important;border-radius:0!important}
}

@media(max-width:760px){
  body.app-shell .invoice-management-head{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:5px!important;
  }
  body.app-shell .invoice-management-head>p{
    margin:0!important;
    text-align:left!important;
  }
  body.app-shell .invoice-editor-linear>.invoice-current-account{
    grid-template-columns:1fr!important;
    gap:4px!important;
  }
  body.app-shell .invoice-editor-linear>.invoice-current-account span,
  body.app-shell .invoice-editor-linear>.invoice-current-account strong{
    justify-self:start!important;
  }
  body.app-shell .invoice-editor-linear>.invoice-sharing{
    grid-template-columns:1fr!important;
    grid-template-areas:"title" "copy" "action"!important;
    gap:5px!important;
  }
  body.app-shell .invoice-editor-linear>.invoice-sharing>form{
    min-width:0!important;
    margin-top:8px!important;
  }
  body.app-shell .invoice-editor-linear .metric-grid{
    grid-template-columns:1fr 1fr!important;
  }
  body.app-shell .invoice-editor-linear .metric-grid>.metric:nth-child(2){border-right:0!important}
  body.app-shell .invoice-editor-linear .metric-grid>.metric:nth-child(-n+2){border-bottom:1px solid #e7ede9!important}
}
