/* ตารางสอน: ตารางสัปดาห์ · ถาดรายวิชา · ช่องวางได้/ไม่ได้ */
.tt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .5rem 0 1rem; }
table.tt { border-collapse: collapse; width: 100%; min-width: 760px; background: var(--surface); table-layout: fixed; }
table.tt th, table.tt td { border: 1px solid var(--border); padding: 3px; vertical-align: top; text-align: center; }
table.tt thead th { background: var(--primary-soft); font-size: .85rem; line-height: 1.1; padding: 4px 2px; }
table.tt thead th .tm { font-weight: 400; color: var(--muted); font-size: .78rem; }
table.tt th.dname { width: 4.6rem; background: var(--primary-soft); vertical-align: middle; }
table.tt th.brk, table.tt td.brk { width: 1.3rem; padding: 0; background: #f0f2f5; }
table.tt th.brk span { writing-mode: vertical-rl; font-size: .72rem; font-weight: 400; color: var(--muted); }
table.tt td { height: 3.3rem; }
table.tt td.clash { background: var(--danger-soft); }
.cl { border-radius: 5px; padding: 2px 3px; margin-bottom: 2px; display: flex; flex-direction: column; line-height: 1.05; font-size: .82rem; text-align: left; }
.cl b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.cl span { color: #3b4455; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl .pl { color: var(--primary); }

/* หน้าลงตาราง */
.gbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.gbar select { width: auto; min-width: 10rem; }
.gwrap { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: .8rem; align-items: start; }
.gwrap > * { min-width: 0; }
@media (max-width: 900px) { .gwrap { grid-template-columns: 1fr; } }
.tray { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; position: sticky; top: .5rem; max-height: calc(100vh - 6rem); overflow: auto; }
@media (max-width: 900px) { .tray { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: .3rem; } .tray h3 { width: 100%; } }
.tray h3 { margin: 0 0 .4rem; font-size: 1rem; }
.chipl { display: flex; flex-direction: column; gap: 0; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; margin-bottom: .3rem; cursor: grab; background: var(--surface); color: var(--text); font: inherit; line-height: 1.1; }
@media (max-width: 900px) { .chipl { width: auto; } }
.chipl b { font-size: .95rem; }
.chipl span { font-size: .8rem; color: var(--muted); }
.chipl .cnt { font-size: .8rem; font-weight: 700; }
.chipl.full { opacity: .55; }
.chipl.sel { outline: 3px solid var(--primary); }
.chipl:hover { background: var(--primary-soft); }
table.tt.edit td { cursor: pointer; position: relative; }
table.tt.edit td.ok { background: #e6f4ea; box-shadow: inset 0 0 0 2px #7cc490; }
table.tt.edit td.ok.warn { background: var(--warn-soft); box-shadow: inset 0 0 0 2px #e0b84a; }
table.tt.edit td.no { background: #f6f6f6; }
table.tt.edit td.swap { background: #e7eef8; box-shadow: inset 0 0 0 2px #6d9bd6; }
table.tt.edit td.swap::after { content: '⇄'; position: absolute; right: 3px; top: 1px; color: var(--primary); font-size: .85rem; }
table.tt.edit td.no::after { content: '✕'; position: absolute; right: 3px; top: 1px; color: var(--danger); font-size: .8rem; }
table.tt.edit td.drop { box-shadow: inset 0 0 0 3px var(--primary); }
.cl.mine { cursor: grab; }
.cl .lk { position: absolute; right: 2px; bottom: 1px; font-size: .75rem; }
.cl.selslot { outline: 2px solid var(--primary); }
.pop { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .5rem; min-width: 14rem; max-width: 22rem; }
.pop .actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.why { font-size: .85rem; color: var(--danger); margin-top: .2rem; }
.legend2 { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend2 i { display: inline-block; width: 1rem; height: .8rem; border-radius: 3px; vertical-align: middle; margin-right: .25rem; }

/* รายการตรวจสอบ */
.meter { display: inline-block; min-width: 4.2rem; padding: 0 .4rem; border-radius: 999px; font-size: .85rem; text-align: center; }
.meter.ok { background: var(--success-soft); color: var(--success); }
.meter.lack { background: var(--warn-soft); color: var(--warn); }
.meter.over { background: var(--danger-soft); color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: .2rem .8rem; max-height: 14rem; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: .4rem; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: .3rem; align-items: center; }
.checks input { width: auto; }
.prow { display: grid; grid-template-columns: 3rem 7rem 7rem 1fr 2.5rem; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.prow input { margin: 0; }
@media (max-width: 600px) { .prow { grid-template-columns: 2.2rem 1fr 1fr; } .prow .pb { grid-column: 1 / -2; } }
