/* ════════════════════════════════════════════════════════════════
   webservice — style เฉพาะเว็บนี้ (โหลดต่อจาก style.css ของ Medeesoft)
   ห้ามแก้ style.css ตรงๆ เพื่อให้อัปเดตธีมจาก Medeesoft ได้ด้วยการคัดลอกทับ
   ════════════════════════════════════════════════════════════════ */

/* ── Page shell / title bar / panel — ใช้ร่วมทุกหน้า ── */
.ws-shell {
    /* ขอบ/เงาการ์ดให้กลมกลืนกับภาพพื้นหลัง: ขอบขาวโปร่ง + แสงขาวฟุ้งรอบการ์ด + เงานุ่มโทนเขียวอมฟ้าของวิว */
    --ws-line: rgba(255,255,255,.78);
    --ws-shadow:
        0 0 0 1px rgba(255,255,255,.28),
        0 0 28px -4px rgba(255,255,255,.55),
        0 2px 6px rgba(12,42,58,.06),
        0 22px 44px -18px rgba(12,42,58,.34);
    display: flex;
    flex-direction: column;
    gap: 18px;
    /* ความกว้างเนื้อหาแบบ apple.com — กว้างสุด 980px อยู่กลางจอ จอเล็กกว่านี้เต็มความกว้าง */
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}
.ws-titlebar {
    margin-bottom: 0;
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(37,99,235,.18);
    overflow: hidden;
}
.ws-panel {
    border: 1px solid var(--ws-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--ws-shadow);
}
/* ── ไอคอนบน title bar: พื้นแก้วโปร่งเดิม + glyph สีขาว เหมือน Medeesoft /apps/shell/ ── */
.title-bar .title-bar-icon,
.title-bar .ms-titlebar-refresh { color: #fff !important; }

/* ปุ่มหน้าหลัก + รีเฟรช ชิดขวาเป็นกลุ่มเดียว */
.ws-titlebar-actions {
    order: 999;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ws-titlebar-actions .ms-titlebar-refresh { margin-left: 0; }

.ws-panel-hd {padding: 13px 18px 11px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 11px; }
.ws-panel-hd-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: var(--fs-lg, 18px); flex-shrink: 0; background: #e0e7ff; color: #4338ca; }
.ws-panel-hd-title { font-size: var(--fs-md, 14px); font-weight: 900; color: #172033; }
.ws-panel-hd-sub { font-size: var(--fs-xs, 11px); font-weight: 700; color: #64748b; margin-top: 1px; }

/* ── Login Modal — คัดลอกจาก Medeesoft layouts/footer.php (ผิวเดียวกัน) ── */
@keyframes lmSlide { from{transform:translateY(12px);opacity:0} to{transform:translateY(0);opacity:1} }
.login-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 44px 44px 24px 24px;
    background: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(4px);
}
#loginModal.active { display:flex !important; }
.login-modal-panel {
    position: relative;
    width: min(95vw, 560px);
    max-height: calc(100vh - 48px);
    overflow: visible;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(37,99,235,0.16) 0%, rgba(37,99,235,0) 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(59,130,246,0.14) 0%, rgba(59,130,246,0) 50%),
        radial-gradient(120% 140% at 100% 100%, rgba(29,78,216,0.10) 0%, rgba(29,78,216,0) 55%),
        linear-gradient(180deg, #f3f8ff 0%, #ffffff 46%, #ffffff 100%);
    border: 1px solid #cfe0f6;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255,255,255,0.72) inset;
    animation: lmSlide .22s ease-out;
}
.lm-close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    cursor: pointer;
    appearance: none;
    box-shadow: 0 8px 20px rgba(15,23,42,0.20);
    transition: all .2s;
    z-index: 3;
}
.lm-close-btn:hover { background:#f8fafc; color:#111827; box-shadow: 0 10px 24px rgba(15,23,42,0.26); transform: translateY(-1px); }
.lm-close-btn i { font-size: 18px; line-height: 1; -webkit-text-stroke: 0.6px currentColor; }
.login-modal-head {
    position: relative;
    padding: 36px 40px 22px 40px;
    background: linear-gradient(135deg, #e6f0ff 0%, #f4f9ff 45%, #ffffff 100%);
    border-bottom: 1px solid #e5effb;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}
.login-modal-head::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -18%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(59,130,246,0.28) 0%, rgba(59,130,246,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}
.login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
/* ไอคอนแบบ app icon ของ Apple: squircle ไล่สีน้ำเงินเดียวกับปุ่ม "เข้าสู่ระบบ" (.login-btn) + glyph ขาว
   + gloss ครึ่งบน + เส้นขอบในจาง + เงานุ่มสีเดียวกัน */
.login-brand-icon {
    position: relative;
    overflow: hidden;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    background: linear-gradient(180deg, #5b9dff 0%, var(--primary-blue, #2563eb) 55%, #1d6fe0 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow:
        0 1px 1px rgba(23,64,140,.3),
        0 10px 20px -8px rgba(37,99,235,.55),
        inset 0 1px 0 rgba(255,255,255,.45),
        inset 0 0 0 1px rgba(255,255,255,.12);
}
.login-brand-icon::before {
    content: '';
    position: absolute;
    inset: 0 0 45% 0;
    background: linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}
.login-brand-icon i {
    position: relative;
    filter: drop-shadow(0 1px 1.5px rgba(15,23,42,.28));
}
.login-brand-copy {
    min-width: 0;
}
.login-modal-title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}
.login-modal-subtitle {
    width: min(100%, 520px);
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}
.login-modal-body {
    padding: 18px 40px 34px;
    overflow-y: auto;
    max-height: calc(100vh - 154px);
    background: #ffffff;
    border-radius: 0 0 20px 20px;
}
.login-modal-error {
    display: none;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}
.login-modal-form {
    display: grid;
    gap: 16px;
    padding: 18px 0 26px;
}
.login-modal-field {
    display: grid;
    grid-template-columns: minmax(88px, 118px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0;
}
.login-modal-field > span:first-child {
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}
/* ช่องกรอก + ปุ่มแสดงรหัสผ่าน ใช้ .ms-input / .ms-input-wrap / .ms-input-eye กลางใน style.css (CLAUDE.md §16.2) */
.login-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: min(100%, 520px);
    margin: 28px auto 2px;
}
.lm-secondary-btn,
.lm-primary-btn {
    position: relative;
    overflow: hidden;
    height: 44px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .22s cubic-bezier(.2,.8,.2,1), transform .18s cubic-bezier(.2,.8,.2,1);
}
.lm-secondary-btn::before,
.lm-primary-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 55%);
    pointer-events: none;
}
.lm-secondary-btn {
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
    color: #374151;
    box-shadow:
        0 1px 1px rgba(15,23,42,.03),
        0 10px 20px -14px rgba(15,23,42,.28),
        inset 0 1px 0 rgba(255,255,255,.8);
}
.lm-secondary-btn:hover {
    border-color: #c7d6ec;
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
    box-shadow:
        0 1px 1px rgba(15,23,42,.04),
        0 14px 26px -12px rgba(15,23,42,.32),
        inset 0 1px 0 rgba(255,255,255,.9);
    transform: translateY(-1px);
}
.lm-secondary-btn:active,
.lm-primary-btn:active:not(:disabled) { transform: translateY(1px); }
.lm-primary-btn {
    border: none;
    background: linear-gradient(180deg, #299bff 0%, #0b8af0 55%, #0a75d1 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 1px 1px rgba(9,74,150,.3),
        0 16px 30px -12px rgba(11,138,240,.55),
        0 6px 14px -6px rgba(11,138,240,.4),
        inset 0 1px 0 rgba(255,255,255,.4);
}
.lm-primary-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #38a4ff 0%, #1690f4 55%, #0b75d6 100%);
    box-shadow:
        0 1px 1px rgba(9,74,150,.32),
        0 20px 36px -12px rgba(11,138,240,.6),
        0 8px 18px -6px rgba(11,138,240,.45),
        inset 0 1px 0 rgba(255,255,255,.45);
    transform: translateY(-1px);
}
.lm-primary-btn:disabled {
    cursor: not-allowed;
    opacity: .72;
    box-shadow: none;
    transform: none;
}
.lm-close-btn:focus-visible,
.lm-secondary-btn:focus-visible,
.lm-primary-btn:focus-visible {
    outline: 2px solid #d7deef;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .login-modal-backdrop { padding: 28px; }
    .login-modal-panel { max-height: calc(100vh - 56px); }
    .login-modal-head { padding: 30px 24px 18px 24px; }
    .lm-close-btn { top: -18px; right: -18px; width: 36px; min-width: 36px; height: 36px; min-height: 36px; flex: 0 0 36px; }
    .login-brand { gap: 11px; }
    .login-brand-icon { width: 42px; height: 42px; flex: 0 0 42px; font-size: 21px; }
    .login-modal-body { padding: 12px 24px 26px; max-height: calc(100vh - 130px); }
    .login-modal-field { grid-template-columns: 1fr; gap: 7px; }
    .login-modal-field > span:first-child { text-align: left; }
    .login-modal-actions { grid-template-columns: 1fr; }
}

/* ── ปุ่มมาตรฐาน (glossy แบบปุ่มใน Login Modal) — ใช้ได้ทุกหน้า ── */
.ws-btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 18px; border-radius: 11px;
    font-family: inherit; font-size: var(--fs-btn, 13px); font-weight: 800;
    cursor: pointer; text-decoration: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .22s cubic-bezier(.2,.8,.2,1), transform .18s cubic-bezier(.2,.8,.2,1);
}
.ws-btn::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 55%); }
.ws-btn i, .ws-btn span { position: relative; }
.ws-btn i { font-size: 16px; }
.ws-btn-primary {
    border: none; color: #fff;
    /* สี primary ตามธีม — ธีมน้ำเงินเริ่มต้นไม่มี --th-* จึงใช้ค่า fallback เดิม */
    background: linear-gradient(180deg, var(--th-1, #299bff) 0%, var(--th-2, #0b8af0) 55%, var(--th-3, #0a75d1) 100%);
    box-shadow: 0 1px 1px rgba(15,23,42,.25), 0 12px 24px -12px rgba(var(--th-rgb, 11,138,240),.55), inset 0 1px 0 rgba(255,255,255,.4);
}
.ws-btn-secondary {
    border: 1px solid #e2e8f0; color: #374151;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
    box-shadow: 0 1px 1px rgba(15,23,42,.03), 0 10px 20px -14px rgba(15,23,42,.28), inset 0 1px 0 rgba(255,255,255,.8);
}
.ws-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ws-btn:active:not(:disabled) { transform: translateY(1px); }
.ws-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #e8edf7; }
.ws-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ── ตาราง .ms-table (ผิวจาก style.css) — webservice: กว้างเต็มการ์ด + ขนาดตัวอักษรแถวมาตรฐาน ── */
table.ms-table { width: 100%; }
table.ms-table > tbody > tr > td {
    padding: 10px 12px;
    font-size: var(--fs-td, 12px);
    font-weight: 700;
    color: #1e293b;
}

/* Modal ฟอร์มทั่วไปที่ใช้ผิวเดียวกับ Login Modal (.login-modal-*) — เปิดด้วย class .active */
.login-modal-backdrop.active { display: flex; }

/* ── Release Info Modal (รายละเอียดเวอร์ชัน) — คัดลอกจาก Medeesoft layouts/footer.php ── */
/* Release Info Modal — close button ตาม CLAUDE.md §13.5 (floating corner X) */
.rel-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 44px 44px 16px 16px;
    background: rgba(15,23,42,.52);
    backdrop-filter: blur(3px);
}
.rel-modal-overlay.is-open { display: flex; }
.rel-modal {
    position: relative;
    overflow: visible;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    width: 94%;
    max-width: 640px;
    /* ต้องตั้ง height คู่กับ max-height เสมอ — ถ้ามีแค่ max-height ตัว flex
       container จะไม่มี definite height ให้ .rel-modal-body (flex:1;
       min-height:0) คำนวณพื้นที่ scroll ได้ถูกต้องในบางเบราว์เซอร์
       ทำให้เนื้อหาที่เกินพื้นที่ scroll ลงไปดูไม่ได้ (bug ที่เจอจริง) */
    height: 88vh;
    max-height: 88vh;
    box-shadow: 0 24px 64px rgba(12,26,58,.24);
    display: flex;
    flex-direction: column;
    animation: relModalIn .22s ease;
}
@keyframes relModalIn { from{ transform: translateY(16px) scale(.97); opacity: 0; } to{ transform: none; opacity: 1; } }
.rel-modal-close {
    position: absolute;
    top: -20px; right: -20px;
    width: 40px; height: 40px;
    border-radius: 50%; border: 0;
    background: #fff; color: #1f2937;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15,23,42,0.20);
    transition: background .2s, color .2s, box-shadow .2s, transform .2s;
    z-index: 3;
}
.rel-modal-close:hover { background: #f8fafc; color: #111827; box-shadow: 0 10px 24px rgba(15,23,42,0.26); transform: translateY(-1px); }
.rel-modal-close i { font-size: 18px; line-height: 1; }
.rel-modal-hd {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    padding: 16px 22px;
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #e6f0ff 0%, #f4f9ff 45%, #ffffff 100%);
    border-bottom: 1px solid #e5effb;
    border-radius: 18px 18px 0 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.rel-modal-hd::before {
    content: '';
    position: absolute;
    top: -60%; right: -18%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(59,130,246,0.28) 0%, rgba(59,130,246,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}
.rel-modal-hd-icon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    background: #e0e7ff; border: 1px solid #c7d2fe; color: #4338ca;
    display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
}
.rel-modal-hd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rel-modal-hd-title { font-size: var(--fs-modal-title, 15px); font-weight: 800; color: #172033; }
.rel-modal-hd-sub { font-size: 11.5px; font-weight: 600; color: #64748b; }
/* แถบเลือกเวอร์ชัน — คลิกดู release notes ของเวอร์ชันอื่นได้โดยไม่ต้องปิด modal */
.rel-modal-versions {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 22px; overflow-x: auto;
    border-bottom: 1px solid #f1f5f9; background: #fafbff;
}
.rel-modal-versions:empty { display: none; }
.rel-version-pill {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px; border: 1.5px solid #e2e8f0;
    background: #fff; color: #475569; font-size: 11.5px; font-weight: 800;
    font-family: inherit; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.rel-version-pill:hover:not(:disabled) { background: #f0f9ff; border-color: #93c5fd; color: #1d4ed8; }
.rel-version-pill.is-active {
    background: #2852c8; border-color: #2852c8; color: #fff;
    box-shadow: 0 2px 8px rgba(40,82,200,0.28);
}
.rel-version-pill .rel-version-latest-tag { font-size: 9px; font-weight: 800; opacity: .8; }
/* เส้นคั่นระหว่าง release แต่ละ patch เมื่อแสดงต่อเนื่องกันในกลุ่มเดียวกัน */
.rel-group-divider { border: none; border-top: 2px dashed #dbe4f0; margin: 22px 0; }
.rel-modal-body { flex: 1; min-height: 0; overflow: hidden; }
.rel-modal-body-scroll {
    height: 100%; overflow-y: auto; padding: 18px 22px;
    scrollbar-width: thin; scrollbar-color: #2852c8 #f1f5f9;
}
.rel-modal-body-scroll::-webkit-scrollbar { width: 8px; }
.rel-modal-body-scroll::-webkit-scrollbar-track { background: #f1f5f9; }
.rel-modal-body-scroll::-webkit-scrollbar-thumb { background: #2852c8; border-radius: 999px; }
.rel-modal-loading, .rel-modal-error {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 40px 10px; color: #64748b; font-size: 13px; font-weight: 700; text-align: center;
}
.rel-modal-error { color: #991b1b; flex-direction: column; }
.rel-modal-spinner {
    width: 24px; height: 24px; border-radius: 50%;
    border: 3px solid #c7d2fe; border-top-color: #4338ca;
    animation: relSpin .7s linear infinite; flex-shrink: 0;
}
@keyframes relSpin { to{ transform: rotate(360deg); } }
.rel-tag-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 800;
    background: #dbeafe; color: #1d4ed8; margin-bottom: 4px;
}
.rel-meta { font-size: 11.5px; color: #94a3b8; font-weight: 600; margin-bottom: 14px; }
.rel-body h2, .rel-body h3 {
    font-size: 13.5px; font-weight: 800; color: #172033;
    margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9;
}
.rel-body h2:first-child, .rel-body h3:first-child { margin-top: 0; }
.rel-body ul { margin: 0 0 10px; padding-left: 20px; }
.rel-body li { font-size: 12.5px; color: #374151; line-height: 1.6; margin-bottom: 4px; }
.rel-body code {
    font-family: 'Courier New',monospace; font-size: 11.5px;
    background: #f1f5f9; color: #475569; padding: 1px 6px; border-radius: 5px;
}
.rel-body hr { border: none; border-top: 1px solid #f1f5f9; margin: 14px 0; }
.rel-body p { font-size: 12.5px; color: #374151; line-height: 1.6; margin: 0 0 10px; }
.rel-modal-ft {
    flex-shrink: 0;
    padding: 12px 22px;
    border-top: 1px solid #dbe4f0;
    background: #f8faff;
    border-radius: 0 0 18px 18px;
    display: flex; justify-content: flex-end; gap: 10px;
}
.rel-modal-cancel-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 9px; border: 1.5px solid #cbd5e1;
    background: #fff; color: #64748b; font-size: 12.5px; font-weight: 800;
    font-family: inherit; cursor: pointer; transition: all .15s;
}
.rel-modal-cancel-btn:hover { background: #f1f5f9; color: #475569; }
@media (max-width: 480px) {
    .rel-modal-close { top: -12px; right: -12px; width: 36px; height: 36px; }
    .rel-modal-hd, .rel-modal-body-scroll, .rel-modal-ft { padding-left: 16px; padding-right: 16px; }
}

/* เมนูแอป: หน้าต่างแคบลง (style.css ตั้งไว้ 920px) + การ์ดหมวด/แอปแถวละ 2 (เดิม 4)
   จอแคบกว่า 720px การ์ดแอปเหลือแถวละ 1 ตามเดิม */
.apps-dropdown { width: min(580px, calc(100vw - 28px)); }
.apps-category-grid,
.apps-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) {
    .apps-card-grid { grid-template-columns: 1fr; }
}

/* จอแคบ: ปุ่มหน้าหลัก + รีเฟรช บน title bar อยู่กึ่งกลาง (ตามหัวข้อที่จัดกึ่งกลางอยู่แล้ว) */
@media (max-width: 768px) {
    .title-bar .title-bar-right { justify-content: center; }
    .ws-titlebar-actions { margin-left: 0; margin-right: 0; }
}

/* ── การ์ดติดต่อเรา (จาก Medeesoft site/#contact) — แสดงเฉพาะหน้าแรก (layouts/contact_card.php ผ่าน index.php)
   กว้างเท่าเนื้อหา (.ws-shell 980px) ── */
.ws-contact-wrap { margin-top: 18px; }
.contact-card {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center;
    padding: 30px 34px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 55%, #eef3ff 100%);
}
.contact-card .ws-hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.contact-card .ws-hero-glow.is-blue   { width: 320px; height: 320px; top: -120px; right: -80px; background: rgba(59,130,246,.10); }
.contact-card .ws-hero-glow.is-purple { width: 260px; height: 260px; bottom: -120px; left: -60px; background: rgba(168,85,247,.08); }
.contact-main { position: relative; z-index: 1; }
.contact-main h2 { margin: 12px 0 8px; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; line-height: 1.25; color: #0f172a; }
.contact-main h2 span {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #0284c7 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    padding-top: .2em; margin-top: -.2em;
}
.contact-main p { margin: 0 0 6px; font-size: var(--fs-body, 12.5px); font-weight: 600; color: #475569; line-height: 1.7; }
.contact-free { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label, 12px); font-weight: 700; color: #15803d; }
.contact-cta { margin-top: 16px; height: 42px; padding: 0 22px; }
.contact-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.contact-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none;
    border-radius: 14px; background: rgba(255,255,255,.9); border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 24px -16px rgba(15,23,42,.18);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease;
}
a.contact-item:hover {
    transform: translateY(-3px); border-color: rgba(37,99,235,.20);
    box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 18px 36px -16px rgba(30,58,138,.32), 0 0 0 3px rgba(37,99,235,.06);
}
.contact-icon { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; font-size: 20px; }
.contact-item small { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; }
.contact-item b { display: block; font-size: var(--fs-section, 13px); font-weight: 800; color: #0f172a; }
.contact-go { margin-left: auto; color: #94a3b8; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .contact-item { transition: none; } a.contact-item:hover { transform: none; } }
@media (max-width: 860px) { .contact-card { grid-template-columns: 1fr; padding: 26px 22px; } }

/* ════════════════════════════════════════════════════════════════
   DataTables — ผิวเดียวกับ Medeesoft apps/acc_opd (docs/standards/datatables.md §9, §10)
   หัวตาราง / ปุ่มเรียง / pagination / แถวที่เลือก มาจาก global rule ใน style.css แล้ว — ที่นี่คือส่วนของหน้า
   ใช้คู่กับ: vendor/datatables (jquery.dataTables + responsive) และ toolbar .dt-toolbar
   ════════════════════════════════════════════════════════════════ */
.dataTables_wrapper { padding: 0; }
.dt-toolbar {
    padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: #fff; border-bottom: 1px solid #f1f5f9;
}
.dt-search-wrap { position: relative; flex: 1 1 360px; max-width: 460px; }
.dt-search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #93c5fd; font-size: 17px; pointer-events: none; }
.dt-search-input {
    width: 100%; height: 38px; border: 1.5px solid #bfdbfe; border-radius: 9px; background: rgba(255,255,255,.8);
    padding: 0 14px 0 40px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: #172033; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.dt-search-input:focus { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(40,82,200,.12); }
.dt-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex: 0 0 auto; }
.dt-length-label { font-size: 12px; font-weight: 800; color: #1e40af; }
.dt-length-select { width: 82px; height: 38px; }
.dt-toolbar .select2-container { min-width: 82px !important; }
.dt-toolbar .select2-selection--single { height: 38px !important; border: 1.5px solid #bfdbfe !important; border-radius: 9px !important; background: rgba(255,255,255,.8) !important; }
.dt-toolbar .select2-selection__rendered { line-height: 35px !important; }
.dt-refresh-btn {
    min-width: 38px; height: 38px; padding: 0 10px; border: 1.5px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1d4ed8;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.dt-refresh-btn i { font-size: 18px; }
.dt-refresh-btn:hover:not(:disabled) { background: #dbeafe; border-color: #93c5fd; color: #1e40af; box-shadow: 0 4px 12px rgba(29,78,216,.14); }
.dt-refresh-btn:disabled { opacity: .58; cursor: not-allowed; }
.dt-refresh-btn.is-loading i { animation: spin .8s linear infinite; }
.dt-footer { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.dataTables_wrapper .dataTables_info { padding: 12px 20px; font-size: 11.5px; color: #9ca3af; font-weight: 600; }
.dataTables_wrapper .dataTables_paginate { padding: 12px 20px; margin-left: auto; }
.dt-badge { background: #eef2ff; color: #2563eb; border: 1px solid #c7d2fe; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.dt-load-pill {
    background: #fff; color: #64748b; padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #dbe5ee; white-space: nowrap;
}
.dt-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 50px 20px; color: #2563eb; font-size: 13px; font-weight: 700; }
.dt-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #dbeafe; border-top-color: #2563eb; animation: spin .7s linear infinite; }

table.dataTable { border-collapse: collapse !important; margin: 0 !important; width: 100% !important; background: #fff; }
table.dataTable tbody td { padding: 11px 14px !important; border-bottom: none !important; border-top: none !important; vertical-align: middle; font-size: 12.5px; color: #374151; text-align: center; }
table.dataTable tbody td.td-left { text-align: left; }
table.dataTable tbody tr:nth-child(even) td { background: #fcfdff; }
table.dataTable tbody tr:hover td { background: var(--ms-dt-hover-bg, #F0F8FF) !important; }
table.dataTable tbody tr { cursor: pointer; }
.dt-seq { font-weight: 700; color: #94a3b8; font-size: 12px; }

/* Responsive expand (แตะแถวเพื่อดูคอลัมน์ที่ซ่อน) */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control { position: relative !important; padding-left: 42px !important; cursor: pointer; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before { content: "" !important; background: transparent !important; border: none !important; box-shadow: none !important; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:after,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:after {
    content: ""; position: absolute; top: 50%; left: 18px; width: 5px; height: 5px;
    border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
    transform: translateY(-50%) rotate(-45deg); transition: all .25s cubic-bezier(.4,0,.2,1); pointer-events: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent:hover > td { background: var(--ms-dt-selected-bg, #DBEAFE) !important; color: var(--ms-dt-selected-text, #1E3A8A) !important; }
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:after { border-color: #2563eb; transform: translateY(-70%) rotate(45deg); }
table.dataTable.dtr-inline.collapsed > tbody > tr:hover td.dtr-control:after { border-color: #2563eb; }
table.dataTable > tbody > tr.child td.child { padding: 0 !important; background: #f8fafc !important; }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; padding: 12px 18px 14px 42px; box-sizing: border-box; }
table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; align-items: flex-start; gap: 18px; padding: 8px 0; border-bottom: 1px solid #e5edf5; font-size: 12.5px; white-space: normal; }
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child { border-bottom: none; }
table.dataTable > tbody > tr.child span.dtr-title { min-width: 130px; color: #64748b; font-weight: 800; }
table.dataTable > tbody > tr.child span.dtr-data { color: #172033; font-weight: 700; text-align: left; word-break: break-all; }

@media (max-width: 640px) {
    .dt-toolbar { flex-wrap: wrap; padding: 12px 14px; }
    .dt-search-wrap { flex-basis: 100%; max-width: none; }
    .dt-footer { justify-content: center; }
    .dataTables_wrapper .dataTables_paginate { margin-left: 0; }
}

/* ── Card menu จากปุ่มเครื่องมือบน title bar (ผิวเดียวกับ .opd-dot-dropdown ของ Medeesoft acc_opd) ──
   <button class="ms-titlebar-refresh ws-titlebar-tool">  +  <div class="ws-cardmenu"> ... <button class="ws-cardmenu-item"> */
.title-bar .ws-titlebar-tool.is-active { background: rgba(255,255,255,.22); }
.ws-cardmenu {
    position: fixed; z-index: 300; width: min(92vw, 340px);
    background: rgba(255,255,255,.9);
    -webkit-backdrop-filter: saturate(1.8) blur(24px); backdrop-filter: saturate(1.8) blur(24px);
    border: 1px solid rgba(15,23,42,.08); border-radius: 18px;
    box-shadow: 0 2px 10px rgba(15,23,42,.06), 0 26px 52px -14px rgba(15,23,42,.24);
    display: none; flex-direction: column;
}
.ws-cardmenu.is-open { display: flex; }
.ws-cardmenu-hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px 12px; border-bottom: 1px solid rgba(15,23,42,.06); font-size: 13px; font-weight: 700; color: #1e293b; }
.ws-cardmenu-hd i { font-size: 15px; color: var(--ms-titlebar-blue, #2852c8); }
.ws-cardmenu-close {
    position: absolute; top: -16px; right: -16px; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: #fff; color: #475569; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
    box-shadow: 0 4px 14px rgba(15,23,42,.16); z-index: 3; transition: background .15s, color .15s, transform .15s;
}
.ws-cardmenu-close:hover { background: #f1f5f9; color: #0f172a; transform: translateY(-1px); }
.ws-cardmenu-grid { display: grid; gap: 4px; padding: 8px; }
.ws-cardmenu-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid transparent; border-radius: 12px;
    background: transparent; color: #374151; font-family: inherit; text-align: left; cursor: pointer; transition: background .12s ease;
}
.ws-cardmenu-item:hover { background: rgba(15,23,42,.045); }
.ws-cardmenu-item:active { background: rgba(15,23,42,.08); }
.ws-cardmenu-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.ws-cardmenu-title { font-size: 12.5px; font-weight: 700; color: #1e293b; line-height: 1.3; }
.ws-cardmenu-desc { font-size: 11px; font-weight: 500; color: #8a94a3; line-height: 1.35; margin-top: 2px; }

/* ── ปุ่มเมนูแอปบน topbar: โทนน้ำเงิน (style.css ของ Medeesoft เป็นม่วง — override ที่นี่ ไม่แก้ style.css) ── */
.apps-menu-btn {
    background: linear-gradient(160deg, #f2f7ff 0%, #e8f0ff 100%);
    color: #2563eb;
    box-shadow: 0 1px 1px rgba(15,23,42,.03), 0 6px 12px -8px rgba(37,99,235,.35), inset 0 1px 0 rgba(255,255,255,.85);
}
.apps-menu-btn:hover,
.apps-menu-btn.active {
    background: linear-gradient(160deg, #e4eeff 0%, #d6e4ff 100%);
    color: #1d4ed8;
    box-shadow: 0 1px 1px rgba(15,23,42,.04), 0 14px 22px -10px rgba(37,99,235,.4), 0 6px 12px -6px rgba(37,99,235,.3), inset 0 1px 0 rgba(255,255,255,.9);
}

/* ── Login Modal ขั้นที่ 2: รหัสยืนยันตัวตน 2 ขั้นตอน (2FA) ── */
.lm-2fa-intro { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #eff6ff; border: 1px solid #bfdbfe;
    color: #1e3a8a; font-size: 13px; font-weight: 600; line-height: 1.55; }
.lm-2fa-intro i { font-size: 26px; color: #2563eb; flex-shrink: 0; }
.lm-2fa-code { height: 56px !important; text-align: center; font-family: Consolas, 'Courier New', monospace !important; font-size: 26px !important;
    font-weight: 800 !important; letter-spacing: 10px; }
.lm-2fa-code.is-recovery { letter-spacing: 3px; font-size: 22px !important; }
.lm-2fa-switch { align-self: center; border: 0; background: none; padding: 2px 6px; color: #2563eb; font-family: inherit; font-size: 12.5px;
    font-weight: 700; text-decoration: underline; cursor: pointer; }
.login-modal-form[hidden] { display: none !important; }   /* สลับขั้นรหัสผ่าน ↔ ขั้นรหัส 2FA */

/* ── ลายน้ำ title bar: ไอคอนของหน้าขยายใหญ่ จางๆ ทางขวา (สร้างโดย initTitlebarWatermarks() ใน layouts/footer.php) ── */
.title-bar.ws-titlebar { overflow: hidden; }
.title-bar > *:not(.ws-tb-wm) { position: relative; z-index: 1; }
.title-bar .ws-tb-wm {
    position: absolute; z-index: 0; right: 120px; top: 50%;
    transform: translateY(-50%) rotate(-12deg);
    font-size: 150px; line-height: 1; color: rgba(255,255,255,.08); pointer-events: none;
}
@media (max-width: 768px) { .title-bar .ws-tb-wm { right: -18px; font-size: 130px; } }

/* ── พื้นหลังหน้าเว็บ (wallpaper) — อยู่กับที่ขณะเลื่อน ──
   ภาพเดียวทั้งเว็บ (config/wallpapers.php) — layouts/header.php ตั้ง --ws-wallpaper / --ws-wallpaper-pos ที่ <body>
   .content-area เป็นกล่องที่เลื่อน (overflow-y:auto) พื้นหลังของกล่องจึงไม่เลื่อนตามเนื้อหา — ใช้ได้ทั้งมือถือ
   ความจาง: ค่า alpha ของชั้นขาวด้านบน — บนสุดเห็นวิวชัด ล่างสุดขาวขึ้นให้อ่านเนื้อหายาวง่าย */
body.ms-app-body .content-area {
    background:
        linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.34) 45%, rgba(248,251,255,.62) 100%),
        var(--ws-wallpaper, none) var(--ws-wallpaper-pos, center) / cover no-repeat,
        linear-gradient(45deg, #cfe4ff 0%, #e2eeff 32%, #f3f8ff 62%, #ffffff 100%);
}
/* ฉาก "เมืองกับโรงพยาบาล" (ภาพเดียวกับ Medeesoft): ภาพชิดล่าง + สีฟ้า + เมฆเคลื่อนไหว ชั้นนี้อยู่ใต้ทุกอย่าง ไม่เลื่อนตามเนื้อหา
   แสดงเฉพาะเมื่อเลือกภาพนี้ · .content-area ต้องโปร่งใส (ไม่มีชั้นขาวทับ) */
.ws-bg-scene {
    display: none; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    --u: max(100vw / 1920, 100vh / 1080);
    background: var(--ws-wallpaper, none) center bottom / cover no-repeat #aee2ee;
}
body[data-wallpaper="hospital-town"] .ws-bg-scene { display: block; }
body.ms-app-body[data-wallpaper="hospital-town"] .content-area,
html[data-theme-color] body.ms-app-body[data-wallpaper="hospital-town"] .content-area { background: transparent; }
.ws-bg-cloud { position: absolute; width: 120px; height: 40px; background: rgba(255,255,255,.9); border-radius: 40px; filter: blur(.4px); box-shadow: 0 8px 20px #78aac82e; }
.ws-bg-cloud::before, .ws-bg-cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.ws-bg-cloud::before { width: 52px; height: 52px; top: -22px; left: 20px; }
.ws-bg-cloud::after { width: 72px; height: 72px; top: -34px; right: 18px; }
.ws-bg-cloud-1 { top: 6%; left: 8%; --s: 1.25; opacity: .95; animation: ws-cloud-sway-a 26s ease-in-out infinite; }
.ws-bg-cloud-2 { top: 12%; left: 62%; --s: .9; opacity: .8; animation: ws-cloud-sway-b 32s ease-in-out infinite; }
.ws-bg-cloud-3 { top: 20%; left: 30%; --s: .7; opacity: .7; animation: ws-cloud-sway-a 22s ease-in-out -6s infinite; }
.ws-bg-cloud-4 { top: 4%; left: 82%; --s: 1; opacity: .85; animation: ws-cloud-sway-b 38s ease-in-out -10s infinite; }
.ws-bg-cloud-5 { top: 26%; left: 4%; --s: .8; opacity: .6; animation: ws-cloud-sway-a 30s ease-in-out -14s infinite; }
/* เมฆเล็กเหนือเส้นขอบฟ้า ลอยซ้าย-ขวา · --u = 1px ของภาพหลังขยายแบบ cover ขนาดและตำแหน่งจึงตรงกับภาพทุกจอ */
.ws-bg-mini { position: absolute; width: calc(var(--u) * 80 * var(--s)); height: calc(var(--u) * 22 * var(--s)); background: #f2fbfd; border-radius: 999px; }
.ws-bg-mini::before, .ws-bg-mini::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.ws-bg-mini::before { width: 34%; height: 125%; left: 12%; top: -70%; box-shadow: calc(var(--u) * 26 * var(--s)) calc(var(--u) * -5 * var(--s)) 0 calc(var(--u) * 4 * var(--s)) #f2fbfd; }
.ws-bg-mini::after { width: 26%; height: 95%; right: 6%; top: -40%; }
.ws-bg-mini-1 { --s: 1; left: 3.65%; bottom: calc(var(--u) * 197); animation: ws-mini-sway-a 34s ease-in-out 0s infinite; }
.ws-bg-mini-2 { --s: 0.8; left: 17.19%; bottom: calc(var(--u) * 232); animation: ws-mini-sway-b 42s ease-in-out -9s infinite; }
.ws-bg-mini-3 { --s: 0.7; left: 29.17%; bottom: calc(var(--u) * 184); animation: ws-mini-sway-a 28s ease-in-out -16s infinite; }
.ws-bg-mini-4 { --s: 0.8; left: 67.19%; bottom: calc(var(--u) * 192); animation: ws-mini-sway-b 36s ease-in-out -5s infinite; }
.ws-bg-mini-5 { --s: 1; left: 80.21%; bottom: calc(var(--u) * 221); animation: ws-mini-sway-a 46s ease-in-out -21s infinite; }
.ws-bg-mini-6 { --s: 0.75; left: 93.75%; bottom: calc(var(--u) * 187); animation: ws-mini-sway-b 31s ease-in-out -12s infinite; }
@keyframes ws-mini-sway-a { 0%, 100% { transform: translateX(calc(var(--u) * -45)); } 50% { transform: translateX(calc(var(--u) * 45)); } }
@keyframes ws-mini-sway-b { 0%, 100% { transform: translateX(calc(var(--u) * 40)); } 50% { transform: translateX(calc(var(--u) * -40)); } }
@media (prefers-reduced-motion: reduce) { .ws-bg-mini { animation: none; } }
@keyframes ws-cloud-sway-a { 0%,to{transform:translate(0) scale(var(--s, 1))}50%{transform:translate(70px,10px) scale(var(--s, 1))} }
@keyframes ws-cloud-sway-b { 0%,to{transform:translate(0) scale(var(--s, 1))}50%{transform:translate(-90px,-8px) scale(var(--s, 1))} }
@media (prefers-reduced-motion: reduce) { .ws-bg-cloud { animation: none; transform: scale(var(--s, 1)); } }
@media print { .ws-bg-scene { display: none !important; } }
.ws-photo-credit { max-width: 980px; margin: 22px auto 0; text-align: right; font-size: 11px; font-weight: 600; color: rgba(15,23,42,.55); }
.ws-photo-credit a { color: inherit; text-decoration: underline; text-decoration-color: rgba(15,23,42,.25); }

/* การ์ดสรุปตัวเลขของแต่ละหน้า ใช้ขอบ/เงาเดียวกับ .ws-panel (กลมกลืนกับภาพพื้นหลัง) */
.al-stat, .pm-stat, .hs-stat, .dash-stat { border: 1px solid var(--ws-line) !important; box-shadow: var(--ws-shadow) !important; }
.ws-photo-credit[hidden] { display: none; }

/* ── ปุ่ม "กลับขึ้นบน" แบบปุ่มเลื่อนของ claude.ai โทนมืด: วงกลมเรียบ ไม่มันวาว ขอบบาง เงานุ่ม ลูกศรขาวนวล ──
   override .go-top-btn ใน style.css (ไม่แก้ style.css) */
.go-top-btn {
    width: 38px; height: 38px;
    background: rgba(48,48,46,.92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgba(222,220,209,.16);
    color: #f5f4ef;
    box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 8px 20px -6px rgba(0,0,0,.35);
}
.go-top-btn::before { display: none; }
.go-top-btn i { font-size: 17px; }
.go-top-btn:hover {
    background: rgba(61,61,58,.96);
    border-color: rgba(222,220,209,.26);
    color: #fff;
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 24px -8px rgba(0,0,0,.42);
}
.go-top-btn:active { transform: scale(.96); }
.go-top-btn:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(48,48,46,.6); }

/* ── ป้าย "โหลดหน้า x วินาที" มุมซ้ายล่าง — แบบ Medeesoft (apps/home): ตัวอักษร + ไอคอนล้วน ไม่มีพื้น/ขอบ/เงากล่อง ──
   ไอคอนเส้นบาง (ph regular) สีธีม, ป้าย "โหลดหน้า" เทา, ตัวเลขเด่นสีธีมเข้ม tabular, หน่วยเทาจาง,
   เส้นคั่น hairline ไล่จางหัวท้าย, halo ขาวรอบตัวอักษรให้อ่านออกบนภาพพื้นหลัง — override .ms-page-load-time ใน style.css */
.ms-page-load-time {
    left: 18px; gap: 7px; overflow: visible;
    background: none; border: none; border-radius: 0; padding: 0; box-shadow: none;
    font-size: var(--fs-caption, 11.5px); line-height: 1; color: #64748b;
    text-shadow: 0 0 8px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.9);
    animation: msPltIn .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes msPltIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ms-page-load-time::before { display: none; }
.ms-page-load-time:hover { box-shadow: none; transform: none; }
.ms-page-load-time > i { font-size: 16px; color: var(--th-3, #2563eb); filter: drop-shadow(0 0 4px rgba(255,255,255,.95)); }
.ms-plt-text { display: inline-flex; align-items: baseline; gap: 4px; pointer-events: none; }
.ms-plt-label { font-size: var(--fs-helper, 11px); font-weight: 600; letter-spacing: .02em; color: #64748b; }
.ms-page-load-time strong { font-size: var(--fs-section, 13px); font-weight: 800; letter-spacing: -.01em; color: var(--th-tb, #1d4ed8); font-variant-numeric: tabular-nums; }
.ms-plt-unit { font-size: var(--fs-tiny, 10.5px); font-weight: 600; color: #94a3b8; }
.ms-plt-divider { width: 1px; height: 14px; margin: 0 2px; background: linear-gradient(180deg, transparent 0%, rgba(100,116,139,.45) 50%, transparent 100%); }
.ms-copy-url-btn { color: #94a3b8; border-radius: 7px; filter: drop-shadow(0 0 4px rgba(255,255,255,.95)); transition: color .2s ease, transform .2s cubic-bezier(.2,.8,.2,1); }
.ms-copy-url-btn:hover { color: var(--th-3, #2563eb); background: transparent; transform: translateY(-1px); }
.ms-copy-url-btn:active { transform: scale(.92); }
.ms-copy-url-btn.copied { color: #16a34a; }
.ms-copy-url-btn i { font-size: 14px; }

/* ── ปุ่มเลขหน้า DataTable — แบบ Medeesoft (apps/acc_opd): ผิวเดียวกับปุ่มไอคอนบน topbar (เมนูแอป) ──
   พื้นไล่สีอ่อนของธีม ไม่มีเส้นขอบ + gloss ขาวครึ่งบน + เงานุ่มสีธีม, ตัวอักษร --th-3
   hover/หน้าปัจจุบัน = พื้นเข้มขึ้น ตัวอักษร --th-tb (หน้าปัจจุบันไม่ยก) · สีตามธีม (theme.css; ค่าเริ่มต้นน้ำเงิน) */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    position: relative !important; overflow: hidden !important;
    border: none !important; border-radius: 11px !important;
    background: linear-gradient(160deg, var(--th-50, #f2f7ff) 0%, var(--th-100, #e8f0ff) 100%) !important;
    color: var(--th-3, #2563eb) !important;
    font-size: 12px !important; font-weight: 800 !important; font-variant-numeric: tabular-nums;
    padding: 0 12px !important; margin: 0 3px !important;
    min-width: 38px !important; height: 38px !important; min-height: 38px !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    line-height: 1 !important; box-sizing: border-box !important;
    box-shadow: 0 1px 1px rgba(15,23,42,.03), 0 6px 12px -8px rgba(var(--th-rgb, 37,99,235), .35), inset 0 1px 0 rgba(255,255,255,.85) !important;
    transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .22s cubic-bezier(.2,.8,.2,1), background .2s ease, color .2s ease !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button::before {
    content: '' !important; position: absolute !important; inset: 0 !important; border-radius: inherit !important;
    background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 55%) !important; pointer-events: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:first-child,
.dataTables_wrapper .dataTables_paginate > .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button:last-child,
.dataTables_wrapper .dataTables_paginate > .paginate_button.next { border-radius: 11px !important; margin-left: 3px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:focus,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:active {
    background: linear-gradient(160deg, var(--th-100, #e8f0ff) 0%, var(--th-200, #d6e4ff) 100%) !important;
    border: none !important; color: var(--th-tb, #1d4ed8) !important; border-radius: 11px !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 1px 1px rgba(15,23,42,.04), 0 14px 22px -10px rgba(var(--th-rgb, 37,99,235), .4), 0 6px 12px -6px rgba(var(--th-rgb, 37,99,235), .3), inset 0 1px 0 rgba(255,255,255,.9) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:focus,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:active { transform: none !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.paginate_button:active { transform: translateY(0) scale(.95) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current *,
.dataTables_wrapper .dataTables_paginate .paginate_button.current.current:hover * { color: var(--th-tb, #1d4ed8) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled.disabled:active {
    background: linear-gradient(160deg, var(--th-50, #f2f7ff) 0%, var(--th-100, #e8f0ff) 100%) !important;
    color: var(--th-3, #2563eb) !important; cursor: default !important; opacity: .45 !important; box-shadow: none !important; transform: none !important;
}

/* ── ปุ่มปิด modal ตามมาตรฐาน Medeesoft (docs/standards/modals.md — module-modal-close / mcModal) ──
   อยู่ในหัว modal มุมขวาบน (ไม่ลอยนอกกรอบ): วงกลม 32px ไม่มีขอบ พื้นขาวโปร่ง ไอคอน #64748b 16px
   hover = พื้นแดงอ่อน #fee2e2 ไอคอน #ef4444 (ไม่มีขอบแดง) · ใช้ทั้งโปรเจกต์:
   login modal / modal ในแอป (.lm-close-btn), modal บันทึกการอัปเดต, เมนูแอป, เมนูตั้งค่าบนการ์ด (แผงตั้งค่าธีมอยู่ใน theme.css) */
.lm-close-btn,
.rel-modal-close,
.apps-dropdown-close,
.ws-cardmenu-close {
    top: 16px; right: 16px;
    width: 32px; min-width: 32px; height: 32px; min-height: 32px; flex: 0 0 32px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.55); color: #64748b;
    font-size: 16px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7), inset 0 0 0 1px rgba(148,163,184,0.16);
    transition: all 0.2s;
}
.lm-close-btn i,
.rel-modal-close i,
.apps-dropdown-close i,
.ws-cardmenu-close i { font-size: 16px; -webkit-text-stroke: 0; }
.lm-close-btn:hover,
.rel-modal-close:hover,
.apps-dropdown-close:hover,
.ws-cardmenu-close:hover {
    background: #fee2e2; color: #ef4444; transform: none;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7), inset 0 0 0 1px rgba(148,163,184,0.16);
}
@media (max-width: 640px) {
    .lm-close-btn { top: 14px; right: 14px; width: 32px; min-width: 32px; height: 32px; min-height: 32px; flex: 0 0 32px; }
}
@media (max-width: 480px) {
    .rel-modal-close,
    .apps-dropdown-close { top: 12px; right: 12px; width: 32px; height: 32px; }
}
/* เมนูตั้งค่าบนการ์ด: หัวเมนูเตี้ยกว่า modal — วางให้อยู่กลางแถวหัวเมนู */
.ws-cardmenu-close { top: 9px; right: 10px; }
.ws-cardmenu-hd { padding-right: 52px; }
