.photo-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.photo-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.photo-status {
  color: var(--muted);
}

.photo-status[data-required="true"]::after {
  content: " Bắt buộc khi mua thuốc tại Lúa Việt.";
  color: var(--danger);
}

.completion-payment {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 16px;
}

.completion-payment h3 {
  margin: 0 0 12px;
}

.payment-qr {
  text-align: center;
}

.payment-qr img {
  background: #fff;
  border-radius: 12px;
  max-height: 240px;
  max-width: 240px;
  object-fit: contain;
}

.payment-summary {
  line-height: 1.65;
  padding: 14px 16px;
}

.optional-debt span {
  align-items: center;
  display: flex;
  gap: 8px;
}

.optional-debt input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.compact-note {
  margin: 4px 0;
}

.paid-amount {
  color: var(--green) !important;
}

.debt-amount {
  color: var(--danger) !important;
}

.old-debt-amount {
  color: #a15c00 !important;
}

.old-debt-notice {
  align-items: center;
  background: #fff6df;
  border: 1px solid #efd28b;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.old-debt-notice strong {
  color: #a15c00;
}

.document-actions {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.attachment-preview {
  background: #eef5f1;
  border-radius: 14px;
  display: grid;
  max-height: 70dvh;
  overflow: auto;
  padding: 10px;
  place-items: center;
}

.attachment-preview img {
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.subtabs,
.quick-ranges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subtabs { margin: 16px 0; }
.finance-summary { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.section-title { margin: 22px 0 10px; }
.cash-held { color: var(--green); font-size: 16px; }
.finance-load-actions { align-items: center; }
.load-status {
  align-self: center;
  background: #eef5f1;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
}
.load-status.loading { color: #9a6200; font-weight: 700; }
.load-status.success { color: var(--green); font-weight: 700; }
.load-status.error-text { color: #b42318; font-weight: 700; }
.finance-loading-banner,
.finance-result-confirmation {
  border-radius: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
}
.finance-loading-banner {
  background: #fff6df;
  border: 1px solid #efd28b;
  color: #8a5a00;
  font-weight: 700;
}
.finance-result-confirmation {
  align-items: center;
  background: #e5f4ea;
  border: 1px solid #b9ddc7;
  color: var(--green);
  display: grid;
  gap: 3px;
}
.finance-result-confirmation span,
.finance-result-confirmation small { color: var(--ink); }

dialog {
  max-height: 94dvh;
  overflow: auto;
}

.dialog-actions {
  background: #fff;
  bottom: 0;
  position: sticky;
  z-index: 2;
}

@media (max-width: 650px) {
  .photo-actions .button {
    flex: 1;
  }

  .payment-qr img {
    max-height: 200px;
    max-width: 200px;
  }

  .subtabs .button,
  .quick-ranges .button {
    flex: 1;
    min-width: 120px;
  }
}
