* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Noto Sans Thai", system-ui, sans-serif;
  background: #f4f5f7; color: #1a1a1a;
}
.hidden { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e2a44; color: #fff; padding: 12px 16px; flex-wrap: wrap; gap: 8px;
}
.brand { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.navbtn {
  background: #33456b; color: #fff; border: none; border-radius: 8px;
  padding: 10px 14px; font-size: 0.95rem; cursor: pointer;
}
.navbtn:hover { background: #3f558a; }
.whoami { font-size: 0.9rem; opacity: 0.85; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }
.card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card.narrow { max-width: 380px; margin: 40px auto; }

h1 { margin-top: 0; font-size: 1.4rem; }
.muted { color: #777; }
.small { font-size: 0.85rem; }
.error { color: #c0392b; min-height: 1.2em; }

label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: #444; }
input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #ccc; border-radius: 8px; font-size: 1rem;
}
.btn {
  border: none; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 1rem;
}
.btn.primary { background: #1e2a44; color: #fff; }
.btn.primary:hover { background: #2c3c60; }
.btn.big { width: 100%; padding: 12px; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filterBtn {
  border: 1px solid #d5d8de; background: #fff; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 0.9rem;
}
.filterBtn.active { background: #1e2a44; color: #fff; border-color: #1e2a44; }

.articleList { display: flex; flex-direction: column; gap: 24px; margin-top: 12px; }
.catSection + .catSection { border-top: 1px solid #eee; padding-top: 20px; }
.catHeading {
  font-size: 1.1rem; margin: 0 0 12px; color: #1e2a44;
  border-left: 4px solid #1e2a44; padding-left: 10px;
}
.catCards { display: flex; flex-direction: column; gap: 14px; }
.newsCard {
  border: 1px solid #eaeaea; border-radius: 10px; padding: 14px 16px;
}
.newsCard h3 { margin: 0 0 6px; font-size: 1.05rem; }
.newsCard h3 a { color: #16223c; text-decoration: none; }
.newsCard h3 a:hover { text-decoration: underline; }
.newsCard p { margin: 4px 0; color: #333; line-height: 1.5; }
.newsMeta { font-size: 0.8rem; color: #888; margin-top: 6px; }
.readMore {
  display: inline-block; margin-top: 8px; font-size: 0.9rem;
  color: #1e2a44; font-weight: 600; text-decoration: none;
}
.readMore:hover { text-decoration: underline; }

.mailTable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mailTable th, .mailTable td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }

@media (max-width: 480px) {
  .topbar { flex-direction: column; align-items: flex-start; }
}
