/* หน้าแรกสาธารณะ — ตามแบบ: แถบบนขาว, Hero ม่วงไล่สี, การ์ดสถิติ, แผงกราฟ, หมวด 8 ด้าน, ข่าว, ลิงก์ และ footer ม่วงเข้ม */
.hp { background: var(--si-hp-bg, #F7F6FB); }
[data-bs-theme="dark"] .hp { background: var(--si-bg); }
.hp-wrap { max-width: 1240px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.hp-header { background: var(--si-surface); border-top: 4px solid var(--si-primary); box-shadow: 0 2px 10px rgba(var(--si-ink-rgb), .05); position: sticky; top: 0; z-index: 1030; }
.hp-header-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; padding-bottom: .4rem; }
.hp-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--si-primary); min-width: 0; }
.hp-brand img, .hp-logo-fallback { width: 58px; height: 58px; object-fit: contain; flex: 0 0 58px; }
.hp-logo-fallback { display: grid; place-items: center; border-radius: 50%; background: var(--si-primary-50); font-size: 1.8rem; }
.hp-brand b { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.hp-brand small { display: block; font-size: 1.05rem; color: var(--si-primary); font-weight: 500; }
[data-bs-theme="dark"] .hp-brand, [data-bs-theme="dark"] .hp-brand small { color: var(--si-on-dark); }
.hp-actions { display: flex; align-items: center; gap: .6rem; }
.hp-search { border: 1px solid var(--si-border); border-radius: 999px; overflow: hidden; background: var(--si-surface); }
.hp-search .form-control { border: 0; border-radius: 0; width: 210px; font-size: .9rem; background: transparent; }
.hp-search .btn { border: 0; border-radius: 0; color: var(--si-muted); }
.hp-login { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--si-ink); font-weight: 600; white-space: nowrap; }
.hp-login i { font-size: 1.6rem; color: var(--si-primary); }
.hp-nav { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; margin: 0; padding: .35rem 0 .55rem; }
.hp-nav a { display: inline-flex; align-items: center; gap: .3rem; color: var(--si-ink); text-decoration: none; font-size: .93rem; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; }
.hp-nav a i { color: var(--si-primary); }
.hp-nav a:hover, .hp-nav a.active { color: var(--si-primary); border-bottom-color: var(--si-primary); }
.hp-nav .hp-edit { color: #B45309; }

.hp-hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(90deg, rgba(var(--si-deep-rgb, 43, 19, 82), .96) 0%, rgba(var(--si-deep-2-rgb, 74, 34, 125), .86) 38%, rgba(var(--si-primary-rgb), .25) 70%, rgba(var(--si-primary-rgb), 0) 100%), var(--hero-img, linear-gradient(120deg, var(--si-deep-2), var(--si-primary-600) 60%, var(--si-primary-light)));
  background-size: cover; background-position: center;
}
.hp-hero-inner { display: flex; align-items: center; gap: 1.4rem; min-height: 290px; padding-top: 2.2rem; padding-bottom: 2.2rem; }
.hp-hero-logo { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3)); }
.hp-hero h1 { font-size: 3rem; font-weight: 700; margin: 0; line-height: 1.1; }
.hp-hero-sub { font-size: 1.5rem; margin: .1rem 0 .9rem; font-weight: 500; }
.hp-hero-quote { font-size: 1.15rem; max-width: 520px; opacity: .95; }
.hp-hero-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.3rem; border-radius: 999px; background: rgba(var(--si-primary-rgb), .65); border: 1.5px solid rgba(255,255,255,.75); color: #fff; text-decoration: none; font-weight: 600; }
.hp-hero-btn:hover { background: #fff; color: var(--si-primary); }

.hp-row { margin-top: .1rem; }
.hp-block { margin-top: 1.1rem; }
.hp-title { font-size: 1.35rem; font-weight: 700; color: var(--si-primary); margin-bottom: .9rem; }
[data-bs-theme="dark"] .hp-title { color: var(--si-on-dark); }
.hp-stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; background: var(--si-surface); border: 1px solid var(--si-border); border-radius: 12px; box-shadow: var(--si-shadow); height: 100%; }
.hp-stat-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; background: var(--si-primary-50); color: var(--si-primary-600); flex: 0 0 64px; }
.hp-stat-label { font-weight: 600; font-size: .95rem; }
.hp-stat-value { font-size: 2rem; font-weight: 700; color: var(--si-primary); line-height: 1.15; }
[data-bs-theme="dark"] .hp-stat-value { color: var(--si-on-dark); }
.hp-stat-value small { font-size: 1rem; color: var(--si-ink); font-weight: 500; }
.hp-stat-sub { font-size: .85rem; color: var(--si-muted); }

