/* v0.77.5 — sales allocation and workflow navigation refinements. */
.sales-credit-allocation-panel {
  display: grid;
  gap: .7rem;
  border-color: #b9dcc5;
  background: #f6fbf7;
}

.sales-credit-allocation-panel.hidden { display: none; }

#salesCreditAllocationRows {
  display: grid;
  gap: .55rem;
}

.sales-credit-allocation-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(145px, .8fr) minmax(200px, 1.2fr) auto;
  gap: .65rem;
  align-items: end;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.sales-credit-allocation-row label {
  display: grid;
  gap: .25rem;
  margin: 0;
}

.sales-credit-allocation-detail {
  align-self: center;
  color: var(--muted);
  font-size: .78rem;
}

.sales-credit-allocation-panel .allocation-balance {
  margin: 0;
  padding: .55rem .7rem;
  border-radius: 8px;
  background: #e9f6ed;
  color: #146b35;
}

.sales-credit-allocation-panel .allocation-balance .error { color: var(--danger); }

@media (max-width: 900px) {
  .sales-credit-allocation-row { grid-template-columns: 1fr 1fr; }
  .sales-credit-allocation-detail { align-self: end; }
}

@media (max-width: 580px) {
  .sales-credit-allocation-row { grid-template-columns: 1fr; }
  .sales-credit-allocation-row .remove-sales-credit-allocation { width: 100%; }
}

.side-nav .nav-priority {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .045);
}

.side-nav .nav-priority.active,
.side-nav .nav-priority:hover {
  border-color: rgba(72, 201, 176, .42);
}

.nav-module > div > .nav-subsection-label {
  display: block;
  padding: .7rem .7rem .24rem;
  color: rgba(255, 255, 255, .46);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .075em;
  line-height: 1.25;
  text-transform: uppercase;
}

.nav-module > div > .nav-subsection-label:not(:first-child) {
  margin-top: .28rem;
  border-top: 1px solid rgba(255, 255, 255, .075);
}

.nav-module > div > .nav-subsection-label.hidden { display: none; }

.nav-settings-module { margin: 0; }

.nav-settings-module summary { color: rgba(255, 255, 255, .78); }

@media (max-width: 1100px) {
  .side-nav-fixed { margin-top: .65rem; }
}

/* Keep approval actions reachable while the single outer record area scrolls. */
#detailDialog > #detailContent.invoice-record-shell .invoice-record-footer {
  position: sticky !important;
  z-index: 12 !important;
  bottom: -.25rem;
  margin-top: .55rem;
  padding: .65rem .2rem .45rem !important;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 -8px 14px rgba(18, 43, 61, .06);
}

#customerInvoiceRequestDialog .sales-editor-panel label,
#customerInvoiceRequestDialog .customer-request-line label {
  margin-bottom: 0;
}

@media (min-width: 1101px) {
  #customerInvoiceRequestDialog .customer-request-sales-layout {
    grid-template-columns: minmax(430px, .95fr) minmax(260px, .58fr) minmax(420px, 1.08fr);
    align-items: start !important;
    grid-auto-rows: max-content;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section,
  #customerInvoiceRequestDialog .customer-request-coding-section,
  #customerInvoiceRequestDialog .customer-request-preview-section {
    align-self: start !important;
    height: auto !important;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section .compact-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .35rem .45rem;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section .compact-form-grid .span-2 {
    grid-column: span 2;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section .customer-request-new-toggle {
    grid-column: 1 / -1 !important;
    min-height: 32px !important;
    margin-top: 0 !important;
    padding-top: .15rem !important;
    font-size: .68rem;
    line-height: 1.1;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section .customer-request-new-toggle input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    padding: 0;
  }

  #customerInvoiceRequestDialog .customer-request-coding-section .compact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #customerInvoiceRequestDialog .customer-request-customer-section label {
    gap: .2rem;
    font-size: .72rem;
    line-height: 1.15;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section input,
  #customerInvoiceRequestDialog .customer-request-customer-section select,
  #customerInvoiceRequestDialog .customer-request-customer-section textarea {
    min-height: 32px;
    padding: .38rem .44rem;
  }

  #customerInvoiceRequestDialog .customer-request-customer-section textarea {
    height: 42px;
    min-height: 42px;
  }

  #customerInvoiceRequestDialog .customer-request-selected-customer {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 36px;
    margin-top: .4rem;
    padding: .32rem .48rem;
    font-size: .72rem;
    line-height: 1.2;
  }
}
