:root {
  --amber: #f5a623;
  --amber-dark: #e0940f;
  --ink: #1f2430;
  --muted: #6b7280;
  --border: #e2e2e2;
  --danger: #d64545;
  --card-bg: #ffffff;
  --page-bg: #f2f2f2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--ink);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
}

header.topbar {
  background: var(--amber);
  padding: 18px 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--amber-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.brand p {
  margin: 0;
  font-size: 13px;
  color: #4a3a00;
}

.badge-test {
  background: #fff;
  color: var(--amber-dark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

main {
  flex: 1;
  padding: 20px 20px 100px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.card + .card { margin-top: 16px; }

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.receipt-header .invoice-no { font-weight: 700; font-size: 17px; }
.receipt-header .amount { font-weight: 700; font-size: 18px; }
.receipt-date { color: var(--muted); font-size: 13px; margin-top: 2px; }

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.merchant-name { font-weight: 700; font-size: 16px; margin: 0 0 6px; }
.merchant-sub { font-weight: 600; font-size: 14px; margin: 0; }
.merchant-id { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.merchant-addr { font-size: 13px; color: #444; margin: 0; }

.line-item {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.line-item .desc .name { font-weight: 600; }
.line-item .desc .qty { color: var(--muted); font-size: 13px; }
.line-item .amt { font-weight: 600; }

.totals-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }

.total-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 14px;
}
.total-row.strong { font-weight: 700; }

.payable-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  margin-top: 14px;
}

.status-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.status-banner .tick {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-weight: 700;
}
.status-banner .title { font-weight: 700; margin: 0 0 2px; }
.status-banner .time { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.status-banner .note { font-size: 13px; margin: 0; color: #333; }

h2.form-title {
  margin: 4px 0 20px;
  font-size: 18px;
}

.field { margin-bottom: 18px; }

.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.field label .req { color: var(--danger); }
.field label .info {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9aa0a6;
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  cursor: default;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23555'><path d='M5.5 7.5l4.5 5 4.5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.field select.filled,
.field input.filled { background-color: #eef3fc; border-color: #cdd9ef; }

.field.invalid input,
.field.invalid select { border-color: var(--danger); }
.field .err {
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}
.field.invalid .err { display: block; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; flex: none; }

.consent {
  font-size: 13px;
  color: #333;
  margin: 18px 0 4px;
  line-height: 1.5;
}
.consent a { color: var(--ink); font-weight: 700; text-decoration: underline; }

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

button, .btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  padding: 14px 18px;
  border: none;
  cursor: pointer;
  flex: 1;
}

.btn-primary {
  background: var(--amber);
  color: #1f1f1f;
}
.btn-primary:hover { background: var(--amber-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.footer-bar {
  text-align: center;
  padding: 14px;
  background: var(--amber);
  color: #4a3a00;
  font-size: 13px;
  font-weight: 600;
}

.form-error {
  background: #fdecec;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.form-error.show { display: block; }

.hidden { display: none !important; }

/* filledform.html */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
.admin-wrap h1 { font-size: 20px; }
.admin-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  flex-wrap: wrap;
}
.admin-toolbar input[type="password"], .admin-toolbar input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.admin-toolbar button {
  flex: none;
  padding: 8px 14px;
}
.admin-status { font-size: 13px; color: var(--muted); }

table.submissions {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
table.submissions th, table.submissions td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.submissions th {
  background: #fafafa;
  position: sticky;
  top: 0;
}
table.submissions tr:hover { background: #fffbea; }
.mono { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 12px; }
.detail-toggle { cursor: pointer; color: #1a5fb4; text-decoration: underline; font-size: 12px; }
pre.json-detail {
  background: #101418;
  color: #d6e2f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.table-scroll { overflow-x: auto; }
.del-btn {
  background: #fff;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}

@media (max-width: 600px) {
  main { padding: 16px 16px 90px; }
}
