/* ═══ vg-navhead.css — ส่วนหัวมาตรฐานของหน้า Vigil (23 พ.ย. 69 · แบบที่ผู้ใช้เลือก) ═══
   โหลด: vg_head([... 'navhead' => true]) · ต้นแบบ report_checkin_clock.php · สกิล vigil-nav-header
   ระยะเต็มขอบ (margin ติดลบตาม padding ของ body) กำหนดในไฟล์ CSS ของหน้าเอง
   แถบประกาศ = ไล่เฉดหลัก (ต่อจากหัวเมนูข้าง) · แถบนำทาง = ชื่อหน้า | ช่วงด่วน (ขีดเส้นใต้ที่เลือก) | กล่องเลือกวันที่ | ปุ่มไอคอน + ปุ่มหลัก */
.vg-nh, .vg-nh *, .vg-nh *::before, .vg-nh *::after { box-sizing: border-box; }   /* บางหน้าไม่มี reset → หัวสูงเกิน */
.vg-nh {
    background: var(--vg-surface);
    border-bottom: 1px solid var(--vg-line);
    box-shadow: 0 6px 18px rgba(15,40,80,.06);
    font-family: var(--vg-font);
}
.vg-nh-strip {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 38px; padding: 6px 16px;
    background: var(--vg-grad-header);
    color: #fff; font: 600 13px/1.3 var(--vg-font-head);
    text-align: center;
}
.vg-nh-strip-txt { display: inline-flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; justify-content: center; }
.vg-nh-strip-txt b { font-weight: 700; }
.vg-nh-strip-dept { display: inline-flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.35); opacity: .95; }
.vg-nh-live {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34);
    font: 700 11px/1 var(--vg-font-head); letter-spacing: .8px;
}
.vg-nh-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: vgNhLive 1.6s ease-out infinite; }
@keyframes vgNhLive { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.7); } 100% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } }
.vg-nh-strip-cmp { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 3px 4px 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 12px; }
.vg-nh-strip-cancel { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #fff; color: var(--vg-primary-ink); text-decoration: none; font-size: 11.5px; }
.vg-nh-strip-cancel:hover { text-decoration: none; background: var(--vg-primary-tint); }

.vg-nh-bar { display: flex; align-items: center; gap: 18px; min-height: 72px; padding: 10px 20px; }
.vg-nh-brand { display: flex; align-items: center; gap: 11px; flex: none; min-width: 0; }
.vg-nh-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--vg-grad-primary); color: #fff; font-size: 18px; box-shadow: 0 6px 14px rgba(0,113,227,.28); }
.vg-nh-brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.vg-nh-brand-txt b { font: 700 1.18rem/1.15 var(--vg-font-head); color: var(--vg-text); letter-spacing: -.2px; white-space: nowrap; }
.vg-nh-brand-txt small { font-size: 11.5px; color: var(--vg-muted); margin-top: 2px; white-space: nowrap; }

.vg-nh-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.vg-nh-link {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    position: relative; padding: 10px 12px;
    font: 600 15px/1.2 var(--vg-font-head); color: var(--vg-text-2);
    border-radius: 10px; transition: color .15s, background .15s;
}
.vg-nh-link:hover { color: var(--vg-primary); background: var(--vg-primary-tint); }
.vg-nh-link.active { color: var(--vg-primary); }
a.vg-nh-link, a.vg-nh-cta, a.vg-nh-icon-btn { text-decoration: none; }   /* หลายหน้าใช้ <a> เป็นเมนู/ปุ่ม */
a.vg-nh-link:hover, a.vg-nh-cta:hover { text-decoration: none; }
.vg-nh-link.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--vg-primary); }

.vg-nh-search {
    flex: 1 1 360px; min-width: 0; max-width: 620px; margin-left: auto;
    display: flex; align-items: center; gap: 4px;
    height: 46px; padding: 0 6px 0 14px;
    border: 1px solid var(--vg-border); border-radius: 12px; background: var(--vg-surface);
    transition: border-color .15s, box-shadow .15s;
    overflow-x: auto; scrollbar-width: none;
}
.vg-nh-search::-webkit-scrollbar { display: none; }
.vg-nh-search:focus-within { border-color: var(--vg-primary); box-shadow: 0 0 0 3px var(--vg-primary-ring); }
.vg-nh-search-ic { color: var(--vg-muted); font-size: 15px; flex: none; margin-right: 4px; }
.vg-nh-sep { width: 1px; height: 22px; background: var(--vg-line); flex: none; margin: 0 4px; }
.vg-nh-ctrl {
    appearance: auto; border: 0; background: transparent; outline: 0;
    height: 36px; padding: 0 8px; border-radius: 8px; flex: none;
    font: 500 14.5px/1 var(--vg-font); color: var(--vg-text); cursor: pointer;
}
.vg-nh-ctrl:hover:not(:disabled) { background: var(--vg-bg); }
input.vg-nh-ctrl { width: 140px; cursor: text; color-scheme: light; }
input.vg-nh-ctrl.vg-nh-ctrl--grow { flex: 1 1 160px; width: auto; min-width: 120px; }   /* ช่องพิมพ์ค้นหา (ไม่ใช่ช่องวันที่) */

