/* theme.css — โทนสีของ newjob : หัวเว็บน้ำเงินสด #2563EB + เมนูด้านข้างพื้นสว่าง #F5F8FF (แบบ 2, ปรับ 26/11/2569)
   โหลดต่อจาก header.jsp + sidebar.jsp ใน template.jsp จึงทับค่าสีเดิมได้โดยไม่ต้องแก้ 2 ไฟล์นั้น
   เปลี่ยนโทนทั้งระบบได้ที่ตัวแปรด้านล่าง */
:root{
    --th-deep:#1E3A8A;        /* น้ำเงินเข้ม (ตัวอักษรหัวข้อ / เงา) */
    --th-main:#1D4ED8;        /* น้ำเงินหลัก (ไอคอน / ช่องติ๊ก / ปฏิทิน) */
    --th-header:#2563EB;      /* หัวเว็บ */
    --th-bright:#3B82F6;      /* น้ำเงินสว่าง (ปลายไล่เฉด) */
    --th-mint:#93B4F5;        /* ฟ้าอ่อน */
    --th-soft:#EFF4FF;        /* ฟ้าจาง (พื้นหลังปุ่ม/ป้าย) */
    --th-gold:#3B82F6;
    --th-amber:#93B4F5;
    --th-ink:#1E3A8A;
    /* เมนูด้านข้างแบบพื้นสว่าง */
    --sb-bg:#F5F8FF;
    --sb-line:#E2E8F4;
    --sb-text:#334155;
    --sb-icon:#64748B;
    --sb-title:#5B6B85;
    --sb-hover:#EAF0FD;
    --sb-active-bg:#E0EAFF;
    --sb-active-text:#1D4ED8;
    --tsu-hd-bg:var(--th-header);
    --tsu-sb-bg:var(--sb-bg);
    --bs-primary:#2563EB;
    --bs-primary-rgb:37,99,235;
    --bs-link-color:#2563EB;
    --bs-link-color-rgb:37,99,235;
    --bs-link-hover-color:#1E40AF;
    --bs-link-hover-color-rgb:30,64,175;
    --nj-blue:#2563EB;
    --nj-blue-soft:#EFF4FF;
    --nj-orange:#3B82F6;
    --nj-line:#E2E8F4;
}