.hp-panel { background: var(--si-surface); border: 1px solid var(--si-border); border-radius: 12px; box-shadow: var(--si-shadow); overflow: hidden; }
.hp-band { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.2rem; background: linear-gradient(90deg, var(--si-primary), var(--si-primary-2) 70%, var(--si-on-dark)); color: #fff; }
.hp-band h2 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.hp-band small { font-size: .95rem; font-weight: 500; }
.hp-band .hp-more { color: #fff; }
.hp-chart-card { border: 1px solid var(--si-border); border-radius: 10px; padding: .8rem; height: 100%; }
.hp-chart-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.hp-panel-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--si-border); }
.hp-panel-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.hp-panel-head .form-select { width: auto; }
.hp-more { font-size: .88rem; text-decoration: none; white-space: nowrap; }

.hp-cat { --c: #7C3AED; position: relative; display: flex; flex-direction: column; height: 100%; padding: 1.1rem 1.1rem 1rem 5.2rem; border-radius: 12px; text-decoration: none; color: var(--si-ink);
  background: color-mix(in srgb, var(--c) 6%, var(--si-surface)); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); transition: transform .15s, box-shadow .15s; min-height: 140px; }
.hp-cat:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 18%, transparent); color: var(--si-ink); }
.hp-cat-icon { position: absolute; left: 1rem; top: 1rem; width: 52px; height: 52px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 1.5rem; }
.hp-cat-no { color: var(--c); font-weight: 700; font-size: .95rem; }
.hp-cat-title { color: var(--c); font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
.hp-cat-desc { font-size: .87rem; color: var(--si-muted); margin: .45rem 0 .75rem -4.1rem; }
.hp-cat-btn { margin-left: -4.1rem; margin-top: auto; align-self: flex-start; background: var(--c); color: #fff; border-radius: 999px; padding: .3rem 1.1rem; font-size: .9rem; font-weight: 600; }

.hp-news { list-style: none; margin: 0; padding: .3rem 1.1rem .6rem; }
.hp-news li { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--si-border); }
.hp-news li:last-child { border-bottom: 0; }
.hp-news a, .hp-news span:not(.hp-news-icon):not(.hp-tag) { color: var(--si-ink); text-decoration: none; font-weight: 500; display: block; }
.hp-news a:hover { color: var(--si-primary); }
.hp-news small { color: var(--si-muted); }
.hp-news-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 40px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.hp-tag { font-size: .75rem; padding: .1rem .55rem; border-radius: 6px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); white-space: nowrap; }

