@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;700&family=Playfair+Display:ital,wght@1,600&display=swap');

:root {
  --red: #9E2A2B;
  --red-dark: #7A1F20;
  --beige: #F4ECE1;
  --beige-2: #E9DCC9;
  --card: #FFFDF9;
  --ink: #3A2A22;
  --muted: #8A776A;
  --line: #E4D6C3;
  --ok: #3E8E5A;
  --warn: #C27A1A;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  background: var(--beige);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 60px; }
.wide { max-width: 1100px; }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; }
.script { font-family: 'Playfair Display', serif; font-style: italic; color: var(--red); }
.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { font-size: 40px; }
.hero p { margin: 4px 0 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 2px 10px rgba(122, 31, 32, .05);
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 20px;
  font: inherit; font-weight: 500; cursor: pointer;
  background: var(--beige-2); color: var(--ink);
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-dark); }
.btn.big { width: 100%; padding: 16px; font-size: 19px; }
.btn.ghost { background: transparent; color: var(--red); padding: 8px 12px; }
.btn:disabled { opacity: .55; }

label { display: block; font-weight: 500; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: -1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.chip.on { color: #fff; border-color: transparent; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.qr { width: 100%; max-width: 340px; display: block; margin: 8px auto; border-radius: 12px; background: #fff; }
.acc { text-align: center; }
.acc .num { font-size: 22px; font-weight: 700; letter-spacing: 1px; }

.code-box { text-align: center; padding: 10px 0; }
.code { font-size: 64px; font-weight: 700; letter-spacing: 6px; color: var(--red); line-height: 1.1; }

.tag { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--beige-2); }
.tag.ok { background: #E3F1E7; color: var(--ok); }
.tag.warn { background: #FBEBD3; color: var(--warn); }
.tag.err { background: #F8DEDE; color: var(--red); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 28px; color: var(--red); }
.stat span { font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin: 12px 0; }

.sheet-bg { position: fixed; inset: 0; background: rgba(40, 20, 15, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 20px 18px 28px; max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; z-index: 20; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--beige); }
.scroll-x { overflow-x: auto; }

.acc .bank { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.private { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--beige); font-size: 15px; text-align: left; }
.money { display: flex; align-items: center; gap: 8px; }
.money input { flex: 1; font-size: 22px; font-weight: 700; text-align: right; }
.money span { font-weight: 500; }
