/* หน้าในระบบของคลังเกียรติยศ */
.alist { display: grid; gap: .5rem; }
.arow { display: grid; grid-template-columns: auto 88px 1fr auto; gap: .7rem; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; }
.arow.nochk { grid-template-columns: 88px 1fr auto; }
.arow .th { width: 88px; height: 66px; border-radius: 6px; background: #e9edf4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; overflow: hidden; }
.arow .th img { width: 100%; height: 100%; object-fit: cover; }
.arow .t1 { font-weight: 700; line-height: 1.15; }
.arow .t1 .res { color: #8a5a00; }
.arow .t2 { color: var(--muted); font-size: .92rem; }
.arow .acts { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.arow input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.lvb { display: inline-block; color: #fff; border-radius: 99px; padding: 0 .5rem; font-size: .8rem; margin-right: .25rem; vertical-align: 1px; }
.tag-hidden { display: inline-block; background: #fdecea; color: var(--danger); border-radius: 4px; padding: 0 .4rem; font-size: .8rem; margin-left: .3rem; }
.selbar { position: sticky; top: 0; z-index: 5; background: var(--primary-soft); border: 1px solid #c9d8ee; border-radius: 10px; padding: .45rem .6rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.selbar .grow { flex: 1; }
.fbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .6rem; }
.fbar .field { margin: 0; }
.fbar input[type=search] { min-width: 14rem; }

/* ฟอร์มรางวัล */
.kindsel { display: flex; gap: .4rem; flex-wrap: wrap; }
.kindsel label { border: 1px solid var(--border); border-radius: 10px; padding: .35rem .8rem; cursor: pointer; background: #fff; font-weight: 400; display: flex; align-items: center; gap: .35rem; }
.kindsel input { width: auto; }
.kindsel label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
.people { display: grid; gap: .3rem; margin-bottom: .4rem; }
.prow { display: grid; grid-template-columns: 1.6rem 1fr 9rem auto; gap: .4rem; align-items: center; }
.prow .no { color: var(--muted); text-align: right; }
.prow .nm { font-weight: 700; }
.prow .nm small { font-weight: 400; color: var(--muted); }
.prow input { padding: .2rem .4rem; }
.picker { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 20px rgba(16,24,40,.15); max-height: 280px; overflow: auto; }
.sugg button { display: block; width: 100%; text-align: left; background: #fff; color: var(--text); border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; font-weight: 400; padding: .35rem .6rem; min-height: 0; }
.sugg button:hover, .sugg button.on { background: var(--primary-soft); }
.sugg small { color: var(--muted); }
.counter { text-align: right; color: var(--muted); font-size: .85rem; }

/* รูป */
.drop { border: 2px dashed #b8c4d6; border-radius: 10px; padding: .8rem; text-align: center; background: #f8fafd; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; margin-top: .6rem; }
.tcell { position: relative; border-radius: 8px; overflow: hidden; background: #e9edf4; border: 2px solid transparent; }
.tcell.cover { border-color: #f59e0b; }
.tcell img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.tcell.cert img { object-fit: contain; background: #fff; }
.tcell .bar { display: flex; justify-content: space-between; gap: 2px; padding: 2px; background: #fff; }
.tcell .bar button { min-height: 0; padding: .05rem .3rem; font-size: .85rem; background: #f1f3f7; color: var(--text); border: 1px solid var(--border); font-weight: 400; }
.tcell .badge-c { position: absolute; left: 4px; top: 4px; background: #f59e0b; color: #fff; border-radius: 4px; font-size: .78rem; padding: 0 .35rem; }
.tcell .badge-low { position: absolute; right: 4px; top: 4px; background: var(--danger); color: #fff; border-radius: 4px; font-size: .78rem; padding: 0 .35rem; }
.uplist { margin-top: .4rem; display: grid; gap: .2rem; font-size: .92rem; }
.uplist progress { width: 100%; height: .6rem; }

/* จัดหน้าพิมพ์ */
.layout-tools { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.gpick { display: flex; gap: .35rem; flex-wrap: wrap; }
.gpick button { background: #fff; color: var(--text); border: 1px solid var(--border); font-weight: 400; padding: .25rem .4rem; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; font-size: .82rem; }
.gpick button.on { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.gpick svg { width: 54px; height: 36px; display: block; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; max-height: 70vh; overflow: auto; }
.strip button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #e9edf4; min-height: 0; position: relative; }
.strip button img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.strip button.used { border-color: #16a34a; }
.strip button .n { position: absolute; right: 3px; top: 3px; background: #16a34a; color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 .35rem; }
.qrbox { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.qrbox .q { width: 150px; height: 150px; flex: none; }
.qrbox .q svg { width: 100%; height: 100%; }
.qrbox code { word-break: break-all; }

/* รายงาน */
table.sum th, table.sum td { text-align: center; }
table.sum td.l, table.sum th.l { text-align: left; }
.rep-print .noprint { display: none; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(4, 1fr); max-height: none; }
}
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .arow { grid-template-columns: auto 64px 1fr; }
  .arow.nochk { grid-template-columns: 64px 1fr; }
  .arow .th { width: 64px; height: 48px; }
  .arow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .prow { grid-template-columns: 1.2rem 1fr auto; }
  .prow input { grid-column: 2 / 3; }
  .strip { grid-template-columns: repeat(3, 1fr); }
}
@media print {
  body.printing-report .topbar, body.printing-report .side, body.printing-report #hub, body.printing-report .noprint { display: none !important; }
  body.printing-report .content { padding: 0; margin: 0; }
}
