/* ระบบแจ้งซ่อมเครื่องจักร — ธีมตาม prototype (Bootstrap 5 + IBM Plex Sans Thai) */
:root {
  --navy: #16202a;
  --navy-2: #1f2b37;
  --primary: #1d4ed8;
  --primary-soft: #dbe6fe;
  --bg: #eef2f6;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 14px;
  --bs-primary: #1d4ed8;
  --bs-primary-rgb: 29, 78, 216;
  --bs-body-font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-radius: 10px;
  --bs-link-color: #1d4ed8;
  --bs-link-color-rgb: 29, 78, 216;
}
body { font-family: var(--bs-body-font-family); background: var(--bg); color: var(--text); font-size: 15px; }
.btn { font-weight: 600; border-radius: 10px; }
.btn-primary { --bs-btn-bg: #1d4ed8; --bs-btn-border-color: #1d4ed8; --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af; --bs-btn-active-bg: #1e3a8a; --bs-btn-disabled-bg: #93b0f3; --bs-btn-disabled-border-color: #93b0f3; }
.btn-outline-primary { --bs-btn-color: #1d4ed8; --bs-btn-border-color: #1d4ed8; --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); }
.form-control, .form-select { border-radius: 10px; border-color: #cbd5e1; padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: #1d4ed8; box-shadow: 0 0 0 .2rem rgba(29,78,216,.15); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.req::after { content: ' *'; color: #dc2626; }
a { text-decoration: none; }
.small, small { font-size: .82rem; }
.text-muted { color: var(--muted) !important; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; background: var(--navy); color: #cbd5e1; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; padding: 4px 8px 16px; }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; color: #fff; font-size: 1rem; }
.brand strong { display: block; font-size: .95rem; line-height: 1.1; }
.brand small { color: #94a3b8; font-size: .72rem; }
.side-nav a { display: flex; align-items: center; gap: 11px; color: #cbd5e1; padding: 9px 12px; border-radius: 9px; font-size: .9rem; margin-bottom: 2px; }
.side-nav a i { font-size: 1.02rem; width: 18px; text-align: center; }
.side-nav a:hover { background: var(--navy-2); color: #fff; }
.side-nav a.active { background: #2a3744; color: #fff; font-weight: 600; }
.side-label { color: #64748b; font-size: .72rem; padding: 14px 12px 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 12px 24px; position: sticky; top: 0; z-index: 1020; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.2rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { display: block; color: var(--muted); font-size: .75rem; }
.topbar-back { color: var(--text); font-size: 1.15rem; margin-left: -6px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; border: 0; background: transparent; font-size: 1.2rem; color: inherit; padding: 4px 6px; }
.bell-count { position: absolute; top: -2px; right: -4px; background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); }
.user-chip strong { display: block; font-size: .85rem; line-height: 1.15; }
.user-chip small { color: var(--muted); font-size: .72rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }
/* เนื้อหาอยู่กลางจอ กว้างตามจอ แต่ไม่ยืดจนอ่านยากบนจอใหญ่ */
.content { padding: 20px 24px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.content.narrow { max-width: 1180px; }
@media (min-width: 1600px) { .content { padding: 28px 40px 48px; } }
/* หน้าที่ออกแบบสำหรับมือถือ: จอกว้างแบ่ง 2 คอลัมน์ (คอลัมน์ข้างติดอยู่ขณะเลื่อน) */
@media (min-width: 992px) { .sticky-side { position: sticky; top: 84px; } }
/* รายการการ์ดงาน: มือถือ 1 คอลัมน์ · จอกว้าง 2 คอลัมน์ */
@media (min-width: 992px) { .urg-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.job-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.job-grid > .job-card + .job-card { margin-top: 0; }
@media (min-width: 1200px) { .job-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) {
  .big-actions.stack { grid-template-columns: 1fr; }
  .big-actions.stack .big-action { min-height: 120px; }
}

.notif-panel { width: 360px; max-width: calc(100vw - 24px); border-radius: 14px; overflow: hidden; border-color: var(--line); box-shadow: 0 12px 32px rgba(15,23,42,.18); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-list a { display: block; padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: var(--text); }
.notif-list a.unread { background: #eff4ff; }
.notif-list a strong { display: block; font-size: .87rem; }
.notif-list a span { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-list a time { font-size: .72rem; color: #94a3b8; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: .88rem; }

/* มือถือ: หัวสีกรมท่า + แถบล่าง */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; text-align: center; color: #64748b; padding: 8px 0 7px; font-size: .7rem; }
.bottom-nav a i { display: block; font-size: 1.2rem; margin-bottom: 1px; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
@media (max-width: 991.98px) {
  .topbar { background: var(--navy); color: #fff; border: 0; padding: 12px 16px; }
  .topbar-title h1 { font-size: 1.05rem; }
  .topbar-title small { color: #94a3b8; }
  .topbar-back { color: #fff; }
  .content { padding: 14px 14px 96px; }
  body { font-size: 14.5px; }
}
.menu-canvas { height: auto !important; border-radius: 18px 18px 0 0; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.menu-grid a { text-align: center; color: var(--text); font-size: .78rem; padding: 10px 4px; border-radius: 12px; background: #f8fafc; }
.menu-grid a i { display: block; font-size: 1.3rem; color: var(--primary); margin-bottom: 4px; }

/* ---------- components ---------- */
.card-x { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-x + .card-x { margin-top: 14px; }
.card-title-x { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title { font-size: .95rem; font-weight: 700; margin: 18px 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-rose { background: #ffe4e6; color: #be123c; }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-violet { background: #ede9fe; color: #5b21b6; }
.pill-slate { background: #e2e8f0; color: #334155; }
.pill-teal { background: #ccfbf1; color: #115e59; }
.pill-orange { background: #ffedd5; color: #c2410c; }
.pill-green { background: #dcfce7; color: #166534; }
.pill-gray { background: #f1f5f9; color: #64748b; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-fixpro { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; font-weight: 500; }

/* การ์ดงาน (มือถือ) */
.job-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); border-left: 4px solid #cbd5e1; }
.job-card + .job-card { margin-top: 10px; }
.job-card:hover { border-color: #93c5fd; }
.job-card .doc { font-weight: 700; font-size: .9rem; }
.job-card .what { font-weight: 600; margin-top: 4px; }
.job-card .sym { color: #475569; font-size: .86rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-card .meta { color: var(--muted); font-size: .78rem; margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.u-shutdown { border-left-color: #dc2626; } .u-emergency { border-left-color: #f97316; } .u-urgent { border-left-color: #f59e0b; }
.u-normal { border-left-color: #94a3b8; } .u-no_sla { border-left-color: #e2e8f0; }
.sla-late { color: #dc2626; font-weight: 600; } .sla-ok { color: #475569; }

.tabs-x { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs-x a { flex: 1 0 auto; text-align: center; padding: 10px 12px; color: var(--muted); font-size: .86rem; font-weight: 500; border-bottom: 2px solid transparent; position: relative; white-space: nowrap; }
.tabs-x a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs-x .cnt { background: #dc2626; color: #fff; font-size: .66rem; border-radius: 9px; padding: 0 6px; margin-left: 4px; }
.tabs-x .cnt-muted { background: #e2e8f0; color: #475569; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-action { border-radius: 14px; padding: 16px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; font-weight: 700; color: var(--text); background: #fff; border: 1px solid var(--line); }
.big-action i { font-size: 1.6rem; color: var(--primary); }
.big-action.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.big-action.primary i { color: #fff; }

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; border-top: 3px solid #cbd5e1; color: var(--text); display: block; }
.stat:hover { box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.stat .lbl { font-size: .8rem; font-weight: 600; }
.stat .num { font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.stat .go { font-size: .74rem; color: var(--muted); }
.st-amber { border-top-color: #f59e0b; } .st-rose { border-top-color: #e11d48; } .st-blue { border-top-color: #2563eb; }
.st-violet { border-top-color: #7c3aed; } .st-teal { border-top-color: #0d9488; } .st-orange { border-top-color: #ea580c; } .st-green { border-top-color: #16a34a; }
.kpi .num { font-size: 1.9rem; font-weight: 700; }
.kpi .unit { font-size: .9rem; color: var(--muted); font-weight: 500; }
.bar { height: 7px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #1d4ed8; border-radius: 6px; }
.bar.green > span { background: #16a34a; }

/* ตาราง */
.table-x { width: 100%; font-size: .87rem; }
.table-x th { color: var(--muted); font-weight: 600; font-size: .78rem; background: #f8fafc; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-x td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table-x tr.click { cursor: pointer; }
.table-x tr.click:hover td { background: #f8fafc; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-wrap .table-responsive { margin: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 140px; padding: .45rem .7rem; font-size: .87rem; }
.chip-check { display: inline-flex; }
.chip-check input { display: none; }
.chip-check span { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .8rem; cursor: pointer; }
.chip-check input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ขั้นตอนงาน 5 ขั้น */
.stepper { display: flex; gap: 6px; margin-top: 12px; }
.stepper .s { flex: 1; font-size: .74rem; color: var(--muted); }
.stepper .s::before { content: ''; display: block; height: 5px; border-radius: 4px; background: #e2e8f0; margin-bottom: 5px; }
.stepper .s.done::before { background: #1d4ed8; }
.stepper .s.cur { color: var(--primary); font-weight: 700; }
.stepper .s.cur::before { background: #1d4ed8; }
.stepper .s.bad::before { background: #dc2626; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 112px 1fr; } }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-stage { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.media-stage h6 { font-size: .8rem; font-weight: 700; display: flex; justify-content: space-between; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; border-radius: 8px; background: #e2e8f0 center/cover no-repeat; display: grid; place-items: center; color: #475569; font-size: 1.2rem; border: 1px solid var(--line); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: .86rem; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #1d4ed8; }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline li:last-child::after { display: none; }
.timeline time { color: var(--muted); font-size: .75rem; display: block; }

.action-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 16px -24px -40px; z-index: 5; }
@media (max-width: 991.98px) { .action-bar { position: fixed; left: 0; right: 0; bottom: 58px; margin: 0; padding: 10px 14px; box-shadow: 0 -4px 12px rgba(15,23,42,.06); } .has-action-bar { padding-bottom: 170px; } }
.action-bar .btn { flex: 0 0 auto; }
@media (max-width: 575.98px) { .action-bar .btn { flex: 1 1 auto; } }

.urg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.urg-opt input { display: none; }
.urg-opt span { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: #fff; }
.urg-opt span b { display: block; font-size: .88rem; }
.urg-opt span small { color: var(--muted); }
.urg-opt input:checked + span { border-color: #1d4ed8; background: #eff4ff; box-shadow: 0 0 0 2px rgba(29,78,216,.15); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #e2e8f0; border-radius: 10px; padding: 3px; }
.seg input { display: none; }
.seg label { text-align: center; padding: 7px; border-radius: 8px; font-weight: 600; font-size: .88rem; cursor: pointer; color: #475569; }
.seg input:checked + label { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.stars { display: flex; gap: 6px; font-size: 1.8rem; color: #cbd5e1; }
.stars input { display: none; }
.stars label { cursor: pointer; }
.stars label.on { color: #f59e0b; }
.sig-pad { border: 1.5px dashed #94a3b8; border-radius: 10px; background: #fff; width: 100%; height: 160px; touch-action: none; display: block; }

.pf-btns { display: inline-flex; gap: 4px; }
.pf-btns input { display: none; }
.pf-btns label { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.pf-btns input:checked + label.pass { background: #16a34a; color: #fff; border-color: #16a34a; }
.pf-btns input:checked + label.fail { background: #dc2626; color: #fff; border-color: #dc2626; }
.pf-btns input:checked + label.na { background: #475569; color: #fff; border-color: #475569; }
.check-item { border-bottom: 1px solid #f1f5f9; padding: 12px 0; }

.fab { position: fixed; right: 18px; bottom: 76px; z-index: 1025; border-radius: 999px; padding: 11px 18px; box-shadow: 0 8px 20px rgba(29,78,216,.35); }
@media (min-width: 992px) { .fab { bottom: 24px; } }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: .9rem; }
.empty i { font-size: 1.8rem; display: block; margin-bottom: 6px; color: #94a3b8; }

/* การ์ดตั้งค่ามือถือ (ติดตั้งแอป + แจ้งเตือน) */
.device-setup { border-color: #bfdbfe; background: #f5f8ff; }
.ds-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #dbe6fe; }
.ds-row:first-of-type { border-top: 0; }
.ds-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.ds-row.done .ds-num { background: #16a34a; }
.ds-row.blocked .ds-num { background: #f59e0b; }
.ds-row.off .ds-num { background: #94a3b8; }
.ds-body { flex: 1; min-width: 0; }
.ds-title { font-weight: 600; }
.ds-action { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 420px) { .ds-row { flex-wrap: wrap; } .ds-action { flex: 1 0 100%; padding-left: 40px; justify-content: flex-start; } }
.ds-steps { padding-left: 1.2rem; }
.ds-steps li { margin-bottom: 10px; }
.ds-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #e2e8f0; color: var(--primary); vertical-align: middle; }

/* auth — มือถือ: คอลัมน์เดียวเต็มจอ ; จอกว้าง: แผงแบรนด์ซ้าย + การ์ดฟอร์มขวา */
.auth-body { background: var(--bg); }
.auth-split { min-height: 100vh; display: flex; }
.auth-side { display: none; }
.auth-main { flex: 1; display: flex; justify-content: center; }
.auth-wrap { width: 100%; max-width: 480px; min-height: 100vh; background: var(--bg); }
@media (min-width: 768px) {
  .auth-main { align-items: center; padding: 40px 24px; }
  .auth-wrap { min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(15,23,42,.10); }
  .auth-wrap .auth-form { padding: 28px 32px 32px; }
  .auth-wrap .auth-head { padding: 18px 24px; }
}
@media (min-width: 992px) {
  .auth-side { display: flex; flex-direction: column; justify-content: space-between; width: 44%; max-width: 620px; flex: 0 0 auto;
    background: radial-gradient(circle at 20% 10%, #24344a 0, transparent 55%), var(--navy); color: #fff; padding: 56px 56px 32px; position: sticky; top: 0; height: 100vh; }
  .auth-side-inner { margin: auto 0; max-width: 460px; }
  .auth-side .brand-icon { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; margin-bottom: 24px; }
  .auth-side h1 { font-size: 2rem; font-weight: 700; margin-bottom: 6px; }
  .auth-side .lead { color: #94a3b8; font-size: 1.05rem; margin-bottom: 36px; }
  .auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
  .auth-points li { display: flex; gap: 14px; align-items: flex-start; }
  .auth-points i { flex: 0 0 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 1.15rem; color: #93b4ff; }
  .auth-points b { display: block; font-size: .98rem; }
  .auth-points span { color: #94a3b8; font-size: .88rem; }
  .auth-side-foot { color: #64748b; font-size: .8rem; }
  .auth-hero-mobile { display: none; }
  .auth-desktop-title { display: block !important; }
}
.auth-desktop-title { display: none; padding: 32px 32px 0; }
.auth-desktop-title h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.auth-desktop-title p { color: var(--muted); margin: 0; }
.auth-hero { background: var(--navy); color: #fff; padding: 44px 24px 26px; }
.auth-hero .brand-icon { width: 48px; height: 48px; font-size: 1.4rem; border-radius: 12px; margin-bottom: 16px; }
.auth-hero h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.auth-hero p { color: #94a3b8; margin: 4px 0 0; }
.auth-form { padding: 22px 24px; }
.auth-head { background: #fff; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 1.05rem; }
.auth-head a { color: var(--text); }
.info-box { background: #dbeafe; color: #1e3a8a; border-radius: 10px; padding: 10px 12px; font-size: .85rem; }

.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.qr-label { border: 1px dashed #94a3b8; border-radius: 10px; padding: 10px; text-align: center; background: #fff; page-break-inside: avoid; }
.qr-label .code { font-weight: 700; font-size: 1rem; }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .fab { display: none !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; }
}

/* ---------- คลังอะไหล่ ---------- */
.fpill { display: inline-block; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #334155; font-size: .84rem; font-weight: 500; }
.fpill:hover { border-color: #94a3b8; }
.fpill.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.part-thumb { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #f1f5f9 center/cover no-repeat; color: #64748b; flex: none; vertical-align: middle; }
.part-thumb i { font-size: 1.1rem; }
.mchip { display: inline-flex; align-items: center; gap: 2px; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; font-size: .84rem; }
.mchip a { color: #334155; }
.mchip.top { background: #ffedd5; color: #c2410c; font-weight: 600; }
.mchip.top a { color: #c2410c; }
.wd-card { border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; overflow: hidden; background: #fff; }
.wd-card.is-pending { border-color: #fcd34d; }
.wd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: #f8fafc; }
.wd-doc { font-size: 1rem; }
.wd-sub { padding: 6px 14px; font-size: .86rem; color: #334155; }
.wd-table { margin: 0; }
.wd-table th, .wd-table td { font-size: .86rem; }
.wd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.rt-card { margin: 10px 14px 12px; border: 1px solid #99f6e4; border-radius: 10px; padding: 0 10px 8px; }
.rt-card .wd-head { background: transparent; padding: 8px 0; }
.wd-list { display: flex; flex-direction: column; }
.wd-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wd-row.on .wd-name b { color: var(--primary); }
.wd-name { flex: 1; min-width: 0; }
.stepper-q { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper-q .btn { width: 44px; height: 44px; font-size: 1.2rem; padding: 0; border: 1px solid var(--line); }
.stepper-q input { width: 56px; text-align: center; border: 0; font-weight: 700; font-size: 1.1rem; background: transparent; -moz-appearance: textfield; }
.stepper-q input::-webkit-outer-spin-button, .stepper-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wd-hit { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 9px 4px; font-size: .9rem; }
.wd-hit:hover { background: #f8fafc; }
.wd-hit i { color: var(--primary); font-size: 1.2rem; }
.stock-card { border: 2px solid #bfdbfe; }
.stat .num.sm { font-size: 1.1rem; }
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.inv-grid a { border-radius: 12px; padding: 12px 8px; text-align: center; color: var(--text); }
.inv-grid .n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.inv-grid .l { font-size: .76rem; color: #475569; margin-top: 4px; }
@media (max-width: 575px) { .inv-grid { grid-template-columns: repeat(2, 1fr); } }
.side-badge { margin-left: auto; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.wd-table td:first-child { min-width: 140px; }
