/* =====================================================================
   ESARNTECH CONNECT 1.0 — ธีม "เขียวอีสานเหนือ" (ส่วนท้ายไฟล์) บนโครง Clean Minimal Enterprise
   โหลดต่อจาก app.css / ux.css เมื่อเปิดหน้าตาใหม่ (ค่าตั้ง ui_theme) · ปิดได้ทันทีโดยไม่กระทบการทำงาน
   สีหลัก #075638 · สีรอง #16865C · พื้น #F5F7F8 · เนื้อหา #FFFFFF · ตัวอักษร Sarabun (เก็บในเครื่องแม่ข่าย)
   ความคมชัดสีผ่าน WCAG 2.2 AA (ข้อความปกติ ≥ 4.5:1)
   ===================================================================== */
@font-face { font-family: 'Sarabun'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/sarabun/Sarabun-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Sarabun'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/sarabun/Sarabun-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/sarabun/Sarabun-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Sarabun'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/sarabun/Sarabun-Bold.woff2') format('woff2'); }

:root {
  --green: #075638; --green-2: #16865C; --green-dark: #04432B;
  --lime: #8CCB6A; --mint: #E9F4EE; --mint-2: #F5F7F8;
  --line: #E1E7E3; --line-2: #EDF1EE;
  --ink: #18231D; --muted: #56635B; --field: #C3CDC7;
  --bg: #F5F7F8; --surface: #FFFFFF;
  --red: #B42318; --red-bg: #FDECEA; --amber: #8A4A06; --amber-bg: #FDF5E9; --amber-line: #F0CF9E; --blue: #1D4E89; --blue-bg: #EAF1FA;
  /* สีสถานะมาตรฐานทุกระบบ (ใช้คู่กับไอคอน/ข้อความเสมอ) */
  --st-wait: #8A4A06; --st-wait-bg: #FDF5E9;
  --st-ok: #075638; --st-ok-bg: #E4F3EA;
  --st-bad: #B42318; --st-bad-bg: #FDECEA;
  --st-back: #6B3FA0; --st-back-bg: #F2ECF9;
  --st-info: #1D4E89; --st-info-bg: #EAF1FA;
  --radius: 10px;
  --font: 'Sarabun', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  --font-head: 'Sarabun', 'Noto Sans Thai', 'Leelawadee UI', sans-serif;
  --side-w: 248px; --side-mini: 64px; --top-h: 60px;
  --shadow-1: 0 1px 2px rgba(16, 24, 20, .05);
  --shadow-2: 0 8px 24px rgba(16, 24, 20, .10);
}
body.cx { background: var(--bg); font-size: 15px; color: var(--ink); }
.cx h1, .cx h2, .cx h3 { font-weight: 700; letter-spacing: 0; }
.cx .h1 { font-size: 22px; color: var(--ink); }
.cx .h2 { font-size: 18px; color: var(--ink); }
.cx .h3 { font-size: 16px; }
.cx a { color: var(--green); }
.cx :focus-visible { outline: 3px solid #7FC29B; outline-offset: 2px; }

/* ลดเอฟเฟ็กต์ที่ไม่จำเป็น (ux.css) — คงไว้เฉพาะ hover เบา ๆ */
.cx .content > .card, .cx .content > section.card, .cx .content > .grid > .stat, .cx .content > .alert, .cx .side-sec[open] > .side-sub { animation: none; }
.cx .btn:not(:disabled):hover { transform: none; box-shadow: none; }
.cx .icon-btn:hover { transform: none; }
.cx a.stat:hover, .cx .stat:hover { transform: none; box-shadow: var(--shadow-2); }
.cx .side-sec > summary:hover .side-ico, .cx .side-top:hover .side-ico { transform: none; }
.cx .side-sub .side-link:hover { transform: none; }

/* ---------------- Sidebar (พื้นขาว เรียบ) ---------------- */
.cx .side { width: var(--side-w); flex: 0 0 var(--side-w); background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); padding: 0 10px 0; scrollbar-color: #CBD5CF transparent; transition: width .18s ease, flex-basis .18s ease; }
.cx .side-head { position: sticky; top: 0; z-index: 3; background: var(--surface); flex-direction: row; align-items: center; min-height: var(--top-h); padding: 8px 4px; margin: 0 -10px; padding-left: 14px; padding-right: 8px; border-bottom: 1px solid var(--line); }
.cx .cx-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1; }
.cx .cx-mark { width: 84px; height: 36px; flex: 0 0 84px; object-fit: contain; }
.cx .cx-bt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cx .cx-bt b { font-size: 14.5px; font-weight: 700; color: var(--green); letter-spacing: .02em; white-space: nowrap; }
.cx .cx-bt small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .side-close { color: var(--muted); }
.cx .side-user { background: var(--mint-2); border: 1px solid var(--line); border-radius: 10px; margin: 10px 2px 8px; padding: 10px; }
.cx .side-user-name { color: var(--ink); font-size: 14.5px; }
.cx .side-user-role, .cx .side-user label { color: var(--muted); }
.cx .side-user-switch { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.cx .side-user-switch:hover, .cx .side-user-switch:focus-visible { background: var(--mint); }
.cx .side-user-chg { color: var(--green); }
/* ตัวเลือกบทบาทในแถบด้านข้าง (side-role-picker) บนพื้นขาว */
.cx .side-role-picker[open] > summary { background: var(--mint); }
.cx .side-role-options { background: #fff; border: 1px solid var(--line); }
.cx .side-role-choice { color: var(--ink); }
.cx .side-role-choice:hover, .cx .side-role-choice:focus-visible { background: var(--mint); }
.cx .side-role-choice.active { background: var(--green); color: #fff; }
.cx .side-search { background: var(--surface); top: var(--top-h); }
.cx .side-search input { background: var(--mint-2); border: 1px solid var(--line); }
.cx .side-empty { color: var(--muted); }
.cx .side-cat { color: #6B7A72; font-size: 11.5px; letter-spacing: .04em; padding: 14px 10px 4px; }
.cx .side-cat::after { background: linear-gradient(90deg, var(--line), transparent); }
.cx .side-link { color: var(--ink); }
.cx .side-link:hover, .cx .side-sec > summary:hover { background: var(--mint-2); color: var(--green-dark); }
.cx .side-sec > summary { color: var(--ink); font-weight: 600; }
.cx .side-sec[open] > summary { background: transparent; }
.cx .side-sec[data-active] > summary { color: var(--green); }
.cx .side-sec[data-active] > summary::after { background: var(--green-2); }
.cx .side-ico { color: var(--muted); opacity: 1; }
.cx .side-sec[data-active] > summary .side-ico, .cx .side-top.on .side-ico { color: var(--green); }
.cx .side-chev { color: #8A9790; }
.cx .side-sub { border-left-color: var(--line); }
.cx .side-link.on, .cx .side-top.on, .cx .side-sub .side-link.on { background: var(--mint); color: var(--green); font-weight: 700; box-shadow: none; }
.cx .side-sub .side-link.on::before { background: var(--green); box-shadow: none; }
.cx .side-link mark { background: #FFE58A; color: var(--ink); }
.cx .side-count { color: var(--green); background: var(--mint); }
.cx .side-logout { background: var(--surface); border-top: 1px solid var(--line); color: var(--red); display: flex; align-items: center; gap: 10px; margin: auto -10px 0; padding: 12px 20px 14px; bottom: 0; }
.cx .side-logout .side-ico { color: var(--red); }
.cx .side-logout:hover { background: var(--red-bg); color: var(--red); }

/* ---------------- Header ---------------- */
.cx .topbar { min-height: var(--top-h); padding: 6px 22px; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: none; }
.cx .cx-collapse { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; }
.cx .cx-collapse:hover { background: var(--mint-2); color: var(--green); }
.cx .cx-ttl { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
.cx .cx-crumb { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .cx-crumb a { color: var(--muted); text-decoration: none; }
.cx .cx-crumb a:hover { color: var(--green); text-decoration: underline; }
.cx .cx-crumb span[aria-hidden] { color: #9AA6A0; }
.cx .cx-h { font-size: 17px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .topbar-meta { color: var(--muted); font-size: 13.5px; background: var(--mint-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.cx .icon-btn { border-color: var(--line); color: var(--muted); border-radius: 9px; }
.cx .icon-btn:hover { background: var(--mint-2); color: var(--green); }
.cx .online-presence { border-color: var(--line); background: #fff; color: var(--green); }
.cx .online-presence strong { font-family: var(--font); }
.cx .user-menu > summary { border-color: var(--line); }
.cx .user-menu > summary:hover { background: var(--mint-2); }
.cx .um-av { background: var(--green); }
.cx .um-pop { border-color: var(--line); box-shadow: var(--shadow-2); }

/* ---------------- เนื้อหา ---------------- */
.cx .content { padding: 20px 24px 40px; gap: 16px; max-width: 1440px; }
.cx .foot.cx-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px 24px 22px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.cx .foot.cx-foot b { color: var(--green); }
.cx .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-1); }
.cx .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-1); }
.cx .stat-label { font-size: 13.5px; color: var(--muted); }
.cx .stat-value { font-family: var(--font); font-weight: 700; font-size: 26px; color: var(--ink); }
.cx a.stat { color: inherit; text-decoration: none; }
.cx a.stat .stat-value { color: var(--green); }
.cx .stat.warn { background: var(--amber-bg); border-color: var(--amber-line); }
.cx .stat.bad { background: var(--red-bg); }
.cx .grid { gap: 12px; }

/* ปุ่ม: หลัก · รอง · เบา · อันตราย */
.cx .btn, .cx a.btn, .cx a.btn:hover { color: #fff; text-decoration: none; }
.cx .btn-outline, .cx a.btn-outline, .cx .btn-ghost, .cx a.btn-ghost { color: var(--green); }
.cx a.btn-outline:hover, .cx a.btn-ghost:hover { color: var(--green-dark); }
.cx .btn-danger, .cx a.btn-danger, .cx a.btn-danger:hover { color: var(--red); }
.cx .btn { min-height: 38px; border-radius: 8px; font-weight: 600; font-size: 14.5px; background: var(--green); border-color: var(--green); }
.cx .btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.cx .btn-outline { background: #fff; color: var(--green); border-color: var(--field); }
.cx .btn-outline:hover { background: var(--mint-2); color: var(--green-dark); border-color: var(--green-2); }
.cx .btn-ghost { background: transparent; border-color: transparent; color: var(--green); }
.cx .btn-ghost:hover { background: var(--mint-2); }
.cx .btn-danger { background: #fff; color: var(--red); border-color: #E7A49D; }
.cx .btn-danger:hover { background: var(--red-bg); }
.cx .btn-sm { min-height: 32px; border-radius: 7px; font-size: 13.5px; }
.cx .btn[disabled], .cx .btn:disabled { background: #E3E8E5; border-color: #E3E8E5; color: #6B7A72; }

/* ช่องกรอก */
.cx input:not([type]), .cx input[type=text], .cx input[type=password], .cx input[type=number], .cx input[type=date], .cx input[type=search], .cx input[type=email], .cx input[type=tel], .cx input[type=url], .cx select, .cx textarea { border-color: var(--field); border-radius: 8px; background: #fff; }
.cx input:focus, .cx select:focus, .cx textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(22, 134, 92, .16); outline: none; }
.cx .field label, .cx .label { color: var(--ink); font-weight: 600; }
.cx input[type=checkbox], .cx input[type=radio] { accent-color: var(--green); }

/* ตาราง */
.cx .table-wrap { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cx table.tbl { font-size: 14px; }
.cx .tbl th { background: #F3F6F4; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
.cx .tbl thead th { box-shadow: inset 0 -1px 0 var(--line); }
.cx .tbl td { border-bottom: 1px solid var(--line-2); }
.cx .tbl tbody tr:hover, .cx .tbl tr:hover td { background: #F8FBF9; }
.cx .tbl tr:last-child td { border-bottom: 0; }
.cx .card > .table-wrap, .cx .card .table-wrap { border-radius: 10px; }

/* ป้าย/สถานะมาตรฐาน */
.cx .badge { border-radius: 999px; font-weight: 600; font-size: 12.5px; min-height: 24px; padding: 0 10px; }
.cx .badge-ok { background: var(--st-ok-bg); color: var(--st-ok); }
.cx .badge-warn { background: var(--st-wait-bg); color: var(--st-wait); }
.cx .badge-bad { background: var(--st-bad-bg); color: var(--st-bad); }
.cx .badge-info { background: var(--st-info-bg); color: var(--st-info); }
.cx .badge-neutral { background: #EEF1EF; color: var(--muted); }
.cx .badge-back { background: var(--st-back-bg); color: var(--st-back); }
.cx .st { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cx .st::before { font-weight: 700; }
.cx .st-wait { background: var(--st-wait-bg); color: var(--st-wait); } .cx .st-wait::before { content: '⏳'; }
.cx .st-ok { background: var(--st-ok-bg); color: var(--st-ok); } .cx .st-ok::before { content: '✓'; }
.cx .st-bad { background: var(--st-bad-bg); color: var(--st-bad); } .cx .st-bad::before { content: '✕'; }
.cx .st-back { background: var(--st-back-bg); color: var(--st-back); } .cx .st-back::before { content: '↩'; }

/* แจ้งผล */
.cx .alert { border-radius: 10px; }
.cx .alert-success { background: #EEF7F1; border-color: #A9D6B9; color: #12402A; }
.cx .alert-success::before { background: var(--green-2); }

/* แท็บ / แบ่งหน้า */
.cx .tabs, .cx .pp-tabs { border-bottom-color: var(--line); }
.cx .tabs a.on, .cx .pp-tabs > a.on { color: var(--green); border-bottom-color: var(--green); }
.cx .pager a, .cx .pager .current { border-color: var(--line); border-radius: 7px; }
.cx .pager .current { background: var(--green); border-color: var(--green); }

/* แจ้งข่าวอัปเดต · โทสต์ */
.cx .ux-news { background: #fff !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow-1); }
.cx .toast { background: var(--ink); border-radius: 10px; }

/* ---------------- Sidebar แบบยุบ (คอมพิวเตอร์) ---------------- */
@media (min-width: 961px) {
  html.cx-mini .cx .side { position: fixed; left: 0; top: 0; height: 100vh; width: var(--side-mini); z-index: 30; overflow-x: hidden; }
  html.cx-mini .cx .main-col { margin-left: var(--side-mini); }
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .cx-bt,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-user,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-search,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-cat,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-sub,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-chev,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .cx-lbl,
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-sec > summary > span { display: none; }
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-sec > summary, html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-top, html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-logout { justify-content: center; padding-left: 0; padding-right: 0; }
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-sec[data-active] > summary { background: var(--mint); }
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-head { padding-left: 14px; }
  html.cx-mini .cx .side:hover, html.cx-mini .cx .side:focus-within { width: var(--side-w); box-shadow: var(--shadow-2); }
}

/* ---------------- จอแท็บเล็ต/มือถือ ---------------- */
@media (max-width: 960px) {
  .cx .cx-collapse { display: none; }
  .cx .side { width: min(300px, 86vw); padding-bottom: 0; }
  .cx .menu-btn { border-color: var(--line); color: var(--green); }
  .cx .topbar { padding: 6px 12px; }
  .cx .content { padding: 14px 12px 32px; }
  .cx .cx-crumb { display: none; }
  .cx .cx-h { font-size: 16px; }
}
@media (max-width: 760px) {
  .cx .grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .cx .stat { padding: 12px 14px; }
  .cx .tbl-cards tr { border-color: var(--line); border-radius: 10px; box-shadow: var(--shadow-1); }
  .cx .online-presence { display: none; }
  .cx .stat-value { font-size: 22px; }
}
/* ป้องกันเลื่อนแนวนอนทั้งหน้า (ตารางกว้างเลื่อนเฉพาะในกรอบ) */
.cx .main-col { overflow-x: clip; }
.cx .content img { max-width: 100%; }

@media print {
  .cx { background: #fff; }
  .cx .cx-collapse, .cx .cx-crumb, .cx .cx-foot { display: none !important; }
  .cx .card, .cx .stat { box-shadow: none; }
  html.cx-mini .cx .main-col { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .cx .side { transition: none; } }

/* ---------------- หน้าเข้าสู่ระบบ ---------------- */
body.bare.cx { background: var(--bg); }
.cx .login-brand.cx-lb { background: var(--green); padding: 44px 48px; gap: 28px; }
.cx .cx-lb-top { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }
.cx .cx-lb-top img { width: 220px; height: auto; max-width: 70%; }
.cx .login-brand.cx-lb h1 { font-size: 40px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.cx .login-brand.cx-lb p { color: #D7EEE2; font-size: 17px; margin: 6px 0 0; }
.cx .login-brand.cx-lb .cx-lb-th { color: #fff; font-size: 19px; font-weight: 600; margin-top: 4px; }
.cx .cx-lb-pts { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; color: #E6F4EC; font-size: 15px; }
.cx .cx-lb-pts li::before { content: '✓'; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.16); margin-right: 8px; font-size: 12px; }
.cx .cx-lb-foot { color: #BFE0CF; }
.cx .login-form { background: var(--bg); }
.cx .login-form form { border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-1); }
@media (max-width: 700px) { .cx .login-brand.cx-lb { padding: 22px 18px; gap: 10px; } .cx .login-brand.cx-lb h1 { font-size: 26px; } .cx .cx-lb-pts, .cx .cx-lb-foot { display: none; } }
@media (max-width: 700px) { .cx .login-brand.cx-lb .cx-lb-th { font-size: 15px; } .cx .login-brand.cx-lb p:not(.cx-lb-th) { display: none; } }

/* ---------------- Dashboard ---------------- */
.cx .cx-dash { display: flex; flex-direction: column; gap: 16px; }
.cx .cx-hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.cx .cx-hello .h1 { margin: 0 0 2px; }
.cx .cx-hello-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.cx .cx-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cx .cx-main, .cx .cx-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cx .cx-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cx .card-head { margin-bottom: 10px; }
.cx .card-head .h2, .cx .card-head .h3 { margin: 0; }
.cx .cx-empty { color: var(--muted); font-size: 14px; margin: 4px 0; }
.cx .cx-todo { list-style: none; margin: 0; padding: 0; }
.cx .cx-todo li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.cx .cx-todo li:first-child { border-top: 0; padding-top: 2px; }
.cx .cx-todo li > span { min-width: 0; flex: 1 1 auto; }
.cx .cx-todo .btn { flex: 0 0 auto; }
.cx .cx-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cx .cx-bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.cx .cx-bars .cx-bl { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .cx-bars .cx-bt { height: 10px; background: #EEF2EF; border-radius: 99px; overflow: hidden; }
.cx .cx-bars .cx-bt i { display: block; height: 100%; border-radius: 99px; background: var(--green-2); }
.cx .cx-bars i.k-warn { background: #D9902B; } .cx .cx-bars i.k-bad { background: #C8463A; } .cx .cx-bars i.k-info { background: #3B74B8; } .cx .cx-bars i.k-neutral { background: #9AA6A0; }
.cx .cx-bars b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx .cx-list { list-style: none; margin: 0; padding: 0; }
.cx .cx-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.cx .cx-list li:first-child { border-top: 0; padding-top: 0; }
.cx .cx-list a { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--ink); }
.cx .cx-list a:hover b { color: var(--green); text-decoration: underline; }
.cx .cx-list b { font-weight: 600; font-size: 14px; }
.cx .cx-notif li.unread b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green-2); margin-right: 6px; vertical-align: middle; }
.cx .cx-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cx .cx-quick a { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; text-decoration: none; color: var(--ink); background: #fff; min-width: 0; }
.cx .cx-quick a:hover { border-color: var(--green-2); background: var(--mint-2); }
.cx .cx-quick b { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.cx .cx-quick small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .cx-prog { display: inline-block; width: 70px; height: 8px; background: #EEF2EF; border-radius: 99px; overflow: hidden; vertical-align: middle; }
.cx .cx-prog i { display: block; height: 100%; background: var(--green-2); }
.cx .cx-tt li { justify-content: flex-start; }
.cx .cx-tt li > span:last-child { display: flex; flex-direction: column; }
.cx .cx-per { flex: 0 0 74px; font-size: 12.5px; font-weight: 700; color: var(--green); background: var(--mint); border-radius: 8px; padding: 4px 8px; text-align: center; }
.cx a.stat .small { color: var(--muted); }
@media (max-width: 1100px) { .cx .cx-cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cx .cx-todo li { flex-wrap: wrap; } .cx .cx-charts { grid-template-columns: 1fr; } }

/* โลโก้วงรี (ไม่เป็นทางการ) ในระบบ · ตรากลมใช้เฉพาะเอกสาร/รายงานทางราชการ */
.cx .cx-bt b { font-size: 13px; }
.cx .cx-bt small { font-size: 10px; }
@media (min-width: 961px) { html.cx-mini .cx .side:not(:hover):not(:focus-within) .cx-mark { width: 40px; flex-basis: 40px; } html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-head { padding-left: 10px; } }
@media (max-width: 700px) { .cx .cx-lb-top img { width: 160px; } }

/* ---------------- ตารางมาตรฐาน (datatable) ---------------- */
.cx .dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.cx .dt-search { display: flex; gap: 6px; align-items: center; flex: 1 1 280px; min-width: 0; }
.cx .dt-search input[type=search] { flex: 1 1 auto; min-width: 0; min-height: 36px; height: 36px; }
.cx .dt-count { margin-right: auto; }
.cx a.dt-sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.cx a.dt-sort span { font-size: 10px; color: #9AA6A0; }
.cx a.dt-sort.on, .cx a.dt-sort.on span { color: var(--green); }
.cx a.dt-sort:hover { color: var(--green); }
@media print { .dt-bar, .pager { display: none !important; } }

/* =====================================================================
   ธีม ก. เขียวอีสานเหนือ (v2.23)
   - เมนูซ้ายเขียวเข้มจากตราวิทยาลัย ลายผ้าขิดอีสาน (ข้าวหลามตัด) เคลื่อนไหวช้า ๆ + แสงเขียวอ่อน
   - ไอคอนเมนูสีตามงาน · พื้นหลังเขียวอ่อน · แถบสีบนการ์ดตัวเลข · แถบต้อนรับหน้าแรกสีเขียว
   - ปุ่มยังใช้สีเดียวทั้งระบบ · ผู้ที่ตั้งค่า "ลดการเคลื่อนไหว" ในเครื่องจะไม่เห็นภาพเคลื่อนไหว
   ===================================================================== */
:root {
  --bg: #EEF5F0; --mint-2: #F3F8F4;
  --side-1: #086141; --side-2: #064A31; --side-3: #043624;
  --side-ink: #E8F4EC; --side-mute: #A9D3BA; --side-line: rgba(255, 255, 255, .13);
  --kkit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.075' stroke-width='1.2'%3E%3Cpath d='M16 2 30 16 16 30 2 16Z'/%3E%3Cpath d='M16 9.5 22.5 16 16 22.5 9.5 16Z'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='1.7' fill='%23ffffff' fill-opacity='.12'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%23ffffff' fill-opacity='.08'/%3E%3Ccircle cx='32' cy='32' r='1.3' fill='%23ffffff' fill-opacity='.08'/%3E%3C/svg%3E");
}
@keyframes cx-drift {
  from { background-position: 0% 0%, 100% 100%, 0 0, 0 0; }
  to   { background-position: 60% 40%, 40% 70%, 64px 128px, 0 0; }
}

/* ---- เมนูซ้าย ---- */
.cx .side {
  color: var(--side-ink); border-right: 0; scrollbar-color: rgba(255, 255, 255, .25) transparent;
  background-color: var(--side-2);
  background-image:
    radial-gradient(closest-side, rgba(140, 203, 106, .30), transparent),
    radial-gradient(closest-side, rgba(38, 170, 112, .38), transparent),
    var(--kkit),
    linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 55%, var(--side-3) 100%);
  background-size: 240% 60%, 260% 70%, 32px 32px, 100% 100%;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
  box-shadow: 2px 0 14px rgba(4, 54, 36, .18);
}
@media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
  .cx .side { animation: cx-drift 38s ease-in-out infinite alternate; }
}
.cx .side-head { background: rgba(4, 54, 36, .55); border-bottom: 1px solid var(--side-line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cx .cx-mark { background: #fff; border-radius: 999px; padding: 3px 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.cx .cx-bt b { color: #fff; }
.cx .cx-bt small { color: var(--side-mute); }
.cx .side-close { color: #fff; }
.cx .side-user { background: rgba(255, 255, 255, .08); border: 1px solid var(--side-line); }
.cx .side-user-name { color: #fff; }
.cx .side-user-role, .cx .side-user label { color: var(--side-mute); }
.cx .side-user-switch { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.cx .side-user-switch:hover, .cx .side-user-switch:focus-visible, .cx .side-role-picker[open] > summary { background: rgba(255, 255, 255, .2); }
.cx .side-user-chg { color: #C8F0A8; }
.cx .side-search { background: transparent; }
.cx .side-search input { background: rgba(255, 255, 255, .1); border: 1px solid var(--side-line); color: #fff; }
.cx .side-search input::placeholder { color: var(--side-mute); }
.cx .side-empty { color: var(--side-mute); }
.cx .side-cat { color: #9FD8B4; font-weight: 600; }
.cx .side-cat::after { background: linear-gradient(90deg, rgba(255, 255, 255, .22), transparent); }
.cx .side-link, .cx .side-sec > summary { color: var(--side-ink); }
.cx .side-link:hover, .cx .side-sec > summary:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.cx .side-sec[data-active] > summary { color: #fff; }
.cx .side-sec[data-active] > summary::after { background: #9BE07A; }
.cx .side-chev { color: var(--side-mute); }
.cx .side-sub { border-left-color: rgba(255, 255, 255, .16); }
.cx .side-sub .side-link { color: #D3EADB; }
.cx .side-link.on, .cx .side-top.on, .cx .side-sub .side-link.on { background: #fff; color: var(--green); font-weight: 700; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.cx .side-sub .side-link.on::before { background: #9BE07A; }
.cx .side-link mark { background: #FFE58A; color: var(--ink); }
.cx .side-count { color: var(--side-3); background: #B8EC98; }
.cx .side-logout { background: var(--side-3); border-top: 1px solid var(--side-line); color: #FFC2B8; }
.cx .side-logout .side-ico { color: #FFC2B8; background: rgba(255, 120, 100, .16); }
.cx .side-logout:hover { background: #3A1F1A; color: #FFD9D2; }
@media (min-width: 961px) {
  html.cx-mini .cx .side:not(:hover):not(:focus-within) .side-sec[data-active] > summary { background: rgba(255, 255, 255, .14); }
}

/* ไอคอนเมนูสีตามงาน (ชิปสีพื้น ไอคอนขาว) */
.cx .side-sec > summary .side-ico, .cx .side-top .side-ico, .cx .side-logout .side-ico {
  box-sizing: content-box; padding: 5px; border-radius: 8px; flex: 0 0 auto;
  color: #fff; background: var(--ic, rgba(255, 255, 255, .14)); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.cx [data-ico=home]     { --ic: linear-gradient(135deg, #2BB673, #138A55); }
.cx [data-ico=book], .cx [data-ico=calendar], .cx [data-ico=clock] { --ic: linear-gradient(135deg, #4C8FE0, #2563B0); }
.cx [data-ico=send], .cx [data-ico=check] { --ic: linear-gradient(135deg, #23B5A6, #0E8478); }
.cx [data-ico=users], .cx [data-ico=cap]  { --ic: linear-gradient(135deg, #8CCB4A, #4E9A2A); }
.cx [data-ico=doc], .cx [data-ico=print], .cx [data-ico=upload] { --ic: linear-gradient(135deg, #9B7BE0, #6B48B8); }
.cx [data-ico=money]    { --ic: linear-gradient(135deg, #F5A13C, #D7701A); }
.cx [data-ico=chart]    { --ic: linear-gradient(135deg, #36B4D8, #1A84A8); }
.cx [data-ico=star]     { --ic: linear-gradient(135deg, #F1C232, #C8930A); }
.cx [data-ico=idcard]   { --ic: linear-gradient(135deg, #EE6E96, #C23E68); }
.cx [data-ico=user], .cx [data-ico=gear] { --ic: linear-gradient(135deg, #8DA39A, #5E7469); }
.cx .side-link.on .side-ico, .cx .side-top.on .side-ico { color: #fff; }

/* ---- แถบบน ---- */
.cx .topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 0; box-shadow: 0 1px 0 var(--line); position: sticky; }
.cx .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--green) 0%, #16865C 40%, #8CCB4A 75%, #F1C232 100%); opacity: .9; pointer-events: none; }
.cx .topbar-meta { background: var(--mint); border-color: #CFE6D7; color: var(--green-dark); }

/* ---- เนื้อหา ---- */
body.cx { background: var(--bg) radial-gradient(1200px 500px at 100% -10%, rgba(140, 203, 106, .16), transparent 70%) no-repeat; }
.cx .card, .cx .stat { border-color: #DCE9E0; }
.cx .card-head .h2, .cx .card-head .h3, .cx .cx-dash .card > .h2:first-child { display: flex; align-items: center; gap: 8px; }
.cx .card-head .h2::before, .cx .card-head .h3::before { content: ''; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, #16865C, #8CCB4A); flex: 0 0 4px; }
/* การ์ดตัวเลข: แถบสีด้านบนวนสี */
.cx .grid > .stat { position: relative; overflow: hidden; border-top: 0; }
.cx .grid > .stat::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--k, #16865C); }
.cx .grid > .stat:nth-child(6n+1) { --k: linear-gradient(90deg, #16865C, #8CCB4A); }
.cx .grid > .stat:nth-child(6n+2) { --k: linear-gradient(90deg, #2563B0, #4C8FE0); }
.cx .grid > .stat:nth-child(6n+3) { --k: linear-gradient(90deg, #0E8478, #23B5A6); }
.cx .grid > .stat:nth-child(6n+4) { --k: linear-gradient(90deg, #D7701A, #F5A13C); }
.cx .grid > .stat:nth-child(6n+5) { --k: linear-gradient(90deg, #6B48B8, #9B7BE0); }
.cx .grid > .stat:nth-child(6n+6) { --k: linear-gradient(90deg, #C8930A, #F1C232); }
.cx .grid > .stat.warn::before { background: #D9902B; }
.cx .grid > .stat.bad::before { background: #C8463A; }
.cx a.stat:hover { border-color: #9FD0B0; }

/* แถบต้อนรับหน้าแรก */
.cx .cx-hello {
  color: #fff; border-radius: 14px; padding: 18px 22px;
  background-color: var(--green);
  background-image: radial-gradient(420px 200px at 100% 0%, rgba(140, 203, 106, .45), transparent 70%), var(--kkit), linear-gradient(120deg, #075638 0%, #0B6B45 55%, #16865C 100%);
  background-size: 100% 100%, 32px 32px, 100% 100%;
  box-shadow: 0 8px 22px rgba(7, 86, 56, .18);
}
.cx .cx-hello .h1 { color: #fff; }
.cx .cx-hello .muted, .cx .cx-hello .small { color: #D6EEDF; }
.cx .cx-hello .btn-outline { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); }
.cx .cx-hello .btn-outline:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.cx .cx-hello .st, .cx .cx-hello .badge { background: rgba(255, 255, 255, .92); }
.cx .ux-news { border-left: 4px solid #8CCB4A !important; }

/* หน้าเข้าสู่ระบบ: ลายผ้าขิดเดียวกัน */
.cx .login-brand.cx-lb { background-color: var(--green); background-image: radial-gradient(520px 320px at 0% 0%, rgba(140, 203, 106, .35), transparent 70%), var(--kkit), linear-gradient(160deg, #086141 0%, #064A31 60%, #043624 100%); background-size: 100% 100%, 32px 32px, 100% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .cx .login-brand.cx-lb { animation: cx-drift-lb 40s linear infinite; }
}
@keyframes cx-drift-lb { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 0, 64px 128px, 0 0; } }
@media print { .cx .side, .cx .topbar::after { display: none !important; } .cx .cx-hello { background: none; color: var(--ink); box-shadow: none; } .cx .cx-hello .h1 { color: var(--ink); } }
