/* ระบบเอกสาร สอ.ครูมัธยมนครพนม — ออกแบบสำหรับมือถือก่อน ตัวอักษรใหญ่ ปุ่มกดง่ายสำหรับสมาชิกทุกวัย */
@font-face { font-family: "Sarabun"; src: url("/fonts/Sarabun-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("/fonts/Sarabun-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --ink: #1B2624;
  --muted: #56665F;
  --teal: #0E5A4E;
  --teal-dark: #0B4A40;
  --teal-soft: #E5F0ED;
  --amber: #8F5A0E;
  --amber-bg: #FBF1DF;
  --amber-line: #EBCF9F;
  --green: #1E6B3A;
  --green-bg: #E3F2E8;
  --red: #9B2C2C;
  --red-bg: #FBE9E7;
  --line: #D5DFDC;
  --field: #B9CBC6;
  --bg: #F3F6F5;
  --paper: #FFFFFF;
  --desk: #E3E9E7;
  --font: "Sarabun", "Leelawadee UI", "Noto Sans Thai", "Thonburi", Tahoma, sans-serif;
  --r: 0.75rem;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: calc(17px * var(--fs, 1)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--desk); color: var(--ink); font-family: var(--font);
  line-height: 1.55; min-height: 100vh;
}
a { color: var(--teal); }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #E0A23A; outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* โครงหน้า: คอลัมน์เดียวกว้างแบบมือถือ ตรงกลางจอเมื่อเปิดบนคอมพิวเตอร์ */
.demo-ribbon { background: #FFF4D6; color: #6B4510; text-align: center; font-size: .78rem; padding: .2rem 1rem; }
.appbar, .container, .tabbar { max-width: 32rem; margin-inline: auto; }
.appbar {
  display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); flex: 1; min-width: 0; }
.logo { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.org { font-weight: 700; font-size: .85rem; line-height: 1.25; }
.org small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.fontbtn {
  border: 1px solid var(--line); background: var(--paper); border-radius: .5rem; padding: .35rem .6rem;
  font-size: .8rem; min-height: 2.75rem; cursor: pointer; white-space: nowrap;
}
.fontbtn b { font-size: 1.05rem; }
.container {
  background: var(--bg); padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh - 4rem);
}
body.staff .appbar, body.staff .container { max-width: 72rem; }
body.staff .container { padding-bottom: 3rem; }

/* แอตทริบิวต์ hidden ต้องชนะ class ที่ตั้ง display เอง (เช่น .stack-sm) ไม่อย่างนั้นของที่ซ่อนไว้จะโผล่ */
[hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .6rem; }
.narrow { max-width: 26rem; margin-inline: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid2 > * { min-width: 0; }
.push { margin-left: auto; }
.center { align-self: center; text-align: center; }
.h1 { font-size: 1.45rem; font-weight: 700; }
.h2 { font-size: 1.1rem; font-weight: 700; }
.h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .95rem; }
.ink { color: var(--ink); }
.nowrap { white-space: nowrap; }
.back { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .95rem; text-decoration: none; margin-bottom: .2rem; }
.hint { font-size: .95rem; color: var(--muted); }
.note { background: var(--teal-soft); border-radius: var(--r); padding: .7rem .9rem; font-size: .9rem; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
fieldset.card { margin: 0; min-width: 0; }
legend.h3 { padding: 0 .3rem; margin-left: -.3rem; }

/* ปุ่ม: สูงอย่างน้อย 48px ทุกปุ่ม */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-align: center;
  min-height: 3rem; padding: .55rem 1rem; border-radius: .6rem; border: 1.5px solid var(--teal);
  background: var(--paper); color: var(--teal); font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-go { background: var(--green); border-color: var(--green); color: #fff; }
.btn-stop { background: var(--red); border-color: var(--red); color: #fff; }
.btn-go:hover, .btn-stop:hover { filter: brightness(1.1); }
.intake { display: flex; gap: .4rem; flex-wrap: wrap; }
.intake form { margin: 0; }
.dialog { background: var(--paper); color: inherit; border: 0; border-radius: 12px; padding: 1.25rem; width: min(30rem, calc(100vw - 2rem)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(0,0,0,.4); }
.dialog .row-between { margin-bottom: .5rem; }
.actionbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .8rem; }
.actionbar form { margin: 0; }
.actionbar-who { flex: 1 1 100%; font-size: .95rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--line); }
.tabs a { padding: .55rem .9rem; color: var(--ink); text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 2.75rem; display: inline-flex; align-items: center; }
.tabs a[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.tabpanel[hidden] { display: none !important; }
@media print { .tabpanel[hidden] { display: block !important; } }
.btn-block { width: 100%; }
.btn-small { min-height: 2.75rem; padding: .35rem .8rem; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; color: var(--teal); text-decoration: underline; cursor: pointer; padding: .5rem .2rem; min-height: 2.75rem; font-weight: 600; }
.linkbtn.danger { color: var(--red); }

.flash { border-radius: var(--r); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .95rem; }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.flash-ok { background: var(--green-bg); color: var(--green); }
.flash-info { background: var(--teal-soft); color: var(--teal); }
.flash-error { background: var(--red-bg); color: var(--red); }
.stack > .flash { margin-bottom: 0; }

.chip { display: inline-block; border-radius: 1rem; padding: .05rem .6rem; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.chip-teal { background: var(--teal-soft); color: var(--teal); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-grey { background: #ECEFEE; color: var(--muted); }

.banner { border-radius: var(--r); padding: .75rem 1rem; border: 1px solid transparent; }
.banner b { display: block; font-size: 1.02rem; }
.banner-amber { background: var(--amber-bg); border-color: var(--amber-line); color: #6B4510; }
.banner-teal { background: var(--teal-soft); border-color: #B7D6CE; color: var(--teal); }
.banner-green { background: var(--green-bg); border-color: #B9DCC5; color: var(--green); }
.banner-red { background: var(--red-bg); border-color: #EDC3BD; color: var(--red); }

/* หน้าแรก */
.hello { display: flex; gap: .75rem; align-items: center; margin-top: .2rem; }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; flex: none; }
.name { font-weight: 700; font-size: 1.2rem; line-height: 1.3; }
.hello-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; min-height: 5.5rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: .4rem;
  font-weight: 700; color: var(--ink); text-decoration: none;
}
.tile:hover { border-color: var(--teal); }
.tile svg { width: 1.6rem; height: 1.6rem; stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sumcard { display: block; color: inherit; text-decoration: none; }
.sumcard:hover { border-color: var(--teal); }
.sumline { font-size: .92rem; margin-top: .2rem; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: .5rem 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ความช่วยเหลือ */
.help { background: var(--teal); color: #fff; border-radius: var(--r); padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.help b { display: block; }
.help span { font-size: .85rem; }
.help .tel { background: #fff; color: var(--teal); font-weight: 700; font-size: 1rem; border-radius: .5rem; padding: .35rem .8rem; min-height: 2.75rem; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }

/* แถบเมนูล่าง */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  padding: .3rem .25rem calc(.35rem + env(safe-area-inset-bottom, 0px));
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0 .1rem; min-height: 3.25rem; color: var(--muted); font-size: .85rem; text-decoration: none; font-weight: 500; }
.tab + .tab { border-left: 1px solid #EEF3F2; }
.tab svg { width: 1.45rem; height: 1.45rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--teal); font-weight: 700; }
.tab.on::before { content: ""; position: absolute; top: -.3rem; left: 28%; right: 28%; height: .2rem; border-radius: 0 0 .2rem .2rem; background: var(--teal); }

/* ลำดับขั้นยื่นเรื่อง */
.steps-text { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.steps-bar { display: flex; gap: .3rem; }
.steps-bar i { flex: 1; height: .35rem; border-radius: .2rem; background: var(--line); }
.steps-bar i.on { background: var(--teal); }
.steps-lbl { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.steps-lbl .cur { color: var(--teal); font-weight: 700; }

.choice {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem;
  color: var(--ink); text-decoration: none; min-height: 3.5rem;
}
.choice b { display: block; }
.choice span span { display: block; }
.choice::after { content: "›"; font-size: 1.5rem; color: var(--muted); }
.choice.sel { border: 2px solid var(--teal); background: var(--teal-soft); }
.choice-btn { width: 100%; text-align: left; cursor: pointer; }
.choice-btn:hover { border-color: var(--teal); }
.spinner { width: 2.5rem; height: 2.5rem; margin: 1rem auto .2rem; border-radius: 50%; border: .3rem solid var(--teal-soft); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prep { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .92rem; }

/* แบบฟอร์ม */
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field label { font-weight: 700; font-size: .92rem; }
.input {
  width: 100%; min-height: 3rem; border: 1.5px solid var(--field); border-radius: .55rem; background: var(--paper);
  padding: .5rem .75rem; font-size: 1rem;
}
textarea.input { min-height: 5rem; resize: vertical; }
.input:focus { border-color: var(--teal); outline: 3px solid rgba(14, 90, 78, .18); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input.locked { background: #EEF3F2; color: var(--muted); display: flex; align-items: center; overflow-wrap: anywhere; }
.input-lg { font-size: 1.3rem; letter-spacing: .08em; }
.inputwrap { position: relative; display: flex; align-items: center; }
.inputwrap .input { padding-right: 3.5rem; }
.inputwrap .unit { position: absolute; right: .8rem; color: var(--muted); font-size: .9rem; pointer-events: none; }
.inputwrap select.input { padding-right: 4.8rem; }
.inputwrap select + .unit { right: 2.3rem; }
.err { color: var(--red); font-size: .88rem; font-weight: 600; }
.lookup { font-size: .9rem; min-height: 1.3rem; }
.ok { color: var(--green); font-weight: 700; }
.lookup .bad { color: var(--red); font-weight: 600; }
.lookup .warn { display: block; color: var(--amber); font-size: .85rem; }
.attach { border-top: 1px solid var(--line); padding-top: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.attach:first-of-type { border-top: 0; padding-top: 0; }
.attach[hidden] { display: none; }
.filerow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .92rem; }
.filerow a { overflow-wrap: anywhere; }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pickers .btn { position: relative; }
.pickers .btn:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.picked { color: var(--teal); }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.consent input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; accent-color: var(--teal); flex: none; }

/* เอกสารให้ตรวจ หน้าตาเหมือนแบบฟอร์มกระดาษ */
.paperdoc { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(20, 40, 36, .12); padding: 1.1rem 1rem; }
.wm { position: absolute; inset: -20%; display: flex; flex-direction: column; justify-content: space-around; align-items: center; transform: rotate(-24deg); pointer-events: none; }
.wm span { font-weight: 700; font-size: 1.05rem; color: rgba(14, 90, 78, .09); white-space: nowrap; }
.paper-org { text-align: center; font-size: .8rem; color: var(--muted); }
.paper-title { text-align: center; font-size: 1.1rem; }
.paper-sub { text-align: center; font-size: .8rem; color: var(--amber); }
.paper-h { font-size: .9rem; color: var(--teal); margin-top: .8rem; }
.paper-rows { margin: .2rem 0 0; position: relative; }
.paper-rows div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem; border-bottom: 1px dotted var(--field); padding: .25rem 0; font-size: .9rem; }
.paper-rows dt { color: var(--muted); }
.paper-rows dd { margin: 0; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.checks li::before { font-weight: 700; margin-right: .4rem; }
.checks li.ok::before { content: "✓"; color: var(--green); }
.checks li.bad { color: var(--red); }
.checks li.bad::before { content: "✗"; }
.checks li.warn { color: var(--amber, #8A5A00); }
.checks li.warn::before { content: "!"; }

/* ส่งเรียบร้อย */
.done-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; padding-top: .5rem; }
.bigcheck { width: 4rem; height: 4rem; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 700; }

/* ไทม์ไลน์ */
.timeline { list-style: none; margin: .6rem 0 0; padding: 0; }
.timeline .st { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; position: relative; padding-bottom: .9rem; }
.timeline .st::before { content: ""; position: absolute; left: .72rem; top: 1.6rem; bottom: 0; width: 2px; background: var(--line); }
.timeline .st:last-child::before { display: none; }
.timeline .st:last-child { padding-bottom: 0; }
.timeline .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700; z-index: 1; }
.timeline .st-done .dot { background: var(--teal); border-color: var(--teal); }
.timeline .st-now .dot { background: var(--amber); border-color: var(--amber); }
.timeline .st-stopped .dot { background: var(--red); border-color: var(--red); }
.timeline .st b { display: block; }
.timeline .st-todo b { color: var(--muted); }
.timeline .st span { display: block; }
.glist { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.glist li { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.glist li + li { border-top: 1px solid var(--line); padding-top: .5rem; }
.glist .gname { font-weight: 600; }
.glist form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-end; width: 100%; }
.glist form .input { flex: 1; min-width: 8rem; }
.sms-preview { background: #F1F4F3; border-radius: .6rem; padding: .7rem .9rem; margin-top: .3rem; }

/* เอกสารของฉัน */
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.filters a { border: 1px solid var(--line); background: var(--paper); border-radius: 2rem; padding: .35rem .9rem; color: var(--ink); text-decoration: none; font-size: .95rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
.filters a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.doclist { list-style: none; margin: 0; padding: .2rem 1rem; }
.doclist li { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.doclist li:last-child { border-bottom: 0; }
.docicon { width: 2.1rem; height: 2.6rem; border: 1px solid var(--line); border-radius: .25rem; display: grid; place-items: end center; font-size: .6rem; font-weight: 700; color: var(--red); padding-bottom: .2rem; flex: none; }
.doctext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doctext b { font-weight: 600; overflow-wrap: anywhere; }

/* เจ้าหน้าที่ */
.staffnav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.staffnav a { font-weight: 600; text-decoration: none; padding: .4rem 0; }
.staffnav a[aria-current] { border-bottom: 3px solid var(--teal); }
.tablewrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--teal-soft); color: var(--teal); font-size: .85rem; }
.staffgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.guarantor-row + .guarantor-row { border-top: 1px solid var(--line); padding-top: .6rem; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.row-actions:empty { display: none; }
.eventlist { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.outbox { list-style: none; padding: 0; margin: 0; }
.staffme { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.staffme a { font-weight: 600; }
.formcard { max-width: 34rem; }
.rolepick { border: 0; padding: 0; margin: 0; gap: .5rem; }
.rolepick legend { font-weight: 700; font-size: .92rem; margin-bottom: .25rem; }
.radio { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.radio input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--teal); flex: none; }
.temppw { border: 2px solid var(--amber); background: var(--amber-bg); }
.pw { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .08em; background: #fff; border-radius: .4rem; padding: .4rem .8rem; align-self: flex-start; user-select: all; }
.mono { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.row-filter { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.row-filter .field { flex: 1 1 14rem; max-width: 20rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.row-filter .field.grow { flex: 3 1 16rem; max-width: none; }
.input-sm { min-height: 2.75rem; padding: .35rem .6rem; font-size: .9rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }

/* คิวงาน */
.queuetabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.queuetabs a { border: 1px solid var(--line); background: var(--paper); border-radius: 2rem; padding: .35rem .85rem; color: var(--ink); text-decoration: none; font-size: .9rem; min-height: 2.5rem; display: inline-flex; align-items: center; gap: .35rem; }
.queuetabs a[aria-current] { background: var(--teal); border-color: var(--teal); color: #fff; }
.queuetabs .count { font-weight: 700; font-variant-numeric: tabular-nums; }
.queuetabs a.hot:not([aria-current]) { border-color: var(--red); color: var(--red); }
.queue tr.late td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.queue .chip { margin: 0 .2rem .2rem 0; }

/* ตรวจไฟล์แนบ */
.filecheck { border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .4rem; }
.filecheck-ok { border-color: #B9DCC5; }
.filecheck-bad { border-color: #EDC3BD; background: var(--red-bg); }
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.filethumb { display: flex; align-items: center; justify-content: center; height: 14rem; background: var(--bg, #F2F5F4); border-radius: .4rem; overflow: hidden; text-decoration: none; }
.filethumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.filethumb:hover img { opacity: .9; }
.filethumb-doc { font-size: 1.6rem; font-weight: 700; color: var(--teal); text-align: center; line-height: 1.2; }
.reviewform { display: flex; flex-direction: column; gap: .4rem; }
.reviewbtns { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.docsreq { border: 2px solid var(--amber-line); background: var(--amber-bg); }
.moredocs { border: 2px solid var(--amber-line); }
.badfiles { margin: 0; padding-left: 1.2rem; color: var(--red); }

/* ภาพรวม */
.staff .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; }
.staff .tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .1rem; color: var(--ink); text-decoration: none; font-size: .9rem; }
.staff a.tile:hover { border-color: var(--teal); }
.tile-n { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-alert { border-color: var(--red); }
.tile-alert span:last-child { color: var(--red); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 8rem; border-bottom: 1px solid var(--line); }
.bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; }
.bar-fill { display: block; width: 100%; max-width: 2.2rem; margin: 0 auto; background: var(--teal); border-radius: 4px 4px 0 0; }
.bar:hover .bar-fill, .bar:focus .bar-fill { background: var(--teal-dark); }
.bar:hover::after, .bar:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .78rem; padding: .2rem .5rem; border-radius: .3rem; white-space: nowrap; z-index: 1; pointer-events: none; }
.bars-axis { display: flex; justify-content: space-between; }

/* ข้อความ SMS */
.var { font-family: ui-monospace, Consolas, monospace; background: var(--teal-soft); color: var(--teal); border-radius: .3rem; padding: 0 .3rem; cursor: help; }
.smsbox { background: #EEF3F2; border-radius: .6rem; padding: .6rem .8rem; overflow-wrap: anywhere; }
textarea.input { min-height: 5rem; resize: vertical; font: inherit; }

@media (max-width: 760px) {
  .staffgrid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .grid2, .pickers { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ท้ายหน้า */
.footnote { text-align: center; font-size: .85rem; margin: 1.5rem 0 0; }
.prose ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .35rem; }
.prose p { margin: 0; }

/* หน้าเข้าสู่ระบบ */
.btn-line { background: #06C755; border-color: #06C755; color: #fff; }
.btn-line:hover { background: #05a849; }
.steps-list { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .35rem; }

/* หลังบ้าน: หน้าคำขอ */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.money2 b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fixcard { border: 1px dashed var(--red); }
.badge { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 1rem; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4rem; }
@media print {
  .appbar, .staffnav, .demo-ribbon, .footnote, .noprint, .back, .flash, form.card { display: none !important; }
  body, .card { background: #fff !important; }
  .staffgrid { display: block; }
  .card { border-color: #999; break-inside: avoid; margin-bottom: .6rem; }
}

/* ================================================================
   หน้าตาแบบแอปธนาคาร (ต.ค. 2569)
   สีหลักอยู่ที่ --brand ตัวเดียว ได้โลโก้สหกรณ์แล้วเปลี่ยนที่นี่ที่เดียว
   ================================================================ */
:root {
  --brand: #0E5A4E;
  --brand-2: #138070;        /* ปลายไล่สีของการ์ดยอดเงิน */
  --brand-ink: #FFFFFF;
  --teal: var(--brand);
  --bg: #F1F5F4;
  --desk: #E4EBE9;
  --line: #DCE5E2;
  --r: 1rem;
  --shadow: 0 1px 2px rgba(15, 45, 38, .06), 0 6px 18px rgba(15, 45, 38, .07);
  --shadow-lift: 0 2px 4px rgba(15, 45, 38, .08), 0 10px 26px rgba(15, 45, 38, .12);
}

/* หัวเว็บ: สะอาด ไม่มีเส้นหนัก */
.appbar { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.logo-img { background: none; object-fit: contain; border-radius: .5rem; }
.fontbtn { border-radius: 2rem; padding-inline: .8rem; }

/* การ์ด: ไม่มีกรอบเทา ใช้เงาบาง ๆ แทน ดูสะอาดกว่า */
.card, .tile, .choice, .tablewrap { border-color: transparent; box-shadow: var(--shadow); }
.btn { border-radius: .8rem; }
.btn-primary { box-shadow: 0 4px 12px rgba(14, 90, 78, .25); }
.input { border-radius: .7rem; }
.chip { padding: .1rem .7rem; }

/* การ์ดยอดเงินบนหน้าแรก */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: var(--brand-ink); border-radius: 1.25rem; padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 10px 28px rgba(14, 90, 78, .30); position: relative; overflow: hidden;
}
.hero::after { /* วงกลมจาง ๆ ตกแต่ง */
  content: ""; position: absolute; right: -3.5rem; top: -3.5rem; width: 11rem; height: 11rem;
  border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none;
}
.hero a { color: inherit; text-decoration: none; }
.hero-top { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.hero-hi { opacity: .85; font-size: .95rem; }
.hero-name { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.hero-sub { opacity: .9; font-size: .95rem; }
.hero-avatar {
  width: 3rem; height: 3rem; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, .18); font-weight: 700; font-size: 1.3rem; position: relative; z-index: 1;
}
.hero-main { display: block; margin-top: 1rem; }
.hero-label { display: block; opacity: .85; font-size: .95rem; }
.hero-amt { display: block; font-size: 2.1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hero-amt small { font-size: 1rem; font-weight: 600; opacity: .9; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .9rem; }
.hero-row a { background: rgba(255, 255, 255, .13); border-radius: .8rem; padding: .55rem .75rem; display: flex; flex-direction: column; min-height: 2.75rem; }
.hero-row span { font-size: .9rem; opacity: .9; }
.hero-row b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* แจ้งเตือนที่ต้องทำ */
.alert { display: flex; gap: .75rem; align-items: center; border-radius: var(--r); padding: .85rem 1rem; text-decoration: none; box-shadow: var(--shadow); }
.alert b { display: block; font-size: 1.02rem; }
.alert::after { content: "›"; margin-left: auto; font-size: 1.6rem; line-height: 1; opacity: .7; }
.alert-amber { background: #FFF6E5; color: #6B4510; }
.alert-ico { width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: none; display: grid; place-items: center; background: #F2B33D; color: #fff; font-weight: 700; font-size: 1.2rem; }

/* เมนูลัด 4 ปุ่ม */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.quick a {
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; background: var(--paper); border-radius: var(--r);
  padding: .9rem; min-height: 6rem; box-shadow: var(--shadow); color: var(--ink); font-weight: 700; text-decoration: none; line-height: 1.3;
}
.quick a:hover, .quick a:focus-visible { box-shadow: var(--shadow-lift); }
.quick-ico { width: 2.6rem; height: 2.6rem; border-radius: .8rem; flex: none; display: grid; place-items: center; background: var(--teal-soft); }
.quick-ico svg { width: 1.45rem; height: 1.45rem; stroke: var(--brand); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.section-head a { font-weight: 700; text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.empty { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; display: flex; flex-direction: column; gap: .8rem; align-items: center; }

/* การ์ดเรื่อง: แถบสีด้านซ้ายบอกสถานะ ลูกศรบอกว่ากดได้ */
.sumcard { border-left: 5px solid var(--line); }
.sum-row { display: flex; align-items: center; gap: .6rem; }
.sum-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.sum-go { font-size: 1.6rem; color: var(--muted); line-height: 1; }
.sum-amber { border-left-color: #F2B33D; }
.sum-teal { border-left-color: var(--brand); }
.sum-green { border-left-color: #2E8B57; }
.sum-red { border-left-color: var(--red); }
.sum-grey { border-left-color: #B8C4C0; }
.sumcard:hover { box-shadow: var(--shadow-lift); }

/* แถบช่วยเหลือ */
.help { border-radius: var(--r); background: linear-gradient(135deg, #0B4A40, var(--brand)); box-shadow: var(--shadow); }

/* แถบเมนูล่าง: ปุ่มที่เลือกเป็นแคปซูลสี */
.tabbar { border-top: 0; box-shadow: 0 -4px 18px rgba(15, 45, 38, .08); padding-top: .4rem; }
.tab + .tab { border-left: 0; }
.tab { border-radius: 1rem; margin: 0 .15rem; }
.tab.on { background: var(--teal-soft); }
.tab.on::before { display: none; }

/* ไทม์ไลน์ขั้นตอน */
.timeline .dot { box-shadow: 0 0 0 4px var(--paper); }

@media (prefers-reduced-motion: no-preference) {
  .quick a, .sumcard, .alert { transition: box-shadow .15s ease, transform .15s ease; }
  .quick a:active, .sumcard:active, .alert:active { transform: scale(.98); }
}
@media (max-width: 340px) {
  .hero-amt { font-size: 1.8rem; }
}

/* หน้าติดตามเรื่อง: การ์ดสถานะ + แถบความคืบหน้า */
.status-hero { background: var(--paper); border-radius: 1.25rem; box-shadow: var(--shadow); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; border-top: 6px solid var(--brand); }
.status-amber { border-top-color: #F2B33D; }
.status-green { border-top-color: #2E8B57; }
.status-red { border-top-color: var(--red); }
.status-kicker { color: var(--muted); font-size: .95rem; }
.status-amt { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.status-amt small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.progress { height: .6rem; background: #E6EEEB; border-radius: 1rem; overflow: hidden; margin-top: .4rem; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 1rem; }
.status-green .progress span { background: #2E8B57; }
.status-red .progress span { background: var(--red); }
.progress-lbl { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .95rem; color: var(--muted); }
.banner { box-shadow: var(--shadow); border: 0; }

/* ชื่อสหกรณ์บนหัวเว็บ: จอแคบใช้ชื่อย่อ */
.org-short { display: none; }
@media (max-width: 30rem) {
  .org-full { display: none; }
  .org-short { display: inline; }
}

/* จุดรายงานความคืบหน้า (การ์ดสถานะ และการ์ดในหน้าติดตาม) */
.dots { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; align-items: center; }
.dots .dot { flex: 1; display: flex; align-items: center; position: relative; }
.dots .dot:last-child { flex: 0 0 auto; }
/* เส้นเชื่อมระหว่างจุด: ทึบเมื่อผ่านขั้นนั้นแล้ว */
.dots .dot:not(:last-child)::after { content: ""; flex: 1; height: 3px; margin: 0 2px; border-radius: 2px; background: #DDE6E3; }
.dots .dot-done:not(:last-child)::after { background: var(--brand); }
.dots .dot span {
  width: .95rem; height: .95rem; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid #B9C9C4; background: var(--paper); color: #fff; font-size: .6rem; font-weight: 700; line-height: 1;
}
.dots .dot-done span { background: var(--brand); border-color: var(--brand); }
.dots .dot-now span { background: #F2B33D; border-color: #F2B33D; box-shadow: 0 0 0 4px rgba(242, 179, 61, .3); }
.dots .dot-stopped span { background: var(--red); border-color: var(--red); }
/* แบบใหญ่ในการ์ดสถานะ: มีเลขขั้นในจุด */
.dots-big { margin-top: .8rem; }
.dots-big .dot span { width: min(1.9rem, 7.5vw); height: min(1.9rem, 7.5vw); font-size: .9rem; color: var(--muted); border-width: 2.5px; }
.dots-big .dot-done span, .dots-big .dot-now span, .dots-big .dot-stopped span { color: #fff; }
.dots-big .dot-now span { box-shadow: 0 0 0 5px rgba(242, 179, 61, .3); }
.dots-big .dot:not(:last-child)::after { height: 4px; }
.dots-now { display: flex; flex-direction: column; margin-top: .35rem; }
.dots-now b { font-size: 1.05rem; }
.sumcard .dots { margin: .35rem 0 .15rem; }

/* ตัวอักษรใหญ่สุด: ซ่อนคำบรรยายใต้ชื่อสหกรณ์ ให้หัวเว็บไม่สูงเกิน */
html[data-fs="3"] .org small { display: none; }

/* หน้ายอดเงิน: การ์ดเงินกู้ */
.hero-row > div { background: rgba(255, 255, 255, .13); border-radius: .8rem; padding: .55rem .75rem; display: flex; flex-direction: column; }
.loancard { display: flex; flex-direction: column; gap: .35rem; }
.loan-amt { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.loan-amt small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.loan-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--bg); border-radius: .7rem; padding: .55rem .7rem; font-size: .95rem; color: var(--muted); }
.loan-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* หน้าเข้าสู่ระบบ ส่งเรื่องสำเร็จ และข้อผิดพลาด */
.welcome { display: flex; flex-direction: column; gap: .15rem; }
.welcome .hero-name { font-size: 1.7rem; }
.welcome-list { margin: .7rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .35rem; position: relative; z-index: 1; }
.welcome-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; margin-right: .5rem; border-radius: 50%; background: rgba(255, 255, 255, .2); font-size: .8rem; font-weight: 700; }
.done-hero { background: var(--paper); border-radius: 1.25rem; box-shadow: var(--shadow); padding: 1.5rem 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; border-top: 6px solid #2E8B57; }
.bigcheck { background: #2E8B57; box-shadow: 0 0 0 8px #E3F2E8; }
.msgcard { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.5rem 1rem; }
.msg-ico { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; background: #FFF6E5; color: #B7791F; font-size: 1.6rem; font-weight: 700; box-shadow: 0 0 0 8px #FFFAF0; }

/* ขั้นตอนยื่นเรื่อง: จุด 3 ขั้นพร้อมชื่อใต้จุด */
.steps .dots-big { margin-top: 0; }
.steps .steps-lbl { font-size: .9rem; margin-top: .3rem; }
.steps .steps-lbl span:nth-child(2) { text-align: center; }
.steps .steps-lbl span:last-child { text-align: right; }

/* หน้าเอกสาร: ไอคอนไฟล์เป็นป้ายสี */
.docicon { border: 0; border-radius: .6rem; background: #FBE9E7; color: var(--red); place-items: center; padding: 0; width: 2.6rem; height: 2.6rem; font-size: .75rem; }
.filters a { box-shadow: var(--shadow); border-color: transparent; }

/* ===== หน้าเจ้าหน้าที่: เมนูด้านข้าง หัวหน้า และไอคอน ===== */
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico { width: 1.1em; height: 1.1em; }

body.staff-shell { background: var(--bg); }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.staff-main { min-width: 0; width: 100%; max-width: 82rem; padding: 1.5rem 2rem 4rem; }

/* เมนูด้านข้าง สีเขียวเข้มของสหกรณ์ หน้าที่เปิดอยู่เป็นแถบสีขาว */
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #0B3F37; color: #DCEDE8; display: flex; flex-direction: column; padding: 1rem .75rem; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .35rem .9rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
.side-brand .logo { background: #fff; color: var(--brand); }
.side-brand b { display: block; font-size: 1.05rem; line-height: 1.2; }
.side-brand small { display: block; font-size: .78rem; color: #A9CBC2; }
.side-toggle, .side-check { display: none; }
.side-nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; margin: 0; }
.side-group { display: flex; flex-direction: column; gap: .15rem; padding-top: .9rem; }
.side-title { font-size: .75rem; font-weight: 700; letter-spacing: .03em; color: #8DB7AC; padding: 0 .7rem .25rem; }
.side-link { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 2.75rem; padding: .45rem .7rem; border-radius: .65rem;
  color: inherit; text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.side-link .ico { width: 1.25rem; height: 1.25rem; opacity: .9; }
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-link:focus-visible { outline: 2px solid #F2B33D; outline-offset: 1px; }
.side-link[aria-current] { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.side-link[aria-current] .ico { opacity: 1; }
.side-link .badge { margin-left: auto; background: #F2B33D; color: #3A2A06; }
.side-me { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: .15rem; }
.side-me form { margin: 0; }
.side-who { display: flex; align-items: center; gap: .6rem; padding: .2rem .5rem .5rem; }
.side-who b { display: block; color: #fff; line-height: 1.3; }
.side-who .chip { background: rgba(255,255,255,.12); color: #DCEDE8; font-weight: 500; font-size: .75rem; }
.avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #F2B33D; color: #3A2A06; display: grid; place-items: center; font-weight: 700; flex: none; }

/* หัวหน้า: ตำแหน่งของหน้า ไอคอน ชื่อหน้า คำอธิบาย */
.pagehead { display: flex; flex-direction: column; gap: .5rem; }
.pagehead-row { display: flex; align-items: center; gap: .9rem; }
.pagehead-ico { width: 3rem; height: 3rem; border-radius: .9rem; background: var(--teal-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.pagehead-ico .ico { width: 1.6rem; height: 1.6rem; }
.pagehead-text { min-width: 0; }
.pagehead-text .h1 { margin: 0; }
.pagehead-text p { margin: .15rem 0 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .9rem; color: var(--muted); }
.crumbs a { font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { color: #A7B8B3; }

/* คิวงาน: แท็บแบ่งกลุ่ม พร้อมคำอธิบายมุมมองที่เลือก */
.staff .queuetabs { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.qgroup { display: flex; flex-direction: column; gap: .35rem; }
.qgroup-title { font-size: .78rem; font-weight: 700; color: var(--muted); }
.qgroup-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.staff .queuetabs a { box-shadow: var(--shadow); border-color: transparent; padding: .35rem .8rem; gap: .4rem; }
.staff .queuetabs a .ico { color: var(--brand); }
.staff .queuetabs a[aria-current] { background: var(--brand); color: #fff; }
.staff .queuetabs a[aria-current] .ico { color: #fff; }
.staff .queuetabs a.hot:not([aria-current]) .ico { color: var(--red); }
.staff .queuetabs .count { background: rgba(14, 90, 78, .1); border-radius: 1rem; padding: 0 .45rem; font-size: .82rem; }
.staff .queuetabs a[aria-current] .count { background: rgba(255,255,255,.2); }
.staff .queuetabs a.hot:not([aria-current]) .count { background: var(--red-bg); }
.viewhelp { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .92rem; color: var(--muted); }
.viewhelp .ico { color: var(--brand); }
.viewhelp b { color: var(--ink); }
.staff .row-filter { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: .8rem 1rem; }
.staff .table th { background: #F4F8F7; color: var(--muted); font-weight: 700; }
.staff .table tbody tr:hover td { background: #F7FAF9; }
.staff .table td { padding: .7rem .8rem; }
.staff .queue td:first-child a b { font-size: 1rem; }
.staff .empty .ico { width: 2.2rem; height: 2.2rem; color: var(--brand); }
.staff .empty p { margin: 0; color: var(--muted); }

/* หน้าเรื่อง: การ์ดสรุปด้านบน */
.rq-hero { background: var(--paper); border-radius: 1.1rem; box-shadow: var(--shadow); padding: 1rem 1.25rem 1.1rem; border-top: 5px solid var(--brand); display: flex; flex-direction: column; gap: .6rem; }
.rq-hero.rq-amber { border-top-color: #E0A030; }
.rq-hero.rq-red { border-top-color: var(--red); }
.rq-hero.rq-green { border-top-color: var(--green); }
.rq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.rq-head .toolbar { margin-top: 0; }
.rq-title { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.rq-title .h1 { margin: 0; font-size: 1.6rem; letter-spacing: .01em; }
.rq-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-weight: 600; }
.rq-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .92rem; color: var(--muted); }
.rq-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.rq-meta .ico { color: var(--brand); }
.rq-steps { max-width: 40rem; }
.rq-steps .dots-now { display: block; color: var(--muted); font-size: .95rem; }
.rq-steps .dots-now b { font-size: inherit; color: var(--amber); }

/* แถบปุ่มดำเนินการ */
.staff .actionbar { flex-direction: column; align-items: stretch; gap: .6rem; border: 0; box-shadow: var(--shadow-lift); padding: .7rem .9rem; }
.actionbar-main { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.actionbar-main .actionbar-who { flex: 1 1 auto; display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.actionbar-main .actionbar-who .ico { color: var(--brand); }
.btn-next { padding-left: 1.3rem; padding-right: 1.1rem; }
.actionbar-more { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.actionbar-danger { margin-left: auto; display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.actionbar-danger:empty { display: none; }

/* ภาพรวม: การ์ดตัวเลขมีไอคอน */
.staff .tile { padding: .9rem 1rem; gap: .15rem; }
.staff .tile-ico { width: 1.5rem; height: 1.5rem; color: var(--brand); margin-bottom: .2rem; }
.staff .tile-alert .tile-ico, .staff .tile-alert .tile-n { color: var(--red); }
.staff .tile-good .tile-ico { color: var(--green); }
.staff a.tile { transition: transform .12s ease, box-shadow .12s ease; }
.staff a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* จอแคบ: เมนูด้านข้างเป็นแถบด้านบน กดปุ่ม เมนู เพื่อเปิด */
@media (max-width: 60rem) {
  .shell { grid-template-columns: 1fr; }
  .side { z-index: 20; height: auto; max-height: 100vh; padding: .5rem .75rem; }
  .side-head { border-bottom: 0; padding: 0; }
  .side-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .3rem .8rem; border-radius: .6rem; background: rgba(255,255,255,.1); color: #fff; font-weight: 600; cursor: pointer; }
  .side-nav { display: none; padding-bottom: .5rem; }
  .side-check:checked + .side-nav { display: flex; }
  .staff-main { padding: 1rem 1rem 3rem; }
  .rq-title .h1 { font-size: 1.35rem; }
  .actionbar-danger { margin-left: 0; }
  .staff .actionbar { position: static; }
}
/* ตัวอักษรใหญ่: เมนูด้านข้างกว้างขึ้น */
html[data-fs="2"] .shell { grid-template-columns: 17rem minmax(0, 1fr); }
html[data-fs="3"] .shell { grid-template-columns: 18.5rem minmax(0, 1fr); }
@media (max-width: 60rem) { html[data-fs] .shell { grid-template-columns: 1fr; } }
@media print {
  .side { display: none !important; }
  .shell { display: block; }
  .staff-main { padding: 0; max-width: none; }
  .rq-hero { box-shadow: none; border: 1px solid #999; }
}

/* หน้าเข้าสู่ระบบเจ้าหน้าที่ */
.loginbox { margin-top: 1.5rem; padding: 1.5rem; }
.loginbox-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .4rem; }
.loginbox-head .h1 { margin: 0; }
.loginbox-head p { margin: .1rem 0 0; }
.loginhelp { display: flex; gap: .5rem; align-items: flex-start; }
.loginhelp .ico { margin-top: .2rem; color: var(--brand); }

/* หน้าตอบรับการค้ำประกัน */
.gsum-amount { font-size: 2rem; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.gsum-amount span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.checks li.bullet::before { content: "•"; color: var(--teal); }
.btn-lg { min-height: 3.4rem; font-size: 1.1rem; }
details.decline > summary { list-style: none; }
details.decline > summary::-webkit-details-marker { display: none; }
details.decline[open] > summary { border-color: var(--line); color: var(--muted); }

/* หน้า /line: ข้อความนี้โผล่เองหลัง 20 วินาทีโดยไม่ต้องใช้ JavaScript (กรณีสคริปต์โหลดไม่ขึ้นเลย) */
.line-slow { visibility: hidden; animation: line-slow-show 0s 20s forwards; }
@keyframes line-slow-show { to { visibility: visible; } }