.vg-nh-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.vg-nh-icon-btn {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    color: var(--vg-text); font-size: 18px; text-decoration: none; transition: background .15s, color .15s;
}
.vg-nh-icon-btn:hover { background: var(--vg-bg); color: var(--vg-primary); text-decoration: none; }
.vg-nh-cta {
    appearance: none; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 20px; margin-left: 4px; border-radius: 12px;
    background: var(--vg-primary); color: #fff;
    font: 700 15px/1 var(--vg-font-head); white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0,113,227,.28); transition: background .15s, transform .1s;
}
.vg-nh-cta:hover { background: var(--vg-primary-hover); }
.vg-nh-cta:active { transform: scale(.98); }

@media (min-width: 1024px) {
    .vg-nh-bar, .vg-nh-strip { padding-left: var(--vg-gutter); padding-right: var(--vg-gutter); }
}
/* จอกลาง: กล่องเลือกวันที่ลงบรรทัดสองเต็มกว้าง */
@media (max-width: 1360px) {
    .vg-nh-bar { flex-wrap: wrap; row-gap: 10px; }
    .vg-nh-search { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
    .vg-nh-actions { margin-left: auto; }
}
@media (max-width: 1023px) {
    .vg-nh-bar { padding: 10px var(--vg-gutter-sm); gap: 10px; }
    .vg-nh-strip { padding: 6px var(--vg-gutter-sm); }
}
/* มือถือ: ชื่อหน้า + ปุ่ม / ช่วงด่วนเต็มแถว (เลื่อนได้) / กล่องเลือกวันที่ */
@media (max-width: 640px) {
    /* แถบประกาศมือถือ: แถวเดียว กระชับ (24 พ.ย. 69 · เดิมบรรทัดละเรื่อง = 3 บรรทัด) — 📅 ช่วง · 🏢 หน่วยงาน (ตัด …) · 👤 ผู้ใช้ */
    .vg-nh-strip { font-size: 12px; min-height: 34px; padding-top: 6px; padding-bottom: 6px; gap: 8px; justify-content: flex-start; text-align: left; flex-wrap: wrap; }
    .vg-nh-strip-txt { flex: 1 1 0; min-width: 0; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 0; overflow: hidden; }
    .vg-nh-strip-txt > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
    .vg-nh-strip-txt > span:first-child { flex: 0 0 auto; max-width: 48%; }
    .vg-nh-strip-txt > span + span { padding-left: 9px; margin-left: 9px; border-left: 1px solid rgba(255,255,255,.35); }
    .vg-nh-strip-txt > span:last-child:not(:first-child) { flex: 0 0 auto; }
    .vg-nh-strip-txt i { flex: none; font-size: 11px; opacity: .9; }
    .vg-nh-strip-dept { padding-left: 0; border-left: 0; font-weight: 500; opacity: .95; }
    .vg-nh-strip-dept:not([style*="none"]) { display: inline-flex; }   /* JS ซ่อนด้วย style="display:none" ต้องยังซ่อนได้ */
    .vg-nh-strip-txt > .vg-nh-strip-dept:nth-child(2) { flex: 1 1 auto; }   /* หน่วยงาน = ส่วนที่หดได้ (ยาวตัด …) */
    .vg-nh-strip-txt > .vg-nh-strip-dept:nth-child(2) > :not(i) { overflow: hidden; text-overflow: ellipsis; }
    .vg-nh-sm-hide { display: none !important; }   /* ข้อความที่ซ่อนบนมือถือ (เช่น "ช่วงข้อมูล", ช่วงวันที่เต็ม, "สวัสดี") */
    .vg-nh-strip-cmp { flex-basis: 100%; justify-content: space-between; }
    .vg-nh-brand-txt small { display: none; }
    .vg-nh-brand-txt b { font-size: 1.05rem; }
    .vg-nh-logo { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
    .vg-nh-nav { order: 4; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; }
    .vg-nh-nav::-webkit-scrollbar { display: none; }
    .vg-nh-link { font-size: 14px; padding: 9px 10px; flex: none; }
    .vg-nh-cta { height: 42px; width: 42px; padding: 0; justify-content: center; margin-left: 0; }
    .vg-nh-cta span { display: none; }
    .vg-nh-icon-btn { width: 40px; height: 40px; }
    /* กล่องที่มีหลายช่อง: ลงบรรทัดได้ ไม่ต้องเลื่อนข้างหาช่องท้าย ๆ */
    .vg-nh-search { flex-wrap: wrap; height: auto; min-height: 44px; padding: 3px 6px 3px 14px; row-gap: 2px; overflow: visible; }
}
body.is-fullscreen .vg-nh { border-radius: 16px; overflow: hidden; border: 1px solid var(--vg-line); }
