/* fa-core — แดชบอร์ดงานคุณฟ้า · สไตล์ชุดเดียวกับระบบซ่อม (ตัดมาเฉพาะที่หน้านี้ใช้จาก Repair/repair-core/src/public/app.css)
   ฟอนต์ IBM Plex Sans Thai · โทนคราม · ตารางแบบหน้าติดตามช่าง (table.track) — มือถือเป็นการ์ด */
:root { --bg: #f4f5fa; --card: #fff; --ink: #0f172a; --ink-2: #334155; --mute: #64748b; --faint: #94a3b8; --line: #e5e7ef; --line-2: #d4d8e3; --soft: #f8f9fc; --pri: #4f46e5; --pri-2: #6366f1; --pri-d: #4338ca; --pri-soft: #eef2ff; --pri-ring: rgba(99, 102, 241, .18); --ok: #059669; --ok-d: #047857; --ok-soft: #ecfdf5; --warn: #b45309; --warn-soft: #fffbeb; --warn-line: #fde68a; --err: #dc2626; --err-soft: #fef2f2; --green: #d9ead3; --r: 16px; --r-sm: 10px; --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px -8px rgba(15, 23, 42, .10); --shadow-lg: 0 18px 40px -16px rgba(15, 23, 42, .28); --font: "IBM Plex Sans Thai", "Sarabun", system-ui, "Segoe UI", Tahoma, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 400px at 10% -10%, #e9e8ff 0%, transparent 60%), radial-gradient(900px 360px at 100% 0%, #e3f2ff 0%, transparent 55%), var(--bg); background-attachment: fixed; }
a { color: var(--pri); }
.ic { flex: none; display: inline-block; vertical-align: -3px; }
[hidden] { display: none !important; }
.top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 58px; padding: 8px max(16px, calc((100% - 1240px) / 2 + 16px)); background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; text-decoration: none; font-size: 16.5px; letter-spacing: -.01em; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); box-shadow: 0 6px 14px -6px rgba(99, 102, 241, .8); }
.top .lnk { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 10px; border-radius: 9px; }
.top .lnk:hover { background: var(--pri-soft); color: var(--pri-d); }
.top .btn { text-decoration: none; }
.top form.logout { margin: 0; display: inline-flex; }
.top button.lnk { border: 0; background: transparent; font: inherit; cursor: pointer; }
@media (max-width: 640px) {
  .top { position: relative; gap: 8px; row-gap: 2px; min-height: 0; padding: 8px 12px; }
  .top .lnk span, .brand > span:not(.logo) { display: none; }
  .top .btn.pri .tx { display: none; }
  .top .btn.pri { min-height: 36px; padding: 0 10px; }
}
.sp { flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 16px 130px; display: grid; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.card-h .badge { margin-left: auto; }
.tile { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.tile.indigo { background: var(--pri-soft); color: var(--pri); }
.tile.sky { background: #e0f2fe; color: #0284c7; }
.tile.emerald { background: var(--ok-soft); color: var(--ok); }
.tile.amber { background: #fef3c7; color: #d97706; }
.tile.violet { background: #f3e8ff; color: #9333ea; }
.hint { color: var(--mute); font-size: 13.5px; margin: 0 0 12px; }
input, textarea, select { width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover, select:hover { border-color: #b9bfcd; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pri-2); box-shadow: 0 0 0 4px var(--pri-ring); }
textarea { resize: vertical; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash {0% { background-color: #fde68a; } 100% { }}
details.hist summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); font-size: 14px; font-weight: 500; list-style: none; }
details.hist summary::-webkit-details-marker { display: none; }
details.hist summary::after { content: '▾'; margin-left: auto; color: var(--faint); transition: transform .2s; }
details[open].hist summary::after { transform: rotate(180deg); }
details.hist ol { margin: 12px 0 0; padding-left: 22px; color: var(--ink-2); font-size: 14px; }
.msg { font-size: 14px; color: var(--mute); }
.msg.ok { color: var(--ok-d); font-weight: 500; }
.msg.err { color: var(--err); font-weight: 600; }
.badge:empty { display: none; }
.badge:empty { display: none; }
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eef0f5; color: #475569; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok-d); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600; min-height: 40px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 11px; padding: 0 16px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.btn:hover { background: var(--soft); border-color: #b9bfcd; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--pri-ring); }
.btn.pri { border-color: transparent; color: #fff; background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -8px rgba(79, 70, 229, .75); }
.btn.pri:hover { background: linear-gradient(180deg, #5b5ef0 0%, #4338ca 100%); }
.btn.ok { border-color: transparent; color: #fff; background: linear-gradient(180deg, #10b981 0%, #059669 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -8px rgba(5, 150, 105, .75); }
.btn.ok:hover { background: linear-gradient(180deg, #0ea472 0%, #047857 100%); }
.btn.plain { border-color: transparent; background: transparent; color: var(--mute); font-weight: 500; box-shadow: none; }
.btn.plain:hover { background: #eef0f5; color: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: wait; }
.tbl-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.list th, table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { background: var(--soft); font-weight: 600; font-size: 12.5px; color: var(--mute); white-space: nowrap; letter-spacing: .02em; }
table.list th:first-child { border-top-left-radius: 10px; }
table.list th:last-child { border-top-right-radius: 10px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fafbff; }
table.list td.nowrap { white-space: nowrap; }
table.list a { font-weight: 600; text-decoration: none; }
table.list a:hover { text-decoration: underline; }
table.list .sub { color: var(--mute); font-size: 13px; }
.empty-list { padding: 36px; text-align: center; color: var(--mute); }
body.login { display: grid; min-height: 100vh; place-items: center; background: radial-gradient(800px 500px at 20% 10%, #c7d2fe 0%, transparent 60%), radial-gradient(700px 500px at 90% 90%, #ddd6fe 0%, transparent 60%), #eef0fb; }
body.login form { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); padding: 34px 32px; border-radius: 22px; width: min(370px, 92vw); border: 1px solid #fff; box-shadow: var(--shadow-lg); }
body.login .logo { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 14px; }
body.login h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.01em; }
body.login p { color: var(--mute); font-size: 14px; margin: 0 0 20px; }
body.login p.err { color: var(--err); margin: 0 0 12px; font-weight: 500; }
body.login input { padding: 12px 14px; }
body.login input + input { margin-top: 10px; }
body.login button { width: 100%; margin-top: 14px; min-height: 46px; border: 0; border-radius: 12px; color: #fff; font: inherit; font-weight: 600; cursor: pointer; background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%); box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .8); }
.wrap.wide { max-width: 1400px; }
.mainnav { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; }
.mainnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--pri-soft); color: var(--pri-d); }
.mainnav a.on { background: var(--pri-soft); color: var(--pri-d); font-weight: 600; }
@media (max-width: 760px) {
  .mainnav { order: 9; flex-basis: 100%; margin: 4px 0 0; }
}
.stage { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: #eef0f5; color: #475569; }
.stage.gray { background: #eef0f5; color: #475569; }
.stage.amber { background: #fff4dc; color: #b45309; }
.stage.sky { background: #e0f2fe; color: #0369a1; }
.stage.indigo { background: var(--pri-soft); color: var(--pri-d); }
.stage.violet { background: #f3e8ff; color: #7e22ce; }
.stage.emerald { background: var(--ok-soft); color: var(--ok-d); }
.stage.red { background: var(--err-soft); color: #b91c1c; }
.flag { display: inline-block; margin: 4px 4px 0 0; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.flag.red { background: #fee2e2; color: #b91c1c; }
.flag.amber { background: #fef3c7; color: #92400e; }
.flag.violet { background: #f3e8ff; color: #7e22ce; }
.flag.sky { background: #e0f2fe; color: #0369a1; }
.flag.emerald { background: #d1fae5; color: #047857; }
.flags { margin: -4px 0 10px; }
.pipeline { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pipe { flex: 1 1 0; min-width: 120px; display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--ink-2); border-top: 4px solid #cbd5e1; }
.pipe b { font-size: 26px; line-height: 1.1; color: var(--ink); }
.pipe span { font-size: 13px; }
.pipe:hover { border-color: var(--pri-2); }
.pipe.on { box-shadow: 0 0 0 3px var(--pri-ring); border-color: var(--pri-2); }
.pipe.gray { border-top-color: #94a3b8; }
.pipe.amber { border-top-color: #f59e0b; }
.pipe.sky { border-top-color: #0ea5e9; }
.pipe.indigo { border-top-color: var(--pri); }
.pipe.violet { border-top-color: #a855f7; }
.pipe.emerald { border-top-color: var(--ok); }
.pipe-arrow { align-self: center; color: var(--faint); flex: none; }
.alert-late { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: linear-gradient(180deg, #fff5f5, #fef2f2); border: 1px solid #fecaca; color: #991b1b; text-decoration: none; box-shadow: var(--shadow); }
.alert-late b { font-size: 16px; }
.alert-late span { font-size: 13.5px; color: #b45353; }
.alert-late.on { box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.alert-late.amber { background: linear-gradient(180deg, #fffbeb, #fef9e7); border-color: #fde68a; color: #92400e; }
.alert-late.amber span { color: #a16207; }
table.track { table-layout: fixed; min-width: 960px; }
table.track col.w-case { width: 15%; }
table.track col.w-recv { width: 9%; }
table.track col.w-appt { width: 13%; }
table.track col.w-st { width: 13%; }
table.track col.w-note { width: 18%; }
table.track td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; overflow-wrap: anywhere; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
table.track input { padding: 6px 9px; font-size: 14px; width: 100%; }
table.track textarea.note { padding: 6px 9px; font-size: 14px; line-height: 1.45; width: 100%; min-height: 36px; resize: none; overflow: hidden; field-sizing: content; }
table.track .sub.due { color: var(--pri-d); }
table.track .sub.due.late { color: #b91c1c; font-weight: 600; }
table.track .vis { display: flex; align-items: center; gap: 4px; color: var(--pri-d); font-size: 12.5px; font-weight: 600; }
table.track .visbtn { margin-top: 6px; width: 100%; }
.linkbtn { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0; padding: 0; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--mute); cursor: pointer; }
.linkbtn:hover { color: var(--pri-d); }
table.track .flags { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
table.track .flags .flag { margin: 0; white-space: normal; }
table.track tr.late td { background: #fffafa; }
table.track tr.late td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
table.track th.work, table.track td.c-appt, table.track td.c-note { background: #f7f8fc; }
table.track th.work { color: var(--pri-d); }
table.track td.c-appt, table.track th.work:nth-child(6) { border-left: 1px solid var(--line-2); }
table.track tr.late td.c-appt, table.track tr.late td.c-note { background: #fdf3f3; }
.dbox { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.dbox.empty .dv { color: var(--faint); }
.dbox .ic { color: var(--mute); }
.dbox input[type="date"], .dbox input[type="time"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.dbox:focus-within { border-color: var(--pri-2); box-shadow: 0 0 0 4px var(--pri-ring); }
.wrap .dbox { min-height: 43px; padding: 9px 12px; font-size: inherit; }
.dbox input[type="date"], .dbox input[type="time"] { margin: 0; }
.inline > .dbox.tbox { flex: 0 0 124px; }
.dbox.tbox .dv { white-space: nowrap; }
table.track .tbox { margin-top: 6px; }
@media (max-width: 640px) {
  .wrap .dbox:not(.cell) { min-height: 44px; font-size: 16px; }
  .inline > .dbox.tbox { flex-basis: 100px; padding-left: 8px; padding-right: 8px; }
}
table.track tr.saving { opacity: .55; }
table.track tr.flash td { animation: flash 1.4s ease-out; }
td.acts { white-space: nowrap; text-align: right; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; gap: 5px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); }
.toast.ok { background: #064e3b; color: #ecfdf5; }
.toast.err { background: #7f1d1d; color: #fef2f2; }
@media (max-width: 760px) {
  table.track { min-width: 0; table-layout: auto; }
  table.track thead, table.track colgroup { display: none; }
  table.track, table.track tbody { display: block; width: 100%; }
  table.track tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "case st" "model model" "tech recv" "appt appt" "note note" "acts acts"; gap: 0; border: 1px solid var(--line-2); border-radius: 14px; margin-bottom: 12px; padding: 0; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
  table.track tr.late { border-left: 4px solid #ef4444; }
  table.track tr.late td, table.track tr.late td:first-child { box-shadow: none; }
  table.track td { display: block; border: 0; min-width: 0; background: transparent; }
  table.track td.c-case, table.track td.c-st { padding: 12px 14px 10px; background: #f3f4fd; border-bottom: 1px solid var(--line); }
  table.track tr.late td.c-case, table.track tr.late td.c-st { background: #fff1f1; }
  table.track td.c-model { padding: 12px 14px 4px; }
  table.track td.c-recv { padding: 8px 14px 12px; }
  table.track td.c-appt, table.track td.c-note { background: #f6f7fa; border-left: 0; }
  table.track tr.late td.c-appt, table.track tr.late td.c-note { background: #fbf4f4; }
  table.track td.c-appt { padding: 12px 14px 8px; border-top: 1px solid var(--line-2); }
  table.track td.c-note { padding: 0 14px 8px; }
  table.track input, table.track textarea.note, table.track .dbox { background: #fff; }
  table.track .c-case { grid-area: case; }
  table.track .c-st { grid-area: st; text-align: right; }
  table.track .c-st .flags { justify-content: flex-end; }
  table.track .c-model { grid-area: model; }
  table.track .c-recv { grid-area: recv; }
  table.track .c-appt { grid-area: appt; }
  table.track .c-note { grid-area: note; }
  table.track td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 600; color: var(--mute); margin-bottom: 2px; }
  table.track input, table.track textarea.note, table.track .dbox { min-height: 44px; font-size: 16px; }
  table.track td.c-appt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  table.track td.c-appt::before { flex-basis: 100%; margin-bottom: 0; }
  table.track .c-appt .dbox, table.track .c-appt .visbtn { flex: 1 1 0; margin-top: 0; }
  table.track .c-appt .tbox { flex: 0 0 112px; }
  table.track .c-appt .visbtn { flex-basis: 100%; }
  table.track .c-appt .sub { flex-basis: 100%; }
  .track-hint { display: none; }
  .trackpage > section.card { padding: 14px 10px; }
  table.track .linkbtn { min-height: 40px; font-size: 14px; }
  table.track .visbtn { min-height: 44px; }
  .trackpage { display: flex; flex-direction: column; }
}
.tile.red { background: var(--err-soft); color: #dc2626; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input, .inline > .dbox { flex: 1; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.modal-box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); display: grid; gap: 10px; }
.modal-box h3 { margin: 0; font-size: 17px; }
.modal-box p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.modal-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal-btns .btn { min-height: 44px; text-decoration: none; }
.flag:is(a) { text-decoration: none; }
.alert-late.violet { background: linear-gradient(180deg, #f5f3ff, #ede9fe); border-color: #c4b5fd; color: #5b21b6; }
.alert-late.violet span { color: #6d28d9; }
.alert-late.violet.on { box-shadow: 0 0 0 3px rgba(139, 92, 246, .22); }
table.track textarea.note { white-space: pre-wrap; }
table.track .addnote { margin-top: 2px; }
.sub.upd { color: var(--faint); }
.top .who { display: inline-flex; align-items: center; gap: 5px; max-width: 170px; padding: 4px 10px; border-radius: 999px; background: var(--pri-soft); color: var(--pri-d); font-size: 13px; font-weight: 600; }
.top .who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .top .who { max-width: 100px; padding: 3px 8px; font-size: 12.5px; }
}
.upd .by { display: block; max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.notes .nline { padding: 5px 0; overflow-wrap: anywhere; line-height: 1.45; font-size: 14px; }
.notes .nline + .nline { border-top: 1px solid var(--line-2); }
.notes .nline time { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.track .notes[data-noteview] { padding: 2px 9px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; cursor: text; }
.notes[hidden], textarea.note[hidden] { display: none; }
.c-note .addnote + .addnote { margin-left: 8px; }
.alert-late.gray { background: linear-gradient(180deg, #f8fafc, #f1f5f9); border-color: var(--line-2); color: #334155; }
.alert-late.gray span { color: #64748b; }
.alert-late.gray.on { box-shadow: 0 0 0 3px rgba(100, 116, 139, .22); }
@media (min-width: 761px) and (max-width: 1279px) {
  .brand + .mainnav a .ic { display: none; }
}
.pp { max-width: 980px; }
.pp .card-h h2 { display: inline-flex; align-items: center; gap: 8px; }
.pp .card-h .btn { margin-left: auto; }
.pp input, .pp textarea, .pp select { font: inherit; font-size: 14.5px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); min-width: 0; width: 100%; }
.pp textarea { resize: vertical; }
.pp input:focus, .pp textarea:focus, .pp select:focus { outline: none; border-color: var(--pri-2); box-shadow: 0 0 0 3px var(--pri-ring); }
.pp input[type="radio"], .pp input[type="checkbox"] { width: auto; min-height: 0; }

/* ── แดชบอร์ดงานคุณฟ้า (/fa · 24 พ.ย.) — ตารางแบบหน้าติดตามช่าง (table.track) 6 คอลัมน์ · โซนต้องทำเริ่มคอลัมน์ 5 ── */
.logo { background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%); }
.pipe-gap { flex: none; width: 4px; }
table.track.tasks col.w-case { width: 10%; } table.track.tasks col.w-title { width: 23%; } table.track.tasks col.w-recv { width: 11%; }
table.track.tasks col.w-st { width: 15%; } table.track.tasks col.w-appt { width: 18%; } table.track.tasks col.w-note { width: 23%; }
table.track.tasks th.work:nth-child(6) { border-left: 0; }
table.track.tasks th.work:nth-child(5) { border-left: 1px solid var(--line-2); }
.tno { border: 0; background: none; padding: 0; font: inherit; color: var(--pri-d); cursor: pointer; text-align: left; }
.tno b { font-size: 15px; }
.tno:hover b { text-decoration: underline; }
table.track .ttl { font-weight: 600; color: var(--ink); }
.stline { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.stline .sub { flex: none; }
table.track select.priosel, table.track select.whosel { width: 100%; min-width: 0; padding: 5px 8px; font-size: 13px; font-weight: 600; border-radius: 9px; }
select.priosel.red { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
select.priosel.sky { background: #e0f2fe; border-color: #bae6fd; color: #0369a1; }
select.priosel.gray { background: #f1f5f9; color: #475569; }
select.whosel { background: var(--pri-soft); border-color: #c7d2fe; color: var(--pri-d); }
.sendto { margin-top: 10px; }
.sendto-b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.sendto-b .btn { flex: 1 1 auto; }
/* กำหนดส่งใต้วันรับเรื่อง (กำลังดำเนินการ): ตัวหนังสือ กดแล้วเปิดปฏิทิน */
.duepick { position: relative; display: inline-block; margin-top: 3px; font-size: 12.5px; color: var(--pri-d); cursor: pointer; white-space: normal; }
.duepick.late { color: #b91c1c; font-weight: 700; }
.duepick.none { color: var(--mute); }
.duepick:hover span { text-decoration: underline; }
.duepick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; padding: 0; border: 0; }
table.track .donebtn { margin-top: 8px; }
body.noscroll { overflow: hidden; }
/* หน้าต่างเพิ่ม/แก้งาน */
.taskform .tf { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--mute); }
.taskform .tf2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.taskform .newonly { display: grid; gap: 10px; }
.taskform .newonly[hidden], .taskform [hidden] { display: none; }
.taskform input, .taskform textarea, .taskform select { font-weight: 400; color: var(--ink); }
.prio-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.prio-pick .pp { flex: 1 1 0; position: relative; cursor: pointer; }
.prio-pick .pp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prio-pick .pp span { display: block; text-align: center; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.prio-pick .pp input:focus-visible + span { box-shadow: 0 0 0 4px var(--pri-ring); }
.prio-pick .pp.red input:checked + span { background: #fee2e2; border-color: #f87171; color: #b91c1c; }
.prio-pick .pp.sky input:checked + span { background: #e0f2fe; border-color: #38bdf8; color: #0369a1; }
.prio-pick .pp.gray input:checked + span { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.taskform .hist summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.taskform .hist ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); max-height: 220px; overflow: auto; }
.taskform .hist time { color: var(--mute); }
.taskform .msg:empty { display: none; }
.taskform .delbtn { color: #b91c1c; }
@media (max-width: 760px) {
  table.track.tasks tr { grid-template-areas: "case st" "model model" "recv recv" "appt appt" "note note"; }
  /* กล่องบน 4 ช่อง = 2×2 (ไม่ต้องเลื่อนข้าง) */
  .fapage .pipeline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; overflow: visible; }
  .fapage .pipe { min-width: 0; }
  .fapage .pipe-arrow, .fapage .pipe-gap { display: none; }
  table.track.tasks td.c-recv { padding: 4px 14px 12px; }
  table.track.tasks .c-st .stline { justify-content: flex-end; }
  table.track.tasks .c-appt .sendto, table.track.tasks .c-appt .donebtn, table.track.tasks .c-appt .btn.plain { flex-basis: 100%; }
  .taskform .tf2 { grid-template-columns: minmax(0, 1fr); }
}
/* หน้าผู้ใช้ (ผู้ดูแลออกรหัสรายคน · 24 พ.ย.) */
.userspage { max-width: 860px; }
.adduser { display: flex; gap: 8px; margin: 4px 0 14px; }
.adduser input { flex: 1; min-width: 0; }
table.userlist td { vertical-align: middle; }
table.userlist td.acts { white-space: nowrap; text-align: right; }
.pwbox .pwline { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--pri-soft); border: 1px solid #c7d2fe; }
.pwbox .pwline code { flex: 1; font: 700 22px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; color: var(--pri-d); user-select: all; }
.pwbox .pwmsg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); font: 13.5px/1.5 var(--font); white-space: pre-wrap; color: var(--ink-2); }
/* มือถือ: คนละการ์ด — ชื่อ | สถานะ · ออกรหัสล่าสุด · ปุ่ม */
@media (max-width: 640px) {
  .adduser { flex-direction: column; }
  table.userlist { min-width: 0; }
  table.userlist thead { display: none; }
  table.userlist, table.userlist tbody { display: block; width: 100%; }
  table.userlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  table.userlist td { display: block; padding: 0; border: 0; }
  table.userlist td:nth-child(3), table.userlist td.acts { grid-column: 1 / -1; }
  table.userlist td:nth-child(3) .sub { display: inline; margin-left: 6px; }
  table.userlist td.acts { display: flex; gap: 8px; text-align: left; white-space: normal; }
  table.userlist td.acts .btn { flex: 1; min-height: 40px; }
}
