/* judge.css — UI ของระบบกรรมการตัดสิน (ใช้ร่วมทุกหน้าในโฟลเดอร์ competition-judges) */
.cjw{max-width:1080px;margin:0 auto;padding:14px 12px 40px;color:#221a20;-webkit-font-smoothing:antialiased;box-sizing:border-box}
.cjw *{box-sizing:border-box}
.cjw-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;background:linear-gradient(135deg,var(--b),var(--b2,#025180));color:#fff;border-radius:12px;padding:12px 14px;margin-bottom:14px}
.cjw-bar img{max-height:42px;background:#fff;border-radius:6px;padding:2px}
.cjw-bar h1{margin:0;font-size:16px;font-weight:800;line-height:1.35;color:#fff}
.cjw-bar p{margin:2px 0 0;font-size:11.5px;color:rgba(255,255,255,.92)}
.cjw-bar-tx{min-width:0;flex:1 1 220px}
.cjw-bar-act{display:flex;gap:6px;flex-wrap:wrap}
.cjw-bar-act a{display:inline-flex;align-items:center;gap:5px;padding:7px 11px;border-radius:9px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.3);color:#fff !important;font-size:12px;font-weight:700;text-decoration:none !important}
.cjw-bar-act a:hover{background:rgba(255,255,255,.3)}
.cjw-card{background:#fff;border:1px solid #e9e2e7;border-top:4px solid var(--b);border-radius:14px;box-shadow:0 6px 20px rgba(35,20,33,.06);padding:16px;margin:0 0 14px}
.cjw-card h2{margin:0 0 4px;font-size:16.5px;font-weight:800;color:var(--b)}
.cjw-card p.sub{margin:0 0 12px;font-size:12.5px;color:#6c5d6b;line-height:1.7}
.cjw-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:9px 16px;border-radius:11px;border:1px solid #e9e2e7;background:#fff;color:#5c4d58;font-size:13.5px;font-weight:800;text-decoration:none;cursor:pointer}
.cjw-btn:hover{border-color:var(--b);color:var(--b);text-decoration:none}
.cjw-btn-main{background:var(--b);border-color:var(--b);color:#fff}
.cjw-btn-main:hover{background:var(--b2,#025180);border-color:var(--b2,#025180);color:#fff}
.cjw-btn-lg{min-height:54px;font-size:15px;padding:13px 20px}
.cjw-btn-sm{min-height:32px;padding:5px 10px;font-size:11.5px;border-radius:9px}
.cjw-row{display:flex;flex-wrap:wrap;gap:10px}
.cjw-row > *{flex:1 1 240px}
.cjw-lbl{display:block;font-size:12.5px;font-weight:800;color:#4c3d49;margin:0 0 4px}
.cjw-inp{width:100%;min-height:44px;padding:9px 12px;border:1px solid #d8ccd4;border-radius:10px;font-size:14px;background:#fff;color:#221a20}
.cjw-inp:focus{outline:none;border-color:var(--b);box-shadow:0 0 0 3px rgba(145,19,168,.12)}
.cjw-hint{font-size:11.5px;color:#8a7c86;margin-top:4px;line-height:1.6}
.cjw-flash{padding:11px 14px;border-radius:11px;font-size:12.8px;font-weight:700;margin:0 0 12px}
.cjw-ok{background:#e7f6ec;color:#1c7a3a;border:1px solid #bfe6cd}
.cjw-err{background:#fdeaea;color:#b3261e;border:1px solid #f4c2c2}
.cjw-wait{background:#fff6e5;color:#8a5300;border:1px solid #f0dfc0}
.cjw-tbl{width:100%;border-collapse:collapse;font-size:13px}
.cjw-tbl th,.cjw-tbl td{border-bottom:1px solid #eef2f5;padding:9px 10px;text-align:left;vertical-align:top}
.cjw-tbl th{background:var(--s,#F6ECF8);color:var(--b);font-size:12px;font-weight:800}
.cjw-badge{display:inline-block;padding:2px 9px;border-radius:999px;font-size:11.5px;font-weight:800;white-space:nowrap}
.cjw-b0{background:#fff6e5;color:#8a5300}
.cjw-b1{background:#e7f6ec;color:#1c7a3a}
.cjw-b2{background:#fdeaea;color:#b3261e}
.cjw-b3{background:#f1eef0;color:#6b5f68}
.cjw-steps{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px;font-size:11.5px}
.cjw-steps span{padding:4px 10px;border-radius:999px;background:var(--s,#F6ECF8);color:var(--b);font-weight:800}
.cjw-steps span.on{background:var(--b);color:#fff}
.cjw-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.cjw-score{width:96px;min-height:38px;padding:6px 8px;border:1px solid #d8ccd4;border-radius:8px;font-size:14px;text-align:center}
.cjw-scored{background:#f3fbf6;border-color:#bfe6cd}
.cjw-empty{padding:18px;text-align:center;color:#8a7c86;font-size:13px}
@media (max-width:600px){.cjw{padding:10px 8px 30px}.cjw-bar-act a span{display:none}.cjw-tbl th,.cjw-tbl td{padding:7px}}
.cjw-btn-home{border-style:dashed}
.cjw-btn-home:hover{border-color:var(--b);color:var(--b)}
.cjw-field-err{color:#b3261e;font-size:11.5px;font-weight:700;margin-top:4px;line-height:1.5}
.cjw-invalid,.cjw-inp.cjw-invalid,.cjw-score.cjw-invalid{border-color:#e38b8b!important;background:#fff7f7!important;box-shadow:0 0 0 3px rgba(179,38,30,.08)!important}
/* ================= layout: header / sidebar / page / footer (.jl-*) ================= */
.jl-wrap{min-height:100vh;display:flex;flex-direction:column;background:#eef2f6}
.jl-head{display:flex;align-items:center;gap:10px;padding:10px 14px;color:#fff;
  background:linear-gradient(135deg,var(--b2,#025180),var(--b,#026AA8));position:sticky;top:0;z-index:50;
  box-shadow:0 2px 12px rgba(20,14,20,.16)}
.jl-head img{max-height:40px;background:#fff;border-radius:6px;padding:2px}
.jl-head-tx{min-width:0;flex:1 1 auto}
.jl-head-tx h1{margin:0;font-size:15px;font-weight:800;line-height:1.3;color:#fff}
.jl-head-tx p{margin:1px 0 0;font-size:11px;color:rgba(255,255,255,.9);line-height:1.35}
.jl-head-act{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.jl-head-act a,.jl-burger{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:9px;
  background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.3);color:#fff !important;
  font-size:11.5px;font-weight:700;text-decoration:none !important;cursor:pointer;font-family:inherit;line-height:1.2}
.jl-head-act a:hover,.jl-burger:hover{background:rgba(255,255,255,.3);text-decoration:none}
.jl-me{font-size:11.5px;font-weight:700;color:rgba(255,255,255,.95);white-space:nowrap}
.jl-burger{display:none}
.jl-body{display:flex;align-items:flex-start;gap:14px;width:100%;max-width:1240px;margin:0 auto;padding:14px 12px 26px}
.jl-side{flex:0 0 224px;background:#fff;border:1px solid #e9e2e7;border-radius:12px;padding:8px;
  box-shadow:0 6px 18px rgba(35,20,33,.05);position:sticky;top:70px}
.jl-side-grp{padding:4px 2px 8px;border-bottom:1px dashed #eee7ec}
.jl-side-grp:last-child{border-bottom:0}
.jl-side h4{margin:6px 6px 4px;font-size:10.5px;letter-spacing:.05em;text-transform:uppercase;color:#9a8e98;font-weight:800}
.jl-side h4 i{margin-right:4px}
.jl-side a{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:9px;color:#4c3d49;
  font-size:12.5px;font-weight:700;text-decoration:none;line-height:1.35}
.jl-side a i{width:15px;text-align:center;color:var(--b)}
.jl-side a:hover{background:var(--s,#F6ECF8);text-decoration:none}
.jl-side a.on{background:var(--b);color:#fff}
.jl-side a.on i{color:#fff}
.jl-main{min-width:0;flex:1 1 auto}
.jl-main > .cjw{max-width:none;margin:0;padding:0}
.jl-foot{border-top:1px solid #e2dbe1;background:#fff;padding:11px 14px;font-size:11.5px;color:#8a7c86;
  display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:space-between;align-items:center;
  width:100%;max-width:1240px;margin:0 auto}
.jl-foot b{color:#5c4d58}
.jl-foot-links a{color:var(--b);font-weight:700;text-decoration:none}
.jl-foot-links a:hover{text-decoration:underline}
@media (max-width:900px){
  .jl-burger{display:inline-flex}
  .jl-body{padding:10px 8px 20px;gap:0}
  .jl-side{position:fixed;left:8px;right:8px;top:62px;z-index:60;max-height:72vh;overflow:auto;display:none}
  .jl-side.open{display:block}
  .jl-head-tx h1{font-size:14px}
  .jl-head-tx p{display:none}
  .jl-me{display:none}
}

.cj-stat{display:flex;flex-wrap:wrap;gap:4px;margin:0}
.cj-stat-btn{min-height:30px;padding:5px 10px;border-radius:9px;font-size:11.5px;font-weight:800;cursor:pointer;
  background:#f3f1f3;border:1px solid #e4dde2;color:#8a7c86;line-height:1.4;font-family:inherit}
.cj-stat-btn:hover{background:#ece9eb;border-color:#cfc6cc;color:#5c4d58}
.cj-stat-btn.is-active{background:#5c4d58;border-color:#5c4d58;color:#fff;cursor:default}
.cj-stat-btn.is-active:disabled{opacity:1;background:#5c4d58 !important;border-color:#5c4d58 !important;color:#fff !important}
/* สีเฉพาะแต่ละสถานะเมื่อ active (0 = ยังไม่ส่ง/ยกเลิก = เทา, 1 = กำลังกรอก = ส้ม, 2 = ยืนยันส่ง = เขียว) */
.cj-stat-btn.st-0.is-active,.cj-stat-btn.st-0.is-active:disabled{background:#8a7c86 !important;border-color:#8a7c86 !important;color:#fff !important}
.cj-stat-btn.st-1.is-active,.cj-stat-btn.st-1.is-active:disabled{background:#b26a00 !important;border-color:#b26a00 !important;color:#fff !important}
.cj-stat-btn.st-2.is-active,.cj-stat-btn.st-2.is-active:disabled{background:#1c7a3a !important;border-color:#1c7a3a !important;color:#fff !important}
.jl-main [id]{scroll-margin-top:78px}

/* =========================================================================
 * v7 — Modern mobile-first layout (header / sidebar drawer / bottom nav / footer)
 * ========================================================================= */
.jl-wrap{--ink:#221a20;--muted:#8a7c86;--line:#ece3ea;
  min-height:100vh;display:flex;flex-direction:column;
  background:radial-gradient(1200px 420px at 50% -160px, var(--s,#F6ECF8) 0%, #eef2f6 46%, #eef2f6 100%)}

/* ---------- Header ---------- */
.jl-head{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:9px;
  padding:9px 12px;color:#fff;
  background:linear-gradient(135deg,var(--b2,#025180) 0%,var(--b,#026AA8) 62%,var(--b,#026AA8) 100%);
  box-shadow:0 6px 20px rgba(18,12,24,.16)}
.jl-head:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:rgba(255,255,255,.18)}
.jl-head-logo{flex:0 0 auto;width:38px;height:38px;border-radius:11px;background:#fff;display:flex;align-items:center;justify-content:center;padding:3px;box-shadow:0 4px 12px rgba(0,0,0,.18)}
.jl-head-logo img{max-height:32px;max-width:32px;object-fit:contain;border-radius:6px;background:transparent;padding:0}
.jl-head-tx{min-width:0;flex:1 1 auto}
.jl-head-tx h1{margin:0;font-size:14.5px;font-weight:900;line-height:1.25;color:#fff;letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jl-head-tx p{margin:1px 0 0;font-size:10.5px;color:rgba(255,255,255,.85);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jl-head-act{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.jl-head-act a,.jl-burger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;min-width:36px;padding:0 10px;border-radius:11px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.26);color:#fff !important;font-size:12px;font-weight:800;text-decoration:none !important;cursor:pointer;font-family:inherit;line-height:1;transition:background .15s ease,transform .12s ease}
.jl-head-act a:hover,.jl-burger:hover{background:rgba(255,255,255,.3)}
.jl-head-act a:active,.jl-burger:active{transform:scale(.96)}
.jl-head-act a span{display:none}
.jl-me{display:none;align-items:center;gap:7px;padding:4px 10px 4px 4px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);max-width:230px}
.jl-me .av{width:26px;height:26px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#fff,rgba(255,255,255,.75));color:var(--b2,#025180);font-size:12px;font-weight:900}
.jl-me .nm{font-size:11.5px;font-weight:800;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jl-burger{display:inline-flex}

/* ---------- Body / main ---------- */
.jl-body{display:flex;align-items:flex-start;gap:18px;width:100%;max-width:1240px;margin:0 auto;padding:12px 10px calc(96px + env(safe-area-inset-bottom))}
.jl-main{min-width:0;flex:1 1 auto}
.jl-main > .cjw{max-width:none;margin:0;padding:0}

/* ---------- Sidebar (drawer บนมือถือ / การ์ดบนเดสก์ท็อป) ---------- */
.jl-side{flex:0 0 244px;position:sticky;top:74px;background:#fff;border:1px solid var(--line);
  border-radius:18px;box-shadow:0 12px 30px rgba(35,20,33,.07);overflow:hidden}
.jl-side-hd{position:relative;display:flex;align-items:center;gap:10px;padding:14px 14px 12px;
  background:linear-gradient(135deg,var(--b2,#025180),var(--b,#026AA8));color:#fff}
.jl-side-hd .av{flex:0 0 auto;width:40px;height:40px;border-radius:14px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);color:var(--b2,#025180);font-size:16px;font-weight:900}
.jl-side-hd .tx{min-width:0}
.jl-side-hd b{display:block;font-size:13px;font-weight:900;line-height:1.35;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jl-side-hd small{display:block;font-size:10.5px;color:rgba(255,255,255,.85);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jl-side-x{display:none;position:absolute;right:10px;top:12px;width:30px;height:30px;border-radius:999px;
  border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.2);color:#fff;font-size:13px;cursor:pointer;line-height:1;font-family:inherit}
.jl-side-grp{padding:6px 8px}
.jl-side-grp + .jl-side-grp{border-top:1px solid #f5eef3}
.jl-side h4{margin:8px 8px 4px;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#a99ba6;font-weight:900}
.jl-side h4 i{margin-right:5px;opacity:.8}
.jl-side a{display:flex;align-items:center;gap:10px;min-height:42px;padding:8px 10px;border-radius:12px;
  color:#4c3d49;font-size:12.8px;font-weight:700;text-decoration:none;line-height:1.3;
  transition:background .14s ease,color .14s ease,transform .12s ease}
.jl-side a i{width:28px;height:28px;flex:0 0 28px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:9px;background:var(--s,#F6ECF8);color:var(--b);font-size:12.5px}
.jl-side a span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jl-side a:hover{background:#fbf7fa;text-decoration:none}
.jl-side a.on{background:linear-gradient(135deg,var(--b2,#025180),var(--b,#026AA8));color:#fff;box-shadow:0 8px 18px rgba(2,106,168,.22)}
.jl-side a.on i{background:rgba(255,255,255,.22);color:#fff}
.jl-side a:active{transform:scale(.985)}
.jl-side-ov{display:none}

/* ---------- Footer ---------- */
.jl-foot{width:100%;max-width:1240px;margin:0 auto;padding:16px 14px calc(18px + env(safe-area-inset-bottom));
  display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;justify-content:space-between;
  border-top:1px solid var(--line);background:transparent;font-size:11.5px;color:#8a7c86}
.jl-foot .brand{display:flex;align-items:center;gap:8px;min-width:0}
.jl-foot .brand .dot{width:8px;height:8px;border-radius:999px;background:linear-gradient(135deg,var(--b2),var(--b))}
.jl-foot b{color:#5c4d58;font-weight:900}
.jl-foot-links{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.jl-foot-links a{color:var(--b);font-weight:800;text-decoration:none;padding:5px 10px;border-radius:999px;
  background:#fff;border:1px solid var(--line)}
.jl-foot-links a:hover{border-color:var(--b);text-decoration:none}


/* ---------- Bottom nav (mobile) ---------- */
.jl-bnav{display:none}
@media (max-width:900px){
  .jl-burger{display:inline-flex}
  .jl-body{padding:10px 8px calc(104px + env(safe-area-inset-bottom));gap:0}
  .jl-side{position:fixed;left:0;top:0;bottom:0;z-index:80;width:min(86vw,330px);max-height:none;flex:none;
    border-radius:0 18px 18px 0;display:block;overflow:auto;transform:translateX(-105%);
    transition:transform .24s cubic-bezier(.2,.8,.2,1);padding-top:env(safe-area-inset-top)}
  .jl-side.open{transform:translateX(0)}
  .jl-side-x{display:block}
  .jl-side-ov{display:block;position:fixed;inset:0;z-index:75;background:rgba(20,14,24,.45);opacity:0;
    pointer-events:none;transition:opacity .2s ease}
  .jl-side-ov.on{opacity:1;pointer-events:auto}
  .jl-head-tx h1{font-size:13.5px}
  .jl-head-tx p{display:none}
  .jl-me{display:none!important}
  .jl-foot{padding-bottom:calc(96px + env(safe-area-inset-bottom))}

  .jl-bnav{display:block;position:fixed;left:0;right:0;bottom:0;z-index:70;padding:6px 8px calc(6px + env(safe-area-inset-bottom))}
  .jl-bnav-in{position:relative;display:grid;grid-template-columns:repeat(5,1fr);align-items:end;
    background:linear-gradient(135deg,var(--b2,#025180),var(--b,#026AA8));
    border-radius:18px;padding:7px 6px;box-shadow:0 -6px 24px rgba(18,12,24,.24)}
  .jl-bnav a{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 2px 2px;
    color:rgba(255,255,255,.82)!important;font-size:9.8px;font-weight:800;text-decoration:none!important;line-height:1.2;
    -webkit-tap-highlight-color:transparent}
  .jl-bnav a i{font-size:17px;line-height:1;opacity:.95}
  .jl-bnav a.on{color:#fff!important}
  .jl-bnav a.jl-bnav-mid{position:relative;top:-16px}
  .jl-bnav a.jl-bnav-mid i{width:52px;height:52px;border-radius:999px;display:flex;align-items:center;justify-content:center;
    font-size:20px;color:var(--b2,#025180);background:linear-gradient(160deg,#fff,#eaf1f7);
    border:3px solid rgba(255,255,255,.85);box-shadow:0 10px 22px rgba(0,0,0,.28)}
  .jl-bnav a.jl-bnav-mid span{color:#fff}
  .jl-bnav a.jl-bnav-menu{cursor:pointer}
}
@media (min-width:901px){
  .jl-head{padding:11px 18px;gap:12px}
  .jl-head-logo{width:44px;height:44px;border-radius:13px}
  .jl-head-logo img{max-height:38px;max-width:38px}
  .jl-head-tx h1{font-size:16px}
  .jl-head-tx p{font-size:11.5px}
  .jl-head-act a span{display:inline}
  .jl-head-act a{min-height:38px;font-size:12.5px;padding:0 12px}
  .jl-me{display:inline-flex}
  .jl-burger{display:none!important}
  .jl-side-ov{display:none}
  .jl-body{padding:16px 14px 30px}
}

/* ---------- Dashboard (home.php) ---------- */
.jl-hero{background:linear-gradient(135deg,var(--b) 0%,var(--b2) 100%);color:#fff;border-radius:18px;
  padding:16px;margin:0 0 12px;box-shadow:0 12px 26px -14px rgba(40,10,50,.6);position:relative;overflow:hidden}
.jl-hero:after{content:"";position:absolute;right:-40px;top:-50px;width:150px;height:150px;border-radius:50%;
  background:rgba(255,255,255,.12)}
.jl-hero-hi{margin:0;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
.jl-hero h2{margin:2px 0 4px;font-size:19px;font-weight:900;line-height:1.35;color:#fff}
.jl-hero-sub{margin:0;font-size:12px;opacity:.95;line-height:1.6;word-break:break-word}
.jl-hero-dot{opacity:.6;margin:0 2px}
.jl-hero-badge{display:inline-block;padding:1px 9px;border-radius:999px;background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.34);font-weight:800;font-size:11px}
.jl-hero-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0 0;position:relative;z-index:1}
.jl-hero-stats a{display:block;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.26);
  border-radius:12px;padding:8px 6px;text-align:center;text-decoration:none!important;color:#fff}
.jl-hero-stats a b{display:block;font-size:16px;font-weight:900;line-height:1.2}
.jl-hero-stats a span{display:block;font-size:9.6px;opacity:.92;margin-top:2px;line-height:1.3}
.jl-hero-stats a.ok{background:rgba(34,197,94,.28);border-color:rgba(255,255,255,.42)}
.jl-hero-stats a.warn{background:rgba(255,193,7,.24);border-color:rgba(255,255,255,.42)}

.jl-todo{background:#fff;border:1px solid #ece1ea;border-top:4px solid #e0a100;border-radius:16px;
  padding:14px;margin:0 0 12px;box-shadow:0 10px 24px -18px rgba(40,10,50,.45)}
.jl-todo-hd{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.jl-todo-hd h2{margin:0;font-size:14.5px;font-weight:900;color:var(--b2);flex:1 1 auto;min-width:0}
.jl-todo-pill{background:#fff4e0;color:#a76b00;border:1px solid #f2d29a;border-radius:999px;
  padding:2px 10px;font-size:11px;font-weight:800;white-space:nowrap}
.jl-todo-pill.ok{background:#e7f6ec;color:#1c7a3a;border-color:#bfe6cd}
.jl-todo-sub{margin:6px 0 0;font-size:12px;color:#6b5f6a;line-height:1.6}
.jl-todo-bar{height:9px;border-radius:999px;background:#f0e7ee;overflow:hidden;margin:10px 0 4px}
.jl-todo-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#e0a100,#f3c04a);transition:width .3s}
.jl-todo-bar span.full{background:linear-gradient(90deg,#2e9e57,#4fc37b)}
.jl-todo-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.jl-todo-list li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;font-size:12.5px;font-weight:700}
.jl-todo-list li i{font-size:13px}
.jl-todo-list li.ok{background:#eef9f1;color:#1c7a3a;border:1px solid #d3ecdb}
.jl-todo-list li.no{background:#fdf3e6;color:#a15a00;border:1px solid #f4dcbc}
.jl-todo-list li span{flex:1 1 auto;min-width:0}
.jl-todo-list li a{font-size:11.5px;font-weight:800;color:#b3261e;text-decoration:none;white-space:nowrap}
.jl-todo-list li a:hover{text-decoration:underline}

.jl-sec-title{margin:4px 0 8px;font-size:14px;font-weight:900;color:var(--b2)}
.jl-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin:0 0 12px}
.jl-tile{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #ece1ea;border-radius:14px;
  padding:11px 12px;text-decoration:none!important;color:#3d3340;box-shadow:0 8px 20px -18px rgba(40,10,50,.5);
  transition:transform .15s ease,box-shadow .15s ease}
.jl-tile:hover{transform:translateY(-2px);box-shadow:0 14px 26px -18px rgba(40,10,50,.6)}
.jl-tile-ic{flex:0 0 auto;width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;
  justify-content:center;font-size:16px;color:#fff;background:var(--b)}
.jl-tile-tx{min-width:0;display:block}
.jl-tile-tx b{display:block;font-size:12.8px;font-weight:800;line-height:1.35}
.jl-tile-tx em{display:block;font-style:normal;font-size:10.6px;color:#8a7c86;margin-top:2px;line-height:1.4}
.jl-tile.t1 .jl-tile-ic{background:linear-gradient(135deg,#7c3aed,#a855f7)}
.jl-tile.t1b .jl-tile-ic{background:linear-gradient(135deg,#0e7490,#22d3ee)}
.jl-tile.t2 .jl-tile-ic{background:linear-gradient(135deg,#0b6ea8,#38a1d8)}
.jl-tile.t3 .jl-tile-ic{background:linear-gradient(135deg,#0f766e,#2dd4bf)}
.jl-tile.t4 .jl-tile-ic{background:linear-gradient(135deg,#b45309,#f59e0b)}
.jl-tile.t5 .jl-tile-ic{background:linear-gradient(135deg,#be123c,#fb7185)}
.jl-tile.t6 .jl-tile-ic{background:linear-gradient(135deg,#4338ca,#818cf8)}
.jl-tile.t7 .jl-tile-ic{background:linear-gradient(135deg,#475569,#94a3b8)}
.jl-tile.t8 .jl-tile-ic{background:linear-gradient(135deg,#991b1b,#ef4444)}
.jl-note{display:flex;gap:8px;align-items:flex-start;background:var(--s);border:1px solid #e6d5ea;
  border-radius:13px;padding:10px 12px;font-size:11.8px;color:#5c4d58;line-height:1.65}
.jl-note i{margin-top:2px;color:var(--b)}
.jl-note a{font-weight:800;color:var(--b2)}

@media (max-width:480px){
  .jl-hero{padding:14px;border-radius:16px}
  .jl-hero h2{font-size:17.5px}
  .jl-tiles{grid-template-columns:1fr 1fr;gap:8px}
  .jl-tile{padding:10px;gap:8px;border-radius:13px}
  .jl-tile-ic{width:34px;height:34px;font-size:14px;border-radius:10px}
  .jl-tile-tx b{font-size:11.8px}
  .jl-tile-tx em{font-size:10px}
}

/* =========================================================================
 * v8 — header เต็มจอ · bottom nav เต็มซ้าย-ขวา · เว้นที่ให้เห็น footer
 * ========================================================================= */
html,body{overflow-x:hidden}
.jl-head{width:100%;max-width:none;margin:0;border-radius:0;left:0;right:0}
.jl-wrap > .jl-body{flex:1 1 auto}
.jl-head-logo{text-decoration:none!important}
.jl-head-tx a{color:inherit;text-decoration:none!important;display:block;min-width:0}

/* =========================================================================
 * v11 — แก้ card/เนื้อหาล้นขวาบนมือถือ (box-sizing) + กันทุกหน้าล้นกรอบ
 * ========================================================================= */
/* สาเหตุเดิม: .jl-head/.jl-body/.jl-foot ใช้ width:100% + padding แต่เป็น content-box
   → กว้างเกินวิวพอร์ต 20–24px ทำให้การ์ดถูกตัดด้านขวา */
.jl-wrap,.jl-wrap *,.jl-wrap *::before,.jl-wrap *::after{box-sizing:border-box}

/* กัน flex/grid/ตาราง/รูป ดันให้ล้นออกนอกกรอบ
   ⚠️ ห้ามใส่ max-width:100% ที่ .jl-body (จะทับเพดาน 1240px ทำให้เนื้อหากว้างกว่า header) */
.jl-body{max-width:1240px}
.jl-main,.jl-main > .cjw,.cjw-card,.cjw-row,.cjw-actions{min-width:0;max-width:100%}
.cjw-card{overflow-wrap:anywhere}
.cjw-card img,.cjw-card video,.cjw-card iframe{max-width:100%;height:auto}
.cjw-card table{width:100%;max-width:100%}
.cjw-row > *{min-width:0}
.cjw-card a,.cjw-card b,.cjw-card span{overflow-wrap:anywhere}
@media (max-width:900px){
  .jl-body{padding-left:10px;padding-right:10px}
  .jl-head{padding-left:10px;padding-right:10px}
  .jl-foot{padding-left:12px;padding-right:12px}
  /* การ์ดในมือถือ: ขอบเท่ากันซ้าย-ขวา และไม่ดันจอ */
  .cjw-card{padding:13px}
  .cjw-card h2{font-size:15.5px}
  .cjw-tbl{font-size:12.5px}
  .cjw-btn{max-width:100%}
}

/* หัวลิ้นชัก (การ์ดโปรไฟล์สีม่วง) ให้มุมบนโค้งมนรับกับการ์ด */
.jl-side-hd{border-radius:17px 17px 0 0}

/* กันปุ่ม/ชื่อผู้ใช้ดันจน header ล้นออกนอกกรอบ */
.jl-head-act{flex:0 1 auto;min-width:0;overflow:hidden}
.jl-me{flex:0 1 auto;min-width:0;max-width:210px}
.jl-me .nm{min-width:0;flex:1 1 auto;max-width:150px}

@media (min-width:901px){
  /* header ความกว้างเดียวกับ .jl-body (max 1240) + ขอบล่างโค้ง */
  .jl-head{width:100%;max-width:1240px;margin:0 auto;padding:11px 14px;border-radius:0 0 16px 16px}
  .jl-head:after{left:14px;right:14px}
}
@media (min-width:901px) and (max-width:1279px){
  .jl-head-act a span{display:none!important}
}
@media (min-width:901px) and (max-width:1099px){
  .jl-me{display:none!important}
}
@media (min-width:1280px){
  .jl-head-act a span{display:inline}
}
@media (max-width:900px){
  /* ลิ้นชักมือถือ: มุมขวาบนโค้งตามตัวลิ้นชัก + กันชื่อทับปุ่มปิด */
  .jl-side-hd{border-radius:0 18px 0 0;padding-right:48px}
}

/* v9 — โลโก้ในหัวลิ้นชัก (โลโก้ระบบ → OBEC fallback) */
.jl-side-hd .av.av-logo{background:#fff;padding:3px;overflow:hidden}
.jl-side-hd .av.av-logo img{display:block;width:100%;height:100%;object-fit:contain;border-radius:9px}

@media (max-width:900px){
  /* header: เต็มความกว้าง จัดวางกระชับ อ่านง่าย */
  .jl-head{padding:8px 10px;gap:8px;min-height:56px}
  .jl-head-logo{width:36px;height:36px;border-radius:10px;padding:2px}
  .jl-head-logo img{max-height:30px;max-width:30px}
  .jl-head-tx h1{font-size:13px}
  .jl-head-act a,.jl-burger{min-height:34px;min-width:34px;border-radius:10px}

  /* เนื้อหา: ไม่ชิดขอบและไม่ล้นจอ */
  .jl-body{padding:10px 10px 18px}
  .jl-main{max-width:100%}

  /* bottom nav: เต็มซ้าย-ขวา (ไม่มีขอบ/ระยะข้าง) */
  .jl-bnav{left:0;right:0;bottom:0;padding:0;width:100%}
  .jl-bnav-in{border-radius:0;padding:7px 2px calc(6px + env(safe-area-inset-bottom));
    grid-template-columns:repeat(5,1fr);box-shadow:0 -10px 26px rgba(18,12,24,.22)}
  .jl-bnav a{padding:4px 0 2px;font-size:9.6px}
  .jl-bnav a i{font-size:18px}
  .jl-bnav a.jl-bnav-mid{top:-14px}
  .jl-bnav a.jl-bnav-mid i{width:50px;height:50px;font-size:19px}

  /* footer: เว้นที่ด้านล่างให้พ้น bottom nav → เลื่อนลงไปเห็น footer ได้ */
  .jl-foot{padding:16px 12px calc(96px + env(safe-area-inset-bottom));gap:8px;
    flex-direction:column;align-items:flex-start;font-size:11px}
  .jl-foot-links{padding-bottom:2px}
}



/* =========================================================================
 * v12 — การ์ดหน้า home.php ให้เข้าชุดกับ app.php (การ์ดขาว + ขอบบนสีธีม)
 * ========================================================================= */
.jl-hero{background:#fff;border:1px solid #e9e2e7;border-top:4px solid var(--b);border-radius:14px;
  box-shadow:0 6px 20px rgba(35,20,33,.06);color:#221a20;padding:16px}
.jl-hero:after{display:none}
.jl-hero-hi{color:#8a7c86;letter-spacing:.08em;opacity:1}
.jl-hero h2{color:var(--b2,#025180);font-size:18px;font-weight:900;margin:2px 0 4px}
.jl-hero-sub{color:#6c5d6b;opacity:1}
.jl-hero-dot{color:#c9b9c5}
.jl-hero-badge{background:#e7f6ec;border:1px solid #bfe6cd;color:#1c7a3a;font-weight:800}
.jl-hero-stats a{background:var(--s,#F6ECF8);border:1px solid #e6d5ea;color:var(--b2,#025180)}
.jl-hero-stats a b{color:var(--b)}
.jl-hero-stats a span{color:#6c5d6b;opacity:1}
.jl-hero-stats a.ok{background:#e7f6ec;border-color:#bfe6cd;color:#1c7a3a}
.jl-hero-stats a.warn{background:#fff6e5;border-color:#f0dfc0;color:#8a5300}
.jl-hero-stats a.ok b{color:#1c7a3a}
.jl-hero-stats a.warn b{color:#a15a00}
/* การ์ด to-do: ให้ขอบบนหนาเท่ากับ .cjw-card ของ app.php */
.jl-todo{border-top-width:4px;box-shadow:0 6px 20px rgba(35,20,33,.06)}
/* เมนูลัด: ใช้การ์ดขาวขอบเท่าการ์ดอื่นในระบบ */
.jl-tile{box-shadow:0 6px 20px rgba(35,20,33,.05);border-color:#e9e2e7}
.jl-sec-title{color:var(--b2,#025180)}
@media (max-width:480px){
  .jl-hero{padding:13px}
  .jl-hero h2{font-size:16.5px}
  .jl-hero-stats a{padding:7px 4px}
}


/* header: ให้ขอบซ้าย/ขวาตรงกับกรอบการ์ด (เมนู + เนื้อหา) พอดี
   body container 1240 - padding 14*2 = 1212 → header ใช้ความกว้างเดียวกันและจัดกึ่งกลาง */
@media (min-width:901px){
  .jl-head{width:calc(100% - 28px);max-width:1212px;margin:0 auto;padding:11px 14px;
    border-radius:0 0 16px 16px}
  .jl-head:after{left:14px;right:14px}
}

/* =========================================================================
 * v14 — bottom nav ให้บางลง (จาก 84px → ~46px)
 * ไอคอนกลางใช้ absolute ลอยขึ้น ไม่ดันความสูงของแถบ
 * ========================================================================= */
@media (max-width:900px){
  .jl-bnav-in{padding:5px 2px calc(5px + env(safe-area-inset-bottom));align-items:end;
    box-shadow:0 -6px 18px rgba(18,12,24,.18)}
  .jl-bnav a{min-height:40px;gap:2px;padding:3px 0 1px;font-size:9.2px;line-height:1.15}
  .jl-bnav a i{height:18px;font-size:17px}
  .jl-bnav a.jl-bnav-mid{top:0;padding-top:0;overflow:visible}
  .jl-bnav a.jl-bnav-mid i{position:absolute;left:50%;top:-24px;transform:translateX(-50%);
    width:44px;height:44px;font-size:17px;border-width:2px}
  .jl-bnav a.jl-bnav-mid span{padding-top:21px}
  /* footer: ลดที่ว่างด้านล่างให้พอดีกับความสูงใหม่ */
  .jl-foot{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
}


/* =========================================================================
 * v15 — ปุ่มกระดิ่ง (จำนวนรายการค้าง) + modal “รายการที่ต้องดำเนินการ”
 * ========================================================================= */
/* ให้ badge เลขไม่ถูกตัด (เดิม .jl-head-act ใช้ overflow:hidden) */
.jl-head-act{overflow:visible}
.jl-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;
  min-width:38px;min-height:38px;padding:0 9px;border-radius:11px;
  background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.26);
  color:#fff!important;font-size:14px;cursor:pointer;font-family:inherit;line-height:1;
  transition:background .15s ease,transform .12s ease}
.jl-bell:hover{background:rgba(255,255,255,.3)}
.jl-bell:active{transform:scale(.96)}
.jl-bell i{font-size:15px;line-height:1}
.jl-bell-cnt{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#e11d48;color:#fff;font-size:10.5px;font-weight:900;
  display:inline-flex;align-items:center;justify-content:center;line-height:1;
  border:2px solid rgba(255,255,255,.9);box-shadow:0 2px 6px rgba(225,29,72,.45)}

.jl-modal{position:fixed;inset:0;z-index:9500;display:none}
.jl-modal.open{display:block}
.jl-modal-bd{position:absolute;inset:0;background:rgba(24,14,22,.5)}
.jl-modal-dlg{position:relative;max-width:520px;margin:6vh auto;background:#fff;border-radius:16px;
  box-shadow:0 24px 60px rgba(20,10,20,.35);overflow:hidden;display:flex;flex-direction:column;max-height:86vh}
.jl-modal-hd{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 15px;
  border-bottom:1px solid #f0e7ee;background:linear-gradient(135deg,var(--s,#F6ECF8),#fff)}
.jl-modal-hd h3{margin:0;font-size:14.5px;font-weight:900;color:var(--b2,#025180);
  display:flex;align-items:center;gap:7px}
.jl-modal-hd h3 i{color:var(--b);font-size:14px}
.jl-modal-x{border:0;background:#fff;color:var(--b2);width:30px;height:30px;border-radius:999px;
  cursor:pointer;font-weight:900;font-size:14px;line-height:1;box-shadow:0 2px 8px rgba(35,20,33,.14)}
.jl-modal-x:hover{background:var(--s,#F6ECF8)}
.jl-modal-body{padding:13px 15px;overflow:auto}
.jl-modal-body .jl-todo-hd{margin:0 0 2px}
.jl-modal-body .jl-todo-sub{margin:4px 0 0}
.jl-modal-ft{display:flex;justify-content:flex-end;gap:8px;padding:10px 15px;
  border-top:1px solid #f0e7ee;background:#fdfbfd}
@media (max-width:560px){
  /* มือถือ: แสดงเป็น bottom sheet (ไม่ยืดเต็มจอจนโล่ง) */
  .jl-modal-dlg{position:absolute;left:0;right:0;bottom:0;top:auto;margin:0;max-width:none;
    width:auto;max-height:88vh;border-radius:16px 16px 0 0}
  .jl-modal-body{padding:11px 12px}
  .jl-bell{min-width:34px;min-height:34px;padding:0 7px}
}


/* v18 - จัด label ของปุ่มกลาง (โปรไฟล์) ให้ตรงบรรทัดเดียวกับเมนูอื่น */
@media (max-width:900px){
  .jl-bnav a.jl-bnav-mid span{padding-top:0;margin-top:23px}
  .jl-bnav a{justify-content:flex-start}
}
