/* Migrated from factoring.css; keep this file as the single place for this New/Edit form styling. */
/* Factoring Report forms only. */
#modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-report-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.5fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: end;
}

#modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-report-status-row {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.28fr);
}

#modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-schedule-table {
  overflow-x: auto;
}

#modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-report-total {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  margin: 18px 0 24px;
}

@media (max-width: 900px) {
  #modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-report-head,
  #modalForm.vt-modal--factoring-report .vt-factoring-report-form .factoring-report-status-row {
    grid-template-columns: 1fr;
  }
}

/* Migrated from styles.css for this form. */
.factoring-report-editor {
  display: grid;
  gap: 20px;
}

.factoring-report-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 3fr) 280px;
  gap: 16px;
  align-items: end;
}

.factoring-report-editor .table-wrap {
  max-height: 230px;
  overflow: auto;
}

.factoring-report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.factoring-report-section-head h2 {
  margin: 0;
}

.factoring-report-title,
.factoring-number-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.factoring-number-editor[hidden],
.factoring-report-title > [hidden] {
  display: none;
}

.factoring-download {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.factoring-report-actions {
  display: flex;
  width: max-content;
  margin-top: 4px;
}

.factoring-download-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 30;
  min-width: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.factoring-download.open .factoring-download-menu {
  display: grid;
}

.factoring-download-menu button {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.factoring-download-menu button:last-child {
  border-bottom: 0;
}

.factoring-download-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.factoring-report-total {
  text-align: right;
  font-size: 18px;
  font-weight: 800;
  margin-top: 16px;
}

.modal form:has(.factoring-report-editor) {
  width: min(1500px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.factoring-help-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #8b5cf6;
  border-radius: 3px;
  background: #f3e8ff;
  color: var(--ink);
  padding: 12px;
  margin-bottom: 6px;
}

.factoring-help-banner span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8b5cf6;
  color: #fff;
  font-weight: 700;
}

.factoring-report-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.factoring-report-status-row {
  grid-template-columns: minmax(360px, 1fr) 300px;
}

.factoring-readonly-field select,
.factoring-readonly-field input:disabled,
.factoring-readonly-field textarea:disabled {
  background: #c8d4dc;
  color: #314256;
  font-weight: 400;
  opacity: 1;
  cursor: default;
}

.factoring-schedule-table {
  margin-top: 12px;
  overflow-x: auto;
}

.factoring-schedule-table table {
  width: 100%;
  border-collapse: collapse;
}

.factoring-schedule-table th,
.factoring-schedule-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
}

.factoring-schedule-table th {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.factoring-schedule-table td.right,
.factoring-schedule-table th:last-child {
  text-align: right;
}

.factoring-schedule-total td {
  background: #eee;
  border-bottom: 0;
  font-weight: 500;
}
