:root{
  --purple:#534AB7;
  --purple-dark:#3C3489;
  --purple-light:#EEEDFE;
  --purple-soft:#CECBF6;
  --purple-soft-hover:#AFA9EC;
  --page-bg:#F8F6FD;
  --gray-bg:#F1EFE8;
  --gray-fill:#D3D1C7;
  --text-main:#26211C;
  --text-muted:#8A8880;
  --border:#E4E1D6;
  --white:#FFFFFF;
  --danger:#C0392B;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:'Sarabun', sans-serif;
  background:var(--gray-bg);
  color:var(--text-main);
  min-height:100vh;
}
.page{
  max-width:480px;
  margin:0 auto;
  min-height:100vh;
  background:var(--page-bg);
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:2rem 1.25rem 3rem;
  position:relative;
}

.logo-box{
  width:100%;
  max-width:340px;
  aspect-ratio:3/1;
  border-radius:8px;
  background:var(--purple-light);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex-shrink:0;
}
.logo-box img{ width:100%; height:100%; object-fit:contain; }
.logo-box span{ font-size:12px; color:var(--purple-dark); font-weight:600; }
.logo-box.small{ max-width:340px; }

.login-card{
  width:100%;
  max-width:340px;
  margin-top:2.5rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.login-title{ font-size:19px; font-weight:600; margin:14px 0 2px; }
.login-sub{ font-size:13px; color:var(--text-muted); margin:0 0 20px; }

.field{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 12px;
  height:44px;
  margin-bottom:12px;
}
.field input{
  border:none; outline:none; flex:1;
  font-size:15px; font-family:inherit; background:transparent; color:var(--text-main);
}

.btn{
  width:100%; height:44px; border-radius:8px; border:none;
  background:var(--purple-soft); color:var(--purple-dark);
  font-size:15px; font-weight:600; font-family:inherit; cursor:pointer; margin-top:6px;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.btn:hover{ background:var(--purple-soft-hover); }
.btn.secondary{ background:var(--white); color:var(--text-main); border:1px solid var(--border); }
.btn.secondary:hover{ background:var(--gray-bg); }
.btn.small{ height:36px; font-size:13px; width:auto; padding:0 16px; }

.error-msg{ color:var(--danger); font-size:13px; margin:-4px 0 10px; min-height:16px; }
.save-msg{ font-size:13px; color:var(--purple-dark); margin-top:8px; min-height:16px; }

.member-header{ display:flex; flex-direction:column; align-items:center; gap:4px; margin-bottom:1.5rem; }
.member-caption{ font-size:12.5px; color:var(--text-muted); text-align:center; max-width:300px; }

.main-image-frame{
  width:280px; max-height:70vh;
  background:var(--gray-bg); border-radius:12px;
  display:flex; align-items:center; justify-content:center; overflow:hidden; margin-bottom:1.5rem;
}
.main-image-frame img{ width:100%; height:100%; object-fit:contain; }
.placeholder-icon{ color:var(--gray-fill); }
.main-image-title{ font-size:13px; font-weight:600; color:var(--text-main); margin:0 0 8px; text-align:center; }

.banners{
  width:280px;
  display:grid; grid-template-columns:repeat(2, 1fr); gap:6px;
  border-radius:8px; overflow:hidden;
}
.banner-item{ width:100%; aspect-ratio:2.4/1; background:var(--gray-bg); display:block; cursor:pointer; border-radius:8px; overflow:hidden; }
.banner-item img{ width:100%; height:100%; object-fit:contain; display:block; }
.banner-item.no-link{ cursor:default; }

.logout-row{ margin-top:2rem; }

.admin-wrap{ width:100%; max-width:420px; display:flex; flex-direction:column; gap:1.5rem; }
.admin-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:0.5rem; }
.admin-header h2{ font-size:17px; font-weight:600; margin:0; }

.tabs{ display:flex; gap:0; border-bottom:1px solid var(--border); margin-bottom:0.5rem; }
.tab-btn{
  flex:1; background:none; border:none; font-family:inherit; font-size:14px; font-weight:600;
  color:var(--text-muted); padding:10px 0; cursor:pointer; border-bottom:2px solid transparent;
}
.tab-btn.active{ color:var(--purple); border-bottom-color:var(--purple); }
.tab-panel.hidden{ display:none; }
.tab-panel{ display:flex; flex-direction:column; gap:1.5rem; }

.section{ border:1px solid var(--border); border-radius:12px; padding:16px; }
.section h3{ font-size:14px; font-weight:600; margin:0 0 12px; }

.upload-zone{
  border:1.5px dashed var(--border); border-radius:8px; padding:12px; text-align:center;
  cursor:pointer; background:var(--gray-bg);
}
.upload-hint{ font-size:12px; color:var(--text-muted); }
.upload-zone.logo-zone, .upload-zone.banner-zone{
  aspect-ratio:3/1; display:flex; align-items:center; justify-content:center; flex-direction:column;
}
.upload-zone.logo-zone img, .upload-zone.banner-zone img{ width:100%; height:100%; object-fit:contain; }
.upload-zone.main-zone{ min-height:140px; display:flex; align-items:center; justify-content:center; flex-direction:column; }
.upload-zone.main-zone img{ max-width:100%; max-height:220px; object-fit:contain; }

label.small-label{ font-size:12.5px; color:var(--text-muted); display:block; margin:12px 0 6px; }
.banner-block{ border-top:1px solid var(--border); padding-top:14px; margin-top:14px; }
.banner-block:first-child{ border-top:none; padding-top:0; margin-top:0; }

.icon-btn-circle{
  width:32px; height:32px; border-radius:50%; background:var(--gray-bg);
  display:flex; align-items:center; justify-content:center; color:var(--text-muted);
  text-decoration:none; flex-shrink:0;
}
.icon-btn-circle:hover{ background:var(--border); }

.tabs-pill{ display:flex; gap:6px; background:var(--gray-bg); padding:4px; border-radius:10px; }
.tab-pill-btn{
  flex:1; background:none; border:none; border-radius:8px; padding:8px 0;
  display:flex; align-items:center; justify-content:center; gap:6px;
  font-family:inherit; font-size:13px; font-weight:500; color:var(--text-muted); cursor:pointer;
}
.tab-pill-btn.active{ background:var(--white); color:var(--purple-dark); }

.section-title-row{ display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.section-icon{
  width:26px; height:26px; border-radius:7px; background:var(--purple-light);
  display:flex; align-items:center; justify-content:center; color:var(--purple-dark); flex-shrink:0;
}
.section-title-row h3{ margin:0; }

.upload-zone-icon{ font-size:20px; color:var(--text-muted); margin-bottom:4px; }

.form-card{ border:1px solid var(--border); border-radius:10px; padding:14px; }
.form-card-label{ font-size:13px; font-weight:500; color:var(--text-main); margin:0 0 10px; }
.radio-option{
  display:flex; align-items:center; gap:10px; padding:9px 4px; cursor:pointer;
  font-size:14px; color:var(--text-main);
}
.radio-option input[type=radio]{ width:18px; height:18px; accent-color:var(--purple); flex-shrink:0; margin:0; }
.file-upload-zone{
  border:1.5px dashed var(--border); border-radius:8px; background:var(--gray-bg);
  padding:20px 12px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:6px;
  cursor:pointer;
}
.file-upload-zone i{ font-size:24px; color:var(--text-muted); }
.file-upload-zone .file-name{ font-size:12.5px; color:var(--purple-dark); font-weight:500; }
.file-upload-zone .file-hint{ font-size:11.5px; color:var(--text-muted); }

.switch{ position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch-slider{ position:absolute; cursor:pointer; inset:0; background:var(--gray-fill); transition:.15s; border-radius:22px; }
.switch-slider:before{ content:""; position:absolute; height:16px; width:16px; left:3px; bottom:3px; background:var(--white); transition:.15s; border-radius:50%; }
.switch input:checked + .switch-slider{ background:var(--purple-soft-hover); }
.switch input:checked + .switch-slider:before{ transform:translateX(18px); }

select{
  width:100%; height:40px; border-radius:8px; border:1px solid var(--border);
  font-family:inherit; font-size:14px; padding:0 10px; background:var(--white); color:var(--text-main);
}
input[type=text], input[type=tel], input[type=password], textarea{
  width:100%; border:1px solid var(--border); border-radius:8px; padding:8px 10px;
  font-family:inherit; font-size:14px; color:var(--text-main);
}
textarea{ resize:vertical; min-height:50px; }
.file-input-hidden{ display:none; }
