/* =========================================================
   style.css : ธีมกลางของทุกหน้า (โทนเขียวขี้ม้า - ทอง)
   ใช้ร่วมกันใน index / login / personnel / admin
   ========================================================= */
:root{
  --olive-950:#161b12;
  --olive-900:#1e2418;
  --olive-800:#2b3323;
  --olive-700:#3a4530;
  --olive-500:#6b7a5c;
  --olive-100:#e9ece4;
  --olive-50:#f5f6f2;
  --gold:#d4a017;
  --gold-soft:#fbf3dc;
  --red:#a82424;
  --red-dark:#851c1c;
  --text:#1f241c;
  --muted:#6b7365;
  --border:#e3e7de;
  --surface:#ffffff;
  --radius:16px;
  --shadow:0 1px 2px rgba(20,25,15,.04),0 6px 20px rgba(20,25,15,.06);
  --shadow-lg:0 14px 36px rgba(20,25,15,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:'Google Sans Flex','Google Sans','Noto Sans Thai','Leelawadee UI',Tahoma,system-ui,sans-serif;
  background:var(--olive-50);
  color:var(--text);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,h5,h6{font-weight:600;letter-spacing:-.01em}
a{color:var(--olive-800)}
:focus-visible{outline:3px solid rgba(212,160,23,.55);outline-offset:2px}
.text-muted-x{color:var(--muted)!important}

/* ---------- ปุ่ม ---------- */
.btn{border-radius:12px;font-weight:500}
.btn-brand{background:var(--red);color:#fff;border:0;border-radius:999px;padding:.6rem 1.3rem}
.btn-brand:hover,.btn-brand:focus{background:var(--red-dark);color:#fff}
.btn-olive{background:var(--olive-800);color:#fff;border:0}
.btn-olive:hover,.btn-olive:focus{background:var(--olive-700);color:#fff}
.btn-gold{background:var(--gold);color:var(--olive-950);border:0}
.btn-gold:hover,.btn-gold:focus{background:#c2920f;color:var(--olive-950)}
.btn-soft{background:var(--olive-100);color:var(--olive-800);border:0}
.btn-soft:hover,.btn-soft:focus{background:#dde2d5;color:var(--olive-900)}
.btn-ghost-light{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.22)}
.btn-ghost-light:hover,.btn-ghost-light:focus{background:rgba(255,255,255,.18);color:#fff}

/* ---------- การ์ด / หัวข้อ ---------- */
.card-x{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.eyebrow{font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;font-weight:500;color:var(--gold)}
.section-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}
.section-title{font-size:1.45rem;margin:0}
.clamp-2,.clamp-3{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}
.clamp-2{-webkit-line-clamp:2}
.clamp-3{-webkit-line-clamp:3}

/* ---------- ฟอร์ม ---------- */
.form-control,.form-select{border-radius:12px;border-color:var(--border);padding:.6rem .85rem}
.form-control:focus,.form-select:focus{border-color:var(--olive-500);box-shadow:0 0 0 .25rem rgba(107,122,92,.18)}
.form-label{font-weight:400;font-size:.92rem;margin-bottom:.35rem}
.input-group-text{border-color:var(--border);background:var(--olive-50);color:var(--muted);border-radius:12px}
.modal-content{border:0;border-radius:20px;overflow:hidden}
.modal-header{border-bottom-color:var(--border)}
.modal-footer{border-top-color:var(--border)}

/* ---------- แถบประกาศวิ่ง ---------- */
.ticker{background:var(--olive-950);color:#f3e7c4;font-size:.92rem}
.ticker-label{background:var(--gold);color:var(--olive-950);font-weight:500;font-size:.8rem;padding:.15rem .75rem;border-radius:999px;white-space:nowrap}
.ticker-track{flex:1;overflow:hidden;-webkit-mask-image:linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent);mask-image:linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent)}
.ticker-text{display:inline-block;white-space:nowrap;padding-left:100%;animation:ticker 24s linear infinite}
.ticker:hover .ticker-text{animation-play-state:paused}
@keyframes ticker{to{transform:translateX(-100%)}}
@media (prefers-reduced-motion:reduce){.ticker-text{animation:none;padding-left:0}}

/* ---------- แถบเมนูด้านบน ---------- */
.site-nav{position:sticky;top:0;z-index:1030;background:rgba(255,255,255,.88);backdrop-filter:saturate(180%) blur(12px);-webkit-backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--border)}
.brand-logo{height:48px;width:auto}
.brand-title{font-weight:600;font-size:1.1rem;line-height:1.25;color:var(--text)}
.brand-sub{font-size:.8rem;color:var(--muted);line-height:1.3}
.nav-link-x{color:var(--muted);text-decoration:none;padding:.45rem .8rem;border-radius:10px;font-weight:500}
.nav-link-x:hover{color:var(--olive-900);background:var(--olive-100)}

/* ---------- Hero ต้อนรับ ---------- */
.hero{position:relative;overflow:hidden;border-radius:24px;color:#fff;padding:2.25rem;
  background:radial-gradient(900px 380px at 0% 0%,#4a5833 0%,transparent 60%),linear-gradient(135deg,var(--olive-900),var(--olive-800))}
.hero::after{content:'';position:absolute;right:-90px;bottom:-90px;width:300px;height:300px;border-radius:50%;background:radial-gradient(circle,rgba(212,160,23,.28),transparent 70%);pointer-events:none}
.hero h1{font-size:clamp(1.6rem,3.2vw,2.4rem);line-height:1.3;margin:.4rem 0 .9rem}
.hero .lead{color:rgba(255,255,255,.75);font-size:1.05rem;max-width:34rem}
@media (min-width:992px){.hero{padding:3rem}}

.director-card{position:relative;z-index:1;max-width:330px;margin-inline:auto;padding:.75rem;border-radius:20px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14)}
.director-card img{width:100%;aspect-ratio:4/5;object-fit:cover;object-position:top;border-radius:14px;background:var(--olive-700)}
.director-card .info{text-align:center;padding:.9rem .5rem .35rem}
.director-card h3{font-size:1.15rem;margin:0 0 .15rem}
.director-card p{margin:0;color:rgba(255,255,255,.7);font-size:.92rem}

/* ---------- ไทล์บริการ ---------- */
.tile{display:flex;align-items:center;gap:.9rem;padding:1rem 1.1rem;height:100%;color:inherit;text-decoration:none;transition:transform .18s,box-shadow .18s}
.tile:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg);color:inherit}
.tile-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;font-size:1.35rem;flex-shrink:0}
.tile-title{font-weight:500;line-height:1.35}
.tile-sub{font-size:.85rem;color:var(--muted)}
.ic-gold{background:var(--gold-soft);color:#9a6f00}
.ic-red{background:#fde8e8;color:var(--red)}
.ic-blue{background:#e6ecfa;color:#1a3680}
.ic-olive{background:var(--olive-100);color:var(--olive-800)}

/* ---------- ข่าวเด่น ---------- */
.feature{display:grid;grid-template-columns:1fr;overflow:hidden;cursor:pointer;transition:box-shadow .2s;color:inherit;text-decoration:none}
.feature:hover{box-shadow:var(--shadow-lg);color:inherit}
.feature-img{position:relative;min-height:220px;background:var(--olive-100)}
.feature-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.feature-badge{position:absolute;top:1rem;left:1rem;background:var(--gold);color:var(--olive-950);font-weight:500;font-size:.8rem;padding:.2rem .75rem;border-radius:999px}
.feature-title{font-size:1.35rem;line-height:1.45;margin:.25rem 0 .6rem}
@media (min-width:768px){.feature{grid-template-columns:1.1fr 1fr}.feature-img{min-height:300px}}

/* ---------- ตัวกรองหมวดข่าว ---------- */
.chips{display:flex;flex-wrap:wrap;gap:.5rem}
.chip{border:1px solid var(--border);background:#fff;border-radius:999px;padding:.38rem 1rem;font-size:.9rem;color:var(--muted);font-weight:500}
.chip:hover{border-color:var(--olive-500);color:var(--olive-900)}
.chip.active{background:var(--olive-800);border-color:var(--olive-800);color:#fff}

/* ---------- การ์ดข่าว ---------- */
.news-card{height:100%;display:flex;flex-direction:column;overflow:hidden;color:inherit;text-decoration:none;transition:transform .18s,box-shadow .18s}
.news-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg);color:inherit}
.news-head{position:relative;min-height:150px;padding:1.25rem;color:#fff;display:flex;flex-direction:column;justify-content:flex-end}
.news-head.tag-urgent{background:linear-gradient(135deg,#6e1717,#a82424)}
.news-head.tag-welfare{background:linear-gradient(135deg,#132a63,#1a3680)}
.news-head.tag-finance{background:linear-gradient(135deg,#743a00,#a65100)}
.news-head.tag-general{background:linear-gradient(135deg,var(--olive-900),var(--olive-700))}
.news-pill{position:absolute;top:1rem;right:1rem;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);color:#fff;border-radius:999px;padding:.15rem .7rem;font-size:.78rem;font-weight:500}
.news-body{padding:1.1rem 1.25rem 1.25rem;display:flex;flex-direction:column;flex:1}
.news-more{margin-top:auto;font-weight:500;color:var(--olive-800);font-size:.92rem}

/* ป้ายหมวด (ใช้ในตาราง/รายการ) */
.pill{display:inline-block;border-radius:999px;padding:.15rem .7rem;font-size:.8rem;font-weight:500;white-space:nowrap}
.pill.tag-urgent{background:#fde8e8;color:#a82424}
.pill.tag-welfare{background:#e6ecfa;color:#1a3680}
.pill.tag-finance{background:#fdf0e2;color:#a65100}
.pill.tag-general{background:var(--olive-100);color:var(--olive-800)}

/* ---------- สถานะสิทธิ ---------- */
.status{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .75rem;border-radius:999px;font-size:.82rem;font-weight:500;white-space:nowrap}
.status-approved{background:#e6f4ea;color:#1e6b34}
.status-pending{background:#fff4d6;color:#8a5a00}
.status-rejected{background:#fde8e8;color:#a82424}
.status-none{background:#eef0ec;color:#6b7365}

/* ---------- ประกาศ / รายการ ---------- */
.notice{display:flex;gap:.8rem;align-items:flex-start;background:var(--gold-soft);border:1px solid #f0dca0;border-radius:14px;padding:1rem 1.1rem;color:#5c4500}
.notice i{font-size:1.2rem;line-height:1.4}
.list-item{display:flex;gap:.9rem;align-items:flex-start;padding:.9rem 0;border-bottom:1px solid var(--border);color:inherit;text-decoration:none}
.list-item:last-child{border-bottom:0}
.list-item:hover .li-title{color:var(--olive-700);text-decoration:underline}
.kv{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px dashed var(--border);font-size:.92rem}
.kv:last-child{border-bottom:0}
.kv span:first-child{color:var(--muted)}
.kv span:last-child{font-weight:500;text-align:right}
.empty{padding:2.5rem 1rem;text-align:center;color:var(--muted)}
.empty i{font-size:2rem;display:block;margin-bottom:.5rem;opacity:.6}

/* ---------- หน้ากำลังพล ---------- */
.profile-hero{position:relative;overflow:hidden;border-radius:24px;color:#fff;padding:1.75rem;background:linear-gradient(135deg,var(--olive-900),var(--olive-800))}
.profile-hero::after{content:'';position:absolute;right:-70px;top:-70px;width:220px;height:220px;border-radius:50%;background:radial-gradient(circle,rgba(212,160,23,.25),transparent 70%)}
.avatar{width:64px;height:64px;border-radius:18px;background:var(--gold);color:var(--olive-950);display:grid;place-items:center;font-size:1.8rem;flex-shrink:0}
.right-card{padding:1.25rem;height:100%;display:flex;flex-direction:column}
.right-note{margin-top:auto;background:var(--olive-50);border-radius:12px;padding:.7rem .85rem;font-size:.88rem;color:var(--muted)}

/* ---------- Footer ---------- */
.site-footer{background:var(--olive-900);color:#b0baa8;margin-top:3rem}
.contact-chip{display:flex;align-items:center;gap:.75rem;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:.8rem 1rem;color:#fff;text-decoration:none;height:100%}
.contact-chip:hover{background:rgba(255,255,255,.1);color:#fff}
.contact-chip small{color:#b0baa8;display:block;line-height:1.3}

/* ---------- Toast แจ้งเตือน ---------- */
.toast-box{position:fixed;right:1rem;bottom:1rem;z-index:2000;display:flex;flex-direction:column;gap:.5rem}
.toast-msg{display:flex;gap:.6rem;align-items:center;background:var(--olive-900);color:#fff;padding:.75rem 1rem;border-radius:12px;box-shadow:var(--shadow-lg);animation:toastIn .25s ease;transition:opacity .3s,transform .3s}
.toast-msg.success i{color:#7bd389}
.toast-msg.error i{color:#ff8a8a}
.toast-msg.hide{opacity:0;transform:translateY(8px)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}}

/* ---------- หน้า Login ---------- */
.auth-page{min-height:100vh;display:grid;place-items:center;padding:1.5rem;
  background:radial-gradient(900px 500px at 10% 0%,#e1e7d6,transparent 60%),radial-gradient(700px 400px at 100% 100%,#f3ead0,transparent 60%),var(--olive-50)}
.auth-card{width:100%;max-width:440px;padding:2rem}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:var(--olive-100);border-radius:12px}
.seg button{border:0;background:transparent;border-radius:9px;padding:.55rem;font-weight:500;color:var(--muted)}
.seg button.active{background:#fff;color:var(--olive-900);box-shadow:var(--shadow)}

/* ---------- หน้า Admin ---------- */
.admin-shell{display:flex;min-height:100vh}
.admin-side{width:264px;flex-shrink:0;background:var(--olive-800);color:#cfd8c8;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;z-index:1040;transition:transform .25s}
.admin-side .brand{padding:1.1rem 1.25rem;border-bottom:1px solid rgba(255,255,255,.08)}
.side-label{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.45);margin:1rem .6rem .35rem}
.side-link{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;background:none;border:0;color:#d5ddce;padding:.65rem .9rem;border-radius:12px;font-weight:500;margin-bottom:2px}
.side-link:hover{background:rgba(255,255,255,.07);color:#fff}
.side-link.active{background:var(--gold);color:var(--olive-950)}
.admin-main{flex:1;min-width:0}
.admin-top{position:sticky;top:0;z-index:1020;display:flex;align-items:center;gap:.75rem;padding:.85rem 1.5rem;background:rgba(245,246,242,.88);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.admin-body{padding:1.5rem;max-width:1200px}
.side-backdrop{display:none}
@media (max-width:991.98px){
  .admin-side{position:fixed;left:0;top:0;transform:translateX(-100%)}
  .admin-side.open{transform:none}
  .side-backdrop.show{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:1035}
  .admin-body{padding:1rem}
}
.stat{display:flex;align-items:center;gap:1rem;padding:1.1rem 1.25rem;transition:box-shadow .18s}
.stat:hover{box-shadow:var(--shadow-lg)}
.stat .num{font-size:1.6rem;font-weight:700;line-height:1.1}
.panel-head{padding:1rem 1.25rem;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:.6rem;font-weight:600}
.panel-head i{color:var(--gold)}
.table-x{margin:0}
.table-x th{font-size:.78rem;letter-spacing:.04em;color:var(--muted);font-weight:500;background:var(--olive-50);white-space:nowrap}
.table-x td,.table-x th{vertical-align:middle;border-color:var(--border);padding:.75rem 1rem}
.img-preview{width:100%;max-width:200px;aspect-ratio:4/5;object-fit:cover;border-radius:14px;background:var(--olive-100);border:1px solid var(--border)}
.img-preview.wide{max-width:100%;aspect-ratio:16/9}
.form-section{font-weight:600;font-size:.95rem;margin:1.25rem 0 .75rem;padding-top:1rem;border-top:1px solid var(--border);display:flex;align-items:center;gap:.5rem}
.form-section:first-child{margin-top:0;padding-top:0;border-top:0}

/* ---------- น้ำหนักตัวอักษร: เนื้อหาเป็นตัวปกติ ---------- */
body{font-weight:400}
.fw-bold{font-weight:600!important}
.fw-semibold{font-weight:500!important}