/* ---------- หัวเว็บ: น้ำเงินสด #1D4ED8 → #2563EB (ตัวอักษรขาวอ่านได้ทั้งแถบ) ---------- */
.tsu-hd{
    background:linear-gradient(110deg, var(--th-main) 0%, var(--th-header) 100%);
    border-bottom:0;
    box-shadow:0 2px 12px rgba(30,58,138,.18);
}
.tsu-hd-stripe span:first-child{ background:#93C5FD; }
.tsu-hd-stripe span:last-child{ background:#DBEAFE; }
.tsu-hd-sub{ color:#F0F5FF; }
.tsu-hd-logo{ box-shadow:0 2px 10px rgba(0,0,0,.14); }
.tsu-hd-pill{ background:#FFFFFF; color:var(--th-main); box-shadow:none; }
.tsu-hd-avatar{ box-shadow:0 0 0 3px var(--th-header), 0 0 0 5px #BFDBFE; }
.tsu-hd-toggle{ background:rgba(255,255,255,.16); }
.tsu-hd-logout{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.45); }
.tsu-hd-logout:hover{ background:#FFFFFF; border-color:#FFFFFF; color:var(--th-main); }
.tsu-hd-toggle:focus-visible, .tsu-hd-brand:focus-visible, .tsu-hd-logout:focus-visible{ outline:2px solid #FFFFFF; outline-offset:2px; }

/* ---------- เมนูด้านข้าง: พื้นขาวอมฟ้า ตัวอักษรเข้ม ---------- */
.tsu-sb{ background:var(--sb-bg); color:var(--sb-text); border-right:1px solid var(--sb-line); box-shadow:none; }
.tsu-sb-mbar{ background:var(--th-header); color:#fff; }
.tsu-sb-nav{ scrollbar-color:#C7D3EA transparent; }
.tsu-sb-nav::-webkit-scrollbar-thumb{ background:#C7D3EA; }
.tsu-sb-group-title{ color:var(--sb-title); opacity:1; font-weight:600; font-size:11.5px; letter-spacing:.6px; }
.tsu-sb-link{ color:var(--sb-text); }
.tsu-sb-link svg{ color:var(--sb-icon); }
.tsu-sb-link:hover{ background:var(--sb-hover); color:var(--th-deep); box-shadow:none; }
.tsu-sb-link:hover svg{ color:var(--th-main); }
.tsu-sb-link.is-active{
    background:var(--sb-active-bg);
    color:var(--sb-active-text);
    font-weight:600;
    box-shadow:inset 3px 0 0 var(--th-header);
}
.tsu-sb-link.is-active svg{ color:var(--sb-active-text); }
.tsu-sb-link.is-active:hover{ background:#D6E3FF; color:var(--sb-active-text); }
.tsu-sb-link:focus-visible, .tsu-sb-btn:focus-visible{ outline:2px solid var(--th-header); outline-offset:2px; }
.tsu-sb-foot{ border-top-color:var(--sb-line); }
.tsu-sb-link.tsu-sb-logout{ color:#B42318; }
.tsu-sb-link.tsu-sb-logout svg{ color:#B42318; }
.tsu-sb-link.tsu-sb-logout:hover{ background:#FDECEC; color:#912018; }
body.tsu-sb-standalone .tsu-sb-top{ border-bottom-color:var(--sb-line); }
.tsu-sb-brand b{ color:var(--th-deep); }
.tsu-sb-brand small{ color:var(--sb-title); }
.tsu-sb-btn{ background:#EAF0FD; color:var(--th-main); }
.tsu-sb-btn:hover{ background:#DCE6FB; }
body.tsu-sb-collapsed .tsu-sb-section+.tsu-sb-section{ border-top-color:var(--sb-line); }
.tsu-sb-overlay{ background:rgba(15,23,42,.35); }
@media (max-width:767.98px), (max-height:500px) and (max-width:1023.98px){
    .tsu-sb{ box-shadow:8px 0 24px rgba(15,23,42,.18); }
}

/* ---------- พื้นหลังเนื้อหา ---------- */
body{
    background:
        radial-gradient(900px 420px at 100% 0%, rgba(59,130,246,.10), transparent 70%),
        radial-gradient(700px 380px at 0% 100%, rgba(59,130,246,.08), transparent 70%),
        #F4F6FB !important;
    background-attachment:fixed !important;
    color:#16213F;
}
.page-title{
    background:linear-gradient(90deg, var(--th-deep), var(--th-bright));
    -webkit-background-clip:text; background-clip:text; color:transparent;
}
.page-title .bi{ color:var(--th-main); -webkit-text-fill-color:var(--th-main); }

/* การ์ด / หัวข้อ / ตัวอักษรเน้น ที่เดิมเป็นสีน้ำเงิน */
.nj-card-h .bi, .nj-item-pos, .nj-job-pos, .w-pos, .w-count b, .sm-pos{ color:var(--th-main) !important; }
.nj-item-no{ background:linear-gradient(135deg, #EEF2FC, #DCE5F9); color:var(--th-main); }
.nj-item:hover{ border-color:#BFD2F8; box-shadow:0 6px 18px rgba(37,99,235,.14); }
.nj-item{ position:relative; overflow:hidden; }
.nj-item::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
                  background:linear-gradient(180deg, var(--th-bright), var(--th-gold)); opacity:0; transition:.15s; }
.nj-item:hover::before{ opacity:1; }
.nj-job{ border-left-color:var(--th-gold); }
.nj-steps li::before{ background:var(--th-soft); color:var(--th-main); }
.nj-table th, .tabulator .tabulator-footer .tabulator-calcs-holder{ background:#EEF2FA !important; color:#1B2C5C; }
.nj-photo{ border-color:#C9D6F2; }

/* ปุ่ม */
.btn-nj{ background:linear-gradient(135deg, #1D4ED8, #2563EB); box-shadow:0 4px 12px rgba(37,99,235,.3); }
.btn-nj-green{ background:linear-gradient(135deg, #1D4ED8, #3B82F6); }
.btn-outline-primary{ --bs-btn-color:#2563EB; --bs-btn-border-color:#2563EB; --bs-btn-hover-bg:#2563EB; --bs-btn-hover-border-color:#2563EB;
                      --bs-btn-active-bg:#2563EB; --bs-btn-active-border-color:#2563EB; --bs-btn-hover-color:#fff; --bs-btn-active-color:#fff; }
.btn-check:checked + .btn-outline-primary, .btn-outline-primary.active{ background:linear-gradient(135deg, var(--th-main), var(--th-bright)); border-color:var(--th-main); color:#fff; }
.text-primary{ color:var(--th-main) !important; }

/* ช่องกรอก */
.form-control:focus, .form-select:focus{ border-color:#93B4F5; box-shadow:0 0 0 .2rem rgba(59,130,246,.2); }
.form-check-input:checked{ background-color:var(--th-main); border-color:var(--th-main); }

/* ตาราง Tabulator / ปฏิทิน */
.tabulator .tabulator-footer .tabulator-page.active{ background:var(--th-main) !important; border-color:var(--th-main) !important; color:#fff !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover{ background:var(--th-main) !important; border-color:var(--th-main) !important; }
.flatpickr-day.today{ border-color:var(--th-bright) !important; }

@media print{
    body{ background:#fff !important; color:#000; }
    .page-title{ color:#1E3A8A !important; background:none !important; }
}

/* ---------- Modal แสดง PDF (pdfmodal.js) ---------- */
.nj-pdf-modal .modal-content{ border:0; border-radius:18px; overflow:hidden; box-shadow:0 24px 60px rgba(31,70,115,.30); }
.nj-pdf-modal .modal-header{ border:0; color:#fff; padding:14px 20px;
                             background:linear-gradient(110deg, var(--th-main) 0%, var(--th-header) 100%); }
.nj-pdf-modal .modal-title{ font-weight:600; font-size:18px; }
.nj-pdf-modal .btn-close{ filter:invert(1) grayscale(1) brightness(2); opacity:.9; }
.nj-pdf-modal .nj-pdf-frame{ display:block; width:100%; height:78vh; border:0; background:#525659; }
.nj-pdf-modal .modal-footer{ border:0; background:#F4F6FB; }
.nj-pdf-modal .modal-footer .btn{ border-radius:10px; }
@media (max-width:991.98px){
    .nj-pdf-modal .modal-content{ border-radius:0; }
    .nj-pdf-modal .nj-pdf-frame{ height:calc(100vh - 128px); }
}

/* =====================================================================
   เนื้อหา: โทนเดียวกับ header/sidebar — อ่านง่าย คอนทราสต์ชัด ทันสมัย
   ข้อความหลัก #1E293B · ข้อความรอง #5B6B85 · เส้นขอบ #E3E9F4 · สีเน้น #2563EB
   ===================================================================== */
:root{
    --ui-ink:#1E293B;
    --ui-muted:#5B6B85;
    --ui-line:#E3E9F4;
    --ui-accent:#2563EB;
    --ui-accent-2:#3B82F6;
    --ui-title:#1E3A8A;
    --bs-body-color:#1E293B;
    --bs-secondary-color:#5B6B85;
    --bs-border-color:#D6DEEC;
}
body{ color:var(--ui-ink); -webkit-font-smoothing:antialiased; }
::selection{ background:#BFDBFE; color:#1E3A8A; }
.text-muted, .page-sub, .w-sub, .sm-sub, .nj-item-meta, .form-text{ color:var(--ui-muted) !important; }
.page-sub{ font-size:15px; }
a{ color:var(--ui-accent); }
a:hover{ color:#1E40AF; }

/* การ์ด */
.nj-card, .nj-item{
    border:1px solid var(--ui-line);
    box-shadow:0 1px 2px rgba(30,58,138,.04), 0 8px 24px rgba(30,58,138,.06);
}
.nj-card-h{ border-bottom-color:var(--ui-line); }
.nj-card-h h2{ color:var(--ui-ink); }
.nj-item:hover{ border-color:#BFD2F8; box-shadow:0 10px 28px rgba(37,99,235,.14); }
.nj-item-pos, .nj-job-pos, .w-pos, .sm-pos{ color:var(--ui-title) !important; }
.nj-item-dept, .nj-job-dept{ color:#334155; }
.nj-item-no{ background:#EFF4FF; color:var(--ui-accent); font-weight:600; }
.nj-item-go{ color:#A3B3CF; }
.nj-item:hover .nj-item-go{ color:var(--ui-accent); }
.nj-job{ border-left:5px solid var(--ui-accent-2); }
/* วันที่รับสมัคร: ใช้สีเน้นของธีมแทนสีเขียว */
.nj-item-meta .text-success, .nj-job-meta.text-success, .w-sub.text-success{ color:#2F6F9E !important; }

/* ป้ายสถานะ: สีอ่อนพื้น เข้มตัวอักษร อ่านง่าย */
.nj-badge{ font-weight:500; border:1px solid transparent; }
.nj-badge.ok{ background:#E7F6EE; color:#166C43; border-color:#CDEBDB; }
.nj-badge.wait{ background:#FFF5E1; color:#8A5300; border-color:#FBE3B5; }
.nj-badge.no{ background:#F1F4F9; color:#5B6B85; border-color:#E3E9F4; }
.nj-badge.bad{ background:#FDECEC; color:#A12A2A; border-color:#F7D2D2; }

/* ฟอร์ม */
.form-label, .nj-dl dt{ color:#334155; }
.form-control, .form-select, .input-group-text{ border-color:#D3DCEB; }
.input-group-text{ background:#F4F7FC; color:var(--ui-muted); }
.form-control::placeholder{ color:#98A6BE; }
.form-control:focus, .form-select:focus{ border-color:var(--ui-accent-2); box-shadow:0 0 0 .2rem rgba(59,130,246,.2); }
.form-check-input:checked{ background-color:var(--ui-accent); border-color:var(--ui-accent); }
.nj-savebar{ background:rgba(255,255,255,.92); border-top-color:var(--ui-line); }

/* ปุ่ม */
.btn-nj{ background:linear-gradient(135deg, #1D4ED8, #2563EB); box-shadow:0 4px 14px rgba(37,99,235,.28); }
.btn-nj:hover{ filter:brightness(1.06); box-shadow:0 6px 18px rgba(37,99,235,.35); }
.btn-nj-green{ background:linear-gradient(135deg, #15803D, #22A55A); box-shadow:0 4px 14px rgba(21,128,61,.25); }
.btn-nj-orange{ background:linear-gradient(135deg, #D9730D, #F29A3A); box-shadow:0 4px 14px rgba(217,115,13,.25); }
.btn-outline-secondary{ --bs-btn-color:#475569; --bs-btn-border-color:#CBD5E1; --bs-btn-hover-bg:#F1F5FB; --bs-btn-hover-color:#1E293B; --bs-btn-hover-border-color:#B6C3DA; }
.btn-outline-primary{ --bs-btn-color:#2563EB; --bs-btn-border-color:#93B4F5; --bs-btn-hover-bg:#2563EB; --bs-btn-hover-border-color:#2563EB;
                      --bs-btn-active-bg:#2563EB; --bs-btn-active-border-color:#2563EB; }
.btn-check:checked + .btn-outline-primary, .btn-outline-primary.active{ background:linear-gradient(135deg, #1D4ED8, #2563EB); border-color:#2563EB; color:#fff; }
.btn-outline-danger{ --bs-btn-color:#B42318; --bs-btn-border-color:#F1B8B3; --bs-btn-hover-bg:#D92D20; --bs-btn-hover-border-color:#D92D20; }

/* ตาราง */
.nj-table th, .tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col{ background:#F3F6FC !important; color:#1E2B4F; }
.tabulator .tabulator-row.tabulator-row-even{ background:#FAFBFE; }
.tabulator .tabulator-row.tabulator-selectable:hover, .nj-table tbody tr:hover > *{ background:#F1F5FD !important; }
.tabulator, .tabulator .tabulator-tableholder .tabulator-table{ color:var(--ui-ink); }
.tabulator .tabulator-footer{ background:#F8FAFD; border-top-color:var(--ui-line); }
.tabulator .tabulator-footer .tabulator-page{ border-radius:8px; }

/* แถบเลื่อน */
*{ scrollbar-width:thin; scrollbar-color:#C3CFE6 transparent; }
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:#C3CFE6; border-radius:8px; }

/* SweetAlert ให้เข้ากับธีม */
.swal2-popup{ border-radius:18px !important; }
.swal2-styled.swal2-confirm{ background:linear-gradient(135deg, #1D4ED8, #2563EB) !important; border-radius:10px !important; }
.swal2-styled.swal2-cancel{ border-radius:10px !important; }

/* =====================================================================
   ปุ่มหลักและหัวตาราง: อ่านง่าย คอนทราสต์ชัด (ปรับ 26/11/2569)
   ===================================================================== */
/* ไอคอนในปุ่มบนหัวการ์ด ต้องเป็นสีเดียวกับตัวอักษรของปุ่ม (เดิมถูกทับเป็นสีน้ำเงิน → มองไม่เห็นบนปุ่มน้ำเงิน) */
.nj-card-h .btn .bi{ color:inherit !important; }
.btn-nj{ display:inline-flex; align-items:center; justify-content:center; gap:6px; font-weight:500; letter-spacing:.2px; line-height:1.4; }
.btn-nj .bi{ color:#fff !important; font-size:1.1em; line-height:1; margin:0 !important; }
.btn-nj:hover{ filter:none; background:linear-gradient(135deg, #1E40AF, #1D4ED8); color:#fff !important; box-shadow:0 6px 16px rgba(29,78,216,.32); }
.btn-nj:active{ transform:translateY(1px); }
.btn-nj:focus-visible{ outline:3px solid #BFDBFE; outline-offset:2px; }
.nj-card-h .btn-nj.btn-sm{ padding:7px 16px; font-size:14.5px; border-radius:10px; }
.nj-card-h .btn-outline-primary.btn-sm, .nj-card-h .btn-outline-secondary.btn-sm{ display:inline-flex; align-items:center; gap:6px; padding:6px 14px; font-size:14px; font-weight:500; }

/* หัวตาราง Tabulator: ตัวหนาอ่านชัด ลูกศรเรียงลำดับแสดงเมื่อชี้หรือเมื่อเรียงอยู่ */
.tabulator .tabulator-header .tabulator-col .tabulator-col-title{ font-weight:600; font-size:14px; color:#334155; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{ transition:opacity .15s; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{ opacity:0; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"]:hover .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{ opacity:.55; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{ border-bottom-color:#2563EB; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{ border-top-color:#2563EB; }

/* ปุ่มพิมพ์ใบสมัคร: พื้นฟ้าอ่อน ไอคอนในวงกลมน้ำเงิน — ชี้แล้วเป็นน้ำเงินเข้ม */
.nj-btn-print{ display:inline-flex; align-items:center; gap:10px; padding:6px 18px 6px 6px; border-radius:999px;
               background:#EFF4FF; border:1.5px solid #BFD2F8; color:#1D4ED8 !important; font-weight:600; font-size:15px;
               text-decoration:none !important; white-space:nowrap; line-height:1.2;
               box-shadow:0 2px 8px rgba(29,78,216,.10); transition:background .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s; }
.nj-btn-print .ic{ width:34px; height:34px; border-radius:50%; display:inline-grid; place-items:center; flex:0 0 auto;
                   background:linear-gradient(135deg,#1D4ED8,#2563EB); color:#fff; font-size:16px; box-shadow:0 3px 8px rgba(29,78,216,.30); }
.nj-btn-print:hover{ background:#1D4ED8; border-color:#1D4ED8; color:#fff !important; box-shadow:0 6px 16px rgba(29,78,216,.30); }
.nj-btn-print:hover .ic{ background:#fff; color:#1D4ED8; box-shadow:none; }
.nj-btn-print:active{ transform:translateY(1px); }
.nj-btn-print:focus-visible{ outline:3px solid #BFDBFE; outline-offset:2px; }
@media print{ .nj-btn-print{ display:none !important; } }
