@font-face{font-family:Sarabun;src:url('../vendor/Sarabun-Regular.ttf') format('truetype');font-display:swap}
:root{--brand:#0f7a4a;--brand-hover:#0c653d;--brand-dark:#0a4a31;--brand-deep:#062f20;--brand-soft:#e7f4ec;--brand-ring:#0f7a4a33;--accent:#e0b33a;--ink:#1c2f3e;--muted:#738396;--line:#e3e9ef;--bg:#f3f6f5;--radius:12px}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:15px Sarabun,system-ui,sans-serif}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{outline-offset:3px}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.ic{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px}
button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #d9e2ea;background:#fff;color:#26404f;border-radius:9px;padding:9px 15px;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s,transform .05s}
button:hover{background:#f0f6f3;border-color:#c8d8cf}
button:active{transform:translateY(1px)}
button:disabled{opacity:.5;cursor:wait}
a{color:var(--brand);text-decoration:none}
a:hover{color:var(--brand-hover)}
.primary{background:var(--brand);color:#fff;border-color:var(--brand);box-shadow:0 4px 14px #0f7a4a30}
.primary:hover{background:var(--brand-hover);border-color:var(--brand-hover);color:#fff}
.danger{color:#dc2626}
.wide{width:100%}
label{display:block;font-weight:500;margin:14px 0;color:#2b4252}
input,select,textarea{display:block;width:100%;border:1px solid #d6dfe7;border-radius:9px;padding:10px 12px;background:#fff;color:var(--ink);margin-top:6px;transition:border-color .15s,box-shadow .15s}
input:focus,select:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-ring);outline:none}
input::placeholder{color:#a3b0bd}
input[type=checkbox]{display:inline;width:auto;margin-right:8px;accent-color:var(--brand)}
textarea{min-height:85px}
.muted,small{color:var(--muted)}
.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;background:var(--brand-soft);color:var(--brand);border-radius:20px;font-size:12px;font-weight:600}
.pill .ic{width:14px;height:14px}
.brand-mark{display:grid;place-items:center;width:58px;height:58px;border:1px solid #ffffff50;border-radius:16px;background:#ffffff15;font-weight:800;font-size:24px;letter-spacing:-2px}
.brand-mark.small{width:42px;height:42px;font-size:20px;border-radius:12px}

/* Login */
.login-page{min-height:100vh;display:grid;grid-template-columns:1.05fr 1fr}
.login-brand{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;background:radial-gradient(circle at 85% 95%,#22a06b55,transparent 45%),radial-gradient(circle at 0 0,#ffffff12,transparent 40%),linear-gradient(160deg,var(--brand-dark),var(--brand-deep));color:#fff;padding:7vw 6vw 40px}
.login-brand::after{content:"";position:absolute;right:-140px;bottom:-140px;width:520px;height:520px;border-radius:50%;border:70px solid #ffffff08;pointer-events:none}
.login-brand-inner{position:relative;z-index:1}
.org{display:flex;align-items:center;gap:16px}
.org-logo{width:72px;height:72px;border-radius:50%;background:#fff;padding:3px;box-shadow:0 8px 24px #0005}
.org strong{display:block;font-size:17px;font-weight:600}
.org span{display:block;font:11px system-ui;letter-spacing:1.5px;text-transform:uppercase;color:#a8d8bf;margin-top:4px}
.login-brand h1{font:800 clamp(44px,5.2vw,82px)/1 system-ui;letter-spacing:-3px;margin:56px 0 18px}
.login-brand h1 span{color:var(--accent)}
.lead-th{font-size:19px;color:#d4ecdf;margin:0 0 36px}
.feature-list{list-style:none;padding:0;margin:0;display:grid;gap:14px;max-width:440px}
.feature-list li{display:flex;gap:14px;align-items:flex-start;padding:14px 16px;border:1px solid #ffffff1a;background:#ffffff0d;border-radius:14px;backdrop-filter:blur(4px)}
.feature-list .ic{width:22px;height:22px;color:var(--accent);margin-top:2px}
.feature-list b{display:block;font-weight:600;color:#fff}
.feature-list span{font-size:13px;color:#b9dccb;line-height:1.6}
.brand-foot{position:relative;z-index:1;color:#86bba0;font-size:12px;margin-top:40px}
.login-form{display:grid;place-items:center;padding:40px;background:radial-gradient(circle at 100% 0,#e3f2ea,transparent 40%),var(--bg)}
.login-card{width:100%;max-width:420px;background:#fff;border:1px solid var(--line);border-radius:20px;padding:40px 36px;box-shadow:0 20px 50px #0b3d2a14}
.login-card-logo{display:none;width:64px;height:64px;margin-bottom:16px}
.login-form h2{font-size:30px;font-weight:700;margin:18px 0 6px;color:var(--brand-deep)}
.login-form form{margin:24px 0 8px}
.input-icon{position:relative;display:block}
.input-icon>.ic{position:absolute;left:13px;top:50%;margin-top:3px;transform:translateY(-50%);color:#90a0ae;pointer-events:none}
.input-icon input{padding:12px 44px 12px 42px}
.input-icon:focus-within>.ic{color:var(--brand)}
.pw-toggle{position:absolute;right:6px;top:50%;margin-top:3px;transform:translateY(-50%);border:0;background:none;padding:6px;color:#90a0ae}
.pw-toggle:hover{background:#f0f6f3;color:var(--brand)}
.pw-toggle:active{transform:translateY(-50%)}
.pw-toggle[aria-pressed=true]{color:var(--brand)}
.login-form .primary{margin-top:22px;padding:13px;font-size:16px;font-weight:600}
.login-form .primary .ic{transition:transform .15s}
.login-form .primary:hover .ic{transform:translateX(3px)}
#login-error{color:#b91c1c;min-height:1em;margin:8px 0}
#login-error:not(:empty){background:#fff1f2;border:1px solid #fecdd3;border-radius:9px;padding:10px 12px}
.login-hint{display:flex;gap:10px;padding:12px 14px;background:#f6f9f8;border:1px dashed #d3e0d9;border-radius:10px;line-height:1.7}
.login-hint .ic{color:var(--brand);margin-top:3px}

/* Shell */
aside{position:fixed;inset:0 auto 0 0;width:260px;background:linear-gradient(180deg,var(--brand-dark),var(--brand-deep));color:#d3e9dd;padding:24px 16px;display:flex;flex-direction:column;z-index:5;transition:transform .2s;overflow-y:auto}
.brand{display:flex;gap:12px;color:#fff;align-items:center;font:700 15px system-ui;padding:4px 6px}
.brand:hover{color:#fff}
.brand-logo{width:44px;height:44px;border-radius:50%;background:#fff;padding:2px;box-shadow:0 4px 12px #0004}
.brand small{display:block;color:#a9d3bd;font:11px Sarabun;margin-top:5px}
.nav-caption{font-size:11px;letter-spacing:1.5px;color:#7fb398;margin:34px 14px 10px;text-transform:uppercase}
nav a{display:flex;align-items:center;gap:13px;color:#c9e3d5;padding:11px 14px;border-radius:10px;margin:3px 0;font-size:14px;transition:background .15s,color .15s}
nav a .ic{width:19px;height:19px;opacity:.85}
nav a:hover{background:#ffffff14;color:#fff}
nav a.active{background:#fff;color:var(--brand-dark);font-weight:600;box-shadow:0 6px 18px #0003}
nav a.active .ic{opacity:1;color:var(--brand)}
.aside-bottom{margin-top:auto;padding:20px 12px 0;font-size:11px;line-height:2;color:#a5ccb8;border-top:1px solid #ffffff14}
.aside-bottom small{font-size:10px;color:#7aa892}
.workspace{margin-left:260px}
header{position:sticky;top:0;z-index:4;display:flex;gap:16px;align-items:center;padding:16px 32px;background:#ffffffe6;backdrop-filter:blur(8px);border-bottom:1px solid var(--line);min-height:76px}
header strong{font-size:17px;color:var(--brand-deep)}
header small{display:block;font-size:11px;margin-top:3px}
.user-area{margin-left:auto;display:flex;gap:12px;align-items:center;font-size:13px}
.user-chip{display:flex;align-items:center;gap:9px;padding:4px 14px 4px 4px;border:1px solid var(--line);border-radius:30px;background:#fff;font-weight:500}
.avatar{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.avatar .ic{width:16px;height:16px}
#logout{padding:8px 14px;font-size:13px}
#logout:hover{color:#b91c1c;border-color:#fecaca;background:#fff5f5}
#menu-toggle{display:none;padding:8px}
main{padding:32px;max-width:1800px;margin:auto}
footer{padding:20px 32px;font-size:11px;color:#8a9aa8}
.page-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:24px}
.page-heading h1{font-size:26px;margin:0 0 6px;font-weight:700;color:var(--brand-deep)}
.page-heading p{margin:0;color:#8190a0;font-size:13px}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:24px}
.card{border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:22px;box-shadow:0 1px 2px #0b3d2a08,0 6px 20px #0b3d2a06}
.cards>.card{position:relative;overflow:hidden;transition:transform .15s,box-shadow .15s}
.cards>.card::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--brand)}
.cards>.card:hover{transform:translateY(-2px);box-shadow:0 10px 28px #0b3d2a12}
.kpi-title{color:#738396;font-size:13px}
.kpi-value{font:700 30px system-ui;margin:14px 0 6px;color:var(--brand-deep)}
.kpi-note{font-size:11px;color:#93a0ae}
.grid-2{display:grid;grid-template-columns:1fr 1.5fr;gap:20px}
.card h3{font-size:16px;margin:0 0 20px;color:var(--brand-deep)}
.chart-box{height:250px;position:relative}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}
.toolbar input,.toolbar select{width:auto;flex:1;min-width:130px;margin:0}
.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:var(--radius)}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;padding:14px 16px;background:#f5f9f7;white-space:nowrap;color:#5f7484;font-weight:600}
td{padding:14px 16px;border-top:1px solid #edf1f4;max-width:400px;overflow-wrap:anywhere}
tbody tr:hover td{background:#f8fbf9}
td button{padding:5px 10px;font-size:12px}
.status{display:inline-block;border-radius:20px;padding:4px 10px;font-size:11px;font-weight:600;white-space:nowrap;background:#eef2f7;color:#64748b}
.status.in_use,.status.found{background:#e5f6ec;color:#127a45}
.status.damaged,.status.pending{background:#fff5de;color:#a67710}
.status.lost,.status.missing{background:#fdeeee;color:#c93838}
.empty{text-align:center;padding:50px;color:#8997a6}
.pagination{display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:16px 0;font-size:12px}
.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0 20px}
.form-grid .full{grid-column:1/-1}
.section-title{grid-column:1/-1;padding:20px 0 6px;margin:10px 0;color:var(--brand-deep);border-bottom:1px solid #e6ece9;font-size:16px;font-weight:600}
.notice{background:#ecf6f0;border-left:3px solid var(--brand);padding:14px 18px;border-radius:6px;color:#3e5f50;font-size:13px;line-height:1.8;margin:18px 0}
.notice.warn{background:#fff8eb;border-left-color:#d97706;color:#6b4305}.notice.warn strong{color:#92400e}.notice.warn details{margin-top:6px}.notice.warn summary{cursor:pointer;font-weight:600}.notice.warn ul{margin:6px 0 0;padding-left:20px;max-height:280px;overflow:auto}.notice.warn a{color:#9a3412;text-decoration:underline}
tr.dup td{background:#fff8eb}tr.flash td{background:#fde68a;transition:background .4s}.tag-dup{display:inline-block;margin-left:4px;padding:0 6px;border-radius:8px;background:#d97706;color:#fff;font-size:11px;font-weight:700}
.error{background:#fff1f2;border-color:#dc2626;color:#b91c1c}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.gallery{display:flex;flex-wrap:wrap;gap:15px}
.gallery img{height:140px;width:180px;object-fit:cover;border-radius:10px}
.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.detail-grid p{margin:0}
.detail-grid small{display:block;margin-bottom:8px}
.qr{width:160px;height:160px}
dialog{border:0;border-radius:16px;padding:32px;width:min(750px,95vw);max-height:90vh;color:var(--ink);box-shadow:0 30px 80px #0005}
dialog::backdrop{background:#062f2088;backdrop-filter:blur(2px)}
.modal-close{float:right;border:0;padding:6px;border-radius:50%}
#toast{position:fixed;bottom:25px;right:25px;max-width:450px;background:var(--brand-deep);color:#fff;padding:16px 24px;border-radius:12px;border-left:4px solid var(--accent);box-shadow:0 8px 30px #0003;z-index:20}
pre{white-space:pre-wrap;word-break:break-word;font-size:12px}
.verify-card{max-width:600px;background:#fff;margin:5vh auto;border-radius:16px}
.verify-card .brand-mark{background:var(--brand-dark);color:#fff}
[hidden]{display:none!important}
@media(max-width:1100px){.cards{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}.login-page{grid-template-columns:1fr 1fr}}
@media(max-width:860px){.login-page{grid-template-columns:1fr}.login-brand{display:none}.login-form{padding:24px 16px;min-height:100vh}.login-card{padding:32px 24px}.login-card-logo{display:block}}
@media(max-width:760px){aside{transform:translateX(-100%)}body.menu-open aside{transform:none;box-shadow:0 0 0 100vmax #0006}.workspace{margin-left:0}#menu-toggle{display:inline-flex}header{padding:12px 15px;min-height:64px}main{padding:20px 14px}.cards{gap:10px}.card{padding:18px}.kpi-value{font-size:25px}.grid-2,.form-grid,.detail-grid{grid-template-columns:1fr}.user-area{gap:8px}.user-chip,#logout span{display:none}.page-heading{align-items:flex-start}h1{font-size:24px}.page-heading .actions{max-width:120px}}

/* Forgot password / account / admin */
.link-btn{display:inline-flex;align-items:center;gap:6px;border:0;background:none;padding:0;color:var(--brand);font-size:13px;font-weight:600}
.link-btn:hover{background:none;color:var(--brand-hover);text-decoration:underline}
.label-row{display:flex;justify-content:space-between;align-items:center}
.back-link{margin-bottom:18px}
.back-link .ic{width:16px;height:16px}
.forgot-title{margin-top:0!important}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#eef3f1;border-radius:11px;margin:20px 0 6px}
.seg button{border:0;background:none;padding:9px 8px;font-size:13px;color:#4c6271;border-radius:8px}
.seg button[aria-selected=true]{background:#fff;color:var(--brand-dark);font-weight:600;box-shadow:0 1px 4px #0b3d2a1f}
.seg .ic{width:16px;height:16px}
.small-notice{font-size:12px;margin:14px 0 4px;padding:10px 14px}
.code-input{font-family:ui-monospace,Consolas,monospace;letter-spacing:2px;text-transform:uppercase}
#forgot-msg{min-height:1em;margin:14px 0 0}
#login-error.msg-ok,.msg-ok{color:#11603a;background:#e9f7ef;border:1px solid #bfe5cf;border-radius:9px;padding:10px 12px}
.msg-err{color:#b91c1c;background:#fff1f2;border:1px solid #fecdd3;border-radius:9px;padding:10px 12px}
.strength{display:flex;align-items:center;gap:10px;margin:-6px 0 6px}
.strength span{position:relative;flex:1;height:5px;border-radius:5px;background:#e6ecea;overflow:hidden}
.strength span::after{content:"";position:absolute;inset:0 auto 0 0;width:0;border-radius:5px;transition:width .2s,background .2s}
.strength[data-level="1"] span::after{width:25%;background:#dc2626}
.strength[data-level="2"] span::after{width:50%;background:#e0a21a}
.strength[data-level="3"] span::after{width:75%;background:#3aa76d}
.strength[data-level="4"] span::after{width:100%;background:var(--brand)}
.strength small{min-width:84px;text-align:right;font-size:11px}
.hint{display:flex;gap:8px;align-items:flex-start;font-size:12px;color:var(--muted);margin:6px 0 14px}
.hint .ic{width:15px;height:15px;color:var(--brand);margin-top:2px}
.badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;margin-left:auto;border-radius:10px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;line-height:1}
.user-chip{color:var(--ink)}
.user-chip:hover{border-color:#c8d8cf;background:#f6faf8;color:var(--ink)}
.tabs{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--line);margin:0 0 20px;scrollbar-width:thin}
.tabs a{display:flex;align-items:center;gap:8px;white-space:nowrap;padding:11px 14px;color:#5b7080;font-size:14px;border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs a:hover{color:var(--brand-dark);background:#f2f7f4;border-radius:8px 8px 0 0}
.tabs a[aria-selected=true]{color:var(--brand-dark);font-weight:600;border-bottom-color:var(--brand)}
.tabs .ic{width:17px;height:17px}
.tabs .badge{margin-left:2px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.card-head h3{display:flex;align-items:center;gap:8px;margin:0}
.card-head h3 small{font-weight:400;font-size:12px}
.card-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.input-icon.search input{margin:0;padding:9px 12px 9px 38px;min-width:230px}
.input-icon.search>.ic{margin-top:0}
.table-wrap.flat{border-radius:10px}
td.row-actions{white-space:nowrap;text-align:right}
.row-actions button{margin-left:4px}
.row-actions .ic{width:15px;height:15px}
button.danger:hover{background:#fff5f5;border-color:#fecaca}
.icon-only{padding:5px 8px!important}
.user-cell{display:flex;align-items:center;gap:10px}
.user-cell b{display:block;font-weight:600}
.user-cell small,small.block{display:block;font-size:11px;margin-top:2px}
.avatar.xl{width:64px;height:64px;font-size:26px}
.user-cell .avatar,.profile-head .avatar{font-weight:700;font-size:14px}
.profile-head .avatar.xl{font-size:26px}
.role-badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:600;background:#eef2f7;color:#475569;white-space:nowrap}
.role-badge.super_admin{background:#fdf3d7;color:#8a6110}
.role-badge.group_admin{background:var(--brand-soft);color:var(--brand-dark)}
.role-badge.auditor{background:#ede9fe;color:#5b3fb0}
.notice>.ic{width:16px;height:16px;color:var(--brand);margin-right:4px}
.warn-notice{background:#fff8e6;border-left-color:#e0a21a;color:#7a5a12}
.warn-notice>.ic{color:#c88a0b}
.actions.end{justify-content:flex-end;margin-top:18px}
.danger-btn{background:#dc2626;color:#fff;border-color:#dc2626}
.danger-btn:hover{background:#b91c1c;border-color:#b91c1c;color:#fff}
.dialog-center{text-align:center}
.dialog-center h2{font-size:22px;margin:12px 0 6px}
.dialog-center .actions{justify-content:center}
.dialog-icon{display:inline-grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.dialog-icon .ic{width:26px;height:26px}
.dialog-icon.warn{background:#fdecec;color:#dc2626}
.dialog-icon.ok{background:#e5f6ec;color:#127a45}
.big-code{font:700 34px/1 ui-monospace,Consolas,monospace;letter-spacing:6px;color:var(--brand-deep);background:#f3f8f5;border:2px dashed #b9d9c6;border-radius:14px;padding:20px;margin:18px 0 12px;user-select:all}
.steps-list{margin:18px 0;padding-left:20px;line-height:1.9;font-size:13px;color:#3f5565}
.code-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-left:22px;margin:18px 0}
.code-list code{font:600 16px ui-monospace,Consolas,monospace;letter-spacing:2px;color:var(--brand-deep);background:#f3f8f5;padding:6px 10px;border-radius:7px;display:inline-block}
.check-list{border:1px solid var(--line);border-radius:10px;padding:12px 16px;margin:6px 0}
.check-list legend{font-weight:500;padding:0 6px;font-size:14px;float:none;width:auto;margin:0}
.check-list>div{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:2px 12px;max-height:200px;overflow:auto}
.check-list label{display:flex;align-items:center;margin:6px 0;font-weight:400}
.form-grid.two{grid-template-columns:1fr 1fr}
.perm-table td.c,.perm-table th.c{text-align:center}
.perm-table td.on{color:var(--brand)}
.perm-table input[type=checkbox]{width:18px;height:18px;margin:0}
.code{font-family:ui-monospace,Consolas,monospace;color:#94a3b8}
.account-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}
.account-grid #password-form{grid-column:2;grid-row:1/span 2}
.profile-head{display:flex;gap:16px;align-items:center}
.profile-head h3{margin:0 0 2px}
.profile-head p{margin:0 0 8px}
.meta{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0 0;padding-top:16px;border-top:1px solid var(--line)}
.meta dt{font-size:12px;color:var(--muted);font-weight:400}
.meta dd{margin:4px 0 0;font-weight:600}
.recovery-status{display:flex;gap:10px;align-items:center;padding:12px 14px;border-radius:10px;margin:14px 0;font-size:14px}
.recovery-status.ok{background:#e9f7ef;color:#11603a}
.recovery-status.warn{background:#fff8e6;color:#7a5a12}
.card h3 .ic{color:var(--brand)}
.center{text-align:center}
dialog .wide{margin-top:10px}
@media print{body.print-dialog>*:not(#modal){display:none!important}body.print-dialog #modal{position:static;box-shadow:none;max-height:none}body.print-dialog #modal .actions,body.print-dialog .modal-close{display:none!important}}
@media(max-width:900px){.account-grid{grid-template-columns:1fr}.account-grid #password-form{grid-column:auto;grid-row:auto}}
@media(max-width:760px){.tabs a span:not(.badge){display:none}.tabs a[aria-selected=true] span{display:inline}.form-grid.two,.code-list{grid-template-columns:1fr}.input-icon.search input{min-width:0;width:100%}.card-tools,.card-tools .search{width:100%}.row-actions span{display:none}.big-code{font-size:26px;letter-spacing:4px}}
.user-cell{min-width:170px}
.user-cell b,.user-cell small{white-space:nowrap}
.table-wrap.flat td{vertical-align:middle}
.table-wrap.flat td:nth-child(3){white-space:nowrap}
.table-wrap.flat td{overflow-wrap:normal}
@media(max-width:1300px){.row-actions span{display:none}.row-actions button{padding:6px 9px}}
.tabs{overflow-y:hidden}
dialog h2 .ic{width:22px;height:22px;color:var(--brand);vertical-align:-3px}
.form-error{margin:0 0 12px;font-size:13px}
/* หน้ารายละเอียดครุภัณฑ์ */
.da-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;margin-bottom:14px}
.da-back .ic{width:16px;height:16px}
.da-hero{padding:0;overflow:hidden;margin-bottom:20px}
.da-page{container-type:inline-size}
.da-page .card h3{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.da-hero-main{display:flex;flex-wrap:wrap;gap:18px 22px;align-items:flex-start;padding:24px}
.da-title{flex:1 1 320px;min-width:0}
.da-thumb{flex:none;width:92px;height:92px;border-radius:16px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;overflow:hidden}
.da-thumb .ic{width:40px;height:40px;stroke-width:1.5}
.da-thumb img{width:100%;height:100%;object-fit:cover}
.da-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.da-chips .status{font-size:12px;padding:5px 12px}
.pill.soft{background:#eef2f7;color:#475569}
.da-title h1{margin:0 0 10px;font-size:24px;line-height:1.35;color:var(--brand-deep);font-weight:700;overflow-wrap:anywhere}
.da-number{display:flex;align-items:center;gap:4px}
.da-number code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:14px;background:#f3f6f5;border:1px solid var(--line);padding:4px 10px;border-radius:8px;color:var(--ink);overflow-wrap:anywhere}
.da-spec{margin:12px 0 0;color:#4b5f6e;font-size:14px;line-height:1.7}
.da-icon-btn{padding:6px;border-radius:8px;border-color:transparent;background:transparent;color:var(--muted)}
.da-icon-btn:hover{background:#f0f6f3;border-color:transparent;color:var(--brand)}
.da-icon-btn.danger:hover{background:#fff1f2;color:#dc2626}
.da-icon-btn .ic{width:16px;height:16px}
.da-actions{display:flex;gap:10px;flex-wrap:wrap;flex:0 1 auto}
.da-actions .btn{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border:1px solid var(--brand);border-radius:9px;font-weight:600}
.da-actions .ic{width:16px;height:16px}
.da-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line);background:#f9fbfa}
.da-stats>div{padding:16px 24px;border-left:1px solid var(--line);min-width:0}
.da-stats>div:first-child{border-left:0}
.da-stats small{display:block;font-size:12px;margin-bottom:4px}
.da-stats strong{display:block;font-size:20px;line-height:1.35;color:var(--ink);font-weight:700;overflow-wrap:anywhere}
.da-stats strong.da-loc{font-size:15px;font-weight:600;padding:2px 0 3px}
.da-stats span{font-size:12px;color:var(--muted)}
.da-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.da-main,.da-side{display:grid;gap:20px;min-width:0}
.da-main .card-head{margin-bottom:18px}
.da-dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 24px;margin:0}
.da-dl dt{font-size:12px;color:var(--muted);margin-bottom:4px}
.da-dl dd{margin:0;font-weight:500;overflow-wrap:anywhere}
.da-empty{color:#b3bfca;font-weight:400}
.da-compare{width:100%;border-collapse:collapse;font-size:14px}
.da-compare th,.da-compare td{padding:12px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.da-compare thead th{font-size:12px;color:var(--muted);font-weight:600;background:#f7faf8;border-bottom:1px solid var(--line)}
.da-compare tbody th{font-weight:500;color:#4b5f6e;width:170px}
.da-compare tbody td{width:calc(50% - 85px)}
.da-compare tbody tr:last-child>*{border-bottom:0}
.da-compare tbody tr:hover>*{background:#fafcfb}
.col-tag{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 5px;margin-right:8px;border-radius:5px;background:#eef2f7;color:#64748b;font-size:10px;font-weight:700;vertical-align:1px}
.da-raw{display:block;font-size:11px;margin:2px 0 0 30px}
.da-timeline{list-style:none;margin:0;padding:0}
.da-timeline li{position:relative;padding:0 0 20px 28px}
.da-timeline li::before{content:"";position:absolute;left:6px;top:18px;bottom:0;width:2px;background:var(--line)}
.da-timeline li:last-child{padding-bottom:0}
.da-timeline li:last-child::before{display:none}
.da-timeline li::after{content:"";position:absolute;left:0;top:5px;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--brand);box-sizing:border-box}
.da-timeline li.pending::after{border-color:#d9a21b}
.da-timeline li.rejected::after{border-color:#c93838}
.da-timeline p{margin:6px 0 0}
.da-timeline button{margin-top:10px}
.da-tl-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.da-tl-head small{margin-left:auto}
.da-empty-state{display:grid;place-items:center;gap:6px;padding:26px 12px;color:var(--muted);text-align:center;background:#fafcfb;border:1px dashed #d6dfe7;border-radius:10px}
.da-empty-state .ic{width:28px;height:28px;color:#b3bfca}
.da-empty-state p{margin:0;font-size:13px}
.da-qr{text-align:center}
.da-qr h3{text-align:left}
.da-qr img{width:184px;height:184px;padding:10px;border:1px solid var(--line);border-radius:14px;background:#fff}
.da-qr p{font-size:13px;margin:10px 0 16px}
.da-qr-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.da-qr-actions a{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 8px;border:1px solid var(--line);border-radius:9px;font-size:13px;font-weight:600}
.da-qr-actions a:hover{background:#f0f6f3;border-color:#c8d8cf}
.da-qr-actions .ic{width:15px;height:15px}
.da-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.da-gallery .da-empty-state{grid-column:1/-1}
.da-photo{margin:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.da-photo img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.da-photo figcaption{display:flex;align-items:center;gap:6px;padding:5px 5px 5px 10px;font-size:12px;min-width:0}
.da-photo-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.da-photo .pill{padding:2px 8px;font-size:10px}
.da-upload{display:grid;gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.da-upload>input{margin-top:0}
.da-drop{position:relative;display:grid;place-items:center;gap:2px;margin:0;padding:16px;border:1.5px dashed #c8d8cf;border-radius:10px;background:#f7fbf9;color:var(--brand);text-align:center;font-size:13px;font-weight:600;cursor:pointer;overflow-wrap:anywhere}
.da-drop:hover,.da-drop:focus-within{border-color:var(--brand);background:var(--brand-soft)}
.da-drop input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.da-drop small{font-weight:400}
.da-check{margin:0;font-size:13px;font-weight:400}
.da-meta{display:grid;gap:12px;margin:0;font-size:13px}
.da-meta div{display:flex;justify-content:space-between;align-items:center;gap:12px}
.da-meta dt{color:var(--muted);flex:none}
.da-meta dd{display:flex;align-items:center;gap:2px;margin:0;text-align:right;font-weight:500;min-width:0;overflow-wrap:anywhere}
.da-uuid{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;font-weight:400}
@container (max-width:1050px){.da-layout{grid-template-columns:minmax(0,1fr)}.da-side{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));align-items:start}}
@container (max-width:760px){.da-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.da-stats>div:nth-child(3){border-left:0}.da-stats>div:nth-child(n+3){border-top:1px solid var(--line)}.da-dl{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (max-width:500px){.da-hero-main{gap:14px;padding:18px}.da-thumb{width:64px;height:64px;border-radius:12px}.da-thumb .ic{width:30px;height:30px}.da-title{flex-basis:100%}.da-title h1{font-size:20px}.da-actions{flex:1 1 100%}.da-actions>*{flex:1 1 auto}.da-stats>div{padding:12px 16px}.da-stats strong{font-size:17px}.da-dl{grid-template-columns:1fr}.da-compare{font-size:13px}.da-compare th,.da-compare td{padding:10px 8px}.da-compare tbody th{width:auto}.da-raw{margin-left:0}.col-tag{display:none}}
/* คำอธิบายภาษาไทยในหน้านำเข้า/รายงาน */
.help-list{margin:6px 0 0;padding-left:20px}
.help-list li{margin:2px 0}
details.help{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:10px 16px;margin:12px 0}
details.help summary{cursor:pointer;font-weight:600;color:var(--brand-dark)}
details.help table{margin-top:8px}
.import-summary{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));margin:12px 0}
.import-summary .card{padding:12px 16px}
.import-summary strong{display:block;font-size:22px}
label[hidden]{display:none}
/* หัวบน: breadcrumb และบทบาทผู้ใช้ */
.crumbs{display:flex;align-items:center;gap:10px;font-size:14px;color:#6b7c8c;min-width:0;flex-wrap:wrap}
.crumbs a{color:#5f7080;font-weight:500}
.crumbs a:hover{color:var(--brand)}
.crumb-home{display:inline-flex}
.crumb-home .ic{width:19px;height:19px}
.crumb-sep{color:#b3c0cb;margin:0 2px}
#crumb-parent{display:contents}
header #page-title{font-size:15px;color:var(--brand);font-weight:700}
.user-meta{display:flex;flex-direction:column;line-height:1.25}
header .user-meta small{font-size:11px;color:var(--muted);margin:0}
/* หัวหน้าเพิ่ม/แก้ไขครุภัณฑ์ */
.page-hero{position:relative;display:flex;align-items:center;gap:20px;margin:-6px 0 22px;padding:4px 0 8px;min-height:84px}
.hero-icon{position:relative;display:grid;place-items:center;width:64px;height:64px;border-radius:16px;background:linear-gradient(145deg,#17955c,var(--brand-dark));color:#fff;box-shadow:0 8px 20px #0f7a4a40;flex:none}
.hero-icon .ic{width:32px;height:32px}
.hero-icon b{position:absolute;right:8px;bottom:8px;display:grid;place-items:center;width:19px;height:19px;border-radius:50%;background:#fff;color:var(--brand);font-size:13px;line-height:1;box-shadow:0 1px 3px #0003}
.page-hero h1{margin:0 0 6px;font-size:28px;font-weight:700;color:var(--brand-deep)}
.page-hero p{margin:0;color:#5f7080;font-size:14px}
.hero-art{position:absolute;right:8px;bottom:0;width:280px;height:96px;color:var(--brand);opacity:.15;pointer-events:none}
/* ฟอร์มแบ่งส่วน */
.asset-form{padding:18px 22px 22px}
.form-section+.form-section{margin-top:20px}
.form-section-title{display:flex;align-items:center;gap:10px;margin:0 0 4px;padding:10px 16px;border-radius:10px;background:linear-gradient(90deg,#e4f3ea,#f2f9f5);color:var(--brand-deep);font-size:17px;font-weight:700}
.form-section-title .ic{width:20px;height:20px;color:var(--brand)}
.form-section-title em{font-style:normal;font-size:11.5px;font-weight:600;padding:3px 11px;border-radius:20px;background:#cdeadb;color:var(--brand-dark)}
.fx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 28px;padding:2px 16px 0}
.fx{margin:10px 0 0;font-weight:400}
.fx-label{display:block;font-size:13px;font-weight:600;color:#2b4252;margin-bottom:5px}
.fx-label b{color:var(--brand-dark)}
.req{color:#dc2626;font-style:normal;margin-left:3px}
.fx-control{position:relative;display:block}
.fx-control>.ic{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:#7c8c9a;pointer-events:none;z-index:1}
.fx-control input,.fx-control select{margin:0;height:38px;padding:7px 12px;font-size:14px}
.fx-control.has-icon input,.fx-control.has-icon select{padding-left:40px}
.fx-control.has-after input{padding-right:42px}
.is-select select,.is-combo input{appearance:none;-webkit-appearance:none;padding-right:38px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2326404f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center/15px}
.is-combo input::-webkit-calendar-picker-indicator{opacity:0}
.fx-pick{position:absolute;right:4px;top:50%;transform:translateY(-50%);padding:6px;border:0;border-radius:7px;background:none;color:#5f7080;box-shadow:none}
.fx-pick .ic{width:17px;height:17px}
.fx-pick:hover{background:var(--brand-soft);color:var(--brand)}
.fx-pick:active{transform:translateY(-50%)}
.fx-date-picker{position:absolute;right:0;bottom:0;width:1px;height:1px;margin:0;padding:0;border:0;opacity:0;pointer-events:none}
.form-actions{display:flex;gap:20px;align-items:center;justify-content:space-between;margin-top:26px;padding:0 16px}
.form-note{display:flex;gap:12px;align-items:center;flex:1;max-width:860px;background:#ecf6f0;border:1px solid #d3eadc;border-radius:10px;padding:12px 16px;font-size:13px;color:#3e5f50}
.form-note .ic{flex:none;width:20px;height:20px;color:var(--brand)}
.form-buttons{display:flex;gap:12px;flex:none}
.form-buttons button{padding:11px 22px;font-weight:600;font-size:15px}
.form-buttons .primary{min-width:190px}
@media(max-width:1180px){.fx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-actions{flex-direction:column;align-items:stretch}.form-buttons{justify-content:flex-end}}
@media(max-width:760px){.fx-grid{grid-template-columns:1fr;padding:0 2px}.form-actions{padding:0}.form-buttons{flex-direction:column-reverse}.hero-art,#crumb-parent{display:none}.page-hero h1{font-size:23px}.hero-icon{width:52px;height:52px}.form-section-title{font-size:15px;flex-wrap:wrap}}
/* พื้นหลังเมนูข้าง: ส่วนบน (โลโก้ + เส้นโค้ง) ส่วนล่าง (อาคาร) ช่วงกลางเป็นสีพื้นเดียวกับภาพ */
aside{background:url(../img/sidebar-top.webp) left top/100% auto no-repeat,url(../img/sidebar-bottom.webp) left bottom/100% auto no-repeat,linear-gradient(90deg,#014535,#014f3b 50%,#01483a);padding:15px 16px 10px}
/* โลโก้วางทับตำแหน่งโลโก้ในภาพพื้นหลังพอดี (ซ้าย 18px บน 15px ขนาด 45px) */
aside .brand{padding:0 0 0 2px;gap:14px;text-shadow:0 1px 3px #0005}
aside .brand-logo{width:45px;height:45px;padding:1px;box-shadow:none}
aside .nav-caption{margin-top:30px}
/* เว้นที่ให้ภาพอาคารด้านล่าง ข้อความหน่วยงานอยู่ใต้เส้นพื้น */
.aside-bottom{border-top:0;padding:110px 6px 0;text-align:center;line-height:1.6;color:#d3eadd;text-shadow:0 1px 2px #0006}
.aside-bottom small{color:#9fcdb4}
/* พื้นหลังพื้นที่แสดงข้อมูล: เนินเขาและอาคารด้านบน */
.workspace{min-height:100vh;background:#f4f6f6 url(../img/content-top.webp) center top/100% auto no-repeat}
header{background:#ffffffc7}
/* ===== ขนาดตัวอักษรใหญ่ขึ้นทั้งระบบ เพื่ออ่านได้ชัด ===== */
body{font-size:16px}
nav a{font-size:15.5px;padding:12px 14px}
nav a .ic{width:21px;height:21px}
.brand{font-size:17px}
.brand small{font-size:12.5px}
.nav-caption{font-size:12.5px}
.aside-bottom{font-size:13px}
.crumbs{font-size:15px}
header #page-title{font-size:16px}
.user-meta #user-name{font-size:15px}
header .user-meta small{font-size:12.5px}
#logout{font-size:14.5px}
table{font-size:15px}
th{font-size:14.5px}
td small,small{font-size:13.5px}
td button{font-size:14px}
.status{font-size:13.5px;padding:5px 12px;display:inline-flex;align-items:center;gap:7px}
.status::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}
.notice{font-size:14.5px}
.page-heading p,.page-hero p{font-size:15.5px}
.fx-label{font-size:14.5px}
.fx-control input,.fx-control select{font-size:15.5px;height:42px}
.form-note{font-size:14.5px}
.pagination{font-size:14.5px}
footer{font-size:13px}
/* ===== หน้าทะเบียนครุภัณฑ์ ===== */
.hero-action{margin-left:auto;padding:12px 24px;font-size:16.5px;font-weight:600;border-radius:10px;align-self:center;position:relative;z-index:1}
.hero-action .ic{width:20px;height:20px}
.reg-filters{display:grid;grid-template-columns:minmax(200px,1.4fr) repeat(6,minmax(120px,1fr)) auto;gap:14px;align-items:end;margin:0 0 20px}
.reg-filters .fx{margin:0}
.reg-filters .fx-control input,.reg-filters .fx-control select{height:48px;font-size:16px}
.reg-filter-buttons{display:flex;gap:10px}
.reg-filter-buttons button{height:48px;padding:0 22px;font-size:16px;font-weight:600;white-space:nowrap}
.reg-filter-buttons .ic{width:19px;height:19px}
.reg-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;margin-bottom:20px}
.reg-stat{display:flex;align-items:center;justify-content:flex-start;gap:16px;text-align:left;padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);box-shadow:0 1px 2px #0b3d2a08,0 6px 20px #0b3d2a06}
.reg-stat:hover{background:#fff;border-color:#bcd9c8;transform:translateY(-1px)}
.reg-stat.active{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-ring)}
.reg-stat-icon{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;flex:none}
.reg-stat-icon .ic{width:28px;height:28px}
.reg-stat small{display:block;font-size:15.5px;color:#3f5565;margin-bottom:2px}
.reg-stat strong{font-size:30px;font-weight:700;color:var(--brand-deep);line-height:1.15}
.reg-stat em{font-style:normal;font-size:15.5px;color:#3f5565}
.reg-stat.all .reg-stat-icon,.reg-stat.ok .reg-stat-icon{background:#e3f4ea;color:var(--brand)}
.reg-stat.wait .reg-stat-icon{background:#fff3d6;color:#c48a12}
.reg-stat.warn .reg-stat-icon{background:#fde8e8;color:#d23c3c}
.reg-stat.gray .reg-stat-icon{background:#eceff2;color:#6b7785}
.reg-card{padding:0}
.reg-card-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:18px 22px}
.reg-card-head h2{margin:0;font-size:21px;color:var(--brand-deep)}
.reg-card-head h2 small{font-size:16px;font-weight:400;color:#5f7080}
.reg-card-tools{display:flex;gap:18px;align-items:center}
.reg-deleted{display:flex;align-items:center;margin:0;font-size:15px;font-weight:400}
#export-excel{padding:10px 18px;font-size:15.5px;font-weight:600;color:var(--brand-dark);border-color:#cfe0d6}
#export-excel .ic{width:19px;height:19px}
.reg-table{margin:0 22px;border-radius:12px}
.reg-table th{background:#e8f4ed;color:#1f3b2f;font-size:15.5px;padding:13px 14px}
.reg-table td{padding:11px 14px;vertical-align:middle;font-size:15.5px}
.th-sort{border:0;background:none;padding:0;gap:6px;font-weight:700;font-size:15.5px;color:inherit;box-shadow:none}
.th-sort:hover{background:none;color:var(--brand)}
.th-sort .ic{width:15px;height:15px;opacity:.4}
.th-sort.on .ic{opacity:1;color:var(--brand)}
.col-check{width:46px}
.col-check input{width:19px;height:19px;margin:0}
.col-number{white-space:nowrap;color:#1f3340}
.reg-item{display:flex;align-items:center;gap:14px;color:inherit}
.reg-item-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:11px;background:#e7f4ec;color:var(--brand);flex:none}
.reg-item-icon .ic{width:23px;height:23px}
.reg-item strong{display:block;color:var(--brand-dark);font-size:16px}
.reg-item small{display:block;font-size:14px;color:#6b7c8c;margin-top:2px}
.reg-item:hover strong{text-decoration:underline}
.reg-actions{white-space:nowrap}
.reg-actions>a{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:8px;color:var(--brand-dark);font-weight:600;font-size:15px}
.reg-actions>a:hover{background:var(--brand-soft)}
.reg-actions>a+a{position:relative;margin-left:8px}
.reg-actions>a+a::before{content:"";position:absolute;left:-5px;top:8px;bottom:8px;border-left:1px solid var(--line)}
.reg-actions .ic{width:18px;height:18px}
.row-menu{display:inline-block;vertical-align:middle;margin-left:4px}
.row-menu summary{list-style:none;display:grid;place-items:center;width:36px;height:36px;border-radius:8px;cursor:pointer;color:#4b5f6e}
.row-menu summary::-webkit-details-marker{display:none}
.row-menu summary:hover,.row-menu[open] summary{background:#eef3f1}
.row-menu-list{position:fixed;z-index:30;min-width:190px;display:flex;flex-direction:column;padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 30px #0b3d2a26}
.row-menu-list>*{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;padding:10px 12px;border:0;border-radius:8px;background:none;box-shadow:none;font-size:15px;color:var(--ink)}
.row-menu-list>*:hover{background:#f0f6f3}
.row-menu-list .danger-text{color:#b91c1c}
.reg-pager{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:18px 22px 20px;font-size:15.5px;color:#3f5565}
.reg-pager-right{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.reg-size{display:flex;align-items:center;gap:8px;margin:0;font-weight:400}
.reg-size select{width:auto;margin:0;padding:8px 12px;font-size:15px}
.pg{display:flex;align-items:center;gap:6px}
.pg button{min-width:42px;height:42px;padding:0 10px;font-size:15.5px;font-weight:600}
.pg button.current{background:var(--brand);border-color:var(--brand);color:#fff}
.pg button .ic{width:18px;height:18px}
.pg-gap{padding:0 4px;color:#8a9aa8}
@media(max-width:1380px){.reg-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.reg-search,.reg-filter-buttons{grid-column:1/-1}.reg-filter-buttons{justify-content:flex-end}.reg-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.reg-filters{grid-template-columns:1fr}.reg-filter-buttons button{flex:1}.reg-stats{grid-template-columns:1fr 1fr;gap:10px}.reg-stat{padding:12px;gap:10px}.reg-stat-icon{width:42px;height:42px}.reg-stat-icon .ic{width:21px;height:21px}.reg-stat strong{font-size:23px}.reg-table{margin:0 10px}.reg-card-head,.reg-pager{padding:14px}.page-hero{flex-wrap:wrap}.hero-action{margin-left:0}}
/* ===== แบบฟอร์มส่งออก ===== */
.tpl-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 20px;padding:0;list-style:none}
.tpl-steps li{display:flex;align-items:center;gap:14px;padding:14px 18px;background:#ffffffd9;border:1px solid var(--line);border-radius:14px}
.tpl-steps li>span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--brand);color:#fff;font-weight:700;font-size:17px;flex:none}
.tpl-steps strong{display:block;font-size:16px;color:var(--brand-deep)}
.tpl-steps small{font-size:14px;color:#5f7080}
.tpl-upload{padding:22px 24px}
.tpl-upload-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.tpl-upload-head h2{display:flex;align-items:center;gap:10px;margin:0;font-size:20px;color:var(--brand-deep)}
.tpl-upload-head h2 .ic{width:22px;height:22px;color:var(--brand)}
.tpl-group{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:20px;background:var(--brand-soft);color:var(--brand-dark);font-weight:600;font-size:15px}
.tpl-group .ic{width:17px;height:17px}
.tpl-group-select{margin:0;min-width:320px}
.tpl-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;margin:0;padding:34px 20px;border:2px dashed #b9d8c6;border-radius:14px;background:#f6fbf8;text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.tpl-drop:hover,.tpl-drop.drag{border-color:var(--brand);background:#ecf7f0}
.tpl-drop.has-file{border-style:solid;border-color:var(--brand);background:#fff}
.tpl-drop input{position:absolute;inset:0;opacity:0;cursor:pointer;margin:0;width:100%;height:100%}
.tpl-drop-icon{display:grid;place-items:center;width:62px;height:62px;border-radius:50%;background:#dff1e6;color:var(--brand);margin-bottom:6px}
.tpl-drop-icon .ic{width:30px;height:30px}
.tpl-drop strong{font-size:18px;color:var(--brand-deep);word-break:break-word}
.tpl-drop span:last-child{font-size:15px;color:#5f7080}
.tpl-drop u{color:var(--brand);font-weight:600}
#tpl-check{margin-top:16px}
.tpl-checking{display:flex;align-items:center;gap:10px;color:#5f7080;font-size:15px}
.tpl-checking .ic{animation:tpl-spin 1s linear infinite}
@keyframes tpl-spin{to{transform:rotate(360deg)}}
.tpl-result{display:flex;gap:14px;align-items:flex-start;padding:14px 18px;border-radius:12px;font-size:15px}
.tpl-result .ic{width:24px;height:24px;flex:none;margin-top:2px}
.tpl-result strong{font-size:16px}
.tpl-result p{margin:4px 0 0}
.tpl-result.ok{background:#e9f6ee;color:#1d5c3c}
.tpl-result.ok .ic{color:var(--brand)}
.tpl-result.warn{background:#fff6e5;color:#7a4b06}
.tpl-result.warn .ic{color:#d97706}
.tpl-sheets{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:10px;margin:14px 0 0;padding:0;border:0}
.tpl-sheets legend{font-weight:600;font-size:15px;margin-bottom:8px;color:#2b4252}
.tpl-sheets label{display:flex;gap:12px;align-items:flex-start;margin:0;padding:12px 14px;border:1px solid var(--line);border-radius:12px;cursor:pointer;font-weight:400}
.tpl-sheets label:has(input:checked){border-color:var(--brand);background:#f1f9f4;box-shadow:0 0 0 3px var(--brand-ring)}
.tpl-sheets label.dim{opacity:.7}
.tpl-sheets input{width:18px;height:18px;margin:3px 0 0;accent-color:var(--brand);flex:none}
.tpl-sheets strong{display:block;font-size:15.5px}
.tpl-sheets small{display:block;font-size:13.5px;color:#5f7080;margin-top:2px}
.tpl-one,.tpl-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0 0;font-size:15px;color:#3f5565}
.tpl-one .ic,.tpl-name .ic{width:18px;height:18px;color:var(--brand)}
.tpl-upload-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-top:18px}
.tpl-upload-foot p{display:flex;align-items:center;gap:8px;margin:0;font-size:14.5px;flex:1;min-width:260px}
.tpl-upload-foot p .ic{width:18px;height:18px;color:var(--brand);flex:none}
.tpl-upload-foot .primary{padding:12px 26px;font-size:16px;font-weight:600}
.tpl-section{margin-top:28px}
.tpl-section h2{margin:0 0 14px;font-size:21px;color:var(--brand-deep)}
.tpl-section h2 small{font-size:15px;font-weight:400;color:#5f7080;margin-left:6px}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(520px,1fr));gap:16px}
.tpl-card{display:grid;grid-template-columns:auto 1fr;gap:6px 18px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 1px 2px #0b3d2a08,0 6px 20px #0b3d2a06}
.tpl-file{position:relative;display:grid;place-items:center;width:56px;height:64px;border-radius:10px;background:#e3f4ea;color:var(--brand);grid-row:span 2}
.tpl-file .ic{width:30px;height:30px}
.tpl-file b{position:absolute;bottom:-7px;left:50%;transform:translateX(-50%);padding:1px 7px;border-radius:6px;background:var(--brand);color:#fff;font-size:11px;letter-spacing:.5px}
.tpl-body{min-width:0}
.tpl-body h3{margin:0 0 8px;font-size:17.5px;color:var(--brand-deep);word-break:break-word}
.tpl-chips{display:flex;flex-wrap:wrap;gap:8px}
.tpl-chips span{display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:20px;background:#f1f5f3;color:#3f5565;font-size:14px}
.tpl-chips .ic{width:15px;height:15px;color:var(--brand)}
.tpl-chips .tpl-badge{background:#e3f4ea;color:var(--brand-dark);font-weight:600}
.tpl-tables{margin:10px 0 0;font-size:14.5px;color:#3f5565;line-height:1.7}
.tpl-meta{margin:6px 0 0;font-size:13.5px;color:#7a8a98}
.tpl-actions{grid-column:2;display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tpl-actions>*{display:inline-flex;align-items:center;gap:7px;padding:9px 15px;font-size:15px;font-weight:600;border-radius:9px}
.tpl-actions .btn{border:1px solid #d9e2ea;background:#fff;color:#26404f}
.tpl-actions .btn:hover{background:#f0f6f3}
.tpl-actions .ic{width:17px;height:17px}
.ghost-danger{margin-left:auto;color:#b42318;border-color:transparent;background:none;box-shadow:none}
.ghost-danger:hover{background:#fff1f0;border-color:#fecdca;color:#b42318}
.tpl-empty{display:flex;gap:14px;align-items:flex-start;padding:20px 22px;border:1px dashed #c9d9cf;border-radius:14px;background:#ffffffcc;font-size:15px;color:#3f5565;grid-column:1/-1}
.tpl-empty .ic{width:24px;height:24px;color:var(--brand);flex:none}
.tpl-empty strong{font-size:16px;color:var(--brand-deep)}
.tpl-empty p{margin:4px 0 0}
@media(max-width:1100px){.tpl-grid{grid-template-columns:1fr}}
@media(max-width:760px){.tpl-steps{grid-template-columns:1fr}.tpl-group-select{min-width:0;width:100%}.tpl-card{grid-template-columns:1fr}.tpl-file{grid-row:auto}.tpl-actions{grid-column:1}.tpl-actions>*{flex:1 1 auto;justify-content:center}.ghost-danger{margin-left:0}.tpl-upload{padding:16px}}

/* ===== แบบฟอร์มทะเบียน (รุ่นแบบฟอร์มเปล่า + พิมพ์รายงาน) ===== */
.tpl-card.is-standard{border-color:#b9dcc7;background:linear-gradient(180deg,#f6fbf8,#fff 60%)}
.tpl-body h3 em{margin-left:8px;padding:2px 10px;border-radius:20px;background:var(--brand);color:#fff;font-style:normal;font-size:12.5px;vertical-align:middle}
.tpl-actions{align-items:flex-end;gap:14px 18px}
.tpl-act-group{display:flex;flex-direction:column;gap:6px}
.tpl-act-group>small{font-size:13px;color:#5f7080;font-weight:600}
.tpl-act-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tpl-actions .btn.primary{background:var(--brand);color:#fff;border-color:var(--brand)}
.tpl-actions .btn.primary:hover{background:var(--brand-hover);color:#fff}
.tpl-act-row button{display:inline-flex;align-items:center;gap:7px;padding:9px 15px;font-size:15px;font-weight:600}
.tpl-act-row .ic{width:17px;height:17px}
.tpl-report-group{display:flex;align-items:center;gap:6px;margin:0;font-weight:400;font-size:14px}
.tpl-report-group select{width:auto;margin:0;padding:8px 10px;font-size:14.5px;max-width:220px}
details.tpl-upload{margin-top:28px;padding:0}
details.tpl-upload>summary{display:flex;flex-direction:column;gap:4px;padding:18px 24px;cursor:pointer;list-style:none}
details.tpl-upload>summary::-webkit-details-marker{display:none}
details.tpl-upload>summary span{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:700;color:var(--brand-deep)}
details.tpl-upload>summary span::after{content:"＋";margin-left:auto;color:var(--brand);font-size:20px}
details.tpl-upload[open]>summary span::after{content:"−"}
details.tpl-upload>summary span .ic{width:22px;height:22px;color:var(--brand)}
details.tpl-upload>summary small{font-size:14.5px;color:#5f7080}
details.tpl-upload form{padding:0 24px 22px}
@media(max-width:760px){.tpl-act-group,.tpl-act-row{width:100%}.tpl-act-row button{flex:1}.tpl-actions .btn.primary{justify-content:center}details.tpl-upload form{padding:0 14px 16px}}
.tpl-actions>.tpl-act-group{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:0;font-weight:400;border-radius:0}
.tpl-actions>.tpl-act-group .btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;font-size:15px;font-weight:600;border-radius:9px}
.tpl-actions>.tpl-act-group .btn .ic{width:17px;height:17px}

.err-detail{margin-top:10px;padding-top:10px;border-top:1px dashed #f3b4b4;font-size:14px}
.err-detail code{display:block;margin-top:4px;white-space:pre-wrap;word-break:break-word;font-size:13.5px;color:#7a1f1f}

/* ===== ประวัติการนำเข้า ===== */
.imp-history{margin-top:24px;padding:0}
.imp-history-head{padding:18px 22px 6px}
.imp-history-head h2{display:flex;align-items:center;gap:10px;margin:0;font-size:20px;color:var(--brand-deep)}
.imp-history-head h2 .ic{width:22px;height:22px;color:var(--brand)}
.imp-history-head h2 small{font-size:15px;font-weight:400;color:#5f7080}
.imp-history-head p{margin:4px 0 0;font-size:14.5px}
.imp-table{margin:10px 22px 22px;border-radius:12px}
.imp-table td{vertical-align:middle}
.imp-table td>small{display:block;color:#6b7c8c;margin-top:2px}
.imp-file{display:inline-flex;align-items:center;gap:6px;color:var(--brand-dark)}
.imp-file .ic{width:17px;height:17px;flex:none}
.imp-counts{white-space:nowrap}
.imp-counts span{display:inline-block;margin:2px 6px 2px 0;padding:2px 9px;border-radius:12px;background:#f1f5f3;font-size:13.5px}
.imp-counts span.bad{background:#fdeeee;color:#b42318}
.imp-counts em{font-style:normal;color:#b45309}
.imp-actions{white-space:nowrap}
.imp-actions button{padding:7px 12px;font-size:14px;margin:2px 4px 2px 0}
.imp-actions button .ic{width:16px;height:16px}
.imp-actions .ghost-danger{margin-left:0}
.imp-revert{text-align:left;max-width:520px}
.imp-revert .dialog-icon{margin-bottom:6px}
.imp-revert h2{margin:6px 0 2px}
.imp-revert-count{display:flex;align-items:center;gap:14px;margin:14px 0;padding:14px 18px;border-radius:12px;background:#fdeeee;color:#7a1f1f}
.imp-revert-count strong{font-size:34px;line-height:1}
.imp-revert-notes{font-size:14px;color:#5f7080;margin:10px 0}
.imp-revert-ack{display:flex;align-items:center;gap:8px;margin:14px 0;font-weight:600}
.imp-revert-ack input{width:18px;height:18px;margin:0}
/* รายการที่ไม่มีหมายเลขครุภัณฑ์: แถบแดงให้เห็นชัด ผู้ใช้เพิ่มหมายเลขหรือลบภายหลัง */
tr.nonum td{background:#fdecec}tr.nonum td:first-child{box-shadow:inset 4px 0 0 #dc2626}
.tag-nonum{display:inline-block;padding:1px 8px;border-radius:8px;background:#dc2626;color:#fff;font-size:12px;font-weight:700;white-space:nowrap}
.nonum-add{display:block;margin-top:3px;font-size:12px;color:#b91c1c;text-decoration:underline}
.notice.nonum-notice{background:#fdecec;border-left-color:#dc2626;color:#7f1d1d}.notice.nonum-notice strong{color:#991b1b}.notice.nonum-notice summary{cursor:pointer;font-weight:600;margin-top:6px}.notice.nonum-notice ul{margin:6px 0 0;padding-left:20px;max-height:240px;overflow:auto}.notice.nonum-notice a{color:#991b1b;text-decoration:underline}
.reg-nonum-filter{margin-right:14px}.reg-nonum-filter.has-nonum{color:#b91c1c;font-weight:600}
.da-empty.nonum{display:inline-block;padding:2px 10px;border-radius:8px;background:#dc2626;color:#fff;font-weight:700}
/* หมายเลขซ้ำ ใช้สีแดงแบบเดียวกับรายการที่ไม่มีหมายเลข */
#dup-number-tag{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;margin-left:8px}#dup-number-tag .dup-links a{color:#b91c1c;text-decoration:underline}
.col-number .tag-nonum{margin-top:3px}
/* หมายเลขซ้ำ: สีเหลืองอำพัน แยกจากรายการที่ไม่มีหมายเลข (สีแดง) */
tr.dupnum td{background:#fff6dc}tr.dupnum td:first-child{box-shadow:inset 4px 0 0 #f59e0b}
.tag-dupnum{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:8px;background:#b45309;color:#fff;font-size:12px;font-weight:700;white-space:nowrap}
.dupnum-link{display:block;margin-top:3px;font-size:12px;color:#92400e;text-decoration:underline}
.notice.dup-notice{background:#fff6dc;border-left-color:#f59e0b;color:#713f12}.notice.dup-notice strong{color:#92400e}.notice.dup-notice details{margin-top:6px}.notice.dup-notice summary{cursor:pointer;font-weight:600}.notice.dup-notice ul{margin:6px 0 0;padding-left:20px;max-height:280px;overflow:auto}.notice.dup-notice a{color:#92400e;text-decoration:underline}
.reg-nonum-filter.has-dup{color:#92400e;font-weight:600}
#dup-number-tag .dup-links a{color:#92400e}
.swatch{display:inline-block;width:12px;height:12px;margin:0 4px 0 2px;border-radius:3px;vertical-align:-1px}.swatch.nonum{background:#fdecec;box-shadow:inset 3px 0 0 #dc2626,0 0 0 1px #f3b4b4}.swatch.dupnum{background:#fff6dc;box-shadow:inset 3px 0 0 #f59e0b,0 0 0 1px #f5d48a}
/* ส่งคืน / สูญหาย: แยกจากครุภัณฑ์ที่มีอยู่ */
.reg-stat.gone .reg-stat-icon{background:#ede9fe;color:#6d28d9}
.reg-stat-note{display:block;margin-top:2px;font-style:normal;font-size:11.5px;color:var(--muted)}
.kpi-card-gone{border-left:4px solid #7c3aed}
.gone-report{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;border-left:4px solid #7c3aed;margin-bottom:16px}.gone-report h3{display:flex;align-items:center;gap:8px;margin:0 0 4px}.gone-report h3 .ic{color:#6d28d9}.gone-report p{margin:0}.gone-report-actions{display:flex;gap:8px}
/* เลือกกลุ่มงาน (super admin / ผู้ใช้หลายกลุ่ม) */
.group-switch{display:inline-flex;align-items:center;gap:6px;margin:0;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#fff}.group-switch .ic{width:18px;height:18px;color:var(--brand)}.group-switch select{border:0;background:transparent;padding:8px 2px;min-width:180px;max-width:280px;font:inherit}
.imp-history-head .group-switch{margin-top:8px}
#user-role{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* ===== ตรวจนับครุภัณฑ์ (checklist) ===== */
.form-grid.one{grid-template-columns:1fr}
button.link{background:none;border:0;box-shadow:none;color:var(--muted);text-decoration:underline;padding:4px 6px}
.insp-steps{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 22px;padding:0}
.insp-steps li{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#fff}
.insp-steps b{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff;font-size:15px}
.insp-steps strong{display:block;margin-bottom:2px}.insp-steps span{font-size:13px;color:var(--muted);line-height:1.5}.insp-steps em{font-style:normal;font-weight:700;color:var(--ink)}
.insp-list-title{font-size:18px;margin:6px 0 12px}.insp-list-title small{color:var(--muted);font-weight:400;font-size:14px}
.insp-rounds{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.insp-round{display:flex;flex-direction:column;gap:8px;color:inherit;text-decoration:none;transition:box-shadow .15s,border-color .15s}.insp-round:hover{border-color:var(--brand);box-shadow:0 6px 20px #0b3d2a14}
.insp-round.closed{opacity:.85}.insp-round-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.insp-round-head strong{font-size:17px}
.insp-state{flex:none;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700}.insp-state.open{background:#e3f4ea;color:var(--brand)}.insp-state.closed{background:#eceff2;color:#5b6775}
.insp-go{margin-top:auto;align-self:flex-end;color:var(--brand);font-weight:700}
.insp-mini{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:13px}
.insp-progress-text{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-top:4px}.insp-progress-text span{font-weight:700;color:var(--brand)}
.insp-progress{height:10px;border-radius:999px;background:#e8eef3;overflow:hidden}.insp-progress span{display:block;height:100%;background:linear-gradient(90deg,#16a34a,#0b5e3b);border-radius:999px;transition:width .3s}
.insp-pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12.5px;font-weight:700;white-space:nowrap;background:#eceff2;color:#475467}
.insp-pill.ok{background:#e3f4ea;color:#166534}.insp-pill.warn{background:#fff3d6;color:#92400e}.insp-pill.move{background:#e0ecff;color:#1d4ed8}.insp-pill.bad{background:#fdecec;color:#b91c1c}.insp-pill.wait{background:#f3e8ff;color:#6b21a8}.insp-pill.todo{background:#f1f5f9;color:#64748b;border:1px dashed #cbd5e1}
.insp-back{display:inline-block;margin-bottom:6px;color:var(--brand);font-weight:600;text-decoration:none}
.insp-summary{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.insp-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.insp-tabs button{border-radius:999px;padding:6px 14px;font-size:14px;background:#fff;border:1px solid var(--line)}.insp-tabs button b{margin-left:4px}
.insp-tabs button[aria-selected="true"]{background:var(--brand);border-color:var(--brand);color:#fff}
.insp-tools{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.insp-search{flex:1;min-width:240px;display:flex;align-items:center;gap:8px;margin:0;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:#fff}.insp-search .ic{color:var(--muted)}.insp-search input{border:0;flex:1;padding:11px 0;background:transparent;font:inherit;outline:none}
.insp-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px;padding:10px 14px;border-radius:12px;background:#e3f4ea}
.insp-table td{vertical-align:middle}.insp-table td small{display:block;margin-top:2px}.insp-table td small .ic{width:13px;height:13px;vertical-align:-2px;margin-right:2px}
.insp-item{color:var(--ink);text-decoration:none}.insp-item:hover{color:var(--brand);text-decoration:underline}
.insp-actions{display:flex;gap:6px;flex-wrap:wrap}
.insp-btn{padding:7px 12px;border-radius:9px;font-size:14px;font-weight:600;border:1px solid var(--line);background:#fff;white-space:nowrap}
.insp-btn.ok{color:#166534;border-color:#b7e1c4}.insp-btn.ok:hover,.insp-btn.ok[aria-pressed="true"]{background:#16a34a;border-color:#16a34a;color:#fff}
.insp-btn.warn{color:#92400e;border-color:#f5d48a}.insp-btn.warn:hover,.insp-btn.warn[aria-pressed="true"]{background:#d97706;border-color:#d97706;color:#fff}
.insp-btn.bad{color:#b91c1c;border-color:#f3b4b4}.insp-btn.bad:hover,.insp-btn.bad[aria-pressed="true"]{background:#dc2626;border-color:#dc2626;color:#fff}
.insp-btn.more{padding:7px 10px;color:var(--muted)}
@media(max-width:900px){.insp-steps{grid-template-columns:1fr}}
@media(max-width:760px){.insp-table thead{display:none}.insp-table tr{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;padding:12px 4px;border-bottom:1px solid var(--line)}.insp-table td{border:0;padding:2px 4px}.insp-table td.col-check{grid-row:span 3}.insp-table td:not(.col-check){grid-column:2}}
/* ===== หน้ารายงาน: กล่อง QR Label และรายงานส่งคืน/สูญหาย/จำหน่าย ===== */
.rep-top{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:16px;margin-bottom:16px;align-items:stretch}
.rep-box{display:flex;flex-direction:column;gap:12px;text-align:left;justify-content:flex-start}
.rep-box h3{margin:0 0 4px;font-size:18px}.rep-box p{margin:0}
.rep-box-head{display:flex;gap:14px;align-items:flex-start}
.rep-icon{flex:none;display:grid;place-items:center;width:48px;height:48px;border-radius:12px;background:#e3f4ea;color:var(--brand)}.rep-icon .ic{width:26px;height:26px}
.rep-icon.gone{background:#ede9fe;color:#6d28d9}
.rep-qr{border-top:4px solid var(--brand)}.rep-gone{border-top:4px solid #7c3aed}
.rep-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.rep-fields label{margin:0}
#qr-form{display:flex;flex-direction:column;gap:10px;align-items:stretch}
#qr-go{align-self:flex-start;padding:11px 20px;font-size:16px}
.rep-count{margin:0;font-weight:600;color:var(--brand)}.rep-count.over{color:#b91c1c}.rep-count.none{color:var(--muted)}
.rep-actions{display:flex;gap:8px;flex-wrap:wrap}.rep-actions button{padding:10px 18px}
.rep-gone>small:last-child{margin-top:auto}
.rep-form-title{display:flex;align-items:center;gap:8px;font-size:18px}
@media(max-width:1100px){.rep-top{grid-template-columns:1fr}}
@media(max-width:700px){.rep-fields{grid-template-columns:1fr}}
/* ===== หมวดหมู่ครุภัณฑ์ ===== */
.cat-tag{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:999px;background:#eef6f1;color:#1f6b45;font-style:normal;font-size:11.5px;font-weight:600;width:max-content}
.reg-item>span{display:flex;flex-direction:column}
.cat-help{margin:-6px 0 14px;font-size:13.5px}
.auto-cat{display:flex;flex-direction:column;gap:10px;max-width:720px}
.auto-cat-group{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line);border-radius:12px;margin:0;cursor:pointer}
.auto-cat-group:has(input:checked){border-color:var(--brand);background:#f3faf6}
.auto-cat-group input{margin-top:4px;width:18px;height:18px;flex:none}
.auto-cat-group small{display:block;margin-top:4px;color:var(--muted);line-height:1.5}
.auto-cat-n{margin-left:6px;color:var(--brand)}.auto-cat-new{margin-left:6px;padding:1px 8px;border-radius:999px;background:#fff3d6;color:#92400e;font-style:normal;font-size:11.5px;font-weight:700}
.cat-chart-card{margin-top:16px}.cat-chart-card h3 small{font-weight:400;font-size:13px}
.rep-fields{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.col-seq{width:72px;text-align:center}
/* ===== หน้าภาพรวม: การ์ด KPI + กราฟ ===== */
.dash-sec{margin:22px 0 12px;font-size:15px;font-weight:700;color:#516173;letter-spacing:.2px}
.dash-sec:first-of-type{margin-top:6px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.kpi{--c:#0f7a4a;--soft:#e3f4ea;position:relative;display:flex;gap:14px;align-items:flex-start;padding:18px 18px 16px;border:1px solid var(--line);border-radius:16px;background:#fff;color:var(--ink);text-decoration:none;box-shadow:0 1px 2px #0b3d2a08,0 6px 20px #0b3d2a06;overflow:hidden;transition:transform .15s,box-shadow .15s,border-color .15s}
.kpi::after{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:var(--c);opacity:.9}
a.kpi:hover{transform:translateY(-2px);border-color:var(--c);box-shadow:0 10px 26px #0b3d2a14}
.kpi-icon{flex:none;display:grid;place-items:center;width:50px;height:50px;border-radius:14px;background:var(--soft);color:var(--c)}.kpi-icon .ic{width:26px;height:26px}
.kpi-body{min-width:0;flex:1}
.kpi-label{font-size:14px;font-weight:600;color:#516173}
.kpi-num{margin:4px 0 2px;font:700 30px/1.15 Sarabun,system-ui;color:#0f172a;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kpi-num small{margin-left:6px;font-size:14px;font-weight:500;color:#64748b}
.kpi-foot{margin-top:6px;font-size:12.5px;color:#7a8898}
.kpi-bar{height:6px;margin-top:8px;border-radius:999px;background:#e8eef3;overflow:hidden}.kpi-bar span{display:block;height:100%;border-radius:999px;background:var(--c)}
.kpi-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.kpi-chips span{padding:2px 9px;border-radius:999px;background:var(--soft);color:#334155;font-size:12px}.kpi-chips b{color:var(--c)}
.kpi-chips .nonum{background:#fdecec}.kpi-chips .nonum b{color:#b91c1c}.kpi-chips .dup{background:#fff6dc}.kpi-chips .dup b{color:#92400e}
.kpi.green{--c:#0f7a4a;--soft:#e3f4ea}.kpi.blue{--c:#2563eb;--soft:#e6efff}.kpi.amber{--c:#d97706;--soft:#fff3d6}.kpi.teal{--c:#0d9488;--soft:#dcf5f2}
.kpi.orange{--c:#ea580c;--soft:#ffeddf}.kpi.yellow{--c:#ca8a04;--soft:#fdf6d8}.kpi.purple{--c:#7c3aed;--soft:#efe9fe}.kpi.red{--c:#dc2626;--soft:#fdecec}.kpi.ok{--c:#16a34a;--soft:#e3f4ea}
.dash-charts{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:16px;margin-top:22px}
.chart-card{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.dash-charts .chart-card{margin-bottom:0}
.chart-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px}.chart-head h3{margin:0;font-size:17px;color:#0f172a}.chart-head small{color:#8a97a6;font-size:12.5px}
.donut-wrap{display:flex;align-items:center;gap:24px;flex-wrap:wrap;justify-content:center}
.donut-box{position:relative;width:220px;height:220px;flex:none}
.chart-legend{list-style:none;margin:0;padding:0;display:grid;gap:8px;min-width:200px;flex:1}
.chart-legend li{display:grid;grid-template-columns:12px 1fr auto 46px;align-items:center;gap:10px;padding:8px 12px;border-radius:10px;background:#f8fafc;font-size:14px}
.chart-legend i{width:12px;height:12px;border-radius:4px}.chart-legend b{font-variant-numeric:tabular-nums}.chart-legend em{font-style:normal;color:#64748b;text-align:right;font-size:13px}
.chart-empty{padding:30px 0;text-align:center}.chart-tip{margin:0;font-size:13px}
.dash-help{margin-top:16px}.dash-help p{margin:8px 0 0;color:#5f7080;font-size:14px}
@media(max-width:1280px){.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-charts{grid-template-columns:1fr}}
@media(max-width:600px){.kpi-grid{grid-template-columns:1fr}.kpi-num{font-size:26px}.donut-box{width:190px;height:190px}}
/* ตัวกรองหน้าภาพรวม */
.dash-filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:-4px 0 6px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#fff}
.dash-filter{display:flex;align-items:center;gap:8px;margin:0;padding:0 4px 0 10px;border:1px solid #dfe7ee;border-radius:10px;background:#f8fafc;font-size:14px;color:#516173}
.dash-filter .ic{width:17px;height:17px;color:var(--brand);flex:none}.dash-filter span{white-space:nowrap;font-weight:600}
.dash-filter select{border:0;background:transparent;padding:9px 6px;min-width:150px;max-width:300px;font:inherit;color:var(--ink);cursor:pointer}.dash-filter select:disabled{cursor:default;color:var(--ink);opacity:1;-webkit-appearance:none;appearance:none}
.dash-clear{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border:0;background:none;box-shadow:none;color:#b42318;font-weight:600}.dash-clear .ic{width:15px;height:15px}
@media(max-width:600px){.dash-filter{flex:1 1 100%}.dash-filter select{flex:1;min-width:0}}
/* สร้างสถานที่อัตโนมัติ */
.loc-row{cursor:default}.loc-name{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.loc-name input[type=text]{flex:1 1 240px;min-width:0;margin:0;padding:7px 10px;border:1px solid #d5dee6;border-radius:8px;font:inherit;font-weight:600}
.loc-person{padding:1px 8px;border-radius:999px;background:#eef2f6;color:#475569;font-style:normal;font-size:11.5px;font-weight:700}
.auto-cat-group:not(:has(input[type=checkbox]:checked)) .loc-name input{color:#94a3b8;background:#f8fafc}
/* ความเชื่อมโยง: ป้ายหมวด/สถานที่ในทะเบียน, ตัวเลขที่กดได้ */
.row-tags{display:flex;flex-wrap:wrap;gap:4px 6px;margin-top:3px}.row-tags .cat-tag{margin-top:0}
.loc-tag{display:inline-flex;align-items:center;gap:3px;padding:1px 8px;border-radius:999px;background:#e6f6f4;color:#0f766e;font-style:normal;font-size:11.5px;font-weight:600;width:max-content}.loc-tag .ic{width:12px;height:12px}
.loc-tag.raw{background:#f1f5f9;color:#64748b;font-weight:500}
.count-link{font-weight:600;color:var(--brand);text-decoration:none}.count-link:hover{text-decoration:underline}
/* ผู้ดูแลครุภัณฑ์ */
.holder-tag{display:inline-flex;align-items:center;gap:3px;padding:1px 8px;border-radius:999px;background:#eef2ff;color:#4338ca;font-style:normal;font-size:11.5px;font-weight:600;width:max-content}.holder-tag .ic{width:12px;height:12px}
.loc-as{margin:0;padding:6px 8px;border:1px solid #d5dee6;border-radius:8px;font:inherit;font-size:13px;background:#fff}
@media(min-width:1381px) and (max-width:1600px){.reg-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.reg-search,.reg-filter-buttons{grid-column:1/-1}.reg-filter-buttons{justify-content:flex-end}}
/* ระยะห่างระหว่างแถวกราฟ (กราฟสถานะ/หมวดหมู่ กับกราฟสถานที่/กลุ่มงาน) */
.dash-charts{margin-bottom:18px}.chart-card+.chart-card{margin-top:0}.chart-card{margin-bottom:18px}
