/* ═══════════════════════════════════════════════════════════════════════
   vg-forms.css — ฟอร์มทุกหน้าให้หน้าตาเดียวกัน (ระยะ 4 · ต้นแบบรออนุมัติ 23 พ.ย. 69)
   เปิดใช้ทีละหน้า: <body class="vg-forms"> (+ vg_head(['forms' => true]) หรือ <link> ไฟล์นี้หลัง CSS ของหน้า)
   ทำให้ช่องกรอก/ดรอปดาวน์/ปุ่มเดิมของหน้า (ไม่ต้องเปลี่ยน HTML) เป็นแบบเดียวกับ .vg-input / .vg-btn ใน vg-components.css
   ไม่แตะ: ส่วนหัวมาตรฐาน (.vg-nh — มีดีไซน์ของตัวเองใน vg-navhead.css) · เมนูข้าง (#sn-drawer) · แผนที่ Leaflet · SweetAlert · checkbox/radio/range/file/color · ส่วนที่ใส่ .no-vg
   ใช้ !important เฉพาะรูปทรง/ขอบ/ฟอนต์ เพราะหน้าเดิมหลายหน้ามีชั้น override ที่ใช้ !important อยู่แล้ว
   ═══════════════════════════════════════════════════════════════════════ */
body.vg-forms :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea):not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *):not(.no-vg) {
    min-height: 44px;
    padding-top: 8px;   /* ไม่บังคับระยะซ้าย/ขวา — ช่องที่มีไอคอนด้านในใช้ padding-left ของหน้าเดิม */
    padding-bottom: 8px;
    border: 1px solid var(--vg-border) !important;
    border-radius: var(--vg-radius) !important;
    background-color: var(--vg-surface);
    color: var(--vg-text);
    font-family: var(--vg-font) !important;
    font-size: var(--vg-fs-md) !important;   /* 16px กัน iOS ซูมเอง */
    line-height: 1.4;
    box-shadow: none;
    transition: border-color var(--vg-dur-fast), box-shadow var(--vg-dur-fast);
}
body.vg-forms textarea:not(#sn-drawer *):not(.vg-nh *):not(.no-vg *) { min-height: 96px; }
body.vg-forms :is(input, select, textarea):focus:not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *) {
    outline: 0 !important;
    border-color: var(--vg-primary) !important;
    box-shadow: 0 0 0 3px var(--vg-primary-ring) !important;
}
body.vg-forms :is(input, select, textarea)::placeholder { color: var(--vg-muted-2); }
body.vg-forms :is(input, select, textarea):disabled:not(#sn-drawer *):not(.vg-nh *) { background-color: var(--vg-surface-2); color: var(--vg-muted); cursor: not-allowed; }

/* ป้ายช่อง */
body.vg-forms :is(label, .form-label, .field-label):not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *) {
    font-family: var(--vg-font) !important;
    color: var(--vg-text-2);
}

/* ปุ่ม: ทุกปุ่มมุม 12 · ปุ่มหลัก (submit / .btn-primary / .btn-save / .btn-submit) = ฟ้าหลัก */
body.vg-forms :is(button, .btn, input[type=submit], input[type=button]):not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *):not(.no-vg):not(.sn-tile) {
    border-radius: var(--vg-radius) !important;
    font-family: var(--vg-font-head) !important;
}
/* ความสูงขั้นต่ำเฉพาะปุ่มในฟอร์ม/แถบตัวกรอง — ปุ่มเล็กในตาราง (ดู/แก้/ลบ) คงขนาดเดิม */
body.vg-forms :is(button, .btn, input[type=submit], input[type=button]):not(table *):not(.btn-sm):not(.btn-xs):not(.btn-icon):not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *):not(.no-vg):not(.sn-tile) {
    min-height: 40px;
}
body.vg-forms :is(button[type=submit], input[type=submit], .btn-primary, .btn-save, .btn-submit):not(#sn-drawer *):not(.vg-nh *):not(.swal2-container *):not(.no-vg *):not(.no-vg) {
    background: var(--vg-primary) !important;
    border-color: var(--vg-primary) !important;
    color: #fff !important;
    font-weight: 600;
}
body.vg-forms :is(button[type=submit], input[type=submit], .btn-primary, .btn-save, .btn-submit):hover:not(#sn-drawer *):not(.vg-nh *):not(.no-vg *) { background: var(--vg-primary-hover) !important; }
@media (max-width: 768px) {
    body.vg-forms :is(button, .btn, input[type=submit]):not(table *):not(.btn-sm):not(.btn-xs):not(.btn-icon):not(#sn-drawer *):not(.vg-nh *):not(.leaflet-container *):not(.swal2-container *):not(.no-vg *) { min-height: 44px; }   /* เป้าแตะ */
}
