:root{
 /* PortAccount — โทนเขียวอมฟ้าเข้ม (deep teal) + เขียวมรกต บนพื้นอ่อน — ใช้ทั้งโปรแกรม */
 --bg:#f3f7f6;--card:#fff;--ink:#1c2b2c;--mut:#61716f;--line:#dce6e3;
 --pri:#13866d;--pri-d:#0e5f55;--pri2:#e2f3ee;--hdr:#0b4446;--hdr2:#0f5b59;--acc:#b8955a;--grn:#149a7a;
 --ok:#1f8a55;--bad:#b4442f;--shadow:0 1px 2px rgba(20,45,44,.05),0 8px 24px rgba(20,45,44,.06)}
*{box-sizing:border-box}
body{margin:0;font-family:Sarabun,system-ui,sans-serif;background:var(--bg);color:var(--ink);font-size:15px}
header{background:linear-gradient(100deg,var(--hdr),var(--hdr2));color:#fff;display:flex;align-items:center;gap:12px;padding:10px 16px;flex-wrap:wrap}
header h1{font-size:18px;margin:0;font-weight:700}
header .co{opacity:.85;font-size:14px}
header .sp{flex:1}
.stor{display:flex;gap:6px;align-items:center;font-size:13px;flex-wrap:wrap}
.stor select{padding:4px 6px;border-radius:5px;border:0}
.stor button{padding:4px 10px;border-radius:6px;border:0;background:#fff;color:var(--pri-d);font-weight:600}
#status{font-size:12px;opacity:.9;max-width:320px}
#status.err{color:#ffc9c9}
.wrap{display:flex;min-height:calc(100vh - 54px)}
nav{width:235px;background:#fff;border-right:1px solid var(--line);padding:8px 0;flex-shrink:0}
nav .grp{font-size:12px;color:var(--mut);padding:12px 16px 4px;font-weight:700;letter-spacing:.3px}
nav a{display:block;padding:7px 16px;color:var(--ink);text-decoration:none;cursor:pointer;border-left:3px solid transparent;font-size:14.5px}
nav a:hover{background:var(--pri2)}
nav a.on{background:var(--pri2);border-left-color:var(--pri);color:var(--pri);font-weight:600}
main{flex:1;padding:18px;min-width:0;overflow-x:auto}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:16px;box-shadow:var(--shadow)}
h2{margin:0 0 12px;font-size:20px}
h3{margin:0 0 10px;font-size:16px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.f{display:flex;flex-direction:column;gap:3px;font-size:13px;color:var(--mut)}
.f input,.f select,.f textarea{font:inherit;font-size:14.5px;color:var(--ink);padding:6px 8px;border:1px solid var(--line);border-radius:5px;background:#fff}
.f.chk{flex-direction:row;align-items:center;gap:6px;padding-bottom:8px;color:var(--ink)}
input,select,button,textarea{font:inherit}
button{cursor:pointer;border:1px solid var(--line);background:#fff;border-radius:5px;padding:6px 12px;font-size:14px}
button:hover{filter:brightness(.97)}
button.p{background:var(--pri);color:#fff;border-color:var(--pri)}
button.d{color:var(--bad)}
button.sm{padding:2px 8px;font-size:13px}
table{border-collapse:collapse;width:100%}
th,td{border:1px solid var(--line);padding:5px 8px;vertical-align:top}
th{background:#eef3f1;font-weight:600;font-size:14px}
td.n,th.n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
td.c,th.c{text-align:center}
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:12px}
.tabs button.on{background:var(--pri);color:#fff;border-color:var(--pri)}
.lines td{padding:3px}
.lines input,.lines select{width:100%;padding:5px 6px;border:1px solid var(--line);border-radius:4px}
.lines input.n{text-align:right}
.ok{color:var(--ok)}.bad{color:var(--bad)}.mut{color:var(--mut)}
.msg{padding:8px 12px;border-radius:6px;margin:6px 0;font-size:14px}
.msg.e{background:#fdecec;color:var(--bad)}.msg.s{background:#e7f6ec;color:var(--ok)}.msg.i{background:var(--pri2);color:var(--pri-d)}
.rephead{text-align:center;margin:4px 0 14px;line-height:1.5}.rephead .t{font-weight:700;font-size:16px}
.stmt{max-width:820px;margin:0 auto}
.stmt td{border:none;padding:3px 8px}
.stmt td.n{width:130px}
.u{border-bottom:1px solid #333!important}.du{border-bottom:3px double #333!important}
.b{font-weight:700}
.i1{padding-left:26px!important}.i2{padding-left:48px!important}.i3{padding-left:70px!important}
.small{font-size:13px}
.ws th,.ws td{font-size:12.5px;padding:3px 5px}
.tacc{display:grid;grid-template-columns:1fr 1fr;border-top:2px solid #333;margin-bottom:6px}
.tacc>div:first-child{border-right:2px solid #333}
.tacc table td,.tacc table th{border:none;border-bottom:1px dotted #ddd}
.accttl{text-align:center;font-weight:700;margin-top:14px}
.grid4{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:8px;padding:12px}
.kpi .v{font-size:20px;font-weight:700;margin-top:4px}
.kpi .l{font-size:13px;color:var(--mut)}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin-bottom:12px}
#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#1f2937;color:#fff;padding:9px 16px;border-radius:6px;opacity:0;transition:.25s;pointer-events:none;z-index:9;font-size:14px}
#toast.on{opacity:1}#toast.e{background:var(--bad)}
.pill{display:inline-block;font-size:12px;padding:1px 8px;border-radius:10px;background:#eef2f7;color:#334}
.pill.adj{background:#fff3d6;color:#8a5a00}
code{background:#f1f3f6;padding:1px 5px;border-radius:4px;font-size:13px}
ol li,ul li{margin:3px 0}
@media print{header,nav,.noprint{display:none!important}main{padding:0}.card{border:none;padding:0}body{background:#fff}}
@media (max-width:820px){.wrap{flex-direction:column}nav{width:100%;display:flex;flex-wrap:wrap;padding:4px}nav .grp{width:100%;padding:6px 8px 2px}nav a{border-left:0;padding:5px 10px}}
#login{position:fixed;inset:0;background:rgba(36,87,90,.92);display:flex;align-items:center;justify-content:center;z-index:20}
#login .card{width:340px;max-width:92vw}
#bookSel{max-width:260px}
.srv{display:inline-block;width:8px;height:8px;border-radius:50%;background:#9ca3af;margin-right:4px}.srv.on{background:#22c55e}
/* ---------- หน้าระบบสมาชิก / กิจการ ---------- */
body.auth{min-height:100vh;display:flex;flex-direction:column}
.authwrap{width:440px;max-width:94vw;margin:40px auto 20px;flex:1}
.authwrap.wide{width:960px}
.authwrap form.card .f{margin-bottom:12px}
.authwrap form.card .row .f{margin-bottom:0}
button.full{width:100%;padding:9px;font-size:15px;margin-top:4px}
.ferr{color:var(--bad);font-size:13px}
tr.hl td{background:#fffbe6}
.userbox{font-size:14px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.userbox a{color:#fff;opacity:.9}
.authfoot{text-align:center;color:var(--mut);font-size:12px;padding:16px}
td form{margin:0}
.cobtn{color:#fff;text-decoration:none;background:rgba(255,255,255,.14);padding:3px 10px;border-radius:5px;font-weight:600;font-size:14px}
.cobtn:hover{background:rgba(255,255,255,.25)}
.usernav{display:flex;gap:4px;align-items:center;flex-wrap:wrap;font-size:14px}
.usernav a,.usernav .linkbtn{color:#fff;text-decoration:none;padding:4px 9px;border-radius:5px;background:transparent;border:0;font:inherit;font-size:14px;cursor:pointer}
.usernav a:hover,.usernav .linkbtn:hover{background:rgba(255,255,255,.16)}
.usernav form{margin:0}
form.inline{display:inline-block;margin:0}
.rolepill{background:rgba(255,255,255,.18);color:#fff}

/* v1.3 */
td.brk{word-break:break-all;max-width:240px}
.vatscroll{overflow-x:auto}
.vatscroll table{min-width:1180px}
.vatbox{background:#fbfaf3;border-color:#e6dfb8}
.vatbox .lines input,.vatbox .lines select{font-size:13px;padding:4px}
table.noborder td{border:none;padding:2px 0}
select.jsel{font-size:15px;font-weight:600;padding:7px 8px}

/* v1.4 ที่อยู่อัตโนมัติ */
.addr input.auto{background:#f4f8f2}
.addr-list{width:100%;font-size:13.5px;border:1px solid var(--line);border-radius:5px;padding:2px}
.addr-preview{margin-top:6px}

/* v1.5 งบการเงินตามแบบ DBD */
.unit{text-align:right;font-size:13px;margin:-6px 0 6px;max-width:900px;margin-left:auto;margin-right:auto}
table.fs{max-width:900px}
table.fs tr.fshead td{font-weight:700;border-bottom:1px solid #333!important;padding-bottom:4px}
table.fs tr.fsdet td{font-size:12.5px;color:#4b5563}
.i4{padding-left:92px!important}
table.soce{max-width:1100px}
table.soce td.n{width:auto}
.fsopts{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.fsopt{border:1px solid var(--line);border-radius:8px;padding:10px 12px;cursor:pointer;background:#fff;display:block}
.fsopt.on{border-color:var(--pri);background:var(--pri2)}
.fsopt ol{margin:6px 0 0;padding-left:20px;color:#4b5563}
/* รายงานภาษีตามแบบสรรพากร */
.rdhead{margin-bottom:8px}.rdhead td{border:none;padding:3px 0}
.taxbox{display:inline-flex;gap:0;vertical-align:middle}.taxbox i{font-style:normal;border:1px solid #555;width:17px;height:21px;display:inline-flex;align-items:center;justify-content:center;margin-left:-1px;font-size:13px}
.taxbox i:nth-child(1),.taxbox i:nth-child(5),.taxbox i:nth-child(10),.taxbox i:nth-child(12){margin-right:5px}
.ck{display:inline-block;width:16px;height:16px;border:1px solid #555;text-align:center;line-height:14px;font-size:13px}
.rdtable th{font-size:12.5px;vertical-align:middle}
/* งบทดลอง 6 ช่อง */
table.tb6{width:100%;font-size:13px}
table.tb6 th{text-align:center;vertical-align:middle;font-size:12px;border:1px solid #cbd5e1;background:#f8fafc}
table.tb6 th.n{text-align:center}
table.tb6 td{border-left:0;border-right:0}
table.tb6 tbody td{border-top:0;border-bottom:0;padding:3px 8px}
table.tb6 tr.tbh td{border:0;text-align:center;padding:0 0 8px}
table.tb6 tr.tbh .t{font-weight:700;font-size:16px}
.tbmeta{display:flex;justify-content:space-between;margin-top:6px;font-size:13px;font-style:italic}
table.tb6 tfoot td{border-top:1px solid #334155;white-space:nowrap}
@media print{table.tb6{font-size:10.5px}table.tb6 thead{display:table-header-group}table.tb6 tr{page-break-inside:avoid}}
/* โลโก้ / ตราสำคัญ */
.mediarow{gap:18px;margin-bottom:8px}
.mediabox{flex:1;min-width:240px;display:flex;flex-direction:column;gap:6px}
.mediaprev{height:130px;border:1px dashed #cbd5e1;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.mediaprev img{max-width:92%;max-height:118px;object-fit:contain}
.replogo{display:block;margin:0 auto 6px;max-height:64px;max-width:220px;object-fit:contain}
.signbox{display:flex;justify-content:flex-end;gap:40px;margin-top:36px;page-break-inside:avoid}
.signbox .sg{position:relative;text-align:center;min-width:260px;line-height:1.9;padding-right:125px}
.signbox .seal{position:absolute;right:0;top:-30px;width:110px;height:110px;object-fit:contain;opacity:.9;pointer-events:none}

/* ================= v1.7 — ธีมเดียวกันทั้งระบบ, กระดิ่งแจ้งเตือน, แชทกับเรา, สำหรับองค์กร ================= */
header h1 a.brand{color:#fff;text-decoration:none;display:inline-flex;align-items:center;gap:8px;letter-spacing:.2px}
.mark{width:26px;height:26px;flex:none}
button.p{box-shadow:0 1px 0 rgba(0,0,0,.04)}button.p:hover{background:var(--pri-d);filter:none}
a{color:var(--pri)}
.f input:focus,.f select:focus,.f textarea:focus,textarea:focus{outline:2px solid rgba(47,107,110,.25);border-color:var(--pri)}
.usernav .navcta{background:#fff;color:var(--pri-d)!important;font-weight:600}
.usernav .navcta:hover{background:#eef6f4!important}
.authfoot a{color:var(--mut)}
/* กระดิ่ง */
.bell{position:relative;display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;cursor:pointer}
.bell:hover{background:rgba(255,255,255,.22)}
.bell svg{width:19px;height:19px;fill:currentColor}
.bell-badge{position:absolute;top:-4px;right:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#e0664f;color:#fff;font-size:11px;line-height:18px;font-weight:700;text-align:center;box-shadow:0 0 0 2px var(--hdr)}
.bell.ring svg{animation:bellring .9s ease-in-out}
@keyframes bellring{0%,100%{transform:rotate(0)}15%{transform:rotate(14deg)}30%{transform:rotate(-12deg)}45%{transform:rotate(9deg)}60%{transform:rotate(-6deg)}75%{transform:rotate(3deg)}}
@media (prefers-reduced-motion:reduce){.bell.ring svg{animation:none}}
.bellpanel{position:fixed;z-index:60;max-height:min(520px,calc(100vh - 90px));display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 48px rgba(31,45,46,.18);overflow:hidden;color:var(--ink)}
.bellpanel header{background:none;color:var(--ink);display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.bellpanel .linkish{border:0;background:none;color:var(--pri);padding:0;font-size:13px}
.belllist{overflow:auto}
.bellitem{display:flex;gap:10px;align-items:flex-start;padding:11px 14px;border-bottom:1px solid #eef2f0;color:var(--ink);text-decoration:none;position:relative}
.bellitem:hover{background:#f6faf9}
.bellitem.unread{background:#f2f8f6}
.bellitem .bi{font-size:18px;line-height:1.2}
.bellitem .bt{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13.5px}
.bellitem .bt span{color:var(--mut);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.bellitem small{color:#8a9795;font-size:12px}
.bellitem .dot{position:absolute;right:12px;top:16px;width:8px;height:8px;border-radius:50%;background:var(--pri)}
.bellempty{padding:26px 14px;margin:0;text-align:center;color:var(--mut);font-size:14px}
.bellorg{border-bottom:2px solid #e3ecea;background:#fbfdfc}
.bellsub{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 14px;font-size:13.5px;border-bottom:1px solid #eef2f0}
.bellsub .cnt{display:inline-block;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#e0664f;color:#fff;font-size:11.5px;line-height:18px;text-align:center;font-style:normal}
.bellsnd{display:flex;gap:6px;align-items:center;padding:8px 14px;font-size:12.5px;color:var(--mut);cursor:pointer}
.bellitem.org .bi{filter:saturate(1.2)}
/* แชทกับเรา */
.pachat{position:fixed;right:22px;bottom:22px;z-index:55;font-size:14.5px}
.pachat-btn{display:inline-flex;align-items:center;gap:8px;padding:12px 18px;border:0;border-radius:999px;background:linear-gradient(135deg,var(--pri),#3f8584);color:#fff;font-weight:600;box-shadow:0 10px 26px rgba(36,87,90,.32);position:relative}
.pachat-btn:hover{filter:none;transform:translateY(-1px)}
.pachat-btn svg{width:20px;height:20px;fill:currentColor}
.pachat-badge{position:absolute;top:-5px;right:-4px;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#e0664f;color:#fff;font-size:12px;line-height:20px;text-align:center;box-shadow:0 0 0 2px #fff}
body:not(.home) .pachat-btn span{display:none}
body:not(.home) .pachat-btn{padding:13px}
.pachat.is-open .pachat-btn{display:none}
.pachat-box{position:absolute;right:0;bottom:0;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 40px));display:flex;flex-direction:column;background:#fbfcfb;border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 60px rgba(31,45,46,.25);overflow:hidden}
.pachat-box[hidden]{display:none}
.pachat-head{display:flex;align-items:center;gap:10px;padding:14px 14px;background:linear-gradient(120deg,var(--hdr),var(--hdr2));color:#fff}
.pachat-head small{display:block;opacity:.85;font-size:12px}
.pachat-av{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.18);font-weight:700}
.pachat-x{margin-left:auto;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;font-size:20px;line-height:1}
.pachat-msgs{flex:1;overflow:auto;padding:14px;background:linear-gradient(#f4f8f6,#fbfcfb)}
.pachat-hello{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 14px;color:var(--mut);display:flex;flex-direction:column;gap:4px}
.pachat-hello b{color:var(--ink)}
.pachat-m{max-width:84%;margin:8px 0;padding:9px 12px;border-radius:14px;box-shadow:0 2px 6px rgba(31,45,46,.05)}
.pachat-m p{margin:2px 0 3px;line-height:1.5;word-wrap:break-word}
.pachat-m b{display:block;font-size:12px;color:var(--pri-d)}
.pachat-m small{display:block;font-size:11.5px;opacity:.75}
.pachat-m.them{background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px;margin-right:auto}
.pachat-m.me{background:var(--pri);color:#fff;border-bottom-right-radius:4px;margin-left:auto}
.pachat-m.me small{opacity:.85}.pachat-m.me .rd{font-weight:600}
.pachat-m.fail{background:#fbeae6;color:var(--bad)}
.pachat-retry{border:0;background:none;color:inherit;text-decoration:underline;padding:0;font-size:inherit}
.pachat-form{border-top:1px solid var(--line);background:#fff;padding:10px}
.pachat-who{display:grid;grid-template-columns:1fr;gap:6px;margin-bottom:6px}
.pachat-who input,.pachat-in textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font-size:14px}
.pachat-in{display:flex;gap:6px;align-items:flex-end}
.pachat-in textarea{resize:none;min-height:44px;max-height:120px}
.pachat-send{flex:none;width:44px;height:44px;padding:0;border:0;border-radius:12px;background:var(--pri);color:#fff;display:grid;place-items:center}
.pachat-send svg{width:20px;height:20px;fill:currentColor}
.pachat-err{color:var(--bad);font-size:13px;margin:0 0 6px}
.pachat-note{display:block;color:var(--mut);font-size:11.5px;margin-top:6px}
@media (max-width:560px){.pachat{right:12px;bottom:12px}.pachat-box{position:fixed;inset:auto 8px 8px 8px;width:auto;height:min(78vh,600px)}}
@media print{.pachat,.bellpanel,.bell{display:none!important}}
/* กล่องข้อความทีม */
.inbox{padding:0;overflow:hidden}
.inbox-head{padding:14px 16px;border-bottom:1px solid var(--line)}.inbox-head h2{margin:0 0 2px}
.inbox-grid{display:grid;grid-template-columns:300px 1fr;min-height:560px}
.inbox-list{border-right:1px solid var(--line);background:#fafcfb;overflow:auto;max-height:70vh}
.inbox-filter{display:flex;gap:6px;padding:10px;border-bottom:1px solid var(--line)}
.inbox-filter button{flex:1;border-radius:999px;font-size:13px}.inbox-filter button.on{background:var(--pri);color:#fff;border-color:var(--pri)}
.inbox-item{display:flex;flex-direction:column;gap:2px;padding:11px 14px;border-bottom:1px solid #eef2f0;color:var(--ink);text-decoration:none;position:relative}
.inbox-item span{color:var(--mut);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:26px}
.inbox-item small{color:#8a9795;font-size:12px}
.inbox-item.on{background:var(--pri2)}.inbox-item.unread b{color:var(--pri-d)}
.inbox-item .cnt,.tile .cnt{position:absolute;right:12px;top:34px;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#e0664f;color:#fff;font-size:12px;line-height:20px;text-align:center;font-style:normal}
.pill.guest{background:#f3ece0;color:#8a6a2f}
.inbox-thread{display:flex;flex-direction:column;min-width:0}
.inbox-th{display:flex;gap:10px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line);background:#fff;color:var(--ink)}
.inbox-msgs{flex:1;overflow:auto;padding:14px 18px;background:linear-gradient(#f4f8f6,#fbfcfb);max-height:56vh}
.inbox-reply{padding:10px 16px;border-top:1px solid var(--line)}
.inbox-reply textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin-bottom:6px}
.inbox-empty{margin:auto;color:var(--mut);padding:40px;text-align:center}
.backlist{display:none}
@media (max-width:760px){.inbox-grid{grid-template-columns:1fr}.inbox-grid.show-thread .inbox-list{display:none}.inbox-grid:not(.show-thread) .inbox-thread{display:none}.backlist{display:inline-block}.inbox-list{max-height:none}}
/* สำหรับองค์กร */
.eyebrow{display:inline-block;font-size:12.5px;font-weight:700;letter-spacing:.6px;color:var(--pri);background:var(--pri2);padding:4px 10px;border-radius:999px;margin-bottom:8px}
.orghero{display:grid;grid-template-columns:1.1fr .9fr;gap:28px;align-items:start;margin:10px 0 18px}
.orghero h2{font-size:28px;line-height:1.3;margin:4px 0 10px}
.orghero p{color:var(--mut);line-height:1.7}
.ticks{list-style:none;padding:0;margin:14px 0 0;display:grid;gap:8px}
.ticks li::before{content:'✓';color:var(--pri);font-weight:700;margin-right:8px}
.orglogin .f{margin-bottom:10px}.orglogin h3{margin-bottom:2px}
.orgtop h2{font-size:24px;margin:4px 0}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;margin:16px 0}
.tile{position:relative;display:flex;flex-direction:column;gap:4px;padding:18px;background:#fff;border:1px solid var(--line);border-radius:14px;color:var(--ink);text-decoration:none;box-shadow:var(--shadow);transition:transform .15s,box-shadow .15s}
.tile:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(31,45,46,.1)}
.tile .ti{font-size:24px}.tile span{color:var(--mut);font-size:13.5px}
.tile .cnt{top:16px}
.roles{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.role{display:flex;flex-direction:column;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fafcfb}
.role span{color:var(--mut);font-size:13px}
@media (max-width:820px){.orghero{grid-template-columns:1fr}}
@media (max-width:640px){header{padding:8px 10px;gap:8px}.usernav{width:100%;justify-content:flex-end}.usernav a,.usernav .linkbtn{padding:4px 7px;font-size:13px}.authwrap{margin:16px auto}}
[hidden]{display:none!important}
/* ================= v1.8 — แถบบนแบบสว่าง (หน้าระบบสมาชิก) · เมนูอยู่ซ้ายของผู้ใช้ · โปรไฟล์ · กระดิ่ง ================= */
.usernav{gap:6px}
.usernav .unlinks{display:flex;gap:2px;align-items:center;flex-wrap:wrap;width:auto;background:none;border:0;padding:0}
.usernav .unlinks a.on{background:rgba(255,255,255,.2);font-weight:600}
.usernav .langsel{font:inherit;font-size:13.5px;padding:5px 26px 5px 10px;border-radius:8px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.1);color:#fff;margin-left:6px}
.usernav .langsel option{color:var(--ink)}
.usernav a.me{display:inline-flex;align-items:center;gap:8px;padding:3px 8px 3px 3px;border-radius:999px}
.usernav .av{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#3f8584,#24575a);color:#fff;font-weight:700;font-size:14px;box-shadow:0 0 0 2px rgba(255,255,255,.55)}
.usernav .nm{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.usernav .logout{font:inherit;font-size:13.5px;padding:5px 12px;border-radius:8px;border:1px solid rgba(255,255,255,.45);background:transparent;color:#fff}
.usernav .logout:hover{background:rgba(255,255,255,.14)}
.usernav .bell{margin-left:6px}
/* แถบบน (หน้าระบบสมาชิก) — โทนเดียวกับโปรแกรม */
header.topbar{position:sticky;top:0;z-index:30;padding:10px 24px;box-shadow:0 2px 10px rgba(8,40,40,.18)}
header.topbar h1 a.brand{font-weight:800;font-size:20px}
.usernav .unlinks a.on{background:rgba(255,255,255,.18)}
@media (max-width:900px){
 header.topbar{padding:8px 12px}
 .usernav .nm{display:none}
 .usernav .unlinks{order:10;width:100%;flex-wrap:nowrap;overflow-x:auto;padding-top:4px;-webkit-overflow-scrolling:touch}
 .usernav .unlinks a{white-space:nowrap}
 .usernav{justify-content:flex-end}
}
/* หน้า กิจการของคุณ */
.cohead{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin:6px 0 22px}
.cohead h2{font-size:26px;margin:0 0 2px}
.cohead p{margin:0;color:var(--mut)}
.coacts{display:flex;gap:8px;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:9px;border:1px solid var(--pri);background:#fff;color:var(--pri-d);font-weight:600;font-size:14.5px;text-decoration:none;cursor:pointer}
.btn:hover{background:var(--pri2)}
.btn.solid{background:var(--pri);color:#fff}.btn.solid:hover{background:var(--pri-d)}
.btn.warn{border-color:#d9b26a;color:#9a6b17}.btn.warn:hover{background:#fbf4e6}.btn.warn.on{background:#9a6b17;color:#fff;border-color:#9a6b17}
.cogrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.cocard{position:relative;display:flex;flex-direction:column;gap:6px;text-align:left;width:100%;padding:20px 20px 16px;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);font:inherit;color:var(--ink);cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s}
.cocard:hover{transform:translateY(-2px);border-color:#bcd3cd;box-shadow:0 14px 34px rgba(31,45,46,.1);filter:none}
.cocard:focus-visible{outline:3px solid rgba(47,107,110,.35)}
.cocard .tag{align-self:flex-start;font-size:12px;font-weight:700;color:var(--pri-d);background:var(--pri2);padding:3px 10px;border-radius:999px}
.cocard .tag.pt{background:#f3ece0;color:#8a6a2f}
.cocard .tag.iv{background:#e9f2ea;color:#3d6b45}
.cocard .cofy{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;font-size:12.5px;color:var(--mut)}
.cocard .vatb{font-weight:700;padding:2px 8px;border-radius:6px}
.cocard .vatb.on{background:#e3f1ec;color:#1f6b55}.cocard .vatb.off{background:#f1f2f4;color:#6b7280}
.cocard .nm{font-size:17.5px;font-weight:700;line-height:1.4;margin-top:4px}
.cocard .tx{color:var(--mut);font-size:13.5px}
.cocard .meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.cocard .meta span{font-size:12.5px;color:#4d5f5c;background:#f3f6f5;border-radius:6px;padding:2px 8px}
.cocard .cur{position:absolute;top:16px;right:16px;font-size:12px;font-weight:700;color:var(--ok)}
.cowrap{position:relative}
.cowrap form{margin:0}
.coclose{position:absolute;right:12px;bottom:12px}
.coclose button{font-size:13px;padding:5px 10px;border-radius:8px;border:1px solid #e3c79a;background:#fffaf1;color:#8a5a12}
.cogrid.closing .cocard{border-style:dashed}
.coempty{padding:40px 20px;text-align:center;border:1px dashed #c8d6d2;border-radius:16px;background:#fbfdfc;color:var(--mut)}
.cocreate{margin-top:22px}
.closedlist .cocard{opacity:.8;cursor:default}
.closedlist .cocard:hover{transform:none}
.coreport th{white-space:nowrap}
@media print{header.topbar,.cohead .coacts,.authfoot{display:none!important}}
/* ================= v1.8 — โครงหน้าโปรแกรมบัญชี (แถบบน · เมนูซ้าย · หน้าหลัก) ================= */
body.app{background:var(--bg)}
header.apphdr{position:sticky;top:0;z-index:40;height:62px;flex-wrap:nowrap;gap:14px;padding:0 18px;background:linear-gradient(100deg,#0a4143,#0e5654 60%,#0f5d5b);box-shadow:0 2px 12px rgba(6,36,36,.25)}
.apphdr .vsep{width:1px;height:30px;background:rgba(255,255,255,.22);flex:none}
.abrand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;flex:none}
.abrand .bars{width:40px;height:32px;fill:#fff}
.abrand b{display:block;font-size:21px;line-height:1.05;letter-spacing:.2px}.abrand small{display:block;font-size:11.5px;opacity:.85;letter-spacing:.3px}
.navtog{display:none;flex:none;width:38px;height:38px;padding:9px 8px;border:0;border-radius:9px;background:rgba(255,255,255,.12)}
.navtog span{display:block;height:2px;margin:4px 0;background:#fff;border-radius:2px}
.dd{position:relative}
.ddbtn{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:#fff;font-weight:700;font-size:15px;padding:7px 10px;border-radius:9px;max-width:300px}
.ddbtn:hover{background:rgba(255,255,255,.1);filter:none}
.ddbtn svg{width:24px;height:24px;fill:#fff;flex:none}.ddbtn .chev{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.ddtx{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ddmenu{display:none;position:absolute;top:calc(100% + 8px);left:0;min-width:280px;max-height:70vh;overflow:auto;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 44px rgba(10,40,40,.2);padding:6px;z-index:70}
.ddmenu.right{left:auto;right:0}
.dd.open .ddmenu{display:block}
.ddmenu .ddh{font-size:12px;font-weight:700;color:var(--mut);padding:8px 10px 4px}
.ddmenu form{margin:0}
.ddmenu button,.ddmenu a{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;border:0;background:none;padding:8px 10px;border-radius:9px;color:var(--ink);text-decoration:none;font-size:14.5px}
.ddmenu button:hover,.ddmenu a:hover{background:#eef6f3;filter:none}
.ddmenu button.on{background:var(--pri2)}.ddmenu button.on b::after{content:' ✓';color:var(--pri)}
.ddmenu small{color:var(--mut);font-size:12px}
.ddmenu .ddfoot{color:var(--pri);font-weight:600;border-top:1px solid var(--line);border-radius:0 0 9px 9px;margin-top:4px}
.ddmenu .out{color:var(--bad);border-top:1px solid var(--line);border-radius:0 0 9px 9px;margin-top:4px}
.ddrow{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;font-size:14px;color:var(--mut)}
.ddrow .langsel{border:1px solid var(--line);border-radius:8px;padding:4px 8px;font:inherit;font-size:13.5px}
.mehead{display:flex;gap:10px;align-items:center;padding:10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.mehead b{display:block}.mehead small{display:block;color:var(--mut)}
.mehead .rolepill{margin-top:4px;display:inline-block;background:var(--pri2);color:var(--pri-d)}
.av{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#1db48c,#12866d);color:#fff;font-weight:800;font-size:17px;flex:none}
.av.lg{width:44px;height:44px;font-size:20px}
.avbtn{padding:2px;border-radius:50%}
.apphdr .stor{flex-wrap:nowrap;gap:8px;font-size:14px;font-weight:600;white-space:nowrap;min-width:0}
.apphdr .stor select{max-width:270px;padding:7px 30px 7px 12px;border-radius:9px;border:0;font-weight:600;color:var(--ink);background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 9 5 5 5-5' fill='none' stroke='%23334' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center/16px;-webkit-appearance:none;appearance:none;box-shadow:0 1px 2px rgba(0,0,0,.1)}
.apphdr .stor .ib{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:9px;background:rgba(255,255,255,.12)}
.apphdr .stor .ib svg{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:2;stroke-linejoin:round}
.apphdr .stor .ib:hover{background:rgba(255,255,255,.22);filter:none}
.apphdr #status{font-weight:400;font-size:12px;max-width:180px;overflow:hidden;text-overflow:ellipsis}
.hicons{display:flex;align-items:center;gap:10px;flex:none}
.hic{position:relative;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent;color:#fff}
.hic:hover{background:rgba(255,255,255,.12);filter:none}
.hic svg{width:25px;height:25px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round}
.hic svg.fill,.hic .fill{fill:#fff;stroke:none}
.apphdr .bell-badge{top:2px;right:2px;background:#e5484d;box-shadow:0 0 0 2px var(--hdr)}
/* เมนูซ้าย */
body.app .wrap{min-height:calc(100vh - 62px)}
body.app nav#nav{width:262px;padding:14px 12px 24px;background:#fff;border-right:1px solid var(--line);position:sticky;top:62px;height:calc(100vh - 62px);overflow:auto;transition:width .2s}
.navhd{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 12px}
.navhd b{font-size:19px}
.navmin{display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.navmin svg{width:18px;height:18px;fill:none;stroke:var(--ink);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
body.app nav#nav a{display:flex;align-items:center;gap:12px;padding:8px 12px;margin:1px 0;border:0;border-radius:10px;color:#2a3b3b;font-size:15px;line-height:1.3;text-decoration:none}
body.app nav#nav a:hover{background:#eef6f3}
body.app nav#nav a.on{background:linear-gradient(90deg,var(--grn),#17a984);color:#fff;font-weight:700;box-shadow:0 4px 12px rgba(20,154,122,.28)}
.ni{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ntop{padding-bottom:10px;margin-bottom:6px;border-bottom:1px solid #edf2f0}
.ntop a{font-weight:600}
.ngrp{padding:4px 0;border-bottom:1px solid #edf2f0}
.nghd{display:flex;align-items:center;gap:12px;width:100%;padding:9px 12px;border:0;border-radius:10px;background:none;font-size:15.5px;font-weight:700;color:var(--ink);text-align:left}
.nghd:hover{background:#f2f7f5;filter:none}
.nghd .ni{width:22px;height:22px}
.nghd .chev{width:18px;height:18px;margin-left:auto;fill:none;stroke:var(--ink);stroke-width:2.4;stroke-linecap:round;transition:transform .2s}
.ngrp.closed .chev{transform:rotate(180deg)}
.ngrp.closed .ngi{display:none}
.ngrp.has .nghd{background:#eef7f4}
.ngi{margin:2px 0 4px 22px;padding-left:10px;border-left:2px solid #dde8e4}   /* เมนูย่อย: เยื้องเข้า + เส้นนำสายตา แยกจากเมนูหลัก */
.ngi a{padding-left:14px!important;font-size:14.5px!important}
.ngi a .ni{width:18px;height:18px}
.navscrim{position:fixed;inset:62px 0 0 0;background:rgba(10,30,30,.35);z-index:44}
body.navmini nav#nav{width:76px;padding:14px 10px}
body.navmini nav#nav span,body.navmini .navhd b,body.navmini .nghd .chev{display:none}
body.navmini .navmin svg{transform:rotate(180deg)}
body.navmini .navhd{justify-content:center}
body.navmini nav#nav a,body.navmini .nghd{justify-content:center;padding:10px!important}
body.navmini .ngrp.closed .ngi{display:block}
body.navmini .ngi{margin:0;padding:0;border:0}
body.app main#main{padding:22px 26px 40px}
/* หน้าหลัก */
.dhero{position:relative;display:flex;align-items:center;min-height:120px;margin:-22px -26px 4px;padding:22px 26px;background:linear-gradient(110deg,#fff 30%,#e9f6f3);overflow:hidden;border-bottom:1px solid #e3eeeb}
.dht{position:relative;z-index:1;display:flex;align-items:center;gap:16px}
.dhi{width:62px;height:62px;padding:12px;border-radius:14px;background:linear-gradient(145deg,#1d8a73,#0f5d57);stroke:#fff;stroke-width:2.2;box-shadow:0 8px 18px rgba(15,93,87,.25)}
.dht h2{font-size:34px;margin:0;line-height:1.15}.dht p{margin:2px 0 0;color:#4b5d5b;font-size:15.5px}
.dhart{position:absolute;right:0;top:0;height:100%;width:min(560px,52%)}
.dsec{font-size:20px;margin:18px 0 12px}
.djn{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.dj{display:flex;align-items:center;gap:12px;padding:16px;border-radius:14px;border:1px solid var(--line);text-decoration:none;color:var(--ink);box-shadow:var(--shadow);transition:transform .15s,box-shadow .15s}
.dj:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(20,45,44,.1)}
.dj small{display:block;font-size:13px;color:#4d5d5b;line-height:1.3}.dj b{display:block;font-size:20px;margin-top:2px}
.dji{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;flex:none}.dji .ni{width:28px;height:28px}
.dj.jb{background:linear-gradient(135deg,#eef5fe,#fff)}.dj.jb .dji{color:#2b6fd6;background:#e2edfc}
.dj.jg{background:linear-gradient(135deg,#eaf8f1,#fff)}.dj.jg .dji{color:#159a62;background:#d9f2e6}
.dj.jc{background:linear-gradient(135deg,#ecf4fd,#fff)}.dj.jc .dji{color:#1f7fc8;background:#dcecfa}
.dj.jp{background:linear-gradient(135deg,#f4effd,#fff)}.dj.jp .dji{color:#7a4fd0;background:#ebe2fb}
.dj.jo{background:linear-gradient(135deg,#fff3e8,#fff)}.dj.jo .dji{color:#e07a1f;background:#fde7d3}
.dkp{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-top:14px}
.dk{display:flex;align-items:center;gap:14px;padding:16px 18px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);text-decoration:none;color:var(--ink)}
.dk small{display:block;font-size:13.5px;color:#4d5d5b}.dk b{display:block;font-size:19px;margin-top:2px;font-variant-numeric:tabular-nums}
.dki{width:34px;height:34px;color:#4a5a59;stroke-width:1.6}
.dk.res.good{background:linear-gradient(135deg,#e6f8ef,#f6fdf9);border-color:#c5ead6}.dk.res.good b{color:var(--ok);font-size:26px}.dk.res.good .dki{color:var(--ok);stroke-width:2.6}
.dk.res.warn{background:#fdf1ee;border-color:#f3cfc5}.dk.res.warn b{color:var(--bad);font-size:24px}
.drow{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;margin-top:16px}
.drow2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}
.dcard{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px 20px;box-shadow:var(--shadow)}
.dcard h3{display:flex;align-items:center;gap:10px;font-size:18px;margin:0 0 12px}
.dcard h3 .hi{width:26px;height:26px;color:var(--pri)}
.wfl{display:flex;align-items:flex-start;justify-content:space-between;gap:6px;padding:4px 6px}
.wfs{flex:1;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;text-decoration:none;color:var(--ink);padding:8px 4px;border-radius:12px}
.wfs:hover{background:#f2f8f6}
.wfi{position:relative;display:grid;place-items:center;width:56px;height:56px;margin-top:8px}
.wfi .ni{width:44px;height:44px;color:var(--pri);stroke-width:1.5}
.wfi i{position:absolute;top:-8px;right:-8px;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--pri);color:#fff;font-style:normal;font-weight:700;font-size:13px;box-shadow:0 0 0 3px #fff}
.wfs b{font-size:15.5px}.wfs small{color:#4d6563;font-size:13px;line-height:1.45}
.wfa{color:var(--pri);font-size:22px;font-weight:700;margin-top:30px}
.dcta{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:18px;border-radius:16px;background:linear-gradient(150deg,#e4f6f1,#cfeee6);border:1px solid #bfe3d9;text-decoration:none;box-shadow:var(--shadow)}
.dcta svg{width:min(220px,90%)}
.ctab{display:inline-flex;align-items:center;justify-content:center;gap:14px;width:100%;max-width:330px;padding:14px 20px;border-radius:999px;background:linear-gradient(90deg,#0f6b5f,#13866d);color:#fff;font-size:20px;font-weight:700;box-shadow:0 10px 22px rgba(15,107,95,.3)}
.ctab .ni{width:24px;height:24px;stroke-width:2.6}
.dcta:hover .ctab{background:linear-gradient(90deg,#0c5c52,#11795f)}
.dtodo,.dact{list-style:none;margin:0;padding:0}
.dtodo li{display:flex;align-items:center;gap:12px;border-top:1px solid #edf2f0}
.dtodo li:first-child{border-top:0}
.tck{display:grid;place-items:center;width:24px;height:24px;padding:0;border:2px solid #b9c7c4;border-radius:50%;background:#fff;flex:none}
.tck .ni{width:14px;height:14px;stroke-width:3;opacity:0}
.dtodo li.done .tck{background:var(--grn);border-color:var(--grn);color:#fff}.dtodo li.done .tck .ni{opacity:1}
.dtodo li.done a{color:var(--mut);text-decoration:line-through}
.dtodo a{flex:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 0;color:var(--ink);text-decoration:none;font-size:15px}
.dtodo a:hover{color:var(--pri)}
.dall{margin-left:auto;font-size:14px;font-weight:600;color:var(--pri);text-decoration:none}
.dact li{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid #edf2f0}
.dact li:first-child{border-top:0}
.dact .ai{width:22px;height:22px;color:#6c4fd0}
.dact a{flex:1;min-width:0;color:var(--ink);text-decoration:none;font-size:15px}
.dact a small{display:block;color:var(--mut);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dact time{color:#4d5d5b;font-size:14px;white-space:nowrap}
.dnote{margin-top:16px}
/* ค้นหาด่วน / ช่วยเหลือ */
.qs{position:fixed;inset:0;z-index:80;background:rgba(8,30,30,.4);display:flex;align-items:flex-start;justify-content:center;padding:10vh 14px}
.qsbox{width:min(620px,100%);background:#fff;border-radius:16px;box-shadow:0 30px 70px rgba(0,0,0,.3);overflow:hidden}
.qsin{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.qsin svg{width:22px;height:22px;fill:none;stroke:var(--mut);stroke-width:2;stroke-linecap:round}
.qsin input{flex:1;border:0;font-size:17px;outline:0;padding:6px 0}
kbd{font:inherit;font-size:12px;padding:1px 6px;border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;background:#f7f9f8;color:var(--mut)}
.qsl{list-style:none;margin:0;padding:6px;max-height:55vh;overflow:auto}
.qsl li{display:grid;grid-template-columns:auto 1fr;column-gap:10px;padding:9px 10px;border-radius:10px;cursor:pointer}
.qsl li small{grid-column:2;color:var(--mut);font-size:12.5px}
.qsl li[aria-selected="true"],.qsl li:hover{background:var(--pri2)}
.qk{grid-row:span 2;align-self:center;font-size:11.5px;font-weight:700;color:var(--pri-d);background:#e9f3f0;border-radius:6px;padding:2px 7px}
.qsnone{color:var(--mut);display:block!important;text-align:center;padding:20px!important}
.helpbox header{background:none;color:var(--ink);display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--line)}
.helpbox .hx{border:0;background:none;font-size:24px;line-height:1;padding:0 4px}
.helpsteps{margin:0;padding:14px 18px 6px 40px;line-height:1.7}
.helpsteps li{margin-bottom:6px}
.helpkeys{display:flex;gap:16px;padding:4px 18px 10px;color:var(--mut);font-size:13px}
.helpfoot{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 18px;border-top:1px solid var(--line);background:#f8fbfa}
/* จอเล็ก */
@media (max-width:1240px){.djn,.dkp{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1500px){.dj{padding:12px;gap:10px}.dji{width:42px;height:42px}.dj small{font-size:12.5px}.dj b{font-size:18px}.dk{padding:14px;gap:10px}.dk b{font-size:17px}.dki{width:28px;height:28px}}
@media (max-width:1280px){.apphdr .stor label,.apphdr #status{display:none}.apphdr .stor select{max-width:190px}.drow{grid-template-columns:1fr}}
@media (max-width:900px){
 header.apphdr{gap:8px;padding:0 10px}
 .navtog{display:block}
 .apphdr .stor,.apphdr .vsep,.abrand small{display:none}
 .abrand b{font-size:18px}.abrand .bars{width:30px;height:24px}
 .cosw .ddbtn{max-width:44vw;font-size:14px;padding:6px}
 .hicons{gap:2px}.hic{width:36px;height:36px}.hic svg{width:22px;height:22px}#helpBtn{display:none}
 body.app nav#nav{display:block;position:fixed;left:0;top:62px;bottom:0;height:auto;z-index:45;transform:translateX(-105%);transition:transform .22s;box-shadow:12px 0 30px rgba(0,0,0,.15);width:280px!important}
 body.app.navopen nav#nav{transform:none}
 body.navmini nav#nav span,body.navmini .navhd b{display:revert}
 .navmin{display:none}
 body.app main#main{padding:16px 14px 90px}
 .dhero{margin:-16px -14px 4px;padding:18px 14px}.dhart{opacity:.35;width:70%}.dht h2{font-size:26px}.dhi{width:50px;height:50px;padding:10px}
 .djn,.dkp{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .dj{padding:12px;gap:10px}.dji{width:40px;height:40px}.dj b{font-size:17px}
 .drow2{grid-template-columns:1fr}
 .wfl{flex-wrap:wrap}.wfa{display:none}.wfs{flex:1 1 45%}
}
@media (max-width:480px){.djn,.dkp{grid-template-columns:1fr}.cosw .ddtx{max-width:36vw}}
@media print{header.apphdr,nav#nav,.navscrim{display:none!important}}
.usernav .unlinks a{display:inline-block;border-left:0;color:#fff}
.usernav .unlinks a.on{color:#fff;background:rgba(255,255,255,.2);font-weight:700}
.usernav .av{background:linear-gradient(135deg,#1db48c,#12866d);box-shadow:0 0 0 2px rgba(255,255,255,.35)}
@media (max-width:900px){
 header.apphdr .sp{display:none}
 .cosw{flex:1;min-width:0}.cosw .ddbtn{max-width:100%;min-width:0}
 .cosw .ddmenu{position:fixed;left:8px;right:8px;top:58px;min-width:0}
 .dd.me .ddmenu{position:fixed;right:8px;top:58px}
}
@media (max-width:560px){.abrand span{display:none}.hic{width:34px;height:34px}.av{width:32px;height:32px;font-size:15px}}
.drow>*,.drow2>*,.djn>*,.dkp>*{min-width:0}
.dtodo a{min-width:0}
@media (max-width:600px){.dhart{display:none}.dhero{background:linear-gradient(110deg,#fff 40%,#e3f4ef)}
 header.topbar .usernav .langsel{display:none}header.topbar{gap:6px}header.topbar .usernav{flex:1;justify-content:flex-end}}
/* ปุ่มแชทวงกลม (หลังเข้าสู่ระบบ) — ขยับดุ๊กดิ๊กเป็นระยะเพื่อให้สังเกตเห็น */
.pachat.round .pachat-btn{width:60px;height:60px;padding:0;justify-content:center;border-radius:50%;background:radial-gradient(circle at 30% 25%,#2cc39b,#13866d 55%,#0e5f55);box-shadow:0 12px 28px rgba(14,95,85,.38),0 0 0 4px rgba(255,255,255,.75);animation:pawiggle 4.5s ease-in-out infinite;transform-origin:50% 70%}
.pachat.round .pachat-btn span{display:none}
.pachat.round .pachat-btn svg{width:28px;height:28px}
.pachat.round .pachat-btn:hover{animation-play-state:paused;transform:scale(1.08)}
.pachat.round .pachat-btn.has-new{animation:pawiggle 1.6s ease-in-out infinite}
.pachat.round .pachat-btn::after{content:'';position:absolute;inset:-6px;border-radius:50%;border:2px solid rgba(44,195,155,.55);animation:paping 4.5s ease-out infinite;pointer-events:none}
@keyframes pawiggle{0%,62%,100%{transform:rotate(0) translateY(0)}66%{transform:rotate(-14deg) translateY(-3px)}70%{transform:rotate(12deg) translateY(-5px)}74%{transform:rotate(-10deg) translateY(-3px)}78%{transform:rotate(8deg) translateY(-1px)}82%{transform:rotate(-4deg)}86%{transform:rotate(0)}}
@keyframes paping{0%,60%{opacity:0;transform:scale(.9)}66%{opacity:1}100%{opacity:0;transform:scale(1.35)}}
@media (prefers-reduced-motion:reduce){.pachat.round .pachat-btn,.pachat.round .pachat-btn::after{animation:none}}

/* รูปโปรไฟล์ */
.av.hasimg{padding:0;overflow:hidden;background:#dfe9e7}
.av.hasimg img{width:100%;height:100%;object-fit:cover;display:block}
.avedit{display:flex;gap:14px;align-items:center;margin:4px 0 12px}
.avedit .av{width:72px;height:72px;font-size:30px}
.avedit form{display:flex;flex-wrap:wrap;gap:6px;align-items:center}

.avcrop{position:fixed;inset:0;z-index:300;background:rgba(10,30,32,.55);display:grid;place-items:center;padding:16px}
.avcrop[hidden]{display:none}
.avcrop-box{width:min(340px,100%);margin:0}
.avcrop-stage{position:relative;width:280px;height:280px;margin:0 auto 10px;background:#e9efee;border-radius:10px;overflow:hidden;touch-action:none}
.avcrop-stage canvas{display:block;cursor:grab}
.avcrop-stage canvas:active{cursor:grabbing}
.avcrop-ring{position:absolute;inset:0;pointer-events:none;border-radius:50%;box-shadow:0 0 0 400px rgba(255,255,255,.55);outline:2px solid #fff;outline-offset:-2px}
.tmppw{font-size:15px;padding:2px 8px;background:#fff;border:1px dashed #12866d;border-radius:6px;user-select:all}

/* เมนูที่ไม่มีสิทธิ์ใช้: เห็นชื่อแต่กดไม่ได้ */
.navoff,#nav a.off{opacity:.45;cursor:not-allowed;pointer-events:none}
.usernav .unlinks .navoff{display:inline-block;padding:6px 10px;color:#fff;white-space:nowrap;border-radius:8px}
.ddmenu .navoff{display:block;padding:9px 14px}

/* ตั้งค่าผู้ใช้งาน (แบบต้นแบบ PortAccount-h) */
.tabs.mtabs{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;border:0;padding:0;margin:4px 0 16px;width:auto}
.mtabs a{padding:7px 14px;border-radius:8px;background:#eef4f3;color:var(--ink);text-decoration:none;font-weight:600}
.mtabs a.on{background:var(--pri);color:#fff}
.addbox{background:#f6f9f8;border:1px solid #e3ecea;border-radius:10px;padding:12px 14px}
.mtable tr:not(:first-child) td{background:#f8fbfa}
.mtable tr:not(:first-child) td:first-child{border-left:3px solid var(--pri)}
.mtable tr.pend td{opacity:.8}
.mrow{display:inline-flex;align-items:center;gap:10px}
.mrow .av{width:32px;height:32px;font-size:14px}
.roleic.big{font-size:20px}
.stb{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700;color:#fff}
.stb.ok{background:#1b8a5a}.stb.wait{background:#c58a12}.stb.off{background:#b54545}
.mdlg{border:0;border-radius:12px;padding:0;width:min(460px,94vw);box-shadow:0 20px 60px rgba(0,0,0,.3)}
.mdlg::backdrop{background:rgba(20,40,40,.45)}
.mdlg form{padding:0 18px 16px}
.mdlg header{display:flex;justify-content:space-between;align-items:center;margin:0 -18px 12px;padding:12px 18px;background:#1b8a5a;color:#fff;border-radius:12px 12px 0 0}
.mdlg header .x{background:none;border:0;color:#fff;font-size:18px;cursor:pointer}

/* V2.4 ตั้งค่าภาษี / คำนำหน้าชื่อ */
.taxtb{border-collapse:collapse;width:100%;margin-top:6px}.taxtb th,.taxtb td{border-bottom:1px solid #e6eeec;padding:6px 8px;text-align:left;vertical-align:middle}.taxtb th{font-size:13px;background:#f3f6f5}.taxtb .c{text-align:center}
.f.pfx{width:150px}.row.pname{gap:10px;margin:0;flex-wrap:wrap}

/* V2.4 ปุ่มกลับหน้าหลัก (หน้าที่ไม่มีเมนูด้านซ้าย) */
.homebar{display:flex;align-items:center;gap:14px;margin:0 0 16px;flex-wrap:wrap}
.homebtn{display:inline-flex;align-items:center;gap:12px;padding:8px 16px 8px 8px;border-radius:999px;background:#fff;border:1px solid #d9e7e2;
  box-shadow:0 2px 10px rgba(20,70,60,.08);color:var(--ink);text-decoration:none;transition:transform .15s,box-shadow .15s,border-color .15s;position:relative}
.homebtn:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(20,90,70,.16);border-color:#9fd2bf;text-decoration:none}
.homebtn .hbi{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1fa37a,#16705b);box-shadow:inset 0 -2px 0 rgba(0,0,0,.12)}
.homebtn .hbi svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.homebtn .hbt{display:flex;flex-direction:column;line-height:1.15}
.homebtn .hbt b{font-size:14.5px}.homebtn .hbt small{font-size:12px;color:var(--mut);max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.homebtn .hbc{width:16px;height:16px;fill:none;stroke:#7aa597;stroke-width:2.4;stroke-linecap:round;order:-1;margin-left:4px;display:none}
.homebar .crumb{color:var(--mut);font-size:14px;display:flex;gap:8px;align-items:center}.homebar .crumb span{color:#a9c4ba;font-size:18px}
/* V2.4 หน้าต่าง (dialog) มุมมน เด้งขึ้น */
.mdlg{border-radius:18px!important;width:min(520px,94vw);box-shadow:0 30px 80px rgba(10,40,35,.35)!important;overflow:hidden}
.mdlg.wide{width:min(640px,94vw)}
.mdlg[open]{animation:dlgpop .22s cubic-bezier(.2,.9,.3,1.2)}
.mdlg::backdrop{background:rgba(15,40,36,.5);backdrop-filter:blur(3px)}
@keyframes dlgpop{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
.mdlg form{padding:0 22px 20px}
.mdlg header{gap:12px;margin:0 -22px 16px!important;padding:16px 20px!important;background:linear-gradient(135deg,#1b8a5a,#155e57)!important;border-radius:0!important}
.mdlg header > div{flex:1;display:flex;flex-direction:column;line-height:1.2}.mdlg header small{opacity:.85;font-size:12.5px}
.mdlg header .dhi{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-weight:700}
.mdlg header .x{width:32px;height:32px;border-radius:50%!important}.mdlg header .x:hover{background:rgba(255,255,255,.18)}
.mdlg input,.mdlg select{border-radius:10px}
.mdlg .dgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px}.mdlg .dgrid .span2{grid-column:span 2}.mdlg .dgrid .f.pfx{width:auto}
.mdlg .dact{display:flex;justify-content:flex-end;gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid #edf2f0}
.mdlg .dact button{border-radius:10px;padding:9px 18px}
@media (max-width:560px){.mdlg .dgrid{grid-template-columns:1fr}.mdlg .dgrid .span2{grid-column:auto}}
.addcta{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border:1px dashed #b9d9cd;border-radius:16px;background:linear-gradient(135deg,#f5fbf8,#eef7f3);margin:8px 0 14px;flex-wrap:wrap}
.addcta > div{flex:1;min-width:260px}.addcta button.big{border-radius:12px;padding:11px 22px;font-size:15px}
/* V2.4 แถบไอคอนบนขวา (ทุกหน้า): ค้นหา · ภาษา · โปรไฟล์ · กระดิ่ง · ช่วยเหลือ */
header.topbar .hicons{margin-left:auto}
header.topbar .hic{width:38px;height:38px}
.hicons .bell{background:transparent;width:40px;height:40px}
.hicons .bell .bell-badge{top:2px;right:2px;background:#e5484d}
.hicons .dd.lang .langbtn{gap:6px;padding:6px 10px;border:1px solid rgba(255,255,255,.3);border-radius:999px;font-size:13.5px;font-weight:700;letter-spacing:.5px;background:rgba(255,255,255,.06)}
.hicons .dd.lang .langbtn svg.gl{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:1.8}
.hicons .dd.lang .langbtn .chev{width:15px;height:15px}
.langmenu{min-width:190px!important}
.langmenu button{flex-direction:row!important;align-items:baseline!important;gap:10px}
.langmenu button b{width:38px}.langmenu button.on b::after{content:''!important}
.langmenu button.on{background:var(--pri2)}.langmenu button.on::after{content:'✓';margin-left:auto;color:var(--pri);font-weight:700}
.langmenu button:disabled{opacity:.55;cursor:not-allowed}
.hicons .avbtn{padding:2px;border-radius:50%}
.hicons .avbtn .av{width:36px;height:36px;font-size:15px;box-shadow:0 0 0 2px rgba(255,255,255,.55)}
.promenu{min-width:290px!important;padding:6px!important}
.promenu > a,.promenu .out,.promenu .ddsub > summary,.promenu > .navoff{flex-direction:row!important;align-items:center!important;gap:10px;font-size:14.5px;padding:9px 10px!important}
.promenu .mi{width:22px;text-align:center;flex:none}
.promenu > .navoff{display:flex;color:#9aa8a6;cursor:not-allowed;border-radius:9px}
.promenu .ddsub > summary{display:flex;list-style:none;cursor:pointer;border-radius:9px;color:var(--ink)}
.promenu .ddsub > summary::-webkit-details-marker{display:none}
.promenu .ddsub > summary::after{content:'';width:7px;height:7px;margin-left:auto;border-right:2px solid #7a8b88;border-bottom:2px solid #7a8b88;transform:rotate(45deg);transition:transform .15s}
.promenu .ddsub[open] > summary::after{transform:rotate(-135deg)}
.promenu .ddsub > summary:hover{background:#eef6f3}
.promenu .ddsub > a{flex-direction:row!important;margin-left:32px;width:calc(100% - 32px);padding:7px 10px!important;font-size:14px;border-left:2px solid #dde8e4;border-radius:0 9px 9px 0}
.promenu .ddsub > a .mi:empty{display:none}
.promenu .ddsep{height:1px;background:var(--line);margin:6px 4px}
.promenu .out{border-top:0!important;margin-top:0!important;color:var(--bad)}
@media (max-width:640px){header.topbar .hicons{gap:4px}.hicons .dd.lang .langbtn span{display:inline}}
/* V2.4 แถบบนโปรแกรมบัญชี: ส่วนสมุดบัญชี/ที่เก็บข้อมูลหดตัวได้ ไม่ทับไอคอนขวา (ไอคอนขวาล็อกตำแหน่งเสมอ) */
.apphdr .stor{flex:0 1 auto;overflow:hidden}
.apphdr .stor #bookBox{display:inline-flex;align-items:center;gap:8px;min-width:0}
.apphdr .stor select{min-width:110px;flex:0 1 auto;text-overflow:ellipsis}
.apphdr .stor .ib{flex:none}
.apphdr .hicons{flex:none;margin-left:auto}
.apphdr .cosw{flex:0 1 auto;min-width:0}
@media (max-width:1500px){.apphdr .stor label{display:none}.apphdr .stor select{max-width:210px}.apphdr #status{display:none}}
@media (max-width:1200px){.apphdr .stor select{max-width:150px}.apphdr .cosw .ddbtn{max-width:200px}}
/* V2.4 มือถือ: ไอคอนขวาครบ 5 ปุ่มทุกหน้า (ย่อขนาดแทนการซ่อน) */
@media (max-width:900px){
 .hicons{gap:0;flex-wrap:nowrap}.hicons #helpBtn{display:grid}
 .hicons .hic{width:34px;height:34px}.hicons .hic svg{width:21px;height:21px}
 .hicons .dd.lang .langbtn{padding:4px 8px;border-radius:8px;font-size:12.5px}
 .hicons .dd.lang .langbtn svg.gl,.hicons .dd.lang .langbtn .chev{display:none}
 .hicons .dd.lang .ddmenu{position:fixed;right:8px;top:58px}
 .hicons .avbtn .av{width:32px;height:32px;font-size:14px}
 header.topbar{flex-wrap:nowrap}header.topbar h1{min-width:0}
}
@media (max-width:520px){
 header.apphdr .abrand{display:none}
 header.topbar h1 a.brand{font-size:0;gap:0}header.topbar h1 a.brand svg{width:30px;height:30px}
 header.topbar{padding:8px 10px}
}
@media (max-width:900px){header.apphdr .cosw{overflow:hidden}header.apphdr .cosw .ddtx{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
/* V2.4 หน้าต่างยืนยัน / แจ้งผล */
.uidlg{width:min(480px,94vw)}
.uidlg .uib{font-size:15px;line-height:1.65;margin:2px 0 10px}
.uidlg .ferr{color:var(--bad);font-size:13.5px;margin-top:4px}
.uidlg.danger header{background:linear-gradient(135deg,#c2453b,#8f2f2a)!important}
.uidlg button.p.d{background:#c2453b;border-color:#c2453b;color:#fff}.uidlg button.p.d:hover{background:#a83a31}
.uidlg .cx{background:#fff;border:1px solid var(--line)}
.okdlg{width:min(440px,92vw);text-align:center}
.okdlg form{padding:28px 26px 22px!important}
.okdlg .okic{width:68px;height:68px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#22b07f,#138060);box-shadow:0 10px 26px rgba(19,128,96,.35);animation:okpop .4s cubic-bezier(.2,1.4,.4,1)}
.okdlg .okic svg{width:36px;height:36px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.okdlg h3{margin:0 0 8px;font-size:20px}
.okdlg .dact.c{justify-content:center;border-top:0;padding-top:4px}.okdlg .dact .p{min-width:140px;padding:10px 24px}
@keyframes okpop{from{transform:scale(.4);opacity:0}to{transform:none;opacity:1}}
/* V2.4 รายงาน: แสดงรายการก่อน → PDF / Excel / CSV / พิมพ์ · แนวกระดาษ */
.repbtns{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.repbtns .repori{font-size:12.5px;color:var(--mut);background:#f1f5f4;border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap}
.repbtns .repex{display:inline-flex;gap:6px;flex-wrap:wrap}
.repbtns .repex button{border-radius:9px}
#main.repgate .repex{display:none}
#main:not(.repgate) .repgo{background:#fff;color:var(--ink);border:1px solid var(--line)}
#main:not(.repgate) .repgo::first-letter{font-size:0}
#main.repgate > *:not(h2):not(.toolbar):not(.repph){display:none!important}
.repph{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:46px 20px;margin:14px 0;border:2px dashed #c9ddd6;border-radius:18px;background:linear-gradient(135deg,#fbfdfc,#f1f8f5)}
.repph .repphi{font-size:40px}.repph b{font-size:17px}.repph .mut{max-width:520px}.repph button{margin-top:6px;padding:10px 24px;border-radius:12px}
/* แผ่นรายงานบนจอตามแนวกระดาษ A4 */
#main.rep-portrait > .card{max-width:900px;margin-left:auto;margin-right:auto}
#main.rep-landscape > .card{max-width:1280px;margin-left:auto;margin-right:auto}
@media print{#main.rep-portrait > .card,#main.rep-landscape > .card{max-width:none}}