.hp-links { display: flex; flex-wrap: wrap; align-items: stretch; }
.hp-links-head { display: flex; gap: .7rem; align-items: center; padding: 1rem 1.2rem; min-width: 220px; }
.hp-links-head > i { font-size: 1.6rem; color: var(--si-primary); }
.hp-links-head b { display: block; color: var(--si-primary); font-size: 1.05rem; }
.hp-links-head small { color: var(--si-muted); }
.hp-link { flex: 1 1 200px; display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-left: 1px solid var(--si-border); text-decoration: none; color: var(--si-ink); }
.hp-link:hover { background: var(--si-primary-50); color: var(--si-ink); }
.hp-link-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--si-primary-50); color: var(--si-primary); display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 46px; }
.hp-link b { display: block; font-size: .95rem; } .hp-link small { color: var(--si-muted); font-size: .8rem; }
.hp-vision { height: 100%; padding: 1rem 1.1rem; border-radius: 12px; background: var(--si-primary-50); }
.hp-vision > i { color: var(--si-primary); font-size: 1.3rem; margin-right: .4rem; }
.hp-vision p { margin: .4rem 0 0; }
.hp-text { line-height: 1.75; }
.hp-image { margin: 0; } .hp-image img { width: 100%; border-radius: 12px; display: block; }
.hp-image figcaption { text-align: center; color: var(--si-muted); font-size: .9rem; margin-top: .4rem; }
.hp-map { width: 100%; border: 0; display: block; }
.hp-exec-avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--si-primary-2), var(--si-primary)); }

.hp-footer { margin-top: 2rem; background: linear-gradient(90deg, var(--si-deep), var(--si-deep-2)); color: #ECEAF2; }
.hp-footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.hp-brand-footer { color: #fff; } .hp-brand-footer b { font-size: 1.3rem; } .hp-brand-footer small { color: #D6CCF2; font-size: .9rem; }
.hp-brand-footer img { width: 48px; height: 48px; flex-basis: 48px; }
.hp-footer-info { font-size: .9rem; padding-left: 1.5rem; border-left: 1px solid rgba(255,255,255,.2); }
.hp-footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; padding: 0; font-size: .9rem; }
.hp-footer-links a { color: #E9E3FA; text-decoration: none; } .hp-footer-links a:hover { color: #fff; text-decoration: underline; }
.hp-footer-social { margin-left: auto; text-align: right; }
.hp-footer-social a { color: #fff; font-size: 1.25rem; margin-left: .5rem; }

@media (max-width: 991.98px) {
  .hp-nav { flex-direction: column; gap: 0; }
  .hp-hero h1 { font-size: 2.2rem; } .hp-hero-sub { font-size: 1.2rem; }
  .hp-hero-logo { width: 76px; height: 76px; }
  .hp-footer-social { margin-left: 0; text-align: left; }
  .hp-footer-info { border-left: 0; padding-left: 0; }
}
@media (max-width: 575.98px) {
  .hp-brand b { font-size: 1.3rem; } .hp-brand small { font-size: .85rem; }
  .hp-brand img, .hp-logo-fallback { width: 44px; height: 44px; flex-basis: 44px; }
  .hp-hero-inner { flex-direction: column; align-items: flex-start; min-height: 0; }
  .hp-stat { padding: .8rem; gap: .6rem; } .hp-stat-icon { width: 46px; height: 46px; flex-basis: 46px; font-size: 1.4rem; }
  .hp-stat-value { font-size: 1.45rem; }
  .hp-link { border-left: 0; border-top: 1px solid var(--si-border); }
}

/* หน้าอื่นที่เปิดให้บุคคลทั่วไป (ห่อในกรอบกลางจอ) */
.hp-page .si-page-head h1 { color: var(--si-primary); }
.hp-nav .dropdown-menu { border-radius: 12px; font-size: .93rem; padding: .4rem; border: 1px solid var(--si-border); box-shadow: 0 10px 30px rgba(var(--si-ink-rgb), .12); min-width: 220px; margin-top: .35rem; }
/* รายการในเมนูย่อยไม่ใช้สไตล์ลิงก์เมนูหลัก (เส้นใต้/ไม่มีระยะห่าง) */
.hp-nav .dropdown-menu .dropdown-item { display: block; padding: .5rem .85rem; border-radius: 8px; border-bottom: 0; color: var(--si-ink); font-weight: 500; white-space: normal; }
.hp-nav .dropdown-menu .dropdown-item:hover, .hp-nav .dropdown-menu .dropdown-item:focus { background: var(--si-primary-50); color: var(--si-primary); border-bottom: 0; }
.hp-nav .dropdown-toggle::after { margin-left: .35rem; }
