/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  font-size: 13px;
  background: #e8f5e2;
  color: #1a1a1a;
  min-height: 100vh;
  padding: 24px 16px 48px;
}

.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-family: Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: #2e6b2e; color: #fff; }
.btn-secondary { background: #fff; color: #2e6b2e; border: 1.5px solid #2e6b2e; }

/* ── Voucher Card ──────────────────────────────────────────────── */
.voucher-card {
  background: #f0f7e6;
  border: 1.5px solid #b0c8a0;
  border-radius: 8px;
  padding: 24px 28px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Header */
.voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.company-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.logo-circle {
  width: 58px;
  height: 58px;
  border: 2.5px solid #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
}
.company-name {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.slash { font-style: italic; }
.company-sub  { font-size: 9px; font-weight: bold; margin-top: 2px; color: #333; }
.company-addr { font-size: 11px; margin-top: 2px; color: #333; }

.voucher-no-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
  padding-top: 4px;
}
.voucher-no-label { font-weight: 500; }
.input-nobukti {
  border: none;
  border-bottom: 1.5px solid #555;
  background: transparent;
  font-size: 13px;
  font-family: Arial, sans-serif;
  width: 160px;
  padding: 2px 4px;
  outline: none;
}
.input-nobukti:focus { border-bottom-color: #2e6b2e; }

/* Title */
.voucher-title {
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  margin: 10px 0 14px;
  letter-spacing: 0.5px;
}

/* Meta grid */
.meta-grid { margin-bottom: 16px; }
.meta-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 7px;
}
.meta-label {
  width: 130px;
  flex-shrink: 0;
  font-size: 13px;
}
.meta-colon {
  width: 14px;
  flex-shrink: 0;
}
.meta-value { flex: 1; }
.input-meta {
  width: 100%;
  border: none;
  border-bottom: 1px solid #888;
  background: transparent;
  font-size: 13px;
  font-family: Arial, sans-serif;
  padding: 2px 4px;
  outline: none;
}
.input-meta:focus { border-bottom-color: #2e6b2e; }
.input-date { max-width: 180px; }

/* Jumlah display row */
.jumlah-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.display-total {
  font-weight: bold;
  font-size: 13px;
  min-width: 100px;
  border-bottom: 1px solid #888;
  padding-bottom: 2px;
}
.terbilang-label { font-size: 12px; color: #444; white-space: nowrap; }
.display-terbilang {
  font-style: italic;
  font-size: 12px;
  color: #333;
  border-bottom: 1px solid #888;
  padding-bottom: 2px;
  flex: 1;
}

/* ── Items table ───────────────────────────────────────────────── */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-size: 13px;
}
.items-table th {
  background: #d0e8c8;
  border: 1px solid #888;
  padding: 6px 8px;
  text-align: center;
  font-weight: bold;
}
.items-table td {
  border: 1px solid #aaa;
  padding: 3px 4px;
  vertical-align: middle;
}
.col-no      { width: 36px; text-align: center; }
.col-penjelasan { }
.col-acct    { width: 220px; }
.col-jumlah  { width: 140px; }
.col-action  { width: 30px; }

.input-cell {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: Arial, sans-serif;
  padding: 2px 4px;
  outline: none;
}
.input-cell:focus { background: #fffff0; }
.jumlah-input { text-align: right; }

.btn-del-row {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}
.btn-del-row:hover { color: #e74c3c; }

.total-row td {
  background: #d0e8c8;
  font-weight: bold;
  border: 1px solid #888;
  padding: 5px 8px;
}
.total-label { text-align: right; padding-right: 12px; }
.total-amount { text-align: right; }

.btn-add-row {
  background: none;
  border: 1px dashed #2e6b2e;
  color: #2e6b2e;
  padding: 4px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-bottom: 16px;
  font-family: Arial, sans-serif;
}
.btn-add-row:hover { background: #e0f0d8; }

/* ── Signature section ─────────────────────────────────────────── */
.signature-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 4px 0 12px;
  gap: 20px;
}
.sig-table {
  border-collapse: collapse;
  font-size: 12px;
}
.sig-table th, .sig-table td {
  border: 1px solid #555;
  padding: 4px 20px;
  text-align: center;
}
.sig-table td { height: 52px; width: 80px; }

.sig-right { text-align: center; font-size: 12px; }
.yang-menerima { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sig-line { border-top: 1px solid #555; width: 140px; }
.sig-line-bottom { border-top: 1px solid #555; width: 140px; margin-top: 32px; }

/* ── Doc footer ────────────────────────────────────────────────── */
.doc-footer {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  border: 1px solid #555;
  margin-bottom: 16px;
}
.doc-footer span { padding: 3px 8px; }
.doc-footer-left { }
.doc-footer-sep { color: #999; }

/* ── Form actions ──────────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Success overlay ───────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay.hidden { display: none; }
.overlay-box {
  background: #fff;
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.overlay-icon {
  font-size: 48px;
  color: #2e6b2e;
  margin-bottom: 12px;
}
.overlay-box h2 { margin-bottom: 16px; color: #2e6b2e; }
.overlay-box p  { margin-bottom: 6px; font-size: 14px; color: #333; }
.terbilang-text { font-style: italic; color: #555; font-size: 13px; margin-bottom: 20px !important; }
.overlay-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ── Journal page ──────────────────────────────────────────────── */
.journal-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.journal-title { font-size: 18px; font-weight: bold; color: #2e6b2e; }
.journal-month { font-size: 13px; color: #666; margin-top: 4px; }
.journal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.upload-btn { cursor: pointer; }

.table-wrap { overflow-x: auto; }
.journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.journal-table th {
  background: #d9d9d9;
  border: 1px solid #aaa;
  padding: 6px 8px;
  font-weight: bold;
  white-space: nowrap;
}
.journal-table td {
  border: 1px solid #ccc;
  padding: 5px 8px;
}
.journal-table tbody tr:hover { background: #f5fbf0; }
.journal-table tfoot td {
  background: #d9d9d9;
  font-weight: bold;
  border: 1px solid #aaa;
  padding: 6px 8px;
}

.text-right  { text-align: right; }
.text-center { text-align: center; }

.btn-del-entry {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
}
.btn-del-entry:hover { background: #fdecea; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #666;
}
.empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .voucher-header { flex-direction: column; gap: 12px; }
  .voucher-no-box { align-self: flex-end; }
  .col-acct { width: 160px; }
  .journal-header { flex-direction: column; }
}
