
/* NEDA RC41.3 Invoice UI polish - addon only */

.nd-invoice-section{
    border-radius:20px!important;
    background:#fff!important;
    border:1px solid #e8eef6!important;
    padding:10px!important;
    margin-bottom:12px!important;
}

.nd-invoice-section-title{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    padding:6px 8px 12px!important;
    font-size:13px!important;
    font-weight:900!important;
}

.nd-invoice-section-title.unpaid:before{
    content:"◷"!important;
    font-size:16px!important;
}

.nd-invoice-section-title.paid:before{
    content:"✓"!important;
    font-size:16px!important;
}

.nd-customer-invoice-card{
    min-height:105px!important;
    border-radius:16px!important;
    padding:12px!important;
    margin-bottom:8px!important;
}

.nd-customer-invoice-main h3{
    font-size:13px!important;
}

.nd-customer-invoice-main p{
    font-size:11px!important;
    margin-top:3px!important;
}

.nd-customer-invoice-total strong{
    font-size:16px!important;
}

.nd-invoice-icon,
.nd-customer-invoice-actions button{
    border-radius:12px!important;
}

.nd-customer-panel-summary{
    border-radius:16px!important;
    min-height:42px!important;
}

.nd-customer-panel-summary:empty{
    display:none!important;
}

.nd-customer-invoice-list{
    max-height:230px!important;
}

@media(max-width:520px){
    .nd-customer-invoice-card{
        min-height:95px!important;
    }
    .nd-customer-invoice-list{
        max-height:210px!important;
    }
}
.nd-customer-invoice-row{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
}

.nd-customer-invoice-row.top h3{
    font-size:13px!important;
    margin:0!important;
}

.nd-customer-invoice-row.top span{
    font-size:11px!important;
    color:#94a3b8!important;
}

.nd-customer-invoice-row.bottom{
    margin-top:18px!important;
}

.nd-customer-invoice-row.bottom strong{
    font-size:16px!important;
}

.nd-customer-invoice-row.bottom button{
    padding:6px 14px!important;
}
.nd-customer-invoice-card{
    display:flex!important;
    flex-direction:column!important;
    gap:14px!important;
}

.nd-invoice-row{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
}

.nd-invoice-row.bottom{
    margin-top:8px!important;
}

.nd-invoice-action{
    position:static!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:70px!important;
    height:32px!important;
}
/* RC41.7 — Invoice count badge and empty dashboard */

.nd-invoice-section-title{
    justify-content:flex-start!important;
}

.nd-invoice-count{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:24px!important;
    height:24px!important;
    padding:0 7px!important;
    margin-right:7px!important;
    border-radius:999px!important;
    background:#ef4444!important;
    color:#fff!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:900!important;
    direction:ltr!important;
    box-shadow:0 3px 8px rgba(239,68,68,.22)!important;
}

.nd-invoice-dashboard-empty{
    min-height:180px!important;
}
و در فایل CSS فقط یک قانون اضافه کن:

.nd-hidden{
    display:none !important;
}
/* RC42.3 — single visible invoice section fills the panel */

.nd-customer-panel-body{
    display:flex!important;
    flex-direction:column!important;
}

.nd-invoice-section:only-of-type{
    flex:1 1 auto!important;
    min-height:0!important;
}

