/* Invoice center polish: scoped to invoice-specific classes only. */
.botcf-invoice-center {
  max-width: 1180px;
  margin: 24px auto 48px;
  padding: 0 24px;
  color: var(--semi-color-text-0);
}

.botcf-invoice-center .botcf-invoice-page-head {
  position: relative;
  align-items: flex-end;
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--semi-color-border);
}

.botcf-invoice-center .botcf-invoice-page-head::before {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 74px;
  height: 3px;
  border-radius: 2px;
  background: var(--semi-color-primary);
  content: "";
}

.botcf-invoice-page-head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.botcf-invoice-page-head p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
}

.botcf-invoice-page-head button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--semi-color-border);
  border-radius: 6px;
  background: var(--semi-color-bg-0);
  color: var(--semi-color-text-0);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.botcf-invoice-page-head button:hover {
  border-color: var(--semi-color-primary);
  color: var(--semi-color-primary);
  background: var(--semi-color-primary-light-default);
}

.botcf-invoice-center .botcf-invoice-request {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--semi-color-border);
  border-radius: 10px;
  background: var(--semi-color-bg-1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.botcf-invoice-request-head {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--semi-color-border);
}

.botcf-invoice-request-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
}

.botcf-invoice-request-head p {
  max-width: 660px;
  margin: 5px 0 0;
  color: var(--semi-color-text-2);
  font-size: 12px;
  line-height: 1.6;
}

.botcf-invoice-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 16px;
}

.botcf-invoice-fields > label,
.botcf-invoice-fields > .botcf-invoice-fee-note,
.botcf-invoice-fields > textarea,
.botcf-invoice-fields > .botcf-invoice-actions {
  grid-column: 1 / -1;
}

.botcf-invoice-fields label {
  display: grid;
  gap: 6px;
  color: var(--semi-color-text-1);
  font-size: 12px;
  font-weight: 600;
}

.botcf-invoice-fields input,
.botcf-invoice-fields textarea,
.botcf-invoice-fields select {
  min-height: 38px;
  box-sizing: border-box;
  border-radius: 6px;
  background: var(--semi-color-bg-0);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.botcf-invoice-fields input:focus,
.botcf-invoice-fields textarea:focus,
.botcf-invoice-fields select:focus {
  border-color: var(--semi-color-primary);
  box-shadow: 0 0 0 3px var(--semi-color-primary-light-default);
}

.botcf-invoice-fee-note {
  border: 1px solid var(--semi-color-primary-light-hover);
  background: var(--semi-color-primary-light-default);
  line-height: 1.7;
}

.botcf-invoice-center .botcf-invoice-table-wrap {
  overflow: hidden;
  border: 1px solid var(--semi-color-border);
  border-radius: 10px;
  background: var(--semi-color-bg-0);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.botcf-invoice-table {
  min-width: 920px;
}

.botcf-invoice-table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--semi-color-border);
  background: var(--semi-color-fill-0);
  color: var(--semi-color-text-1);
  font-size: 12px;
  font-weight: 600;
}

.botcf-invoice-table td {
  min-height: 52px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--semi-color-border);
  color: var(--semi-color-text-0);
  line-height: 1.5;
}

.botcf-invoice-table tbody tr:last-child td {
  border-bottom: 0;
}

.botcf-invoice-table tbody tr:hover td {
  background: var(--semi-color-fill-0);
}

.botcf-invoice-empty {
  padding: 58px 16px !important;
  color: var(--semi-color-text-2);
  font-size: 13px;
}

.botcf-invoice-pagination {
  padding: 14px 2px 0;
  color: var(--semi-color-text-2);
  font-size: 12px;
}

@media (max-width: 720px) {
  .botcf-invoice-center {
    margin-top: 16px;
    padding: 0 14px;
  }

  .botcf-invoice-center .botcf-invoice-page-head,
  .botcf-invoice-request-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .botcf-invoice-page-head h2 {
    font-size: 21px;
  }

  .botcf-invoice-page-head button {
    width: 100%;
  }

  .botcf-invoice-center .botcf-invoice-request {
    padding: 16px;
  }

  .botcf-invoice-fields {
    grid-template-columns: 1fr;
  }
}

.botcf-invoice-self-apply {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--semi-color-border);
  border-radius: 10px;
  background: var(--semi-color-bg-1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.botcf-invoice-self-apply h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
}

.botcf-invoice-self-apply > p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--semi-color-text-2);
  font-size: 12px;
  line-height: 1.7;
}

.botcf-invoice-self-apply-note {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--semi-color-primary-light-hover);
  border-radius: 6px;
  background: var(--semi-color-primary-light-default);
  color: var(--semi-color-text-1);
  font-size: 12px;
  line-height: 1.6;
}

.botcf-invoice-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 16px;
}

.botcf-invoice-field {
  display: grid;
  gap: 6px;
  color: var(--semi-color-text-1);
  font-size: 12px;
  font-weight: 600;
}

.botcf-invoice-field input,
.botcf-invoice-field select,
.botcf-invoice-field textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--semi-color-border);
  border-radius: 6px;
  background: var(--semi-color-bg-0);
  color: var(--semi-color-text-0);
  padding: 9px 11px;
  outline: none;
  font: inherit;
  font-weight: 400;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.botcf-invoice-field input:focus,
.botcf-invoice-field select:focus,
.botcf-invoice-field textarea:focus {
  border-color: var(--semi-color-primary);
  box-shadow: 0 0 0 3px var(--semi-color-primary-light-default);
}

.botcf-invoice-self-apply-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2px;
}

.botcf-invoice-self-apply-status {
  margin-right: auto;
  color: var(--semi-color-text-2);
  font-size: 12px;
}

.botcf-invoice-self-apply-status[data-state="success"] {
  color: var(--semi-color-success);
}

.botcf-invoice-self-apply-status[data-state="error"] {
  color: var(--semi-color-danger);
}

.botcf-invoice-self-apply-actions button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .botcf-invoice-self-apply {
    padding: 16px;
  }

  .botcf-invoice-config-grid {
    grid-template-columns: 1fr;
  }

  .botcf-invoice-self-apply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .botcf-invoice-self-apply-status {
    margin-right: 0;
  }

  .botcf-invoice-self-apply-actions button {
    width: 100%;
  }
}
