:root {
  --navy: #0B4F6C;
  --teal: #17A398;
  --bg: #F5F7F8;
  --border: #DCE4E8;
  --text: #1C2B33;
  --muted: #5A6B73;
  --gold: #C99A2E;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: 'Sarabun', sans-serif;
  color: var(--text);
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--teal); }

header.site-header {
  width: 100%;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--navy); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 12px; color: var(--muted); }

nav.site-nav { display: flex; gap: 28px; flex-wrap: wrap; }
nav.site-nav a { font-size: 15px; font-weight: 500; color: var(--text); }
nav.site-nav a.active { color: var(--navy); font-weight: 700; }

.btn {
  display: inline-block;
  font-size: 14px; font-weight: 600;
  padding: 10px 22px; border-radius: 8px;
  border: none; cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }

main { max-width: 1200px; margin: 0 auto; padding: 48px; }

.eyebrow { font-size: 13px; font-weight: 600; color: var(--teal); letter-spacing: .04em; }
h1.page-title { font-size: 32px; margin: 8px 0; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.8; max-width: 700px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 24px;
}
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.person-card { display: flex; gap: 14px; align-items: center; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted);
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.section-title { font-size: 19px; font-weight: 700; margin: 40px 0 20px; }

form.form-card { display: flex; flex-direction: column; gap: 16px; }
label { font-size: 14px; font-weight: 600; }
input, textarea, select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: 'Sarabun', sans-serif; width: 100%;
}
textarea { resize: vertical; min-height: 100px; }

.empty-state {
  color: var(--muted); font-size: 14px; padding: 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: 12px;
}

footer.site-footer {
  background: var(--navy); color: #fff; padding: 40px 48px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
footer.site-footer .muted { color: #CFE0E8; font-size: 13px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.badge-admin { background: #E4EEF1; color: var(--navy); }
.badge-done { background: #E3F3EA; color: #177A4F; }
.badge-progress { background: #FBF0DC; color: #B07A17; }
.badge-pending { background: #EDF1F3; color: var(--muted); }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
table.admin-table th { background: var(--bg); color: var(--muted); }
.row-actions button { margin-right: 6px; font-size: 13px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.row-actions button.danger { color: #C1453D; border-color: #F1C9C5; }

.tabs { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.login-wrap { display: flex; min-height: 100vh; }
.login-side {
  width: 46%; background: var(--navy); color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 800px) {
  .login-side { display: none; }
  nav.site-nav { order: 3; width: 100%; justify-content: center; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table.admin-table { min-width: 560px; }

/* ===== ปรับหน้าจอสำหรับมือถือ / แท็บเล็ต ===== */
@media (max-width: 900px) {
  header.site-header { padding: 14px 20px; }
  main { padding: 28px 20px; }
  h1.page-title { font-size: 24px; }
  .lede { font-size: 15px; }
  nav.site-nav { gap: 16px; justify-content: center; width: 100%; order: 3; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tabs { justify-content: center; }
  .tab-btn { padding: 8px 14px; font-size: 13px; }
  .card { padding: 18px; }
  header.site-header > div:last-child { width: 100%; justify-content: center; }
  .brand-text strong { font-size: 15px; }
  .brand-text span { font-size: 11px; }
  table.admin-table th, table.admin-table td { padding: 10px 12px; font-size: 13px; }
  footer.site-footer { padding: 28px 20px; text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
  h1.page-title { font-size: 21px; }
}
