:root { --navy: #1b2f57; --navy2: #24407a; --cream: #fbf8f1; }
.card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 16px rgba(20,33,61,.05); }
.btn-navy { background: linear-gradient(180deg, #24407a, var(--ink)); color: #fff; border: 1px solid var(--ink-deep); } .btn-navy:hover { color: #fff; box-shadow: 0 0 0 2px rgba(201,162,74,.55); }
.btn-gold { background: var(--gold); color: var(--navy); font-weight: 600; } .btn-gold:hover { background: #e3c45a; }
.badge-role { background: #fff3cf; color: #7a5c00; border: 1px solid #f0d58c; font-weight: 500; }
.tbl th { font-size: 13px; color: #5b6478; font-weight: 600; } .tbl td { vertical-align: middle; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; } .kpi b { display: block; font-size: 28px; color: var(--navy); }
.muted { color: #6b7385; font-size: 14px; }
.sigpad { position: relative; border: 1px dashed #9aa6bf; border-radius: 12px; background: repeating-linear-gradient(0deg, #fff, #fff 31px, #eef2f8 32px); touch-action: none; }
.sigpad canvas { display: block; cursor: crosshair; }
.sigpad .sig-clear { position: absolute; right: 8px; top: 8px; }
.chip { display: inline-block; border: 1px solid #cdd5e4; border-radius: 999px; padding: 3px 12px; margin: 0 6px 6px 0; cursor: pointer; background: #fff; }
.chip.on, .chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
@media print { .sidebar, .sidebar-overlay, main > .p-2 > nav, .noprint { display: none !important; } .content { padding: 0; } body { background: #fff; } }

/* ---------- โครงหน้า (รอบ 11: ใช้ธีมระบบเดิม gas.css) ---------- */
.content { padding: 16px 6px 24px; }
@media print { main { padding-left: 0 !important; } .content { padding: 0; } }
.nb-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #eef1f6; color: var(--ink); font-size: 18px; text-decoration: none; transition: background .15s; }
.nb-ico:hover { background: #dfe5ef; color: var(--ink-deep); }
.nb-ico.gold { background: #f6ecd2; color: var(--gold-deep); } .nb-ico.gold:hover { background: #efdfb5; }
.pf-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #eceff4; color: var(--ink); font-size: 18px; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.av-grid button { border: 2px solid transparent; background: #fff; border-radius: 50%; padding: 2px; aspect-ratio: 1; }
.av-grid button:hover { border-color: var(--gold); } .av-grid button.on { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(201,162,74,.5); }
.av-grid img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bare { min-height: 100vh; }
.toast-container .toast { min-width: 300px; max-width: 420px; box-shadow: 0 12px 30px rgba(12,22,48,.25); }
.toast-container .toast-body { white-space: pre-line; }
/* หน้าต่างถาม/ยืนยัน (Ui.html ของระบบเดิม) */
.ui-ov { position: fixed; inset: 0; z-index: 3000; background: rgba(12,22,48,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: uiFade .15s ease; }
.ui-card { background: #fffdf8; border-radius: 20px; box-shadow: 0 24px 60px rgba(12,22,48,.35); width: min(440px, 100%); padding: 22px 22px 18px; border-top: 4px solid #d4af37; animation: uiPop .2s cubic-bezier(.2,.9,.3,1.2); max-height: 92vh; overflow: auto; }
.ui-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; margin: 0 auto 8px; background: linear-gradient(145deg, #fbf3dc, #f1e2b4); box-shadow: inset 0 0 0 1px #e8d49a; }
.ui-ico.danger { background: linear-gradient(145deg, #fde9ec, #f7cdd3); box-shadow: inset 0 0 0 1px #efb2bb; }
.ui-title { font-weight: 700; font-size: 18px; text-align: center; color: #14213d; }
.ui-msg { color: #4b5563; text-align: center; font-size: 14.5px; margin-top: 4px; white-space: pre-line; }
.ui-btns { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.ui-btns .btn { min-width: 112px; border-radius: 12px; }
.ui-btns .btn-danger { background: #9f1d2b; border-color: #9f1d2b; }
@keyframes uiFade { from { opacity: 0 } }
@keyframes uiPop { from { opacity: 0; transform: translateY(10px) scale(.96) } }
@media (prefers-reduced-motion: reduce) { .ui-ov, .ui-card { animation: none } }
/* สวิตช์เปิด/ปิด (ตั้งค่าสิทธิ์) */
.sw { position: relative; display: inline-block; width: 46px; height: 24px; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; border-radius: 99px; background: #b3262e; transition: .2s; cursor: pointer; }
.sw span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw input:checked + span { background: var(--ink); }
.sw input:checked + span::before { transform: translateX(22px); }
.sw input:disabled + span { background: #d5d9e0; cursor: not-allowed; }
.sw input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201,162,74,.45); }
.sw input:disabled:checked + span { background: var(--ink); opacity: .45; }
.sidebar-toggle { min-width: 1.25em; min-height: 1.25em; } /* กดได้แม้ไอคอนยังโหลดไม่ขึ้น */
.sidebar { position: fixed; top: 0; bottom: 0; }

/* ---------- รอบ 12: ตารางทะเบียน (หน้าตาเดียวกับ DataTables ของระบบเดิม) ---------- */
.dataTables_wrapper .dt-top { margin-bottom: .5rem; } .dataTables_wrapper .dt-bottom { margin-top: .5rem; align-items: center; }
.dataTables_length label, .dataTables_filter label { font-weight: normal; white-space: nowrap; font-size: 14px; }
.dataTables_length select { width: auto; display: inline-block; margin: 0 .3em; }
.dataTables_filter { text-align: end; } .dataTables_filter input { margin-left: .5em; display: inline-block; width: auto; }
.dataTables_info { font-size: 14px; color: var(--text, #212529); }
.dataTables_paginate .pagination { margin: 2px 0; justify-content: flex-end; }
table.dataTable thead th.sorting { cursor: pointer; position: relative; padding-right: 22px !important; }
table.dataTable thead th.sorting::before, table.dataTable thead th.sorting::after { position: absolute; right: 6px; font-size: .62em; line-height: 9px; opacity: .2; }
table.dataTable thead th.sorting::before { content: '▲'; top: calc(50% - 9px); } table.dataTable thead th.sorting::after { content: '▼'; top: calc(50% + 1px); }
table.dataTable thead th.sorting_asc::before, table.dataTable thead th.sorting_desc::after { opacity: .7; }
table.dataTable td { font-size: 14px; } table.dataTable td.nw, table.dataTable th { white-space: nowrap; }
@media (max-width: 767px) { .dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { text-align: center !important; } .dataTables_paginate .pagination { justify-content: center; } }
.st-wait { color: var(--box3); } .st-done { color: var(--box2); } .st-stop { color: var(--box4); } .st-reserve { color: var(--gold-deep, #9c7a2c); font-weight: 600; }
.stamp-button { background: #fff !important; color: #1d3fa8 !important; border: 1px solid #b9c7ea !important; } .stamp-button:hover { background: #1d3fa8 !important; color: #fff !important; }
.done-button { background: #fff !important; color: #2e6b4e !important; border: 1px solid #b7d7c4 !important; } .done-button:hover { background: #2e6b4e !important; color: #fff !important; }
.stat-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; flex: none;
  background: linear-gradient(145deg, #1b2f57, #0c1630); color: #e8cf8a; box-shadow: inset 0 0 0 1px rgba(201,162,74,.45), 0 8px 18px -10px rgba(12,22,48,.7); }
.box-info li .stat-ico i { width: auto !important; height: auto !important; background: none !important; font-size: 26px !important; color: inherit !important; border-radius: 0; display: inline; }
.stat-ico.t-done { background: linear-gradient(145deg, #2e6b4e, #17402d); color: #c9f0d8; } .stat-ico.t-wait { background: linear-gradient(145deg, #b8862c, #7a5512); color: #fff3d6; }
.stat-ico.t-stop { background: linear-gradient(145deg, #a42634, #6b1220); color: #ffe1e4; }
.box-info { list-style: none; } .box-info li a.stretched { color: inherit; text-decoration: none; }
.reg-selbar { position: sticky; top: 0; z-index: 5; gap: 8px; align-items: center; background: #fff8e6; border: 1px solid #f0d58c; border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; display: none; flex-wrap: wrap; }
.reg-selmode .reg-sel { display: table-cell !important; } .reg-sel { display: none; width: 30px; }
.reg-selmode tbody tr.reg-picked td { background: #fff3cf !important; }
.reg-ico-sel { min-width: 200px; }
.ui-card .ui-in .form-control { border-radius: 12px; }
.ui-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: center; }
.ui-chips button { border: 1px solid #d9cfb0; background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 13px; color: #14213d; }
.ui-chips button:hover { background: #14213d; color: #fff; border-color: #14213d; }
.ui-card.wide { width: min(580px, 100%); }
/* หน้าต่างฟอร์มลงทะเบียน (กรอบลอยแบบระบบเดิม) */
.reg-frame-modal .modal-dialog { max-width: min(980px, 96vw); }
.reg-frame-modal iframe { width: 100%; height: min(86vh, 900px); border: 0; display: block; border-radius: 0 0 16px 16px; background: var(--paper, #fffefb); }
/* ช่องเลือก จาก/ถึง (ui-pick ของระบบเดิม) */
.ui-pick-wrap { position: relative; }
.ui-pick { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid #d9cfb0; border-radius: 14px; box-shadow: 0 16px 36px rgba(12,22,48,.2); padding: 8px; }
.ui-pick input { border-radius: 10px; } .ui-pick .lst { max-height: 240px; overflow: auto; margin-top: 6px; }
.ui-pick .it { padding: 6px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.ui-pick .it:hover, .ui-pick .it.hl { background: #14213d; color: #fff; } .ui-pick .none { color: #94a3b8; padding: 8px 10px; font-size: 13px; }
.reg-ico-sel { width: auto !important; min-width: 170px; }
table.dataTable.nowrap td, table.dataTable.nowrap th { white-space: nowrap; }
table.dataTable.nowrap td.subj { white-space: normal; min-width: 240px; }
.ui-ov[hidden] { display: none !important; }
/* ตัวแก้รายการ (ข้อมูลพื้นฐาน) — แบบ Ui.html ของระบบเดิม */
.ui-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.ui-li { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e5e0d0; border-radius: 12px; padding: 5px 6px 5px 10px; }
.ui-li .n { width: 22px; color: #a08a4a; font-weight: 600; font-size: 13px; text-align: center; }
.ui-li input { border: 0; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 8px; font-size: 14.5px; }
.ui-li input:focus { outline: 2px solid #d4af37; background: #fffaf0; }
.ui-li button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px; color: #475569; font-size: 12px; }
.ui-li button:hover:not(:disabled) { background: #f1ede2; } .ui-li button:disabled { opacity: .3; }
.ui-li button.del:hover { background: #fde8ea; color: #9f1d2b; }
.ui-add { display: flex; gap: 6px; margin-top: 10px; } .ui-add input { border-radius: 12px; }
.ui-empty { text-align: center; color: #94a3b8; padding: 10px; }

/* ===== รอบ 14: 🔔 กระดิ่งงานของฉัน (Inbox.html) ===== */
.mw-bell { position: relative; }
.mw-bell .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f4ecd4; color: #14213d; cursor: pointer; font-size: 18px; min-width: 38px; }
.mw-bell .ico.ring { animation: mwRing .9s ease 2; }
.mw-bell .bdg { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 999px; background: #9f1d2b; color: #fff; font-size: 11.5px; display: none; place-items: center; padding: 0 5px; font-weight: 700; pointer-events: none; }
.mw-bell .dropdown-menu { width: 400px; max-width: 92vw; padding: 0; overflow: hidden; }
.mw-bell .hd { padding: 10px 14px; font-weight: 700; background: #14213d; color: #fff; display: flex; align-items: center; }
.mw-bell .bl { max-height: 380px; overflow: auto; }
.mw-bell .ft { padding: 8px; border-top: 1px solid #eee; }
.mw-bell .grp { font-size: 12px; color: #6b7280; padding: 6px 14px 2px; background: #faf8f2; }
.mw-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f4f1e8; cursor: pointer; color: inherit; text-decoration: none; }
.mw-item:hover { background: #fffaf0; color: inherit; }
.mw-item.is-new { background: #fff7e6; }
.mw-item .ref { font-weight: 700; color: #14213d; white-space: nowrap; }
.mw-item .sub { font-size: 13.5px; }
.mw-item .meta { font-size: 12px; color: #6b7280; }
.mw-verify { font-size: 16px; letter-spacing: 2px; color: #14213d; }
.mw-empty { padding: 26px; text-align: center; color: #94a3b8; font-size: 13.5px; }
.mw-new { display: inline-block; background: #9f1d2b; color: #fff; font-size: 11px; border-radius: 6px; padding: 0 6px; margin-left: 4px; vertical-align: middle; font-weight: 500; }
.mw-stale { background: #fdf1f2; color: #9f1d2b; border: 1px solid #e8c4c8; border-radius: 6px; padding: 0 5px; font-weight: 600; }
#mwBadge { background: transparent; color: #fff; padding: 0; display: inline-flex; gap: 3px; font-size: 11.5px; }
#mwBadge .nb-new { background: #9f1d2b; color: #fff; border-radius: 10px; padding: 2px 6px; }
#mwBadge .nb-old { background: #8a93a3; color: #fff; border-radius: 10px; padding: 2px 6px; }
#mwBadge.nb-late .nb-old, #mwBadge.nb-late .nb-new { animation: nbPulse 1.6s ease-in-out infinite; }
.sidebar.collapsed #mwBadge, .sidebar.collapsed #deptMenuBadge { display: none !important; }
.mw-tg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid #e5e0d0; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.mw-tg .ok { color: #1d7a46; font-weight: 600; }
@keyframes nbPulse { 50% { box-shadow: 0 0 0 4px rgba(159,29,43,.25); } }
@keyframes mwRing { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-18deg) } 40% { transform: rotate(14deg) } 60% { transform: rotate(-10deg) } 80% { transform: rotate(6deg) } }
@media (prefers-reduced-motion: reduce) { .mw-bell .ico.ring { animation: none } }
.nf-row { border: 1px solid var(--line, #e5e0d0); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.nf-log { font-size: 12px; max-height: 260px; overflow: auto; }
/* รอบ 14.1: อัปโหลดรูปประจำตัว */
.av-up { display: flex; align-items: center; gap: 14px; border: 1px dashed #d9c48a; background: #fffaf0; border-radius: 14px; padding: 10px 14px; }
.av-up img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid #f5dd8c; }
/* รอบ 14.2: ช่อง Token ซ่อนตัวอักษร แต่ไม่ใช่ช่องรหัสผ่าน (กันเบราว์เซอร์เติม username/รหัสเข้าระบบให้เอง) */
.nf-secret { -webkit-text-security: disc; text-security: disc; }
.nf-secret:focus { -webkit-text-security: none; text-security: none; }
