* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f2f4f8;
  color: #222;
}

/* Header */
.app-header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #1f2a44;
  color: #fff;
}

.app-header h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

/* Layout utama */
.app-container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* Form */
.form-section, .preview-section {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.form-section h2, .preview-section h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.25rem;
}

.form-grid input,
.form-grid textarea {
  border: 1px solid #cbd2e1;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
}

.form-grid textarea {
  resize: vertical;
  min-height: 60px;
}

.form-grid label:nth-last-child(1),
.form-grid label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.buttons {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

button {
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

#updateBtn {
  background: #1f2a44;
  color: #fff;
}

#printBtn {
  background: #e4e7f5;
  color: #1f2a44;
}

/* Receipt preview */
.preview-section {
  align-self: flex-start;
}

.receipt {
  background: #ffffff;
  border: 1px solid #cbd2e1;
  padding: 0.8rem 1rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.print-link {
  text-align: center;
  color: #0056b3;
  text-decoration: underline;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

/* Header receipt */
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #cbd2e1;
  padding-bottom: 0.5rem;
}

.receipt-title h1 {
  font-size: 1.2rem;
}

.receipt-title p {
  font-size: 0.8rem;
}

.receipt-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid #1f2a44;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body */
.fee-receipt-title {
  text-align: center;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  text-decoration: underline;
}

.receipt-body {
  margin-top: 0.5rem;
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  column-gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.row span:first-child,
.row span:nth-child(3) {
  font-weight: 600;
}

.payment-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.payment-table th,
.payment-table td {
  border: 1px solid #cbd2e1;
  padding: 0.25rem 0.3rem;
  text-align: left;
  font-size: 0.8rem;
}

.payment-table th {
  background: #f2f4f8;
}

.note-text, .address-text {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

/* Print mode: hanya receipt yang tampil */
@media print {
  body * {
    visibility: hidden;
  }

  #receipt, #receipt * {
    visibility: visible;
  }

  #receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
  }
}