.nd-invoice-section:only-of-type .nd-customer-invoice-list{
    max-height:none!important;
    height:100%!important;
    flex:1 1 auto!important;
}
/* RC46.70.7 — expandable unpaid invoices with live preflight */
.nd-panel-invoice-accordion{padding:0!important;overflow:hidden!important}
.nd-panel-invoice-summary{list-style:none;display:grid;grid-template-columns:12px minmax(110px,1fr) minmax(90px,.8fr) minmax(135px,1fr) auto 24px;gap:10px;align-items:center;padding:14px 15px;cursor:pointer}
.nd-panel-invoice-summary::-webkit-details-marker{display:none}
.nd-panel-invoice-state{width:9px;height:9px;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 5px rgba(245,158,11,.12)}
.nd-panel-invoice-copy,.nd-panel-invoice-date,.nd-panel-invoice-amount{display:flex;flex-direction:column;gap:3px;min-width:0}
.nd-panel-invoice-copy small,.nd-panel-invoice-date small,.nd-panel-invoice-amount small{font-size:10px;color:#7b879b}
.nd-panel-invoice-copy strong,.nd-panel-invoice-date b,.nd-panel-invoice-amount b{font-size:12px;color:#14213d;white-space:nowrap}
.nd-panel-invoice-hint{font-size:11px;font-weight:800;color:#1677ff;white-space:nowrap}
.nd-panel-invoice-chevron{font-size:20px;transition:transform .2s ease;color:#789}
.nd-panel-invoice-accordion[open] .nd-panel-invoice-chevron{transform:rotate(180deg)}
.nd-panel-invoice-detail{border-top:1px solid #e8eef7;padding:14px;background:#fbfdff}
.nd-panel-invoice-items-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;font-size:12px;font-weight:900}
.nd-panel-invoice-items-title b{display:inline-flex;min-width:23px;height:23px;align-items:center;justify-content:center;border-radius:999px;background:#eef5ff;color:#1677ff}
.nd-panel-invoice-items{display:flex;flex-direction:column;border:1px solid #e5ebf4;border-radius:13px;overflow:hidden;background:#fff}
.nd-panel-invoice-item{display:grid;grid-template-columns:25px minmax(0,1fr) auto;gap:9px;align-items:center;padding:10px 11px;border-bottom:1px solid #edf1f6;font-size:11px}
.nd-panel-invoice-item:last-child{border-bottom:0}
.nd-panel-invoice-item-index{display:inline-flex;width:22px;height:22px;align-items:center;justify-content:center;border-radius:7px;background:#f1f5f9;color:#64748b;font-weight:900}
.nd-panel-invoice-item-description{line-height:1.7;color:#334155}
.nd-panel-invoice-item b{font-size:11px;white-space:nowrap;color:#172554}
.nd-panel-invoice-item.tax{background:#fffaf0}.nd-panel-invoice-item.credit{background:#f0fdf4}
.nd-panel-invoice-total{display:flex;align-items:center;justify-content:space-between;padding:13px 3px 4px;font-size:12px}
.nd-panel-invoice-total strong{font-size:15px;color:#0f7b3e}
.nd-panel-invoice-payment-footer{margin-top:10px}
.nd-panel-invoice-pay{width:100%;min-height:43px;border:0;border-radius:12px;background:#1677ff;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 15px;font-weight:900;cursor:pointer}
.nd-panel-invoice-pay:disabled{opacity:.65;cursor:wait}
.nd-panel-invoice-error,.nd-panel-invoice-empty,.nd-panel-invoice-not-payable{padding:13px;border-radius:11px;background:#fff7ed;color:#9a3412;font-size:11px;line-height:1.8}
.nd-panel-invoice-error button{margin-right:8px;border:0;border-radius:8px;padding:6px 10px;background:#fff;color:#c2410c;cursor:pointer}
.nd-panel-price-change{margin-bottom:10px;padding:12px;border:1px solid #bfdbfe;border-radius:13px;background:#eff6ff}
.nd-panel-price-change.error{border-color:#fecaca;background:#fef2f2;color:#991b1b}
.nd-panel-price-head strong,.nd-panel-price-change.error strong{font-size:12px}.nd-panel-price-head p,.nd-panel-price-change.error p{font-size:10px;line-height:1.8;margin:4px 0 8px}
.nd-panel-price-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px dashed #bfdbfe;font-size:10px}
.nd-panel-price-row>span{display:flex;flex-direction:column;gap:3px}.nd-panel-price-row>span:last-child{align-items:flex-end}.nd-panel-price-row strong{color:#0f7b3e}
.nd-panel-price-actions{display:flex;gap:8px;margin-top:10px}.nd-panel-price-actions button,.nd-panel-price-change.error button{flex:1;border:0;border-radius:9px;padding:9px;font-weight:900;cursor:pointer}.nd-panel-price-actions button:first-child{background:#fff;color:#475569}.nd-panel-price-actions button:last-child{background:#1677ff;color:#fff}
@media(max-width:720px){.nd-panel-invoice-summary{grid-template-columns:10px 1fr auto 22px}.nd-panel-invoice-date,.nd-panel-invoice-hint{display:none}.nd-panel-invoice-amount{align-items:flex-end}.nd-panel-invoice-item{grid-template-columns:22px minmax(0,1fr)}.nd-panel-invoice-item b{grid-column:2;margin-top:2px}}

/* RC46.70.8 — drawer-width invoice layout fix
   The customer drawer is narrow even on a desktop viewport, therefore the
   invoice accordion must be sized by the drawer itself, not by viewport media queries. */
.nd-customer-invoice-list .nd-panel-invoice-accordion{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  padding:0!important;
  overflow:hidden!important;
  grid-template-columns:none!important;
  grid-template-areas:none!important;
}
.nd-customer-invoice-list .nd-panel-invoice-summary{
  display:grid!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  grid-template-columns:10px minmax(0,1fr) minmax(108px,auto) 22px!important;
  grid-template-areas:
    "state copy amount chevron"
    "state date amount chevron"!important;
  gap:5px 8px!important;
  padding:13px 12px!important;
  align-items:center!important;
}
.nd-panel-invoice-state{grid-area:state!important}
.nd-panel-invoice-copy{grid-area:copy!important}
.nd-panel-invoice-date{grid-area:date!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important}
.nd-panel-invoice-date small:after{content:":"}
.nd-panel-invoice-amount{grid-area:amount!important;align-items:flex-end!important;text-align:left!important}
.nd-panel-invoice-hint{display:none!important}
.nd-panel-invoice-chevron{grid-area:chevron!important}
.nd-panel-invoice-copy strong,
.nd-panel-invoice-date b,
.nd-panel-invoice-amount b{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}
.nd-panel-invoice-detail{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  padding:12px!important;
}
.nd-panel-invoice-items{min-width:0!important;width:100%!important}
.nd-panel-invoice-item{
  grid-template-columns:24px minmax(0,1fr)!important;
  gap:7px!important;
  padding:10px!important;
}
.nd-panel-invoice-item b{
  grid-column:2!important;
  justify-self:start!important;
  margin-top:2px!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.nd-panel-invoice-item-description{min-width:0!important;overflow-wrap:anywhere!important}
.nd-panel-invoice-total{gap:10px!important;flex-wrap:wrap!important}
.nd-panel-invoice-pay{gap:8px!important;flex-wrap:wrap!important;padding:10px 12px!important}
.nd-panel-price-row{align-items:flex-start!important;flex-wrap:wrap!important}

@media(max-width:390px){
  .nd-customer-invoice-list .nd-panel-invoice-summary{
    grid-template-columns:9px minmax(0,1fr) 20px!important;
    grid-template-areas:
      "state copy chevron"
      "state date chevron"
      "state amount chevron"!important;
  }
  .nd-panel-invoice-amount{align-items:flex-start!important;text-align:right!important;margin-top:3px!important}
}


/* RC46.70.10 — capture-phase accordion controller */
.nd-panel-invoice-accordion{display:block!important;height:auto!important;max-height:none!important}
.nd-panel-invoice-summary{border:0!important;background:transparent!important;color:inherit!important;text-align:inherit!important;font:inherit!important}
.nd-panel-invoice-detail{display:none!important;width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:12px!important}
.nd-panel-invoice-accordion.open>.nd-panel-invoice-detail{display:block!important}
.nd-panel-invoice-accordion.open .nd-panel-invoice-chevron{transform:rotate(180deg)!important}


/* RC46.70.11 — definitive expanded invoice visibility and cache refresh */
.nd-customer-invoice-list .nd-panel-invoice-accordion.open{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
.nd-customer-invoice-list .nd-panel-invoice-accordion.open>.nd-panel-invoice-detail{
  display:block!important;
  position:static!important;
  width:100%!important;
  height:auto!important;
  min-height:72px!important;
  max-height:none!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:visible!important;
}
.nd-customer-invoice-list .nd-panel-invoice-detail[hidden]{display:none!important}


/* RC46.70.12 — isolated unpaid invoice card; no legacy card layout inheritance */
.nd-customer-invoice-list .nd-unpaid-invoice-card{
  display:block!important;
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0 0 10px!important;
  padding:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  border:1px solid #dfe8f3!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:none!important;
}
.nd-customer-invoice-list .nd-unpaid-invoice-head{
  display:grid!important;
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:102px!important;
  box-sizing:border-box!important;
  grid-template-columns:10px minmax(0,1fr) minmax(112px,auto) 22px!important;
  grid-template-areas:"state copy amount chevron" "state date amount chevron"!important;
  align-items:center!important;
  gap:6px 9px!important;
  padding:14px 13px!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:#fff!important;
  color:inherit!important;
  text-align:right!important;
  font:inherit!important;
  cursor:pointer!important;
  overflow:visible!important;
}
.nd-unpaid-invoice-head .nd-panel-invoice-state{grid-area:state!important}
.nd-unpaid-invoice-head .nd-panel-invoice-copy{grid-area:copy!important}
.nd-unpaid-invoice-head .nd-panel-invoice-date{grid-area:date!important}
.nd-unpaid-invoice-head .nd-panel-invoice-amount{grid-area:amount!important}
.nd-unpaid-invoice-head .nd-panel-invoice-chevron{grid-area:chevron!important}
.nd-customer-invoice-list .nd-unpaid-invoice-body{
  display:none!important;
  position:relative!important;
  inset:auto!important;
  float:none!important;
  clear:both!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:13px!important;
  box-sizing:border-box!important;
  border:0!important;
  border-top:1px solid #e6edf6!important;
  border-radius:0!important;
  background:#f8fbff!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:visible!important;
  transform:none!important;
  z-index:auto!important;
}
.nd-customer-invoice-list .nd-unpaid-invoice-card.open>.nd-unpaid-invoice-body{
  display:block!important;
}
.nd-customer-invoice-list .nd-unpaid-invoice-card.open>.nd-unpaid-invoice-head .nd-panel-invoice-chevron{
  transform:rotate(180deg)!important;
}
.nd-customer-invoice-list .nd-unpaid-invoice-body[hidden]{display:none!important}
.nd-customer-invoice-list .nd-unpaid-invoice-card.open>.nd-unpaid-invoice-body[hidden]{display:block!important}
.nd-unpaid-invoice-body .nd-customer-loading{min-height:86px!important}
.nd-unpaid-invoice-body .nd-panel-invoice-pay{
  position:static!important;
  inset:auto!important;
  float:none!important;
  width:100%!important;
  margin:0!important;
}
@media(max-width:390px){
  .nd-customer-invoice-list .nd-unpaid-invoice-head{
    grid-template-columns:9px minmax(0,1fr) 20px!important;
    grid-template-areas:"state copy chevron" "state date chevron" "state amount chevron"!important;
  }
  .nd-unpaid-invoice-head .nd-panel-invoice-amount{align-items:flex-start!important;text-align:right!important}
}
