:root {
  --bg: #f5f7fb; --ink: #0f172a; --muted: #64748b; --line: #e8ecf3;
  --brand: #4f46e5; --brand2: #06b6d4; --ok: #059669; --bad: #e11d48; --warn: #d97706;
  --radius: 18px; --shadow: 0 1px 2px #0f172a0d, 0 8px 30px #0f172a0f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Noto Sans Thai", "Sarabun", system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

header { background: radial-gradient(1200px 400px at 85% -20%, #22d3ee55, transparent), linear-gradient(135deg, #312e81, #4f46e5 55%, #0891b2); color: #fff; padding: 56px 0 110px; position: relative; overflow: hidden; }
header::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -120px; bottom: -200px; background: #ffffff14; }
header h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.5px; }
header p { margin: 0; max-width: 620px; color: #e0e7ff; font-size: 1rem; }
.adminlink { position: absolute; top: 0; right: 20px; color: #fff; font-size: .8rem; background: #ffffff26; backdrop-filter: blur(8px); padding: 6px 14px; border-radius: 99px; text-decoration: none; transition: background .2s; }
.adminlink:hover { background: #ffffff40; }
header .wrap { position: relative; z-index: 1; padding-top: 48px; }

main { padding-top: 0; padding-bottom: 60px; margin-top: -70px; position: relative; z-index: 2; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.card { background: #fff; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card span { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.card b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.5px; }
.card.hl { background: linear-gradient(135deg, #059669, #10b981); color: #fff; border: 0; }
.card.hl span { color: #d1fae5; }

.panel { background: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel h2 { margin: 0 0 16px; font-size: 1.15rem; font-weight: 700; }

.progress { background: #eef1f7; border-radius: 99px; height: 12px; overflow: hidden; }
#bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); width: 0; border-radius: 99px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.small { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

.bank { background: linear-gradient(135deg, #eef2ff, #ecfeff); border: 1px solid #dbe4ff; border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.bank #bankName { font-size: .85rem; color: var(--muted); font-weight: 500; }
.acc { font-size: 1.7rem; font-weight: 800; letter-spacing: 2px; color: #312e81; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: .85rem; font-weight: 500; color: #334155; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; font-weight: 400; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fafbfd; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px #4f46e51a; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); padding: 0; }
input[type=file] { padding: 9px; background: #fff; border-style: dashed; cursor: pointer; }
button { font: inherit; font-weight: 600; background: linear-gradient(135deg, var(--brand), #6366f1); color: #fff; border: 0; padding: 12px 22px; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 14px #4f46e540; transition: transform .1s, box-shadow .2s, filter .2s; }
button:hover { filter: brightness(1.08); box-shadow: 0 6px 20px #4f46e550; }
button:active { transform: translateY(1px); }
button.danger { background: linear-gradient(135deg, #e11d48, #f43f5e); box-shadow: 0 4px 14px #e11d4833; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; padding: 10px 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--line); }
td { text-align: left; padding: 13px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faff; }
.r { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 600; }
td a { color: var(--brand); font-weight: 500; text-decoration: none; background: #eef2ff; padding: 3px 10px; border-radius: 99px; font-size: .8rem; white-space: nowrap; }
td a:hover { background: #e0e7ff; }
.empty { text-align: center !important; color: var(--muted); padding: 28px !important; }
.acts { white-space: nowrap; }
.acts button { padding: 6px 12px; font-size: .78rem; border-radius: 99px; box-shadow: none; margin-right: 4px; }
.tag { padding: 3px 11px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #eef1f7; color: var(--muted); }
.tag.approved { background: #d1fae5; color: #047857; }
.tag.rejected { background: #ffe4e6; color: #be123c; }
.tag.pending { background: #fef3c7; color: #b45309; }

/* admin pages have a plain header */
body:has(#loginBox) header { padding: 28px 0 90px; }
body:has(#loginBox) header h1 { font-size: 1.6rem; }
body:has(#loginBox) .adminlink { top: 4px; }
body:has(#loginBox) header .wrap { padding-top: 0; }
#loginBox { max-width: 420px; margin: 0 auto 16px; }

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  header { padding: 40px 0 100px; }
  .panel { padding: 18px; overflow-x: auto; }
  table { font-size: .82rem; }
  .acc { font-size: 1.4rem; }
}

.refreshbar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
button.ghost { background: #fff; color: var(--brand); border: 1.5px solid #dbe4ff; box-shadow: none; padding: 8px 16px; }
button.ghost:hover { background: #eef2ff; box-shadow: none; filter: none; }

#donate { scroll-margin-top: 16px; }

.req { color: var(--bad); font-weight: 700; }

/* รูปคอนโดพื้นหลังส่วนหัว (ทั้งหน้าลูกบ้านและแอดมิน) — วางไฟล์ไว้ที่ images/condo.jpg */
header {
  background:
    linear-gradient(135deg, #1e1b4bcc, #4f46e590 55%, #0891b280),
    url("images/condo.jpg") center 22% / cover no-repeat,
    #312e81;
}
header h1,
header p { text-shadow: 0 2px 12px #0006; }

.refreshbar { flex-wrap: wrap; }
.bk { margin-bottom: 14px; }
.bk-row { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.bk-row small { color: var(--muted); }
.bk-bar { height: 8px; background: #eef1f7; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 99px; }
