/* screens-iot.css · Option IOT ส่วนรับข้อมูล (M15 lane I1 · 08-iot.md §4 · §9.1 · 12-hardware.md §3.6 · DESIGN-TOKENS.md)
   เกตเวย์ (ลงทะเบียน · รหัสครั้งเดียว · ค่าของเกตเวย์ · เพิกถอน) · อุปกรณ์ (โปรไฟล์ · ข้อมูลรับรองเขียนอย่างเดียว · ใบรับรอง BMC · เซนเซอร์ของเรา ·
   จุดวัดที่พบ) · เซนเซอร์ (ค่าล่าสุด) · ระยะเก็บข้อมูล
   สีจากตัวแปรของชุดสีเท่านั้น · ตัวอักษร ≥ 12px · สถานะมีไอคอน/ข้อความเสมอ · เป้ากด ≥ 24px · ไม่มี style ในหน้า (CSP) */

.iotc-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.iotc-sec-head h2 { margin-bottom: 4px; }
.iotc-table td, .iotc-table th { vertical-align: top; }
.iotc-table th[scope="row"] { font-weight: 500; text-align: start; background: transparent; overflow-wrap: anywhere; }
.iotc-table { min-width: 50rem; } /* จอแคบ: เลื่อนตารางในกรอบ ไม่บีบคอลัมน์จนแถวสูง */
.iotc-table th[scope="row"] a, .iotc-table td a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }
.iotc-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 8px; }
.iotc-filter label { display: grid; gap: 2px; font-size: 12.5px; min-width: 0; flex: 1 1 12rem; }
.iotc-filter select { min-height: 36px; width: 100%; }
.iotc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 0 12px; }
.iotc-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.iotc-h3 { font-size: 13.5px; font-weight: 600; margin: 12px 0 6px; }
.iotc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.iotc-steps { margin: 8px 0; padding-left: 1.4em; display: grid; gap: 4px; font-size: 13.5px; }
.iotc-fp { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 12.5px; background: var(--surf2); padding: 2px 6px; border-radius: var(--r-sm, 6px); }
.iotc-val { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ป้าย (ไอคอน + ข้อความ · ไม่ใช้สีอย่างเดียว) */
.iotc-st, .iotc-flag { display: inline-flex; white-space: nowrap; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border-radius: var(--r-pill); font-size: 12.5px; }
.iotc-st .ico, .iotc-flag .ico { width: 14px; height: 14px; flex: none; }
.iotc-flag { background: var(--surf2); color: var(--ink2); }
.iotc-flag-warn { background: var(--p3-bg); color: var(--p3-fg); }
.iotc-st-ok { background: var(--teal-bg); color: var(--teal-fg); }
.iotc-st-warn { background: var(--p3-bg); color: var(--p3-fg); }
.iotc-st-bad { background: var(--p1-bg); color: var(--p1-fg); }
.iotc-st-wait, .iotc-st-off { background: var(--surf2); color: var(--ink2); }
.iotc-warn { display: flex; gap: 8px; align-items: flex-start; }

/* รหัสลงทะเบียน (แสดงครั้งเดียว) */
.iotc-once { display: flex; gap: 8px; align-items: flex-start; }
.iotc-code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 15px; letter-spacing: .04em; background: var(--surf2); padding: 4px 8px; border-radius: var(--r-sm, 6px); }
.iotc-cmd { margin: 0 0 8px; padding: 10px 12px; max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px;
  background: var(--surf2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md, 8px); }

/* ฟอร์ม */
.iotc-form label { display: block; }
.iotc-form textarea, .iotc-form input:not([type="checkbox"]):not([type="radio"]), .iotc-form select { width: 100%; }
.iotc-fs { min-width: 0; border: 0; padding: 0; margin: 0; }
.iotc-legend { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 0; margin: 0 0 10px; float: left; width: 100%; }
.iotc-legend + * { clear: both; }
.iotc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0 12px; }
.iotc-row input:not([type="checkbox"]):not([type="radio"]), .iotc-row select, .iotc-filter select { min-height: 36px; padding: 6px 10px; border: 1px solid var(--input); border-radius: var(--r-md, 8px); background: var(--surf); color: var(--ink); font: inherit; font-size: 13.5px; }
.iotc-check { display: flex !important; align-items: center; gap: 6px; min-height: 24px; }
.iotc-check input, .iotc-table input[type="checkbox"] { width: 18px; height: 18px; }
.iotc-radio { display: grid; gap: 6px; margin: 0 0 8px; }
.iotc-radio label { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.iotc-radio input { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .iotc-sec-head .btn { width: 100%; justify-content: center; }
  .iotc-code { font-size: 13.5px; }
}
