/* O&K Maintenance — สไตล์หน้าเว็บ + เอกสารพิมพ์ */
:root {
  --ink: #0f2a3f; --ink-2: #3d5a70; --muted: #6a8396; --line: #d6e3ec; --line-2: #e8f0f5;
  --bg: #f1f6f9; --card: #fff; --blue: #0a6bb8; --blue-d: #064f8c; --blue-l: #e6f2fb; --cyan: #7fe0ff;
  --navy: #071e30; --navy-2: #0e3550;
  --ok: #1d7a4f; --ok-l: #e1f4ea; --warn: #b4441b; --warn-l: #fdece4; --amber: #9a6a00; --amber-l: #fdf3d8; --violet: #5b3fb0; --violet-l: #eeeafc;
  --r: 14px; --shadow: 0 1px 2px #0f2a3f0d, 0 6px 20px -12px #0f2a3f40;
  --font: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.6 var(--font); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: clamp(24px, 3vw, 30px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 14.5px; color: var(--ink-2); }
p { margin: 0 0 .7em; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.sub { color: var(--muted); font-size: 14px; }
.warn { color: var(--warn) !important; }
.ok { color: var(--ok) !important; }
.pre { white-space: pre-wrap; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 15px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s; touch-action: manipulation; }
.btn:hover { border-color: #8bbadb; background: #f4f9fd; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-d); }
.btn.primary:hover { background: var(--blue-d); }
.btn.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger-t { color: var(--warn); }
.btn.light { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.btn.ghost { background: transparent; border-color: #ffffff55; color: #fff; }
.btn.ghost:hover { background: #ffffff14; }
.btn.sm { padding: 5px 10px; font-size: 13.5px; border-radius: 8px; }
.btn.big { padding: 12px 22px; font-size: 16.5px; }
.btn.icon { padding: 7px; }
.btn.sm.icon { padding: 5px 7px; }
.link { font-size: 14px; font-weight: 600; }

/* ---------- ฟอร์ม ---------- */
label { display: grid; gap: 4px; font-weight: 600; color: var(--ink-2); font-size: 14px; align-content: start; }
label > span { display: flex; align-items: center; gap: 6px; }
input, select, textarea { width: 100%; border: 1px solid #c3d4e0; background: #fff; border-radius: 9px; padding: 9px 11px; font-weight: 400; color: var(--ink); min-height: 42px; }
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .zone:focus { outline: 2px solid #59b4ef; outline-offset: 1px; }
.req { color: var(--warn); font-style: normal; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.fields.f4 { grid-template-columns: repeat(4, 1fr); }
.fields + .fields { margin-top: 12px; }
.wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 14px; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); }
.chk-list { display: grid; gap: 6px; margin-bottom: 10px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset .btn.primary { margin-top: 16px; }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--blue); margin-bottom: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 14px; }
.filters .grow { flex: 1 1 260px; }
.filters label:not(.grow):not(.chk) { flex: 0 1 190px; }
.filters .chk { padding-bottom: 10px; }
label.inline { display: inline-grid; margin-bottom: 10px; }
.quick { display: flex; gap: 6px; padding-bottom: 6px; }
.narrow-f { max-width: 420px; }

/* ---------- การ์ด / ตาราง ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; min-width: 0; }
.panel.narrow { max-width: 560px; margin: 4vh auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.panel.info p { margin: 4px 0 0; color: var(--ink-2); }
.panel.info h4 { text-transform: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 > .panel, .grid3 > .panel { margin-bottom: 0; }
.grid2, .grid3 { margin-bottom: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.page-head .sub { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); background: #f5f9fb; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl td small { display: block; color: var(--muted); font-size: 12.5px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6fafd; }
.tbl tr.voided td { color: var(--muted); text-decoration: line-through; }
.tbl tr.voided td:last-child, .tbl tr.voided td:nth-last-child(2) { text-decoration: none; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .clip { max-width: 260px; }
.tbl .row-act { text-align: right; white-space: nowrap; }
.tbl .row-act .btn + .btn { margin-left: 4px; }
.empty { padding: 22px; color: var(--muted); text-align: center; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--blue-l); color: var(--blue-d); white-space: nowrap; }
.badge.new { background: var(--violet-l); color: var(--violet); }
.badge.wait { background: var(--amber-l); color: var(--amber); }
.badge.work { background: var(--blue-l); color: var(--blue-d); }
.badge.ready { background: #d9f6ff; color: #075f7d; }
.badge.done { background: var(--ok-l); color: var(--ok); }
.badge.void { background: #eceff2; color: #6b7680; }
.chip { display: inline-block; background: var(--line-2); border-radius: 8px; padding: 2px 9px; font-size: 13px; margin: 2px 4px 2px 0; }
.chip.warn { background: var(--warn-l); }
.tag { font-size: 12px; background: var(--ok-l); color: var(--ok); padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.kind { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); margin-right: 4px; }
.kind.part { background: var(--blue-l); color: var(--blue-d); }
.kind.outside { background: var(--amber-l); color: var(--amber); }
.alert { background: var(--warn-l); border: 1px solid #f3c8b5; color: #7d2e10; padding: 12px 14px; border-radius: 10px; margin: 10px 0; }
.alert.info { background: var(--blue-l); border-color: #bcdcf3; color: var(--blue-d); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 5px; margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.tabs button.active { background: var(--blue-l); color: var(--blue-d); }

/* ---------- เมตริก / บอร์ด ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.metric small { display: block; color: var(--muted); font-weight: 600; }
.metric b { display: block; font-size: 30px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric span { font-size: 13px; color: var(--muted); }
.metric.accent { background: linear-gradient(140deg, var(--navy-2), var(--navy)); border-color: var(--navy); }
.metric.accent small, .metric.accent span { color: #a9d8ee; }
.metric.accent b { color: #fff; }
.board { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.board .col { background: #f5f9fb; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px; min-height: 120px; }
.col-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; color: var(--muted); }
.col-empty { color: #b0c0cc; text-align: center; padding: 14px; }
.kcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; color: var(--ink); font-size: 14px; text-decoration: none !important; }
.kcard:hover { border-color: #8bbadb; }
.kcard.late { border-left: 4px solid var(--warn); }
.kcard small { display: block; color: var(--muted); font-size: 12.5px; }
.kcard .due { color: var(--ink-2); }
.kcard.late .due { color: var(--warn); font-weight: 600; }
.kc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.kc-top small { font-size: 11.5px; }

/* ---------- ใบงาน ---------- */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 7px 11px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.step i { font-style: normal; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line-2); font-size: 12.5px; }
.step:hover { background: #f4f9fd; }
.step.done { color: var(--ok); }
.step.done i { background: var(--ok-l); }
.step.now { background: var(--blue); color: #fff; }
.step.now i { background: #ffffff33; }
.stepper .danger-t { margin-left: auto; }
.insp-sum { margin: 6px 0; }
.sum { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.disc { display: flex; gap: 8px; align-items: end; }
.disc label { width: 150px; }
.sum-t { border-collapse: collapse; min-width: 260px; margin-left: auto; font-variant-numeric: tabular-nums; }
.sum-t th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 3px 14px 3px 0; }
.sum-t td { text-align: right; padding: 3px 0; }
.sum-t .grand th, .sum-t .grand td { font-weight: 800; font-size: 17px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 7px; }
.sum-t .due td, .sum-t .due th { color: var(--warn); font-weight: 700; }
.sum-t .ok td, .sum-t .ok th { color: var(--ok); }
.doc-actions { display: grid; gap: 7px; margin-bottom: 14px; }
.doc-actions .btn { justify-content: flex-start; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.doc-list li small { display: block; color: var(--muted); }
.doc-list li > div:last-child { display: flex; gap: 4px; flex: none; }
.doc-list li.voided > div:first-child { text-decoration: line-through; color: var(--muted); }
.finder .finds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 10px; }
.find { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #f8fbfd; border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.find:hover { border-color: var(--blue); background: var(--blue-l); }
.find small { display: block; color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; align-items: center; gap: 16px; background: #ffffffee; backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; box-shadow: 0 -6px 20px -14px #0f2a3f55; }
.insp { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 22px; }
.checks { display: grid; gap: 4px; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; padding: 3px 0; border-bottom: 1px dashed var(--line-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: block; padding: 3px 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg label + label span { border-left: 1px solid var(--line); }
.seg .ok input:checked + span { background: var(--ok-l); color: var(--ok); }
.seg .bad input:checked + span { background: var(--warn-l); color: var(--warn); }
.seg .na input:checked + span { background: var(--line-2); color: var(--ink-2); }
.seg input:focus-visible + span { outline: 2px solid #59b4ef; }
.car-wrap { max-width: 190px; margin: 0 auto 6px; }
.car-svg { width: 100%; height: auto; display: block; }
.car-body { fill: #f3f7fa; stroke: #9db3c4; stroke-width: 2; }
.zone { fill: #fff; stroke: #b9cbd8; stroke-width: 1.2; }
.car-svg.interactive .zone { cursor: pointer; }
.car-svg.interactive .zone:hover { fill: #eaf5fd; }
.zone.on { fill: #ffd9c9; stroke: var(--warn); }
.zone-x { fill: var(--warn); font-size: 15px; font-weight: 700; pointer-events: none; }
.car-lbl { font-size: 11px; fill: #6a8396; font-family: var(--font); }
.zone-list { text-align: center; margin-bottom: 8px; font-size: 13px; }

/* ---------- Dialog / Toast ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--ink); box-shadow: 0 24px 60px -20px #071e3088; }
dialog.wide { width: min(940px, calc(100vw - 24px)); }
dialog::backdrop { background: #071e3080; backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-head h2 { font-size: 18px; margin: 0; }
.dlg-x { border: 0; background: var(--line-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; flex: none; }
.dlg-body { padding: 18px 20px 20px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg-sum { background: var(--blue-l); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: grid; }
.dlg-sum b { font-size: 24px; color: var(--blue-d); }
.dlg-sum small { color: var(--ink-2); }
select[size] { min-height: 150px; padding: 4px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 12px; z-index: 50; font-weight: 600; box-shadow: 0 10px 30px -10px #000a; transition: .25s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.t-err { background: var(--warn); }

/* ---------- หน้าเว็บสาธารณะ ---------- */
.wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 36px; flex: none; background: linear-gradient(150deg, #169ae7, #034a89); color: #fff; border-radius: 6px 13px 6px 13px; font: italic 800 17px/1 Arial, sans-serif; letter-spacing: -1px; white-space: nowrap; box-shadow: inset 0 -3px #04406f; }
.mark span { color: var(--cyan); margin: 0 1px; }
.brand-t { display: grid; line-height: 1.15; }
.brand-t b { font-size: 18px; letter-spacing: -.2px; }
.brand-t small { font-size: 12.5px; color: var(--muted); }
.pubnav { display: flex; align-items: center; gap: 4px; }
.pubnav a:not(.btn) { color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 9px; text-decoration: none; }
.pubnav a:not(.btn):hover, .pubnav a.active { background: var(--blue-l); color: var(--blue-d); }
.pubnav .btn { margin-left: 8px; }
.menu-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; cursor: pointer; }
.pub-main { padding: 26px 0 40px; }
.hero { display: grid; grid-template-columns: 1fr 1fr; background: var(--navy); border-radius: 24px; overflow: hidden; color: #fff; position: relative; isolation: isolate; box-shadow: 0 20px 40px -20px #0b2c4599; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 10% 100%, #135a80 0, transparent 55%), linear-gradient(135deg, #10394f, #061a2a 70%); }
.hero-text { padding: clamp(28px, 5vw, 64px); align-self: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #b5edfc; font-weight: 600; font-size: 14px; letter-spacing: .3px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: #55dcfa; }
.eyebrow.dark { color: var(--blue); }
.eyebrow.dark::before { background: var(--blue); }
.hero h1 { font-size: clamp(40px, 5.6vw, 74px); line-height: 1.02; margin: 18px 0 6px; letter-spacing: -1.5px; font-family: "Arial", var(--font); font-weight: 800; }
.hero h1 .hl { color: var(--cyan); font-style: italic; letter-spacing: -3px; }
.hero-th { font-size: clamp(18px, 2vw, 24px); font-weight: 700; color: #d7f3ff; margin-bottom: 10px; }
.hero p { color: #c8e3f2; font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 18px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: #a9d8ee; font-size: 14px; }
.hero-img { margin: 0; position: relative; min-height: 340px; }
.hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #071e30 0, transparent 22%); }
.track-strip { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; margin: -28px 24px 0; position: relative; box-shadow: var(--shadow); }
.track-strip h2 { margin: 0; font-size: 20px; }
.track-strip p { margin: 0; color: var(--muted); font-size: 14px; }
.track-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.track-form label:first-child { width: 200px; }
.track-form label:nth-child(2) { width: 140px; }
.panel .track-form { margin-bottom: 8px; }
.sec { margin-top: 48px; }
.sec-head { margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 6px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); border-top: 3px solid #73cce4; }
.svc h3 { margin: 14px 0 6px; }
.svc p { color: var(--muted); margin: 0; font-size: 14.5px; }
.svc-ic { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--navy-2); color: var(--cyan); }
.svc-ic .ic { width: 24px; height: 24px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; }
.steps li b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; margin-bottom: 10px; }
.steps p { color: var(--muted); margin: 0; font-size: 14.5px; }
.contact-band { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 48px; padding: 28px 32px; border-radius: 20px; color: #fff; background: linear-gradient(120deg, var(--navy-2), var(--navy)); }
.contact-band h2 { margin: 0 0 4px; }
.contact-band p { margin: 0; color: #a9d8ee; }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.note-panel h3 { display: flex; align-items: center; gap: 8px; }
.ticks { padding-left: 20px; color: var(--ink-2); }
.login h1 { margin: 6px 0 14px; }
.track-res { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 16px; }
.track-top { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.track-top small { display: block; color: var(--muted); }
.progress { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 0; }
.progress li { position: relative; padding: 6px 0 6px 32px; color: var(--muted); font-weight: 600; }
.progress li::before { content: ""; position: absolute; left: 6px; top: 10px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.progress li::after { content: ""; position: absolute; left: 13px; top: 26px; bottom: -10px; width: 2px; background: var(--line); }
.progress li:last-child::after { display: none; }
.progress li.done { color: var(--ok); }
.progress li.done::before { background: var(--ok); border-color: var(--ok); }
.progress li.now { color: var(--blue-d); }
.progress li.now::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-l); }
.footer { background: var(--navy); color: #c8e3f2; margin-top: 40px; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding: 36px 0 20px; }
.footer .brand { color: #fff; margin-bottom: 10px; }
.footer .brand-t small { color: #8fbfd8; }
.footer h4 { color: #fff; }
.footer p { font-size: 14px; }
.copyright { border-top: 1px solid #ffffff1a; padding: 14px 0 22px; font-size: 13px; color: #7fa7bf; }

/* ---------- ระบบพนักงาน ---------- */
.staff { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #c8e3f2; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 0 6px; }
.side .brand-t small { color: #8fbfd8; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; color: #b4d3e4; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: #ffffff10; color: #fff; }
.side-nav a.active { background: var(--blue); color: #fff; }
.side-user { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #ffffff1a; padding: 14px 6px 0; }
.side-user small { display: block; color: #8fbfd8; }
.side-user .btn { background: transparent; border-color: #ffffff30; color: #fff; }
.staff-main { min-width: 0; }
.staff-body { padding: 22px clamp(14px, 3vw, 32px) 60px; max-width: 1400px; }
.demo-bar { background: var(--amber-l); color: var(--amber); font-size: 13.5px; font-weight: 600; text-align: center; padding: 7px 14px; border-bottom: 1px solid #f2dc9c; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .insp { grid-template-columns: 1fr 1fr; }
  .insp > div:first-child { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(5, 200px); }
}
@media (max-width: 900px) {
  .staff { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; }
  .side .brand-t { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: 2px; flex: 1; scrollbar-width: none; }
  .side-nav a { flex-direction: column; gap: 2px; padding: 6px 9px; font-size: 11.5px; white-space: nowrap; }
  .side-user { margin: 0; border: 0; padding: 0; }
  .side-user > div { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr; }
  .fields.f4 { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-img { min-height: 260px; order: -1; }
  .hero-img::after { background: linear-gradient(0deg, #071e30 0, transparent 30%); }
  .track-strip { margin: 16px 0 0; }
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: block; }
  .pubnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px -20px #0005; }
  .menu-open .pubnav { display: flex; }
  .pubnav .btn { margin: 8px 0 0; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .grid2, .fields, .fields.f4, .svc-grid, .steps, .insp { grid-template-columns: 1fr; }
  .panel { padding: 15px; }
  .metric b { font-size: 24px; }
  .track-form, .track-form label { width: 100% !important; }
  .track-form .btn { width: 100%; }
  .sticky-actions { flex-direction: column; align-items: stretch; }
  .tbl { font-size: 13.5px; }
  .contact-band { padding: 22px; }
}

/* ============================================================
   เอกสารพิมพ์ A4
   ============================================================ */
#print { display: none; }
@page { size: A4; margin: 10mm 11mm; }
@media print {
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
}
.sheet { font-family: "Sarabun", "TH Sarabun New", Tahoma, sans-serif; font-size: 10.5pt; line-height: 1.45; color: #000; position: relative; break-after: page; page-break-after: always; }
.sheet:last-child { break-after: auto; page-break-after: auto; }
.sheet h1, .sheet h4 { color: #000; }
.d-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #0a3d66; padding-bottom: 8px; margin-bottom: 8px; }
.d-shop { display: flex; gap: 10px; }
.d-logo { white-space: nowrap; flex: none; width: 58px; height: 40px; display: flex; align-items: center; justify-content: center; background: #0a5a9c; color: #fff; border-radius: 5px 12px 5px 12px; font: italic 800 17px/1 Arial, sans-serif; letter-spacing: -1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-logo span { color: #9ee6ff; }
.d-shopname { font-size: 15pt; font-weight: 700; line-height: 1.2; }
.d-shopen { font-size: 10pt; font-weight: 600; color: #333; }
.d-small { font-size: 9pt; color: #333; }
.d-title { text-align: right; flex: none; max-width: 48%; }
.d-title h1 { font-size: 16pt; margin: 0; line-height: 1.2; }
.d-en { font-size: 8.5pt; letter-spacing: 1.5px; color: #444; }
.d-copy { display: inline-block; margin-top: 4px; border: 1px solid #000; padding: 1px 10px; font-size: 9pt; font-weight: 700; }
.d-meta { margin-left: auto; border-collapse: collapse; font-size: 10pt; margin-bottom: 8px; }
.d-meta th { text-align: left; font-weight: 600; padding: 1px 12px 1px 0; color: #333; }
.d-meta td { padding: 1px 0; text-align: right; }
.d-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.d-box { border: 1px solid #777; border-radius: 6px; padding: 6px 10px; font-size: 10pt; }
.d-box h4, .d-insp h4, .d-h { font-size: 10pt; margin: 0 0 3px; text-decoration: underline; text-underline-offset: 2px; }
.d-h { margin-top: 8px; }
.d-grid4 { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #777; border-radius: 6px; margin-bottom: 8px; }
.d-grid4 > div { padding: 4px 10px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; }
.d-grid4 small { display: block; font-size: 8.5pt; color: #444; }
.d-grid4 b { font-size: 10.5pt; }
.d-fuel { display: inline-flex; border: 1px solid #555; }
.d-fuel i { font-style: normal; font-size: 8pt; padding: 0 5px; border-right: 1px solid #999; }
.d-fuel i:last-child { border-right: 0; }
.d-fuel i.on { background: #333; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-note { border: 1px solid #999; border-radius: 6px; padding: 5px 10px; margin-bottom: 8px; font-size: 9.5pt; }
.d-note.big { min-height: 52px; font-size: 10.5pt; }
.d-note > b { display: block; font-size: 9.5pt; }
.d-blank-lines { height: 60px; background: repeating-linear-gradient(transparent 0 19px, #bbb 19px 20px); }
.d-insp { display: grid; grid-template-columns: 1.1fr .9fr 1fr; gap: 12px; margin-bottom: 8px; }
.d-insp ul { margin: 0; padding-left: 18px; font-size: 10pt; }
.d-insp .car-svg { height: 200px; width: auto; display: block; margin: 0 auto; }
.d-check { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.d-check td { border-bottom: 1px dotted #aaa; padding: 1px 2px; }
.sheet .zone.on { fill: #ffb99c; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-items { width: 100%; border-collapse: collapse; font-size: 10pt; margin-bottom: 6px; }
.d-items th { background: #e9eef2; border: 1px solid #777; padding: 4px 6px; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-items td { border-left: 1px solid #777; border-right: 1px solid #777; padding: 3px 6px; vertical-align: top; }
.d-items tbody tr:last-child td { border-bottom: 1px solid #777; }
.d-items tfoot th { border: 1px solid #777; padding: 4px 6px; }
.d-items tr.blank td { height: 22px; }
.d-items .c { text-align: center; }
.d-items .r, .d-items td.r { text-align: right; font-variant-numeric: tabular-nums; }
.d-kind { font-size: 8pt; border: 1px solid #999; border-radius: 3px; padding: 0 4px; margin-left: 6px; color: #444; }
.d-total { display: grid; grid-template-columns: 1fr 260px; gap: 12px; margin-bottom: 8px; break-inside: avoid; }
.d-wordbox { border: 1px solid #777; background: #f3f5f7; padding: 5px 10px; text-align: center; font-weight: 700; margin-bottom: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-total table { border-collapse: collapse; width: 100%; font-size: 10pt; }
.d-total th { text-align: left; font-weight: 500; padding: 2px 6px; border-bottom: 1px dotted #aaa; }
.d-total td { text-align: right; padding: 2px 6px; border-bottom: 1px dotted #aaa; font-variant-numeric: tabular-nums; }
.d-total tr.grand th, .d-total tr.grand td { border: 1px solid #000; font-weight: 700; font-size: 11pt; background: #e9eef2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-pay { font-size: 9.5pt; border: 1px solid #999; border-radius: 6px; padding: 5px 10px; }
.d-thanks { text-align: center; font-weight: 600; margin: 4px 0; }
.d-signs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 24px; margin-top: 26px; text-align: center; font-size: 10pt; break-inside: avoid; }
.d-line { border-bottom: 1px dotted #000; height: 30px; margin: 0 14px 4px; }
.void-mark { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-size: 90pt; font-weight: 800; color: #d33a; border: 8px solid #d33a; padding: 0 30px; border-radius: 20px; pointer-events: none; z-index: 2; }
.sheet.report .d-grid4 { grid-template-columns: repeat(4, 1fr); }

/* สิทธิ์ผู้ใช้ */
.perm-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.perm-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 12px; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 10px; }
.perm { align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.perm input { margin-top: 3px; }
.perm small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.perm b { color: var(--ink); }
.step:disabled { cursor: default; }
.step:disabled:hover { background: transparent; }
.step.now:disabled:hover { background: var(--blue); }
@media (max-width: 620px) { .perm-list { grid-template-columns: 1fr; } }

.staff-link { float: right; color: #7fa7bf; font-size: 12.5px; }
.staff-link:hover { color: #fff; }
