/* ===== Product List — design import (scoped to this page) ===== */
/* IBM Plex Sans Thai loaded via <HeadContent> in AllProducts.razor */

/* modal / toast ที่หน้าแม่ render เองนอก .pl-root (นอก MineListShell) ไม่ได้รับตัวแปรสีจาก .pl-root
   → var(--pl-teal) ไม่มีค่า ปุ่ม pl-btn-primary กลายเป็นพื้นใส ตัวอักษรขาว (มองไม่เห็น) — ประกาศตัวแปรซ้ำที่นี่ */
.pl-modal-overlay,
.pl-toast {
    --pl-teal: #0B7A75;
    --pl-teal-dark: #095E5A;
    --pl-ink: #0F172A;
    --pl-line: #E4E9F0;
    --pl-line-soft: #EDF1F6;
    --pl-muted: #8A94A6;
}

.pl-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

.pl-root {
    --pl-teal: #0B7A75;
    --pl-teal-dark: #095E5A;
    --pl-ink: #0F172A;
    --pl-line: #E4E9F0;
    --pl-line-soft: #EDF1F6;
    --pl-muted: #8A94A6;
    font-family: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, sans-serif;
    color: var(--pl-ink);
    background: #EEF1F6;
    -webkit-font-smoothing: antialiased;
    /* .ShowZone ของ layout = display:flex; width:fit-content; min-width:100%; padding-left:160px (แถบเมนูซ้าย)
       ถ้าปล่อย flex-basis:100% จะกว้างเกินจอไป 160px → ล็อกความกว้าง = พื้นที่จริงที่เหลือ */
    flex: 0 0 auto;
    /* อ้าง viewport ตรง ๆ กันปัญหา box-sizing ของ .ShowZone (padding-left 160px = แถบเมนู) */
    width: calc(100vw - 160px);
    max-width: calc(100vw - 160px);
    min-width: 0;
    align-self: stretch;
    /* จอสูง 1080: ล็อกความสูงหน้าจอ (หัก global header 48px) แล้วให้เลื่อนเฉพาะในตาราง */
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 992px) {
    .pl-root { width: calc(100vw - 45px); max-width: calc(100vw - 45px); }
}

@media (max-width: 768px) {
    /* เลิกคำนวณจาก 100vw ตรงๆ ที่จอแคบ (เดิมพัง ทุกครั้งที่ .ShowZone มี padding-left เปลี่ยนค่า เช่นตอนเมนูมือถือเปิด
       ต้องคอย sync เลขให้ตรงกันตลอด) เปลี่ยนให้ flex คำนวณพื้นที่ที่เหลือให้เองแทน กัน overflow ล้นขวาถาวร */
    .pl-root {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
    }
}

.pl-root * {
    box-sizing: border-box;
}

/* ---- topbar ---- */
.pl-topbar {
    flex: 0 0 auto;
    z-index: 30;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #DDE3EC;
}

.pl-topbar-inner {
    max-width: none;
    margin: 0;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.pl-title-wrap {
    flex: 1 1 220px;
    min-width: 0;
}

.pl-crumb {
    font-size: 12px;
    letter-spacing: .04em;
    color: #7C8698;
    font-weight: 500;
}

.pl-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 2px;
}

.pl-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.pl-title-count {
    font-size: 13px;
    color: #7C8698;
    font-weight: 500;
}

.pl-search {
    flex: 1 1 260px;
    position: relative;
    min-width: 0;
}

.pl-search-ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9AA4B5;
    font-size: 15px;
}

/* ---- ช่องค้นหาแบบธรรมดา (ใช้ในคลังสื่อ MediaManage / MediaSelectImage) ---- */
.mm-searchinput {
    width: 100%;
    height: 40px;
    border: 1px solid var(--pl-line, #E4E9F0);
    border-radius: 10px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--pl-ink, #0F172A);
    background: #fff;
    outline: none;
    transition: .15s;
}

    .mm-searchinput::placeholder {
        color: var(--pl-muted, #8A94A6);
    }

    .mm-searchinput:focus {
        border-color: var(--pl-teal, #0B7A75);
        box-shadow: 0 0 0 3px rgba(11,122,117,.13);
    }

.pl-search .mm-searchinput {
    padding-left: 34px;
}

.pl-search-ico {
    z-index: 1;
}

/* ---- tag / token search field ---- */
.pl-tagfield {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 5px 10px 5px 30px;
    border: 1px solid #DDE3EC;
    border-radius: 10px;
    background: #F7F9FC;
    cursor: text;
}

.pl-search:focus-within .pl-tagfield {
    border-color: var(--pl-teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(11, 122, 117, .13);
}

.pl-taginput {
    flex: 1 1 120px;
    min-width: 100px;
    height: 28px;
    border: 0;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--pl-ink);
}

.pl-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 4px 0 8px;
    border-radius: 7px;
    background: #E7EEF6;
    border: 1px solid #D6E1EC;
    font-size: 12.5px;
    max-width: 100%;
}

.pl-tag-k {
    font-size: 10.5px;
    font-weight: 600;
    color: #6B7688;
    text-transform: none;
    white-space: nowrap;
}

.pl-tag-v {
    font-weight: 500;
    color: #253143;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.pl-tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7C8698;
    font-size: 11px;
    cursor: pointer;
}

.pl-tag-x:hover {
    background: rgba(15, 23, 42, .1);
    color: #0F172A;
}

/* สีตามชนิด tag */
.pl-tag-name { background: #EAF6F4; border-color: #CFE6E2; }
.pl-tag-name .pl-tag-k { color: #0B7A75; }
.pl-tag-vendor { background: #EEF0FB; border-color: #DADFF5; }
.pl-tag-vendor .pl-tag-k { color: #4F46E5; }
.pl-tag-barcode { background: #FBF1E6; border-color: #F1DFC5; }
.pl-tag-barcode .pl-tag-k { color: #B45309; }
.pl-tag-code { background: #F0F1F4; border-color: #E0E3EA; }
.pl-tag-code .pl-tag-k { color: #475569; }

/* ---- autocomplete dropdown ---- */
.pl-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .28);
    padding: 6px;
    z-index: 10050;
    max-height: 320px;
    overflow-y: auto;
    animation: pl-pop .12s ease-out;
}

.pl-suggest-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.pl-suggest-row:hover {
    background: #F5F7FA;
}

.pl-suggest-k {
    flex: 0 0 auto;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
    background: #EEF1F6;
    color: #6B7688;
}

.pl-suggest-v {
    flex: 1;
    font-size: 13.5px;
    color: #253143;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---- buttons ---- */
.pl-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: .15s;
    white-space: nowrap;
}

.pl-btn-ghost {
    border: 1px solid #B9C2D0;
    background: #fff;
    color: #1E293B;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15,23,42,.06);
}

.pl-btn-ghost:hover {
    border-color: #8D9AB0;
    background: #F7F9FC;
    color: var(--pl-ink);
}

.pl-btn-ghost.active {
    border-color: var(--pl-teal);
    background: #ECFAF7;
    color: var(--pl-teal);
}

.pl-btn-primary {
    border: 0;
    background: var(--pl-teal);
    color: #fff;
    font-weight: 600;
    padding: 0 18px;
    box-shadow: 0 6px 16px -6px rgba(11,122,117,.6);
}

.pl-btn-primary:hover {
    background: var(--pl-teal-dark);
}

.pl-btn-danger {
    border: 0;
    background: #E11D48;
    color: #fff;
    font-weight: 600;
    padding: 0 18px;
}

.pl-w100 {
    width: 100%;
    margin-top: 12px;
}

.pl-flex1 {
    flex: 1 1 100px;
}

.pl-iconbtn {
    width: 44px;
    padding: 0;
    flex: 0 0 auto;
}

/* ---- KPI ---- */
.pl-kpis {
    flex: 0 0 auto;
    max-width: none;
    margin: 0;
    padding: 18px 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pl-kpi {
    flex: 1 1 190px;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.pl-kpi-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #6B7688;
    font-weight: 500;
}

.pl-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    flex: 0 0 auto;
}

.pl-kpi-val {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-feature-settings: 'tnum';
}

.pl-kpi-unit {
    font-size: 12.5px;
    color: #8A94A6;
    font-weight: 500;
}

.pl-kpi-hint {
    margin-top: 4px;
    font-size: 11.5px;
    color: #98A2B3;
}

/* ---- toolbar (แถบเหนือ KPI) ---- */
.pl-toolbar {
    flex: 0 0 auto;
    max-width: none;
    margin: 0;
    padding: 14px 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pl-pillgroup {
    display: flex;
    gap: 4px;
    background: #E2E7EF;
    padding: 4px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.pl-pill {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #5A6577;
    font-family: inherit;
}

.pl-pill.on {
    background: #fff;
    color: var(--pl-ink);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15,23,42,.12);
}

.pl-pill-n {
    opacity: .55;
    font-weight: 500;
}

.pl-toolbar-spacer {
    flex: 1;
}

/* ---- status pills (ทั้งหมด / เปิดใช้งาน / ปิดชั่วคราว) ---- */
.pl-spills {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pl-spill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px 0 14px;
    border: 1px solid #D5E2E1;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: #0B7A75;
    transition: .15s;
}

.pl-spill:hover {
    color: #095E5A;
    border-color: #095E5A;
}

.pl-spill.on {
    background: var(--pl-teal);
    border-color: var(--pl-teal);
    color: #fff;
    font-weight: 600;
}

.pl-spill.on:hover {
    background: var(--pl-teal-dark);
    border-color: var(--pl-teal-dark);
    color: #fff;
}

.pl-scount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    font-size: 11.5px;
    font-weight: 600;
    font-feature-settings: 'tnum';
}

.pl-spill.on .pl-scount {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* ---- popover ---- */
.pl-popwrap {
    position: relative;
}

.pl-pop {
    position: absolute;
    left: 0;
    top: 46px;
    width: 280px;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 14px;
    box-shadow: 0 18px 40px -12px rgba(15,23,42,.28);
    padding: 14px;
    z-index: 10045;
    animation: pl-pop .14s ease-out;
}

.pl-pop-right {
    left: auto;
    right: 0;
    width: 230px;
}

.pl-pop-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pl-pop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 9px;
    cursor: pointer;
}

.pl-pop-row:hover {
    background: #F5F7FA;
}

.pl-pop-label {
    font-size: 13.5px;
    color: #334155;
    flex: 1;
}

.pl-pop-div {
    height: 1px;
    background: var(--pl-line-soft);
    margin: 10px 0;
}

.pl-pop-sortgroup {
    cursor: default;
}

.pl-pop-sortgroup:hover {
    background: transparent;
}

.pl-sortdir {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.pl-sortdir-btn {
    width: 28px;
    height: 26px;
    border-radius: 7px;
    border: 1.5px solid #C6CFDB;
    background: #fff;
    color: #64748B;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .12s, background .12s, color .12s;
}

.pl-sortdir-btn:hover {
    border-color: var(--pl-teal);
    color: var(--pl-teal);
}

.pl-sortdir-btn.on {
    border-color: var(--pl-teal);
    background: var(--pl-teal);
    color: #fff;
}

.pl-clickcatcher {
    position: fixed;
    inset: 0;
    z-index: 10038;
}

/* ---- checkbox / radio ---- */
.pl-check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex: 0 0 auto;
    border: 1.5px solid #C6CFDB;
    background: #fff;
    color: transparent;
}

.pl-check.on {
    border-color: var(--pl-teal);
    background: var(--pl-teal);
    color: #fff;
}

.pl-radio {
    width: 16px;
    height: 16px;
    border-radius: 99px;
    flex: 0 0 auto;
    border: 1.5px solid #C6CFDB;
}

.pl-radio.on {
    border-color: var(--pl-teal);
    box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 9px var(--pl-teal);
}

/* ---- bulk bar ---- */
.pl-bulkwrap {
    flex: 0 0 auto;
    max-width: none;
    margin: 14px 0 0;
    padding: 0 20px;
}

.pl-bulk {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--pl-teal-dark);
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    animation: pl-slideup .16s ease-out;
}

.pl-bulk-count {
    font-size: 13.5px;
    font-weight: 600;
}

.pl-bulk-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.28);
    background: transparent;
    color: #fff;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.pl-bulk-btn.danger {
    border: 0;
    background: #E11D48;
    font-weight: 600;
}

.pl-bulk-x {
    height: 34px;
    width: 34px;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    border-radius: 9px;
    font-size: 15px;
    cursor: pointer;
}

/* ---- body layout ---- */
.pl-body {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 16px 20px 16px;
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: stretch;
    overflow: hidden;
}

.pl-listcard {
    flex: 1 1 560px;
    min-width: 0;
    min-height: 0;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pl-rows {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.pl-perpage {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #6B7688;
}

.pl-perpage select {
    height: 30px;
    border: 1px solid #DDE3EC;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    padding: 0 6px;
    background: #fff;
}

/* ---- table rows ---- */
.pl-head,
.pl-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
    padding: 11px 16px;
}

.pl-head {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--pl-line);
    background: #FAFBFD;
    font-size: 12px;
    font-weight: 600;
    color: #7C8698;
}

.pl-rowwrap {
    position: relative;
    border-bottom: 1px solid #F1F4F9;
}

.pl-row {
    cursor: pointer;
    background: #fff;
    transition: background .12s;
}

.pl-row:hover {
    background: #F8FAFB;
}

.pl-row.sel {
    background: #F4FAF9;
    box-shadow: inset 3px 0 0 var(--pl-teal);
}

.pl-c-check {
    width: 26px;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.pl-c-name {
    flex: 1 1 340px;
    min-width: 0;
}

.pl-c-cat {
    flex: 0 0 110px;
    width: 110px;
}

.pl-c-stock {
    flex: 0 0 140px;
    width: 140px;
}

.pl-c-price {
    flex: 0 0 108px;
    width: 108px;
    text-align: right;
}

.pl-c-status {
    flex: 0 0 96px;
    width: 96px;
}

.pl-c-menu {
    width: 34px;
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
}

/* desktop: wrapper โปร่งใส — .pl-c-* ทำตัวเป็น flex child ของ .pl-row เหมือนเดิม */
.pl-rowmeta {
    display: contents;
}

/* ยังไม่ได้เลือกสินค้า → ยุบ panel ขวา ให้ตารางกว้างเต็ม (ชื่อสินค้าแสดงได้ยาวขึ้น) */
.pl-detailwrap:has(.pl-nosel) {
    display: none;
}

.pl-stockmin {
    font-size: 11px;
    color: var(--pl-muted);
    margin-top: 1px;
    font-feature-settings: 'tnum';
}

/* label เล็ก ๆ หน้า value (โชว์เฉพาะโหมดซ้อน 2 บรรทัด) */
.pl-mlabel {
    display: none;
}

.pl-stockbox {
    width: 100%;
}

.pl-namecell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pl-thumb {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #EEF1F6;
    color: #5A6577;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
}

.pl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pl-nametext {
    min-width: 0;
}

.pl-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--pl-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-sub {
    font-size: 12px;
    color: var(--pl-muted);
    margin-top: 2px;
    font-feature-settings: 'tnum';
}

.pl-catchip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    background: #F1F4F9;
    color: #4B5666;
    font-size: 12px;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-stocktext {
    font-size: 14px;
    font-weight: 600;
    font-feature-settings: 'tnum';
}

.pl-bartrack {
    height: 4px;
    background: var(--pl-line-soft);
    border-radius: 99px;
    margin-top: 5px;
    overflow: hidden;
}

.pl-barfill {
    height: 100%;
    border-radius: 99px;
}

.pl-pricetext {
    font-size: 14.5px;
    font-weight: 600;
    font-feature-settings: 'tnum';
}

.pl-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
}

.pl-menu-btn {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    color: var(--pl-muted);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.pl-menu-btn:hover {
    background: #EEF1F6;
    color: var(--pl-ink);
}

.pl-rowmenu {
    position: absolute;
    right: 14px;
    top: 52px;
    width: 200px;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px -12px rgba(15,23,42,.3);
    padding: 6px;
    /* ต้องสูงกว่า .pl-clickcatcher (10038) — ไม่งั้น catcher บังเมนู คลิกแล้วเมนูปิดโดยไม่ทำงาน */
    z-index: 10040;
    animation: pl-pop .12s ease-out;
}

.pl-rowmenu-item {
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 13.5px;
    cursor: pointer;
    color: #334155;
}

.pl-rowmenu-item:hover {
    background: #F5F7FA;
}

.pl-rowmenu-item.danger {
    color: #BE123C;
}

/* ---- empty ---- */
.pl-empty {
    padding: 64px 24px;
    text-align: center;
}

.pl-empty-ico {
    font-size: 32px;
    color: #C6CFDB;
}

.pl-empty-title {
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px;
}

.pl-empty-sub {
    font-size: 13px;
    color: var(--pl-muted);
    margin: 4px 0 16px;
}

/* ---- pager ---- */
.pl-pager {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--pl-line-soft);
    background: #FAFBFD;
}

.pl-pager-text {
    font-size: 12.5px;
    color: var(--pl-muted);
}

.pl-pager-btns {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.pl-pg {
    height: 32px;
    padding: 0 11px;
    border: 1px solid #DDE3EC;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
}

.pl-pg:disabled {
    color: #94A0B0;
    cursor: not-allowed;
}

.pl-pg-input {
    width: 44px;
    height: 32px;
    border: 1px solid #DDE3EC;
    border-radius: 8px;
    text-align: center;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.pl-pager-of {
    font-size: 13px;
    color: var(--pl-muted);
}

/* ---- detail panel ---- */
.pl-detailwrap {
    flex: 0 0 380px;
    min-width: 320px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pl-detail {
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.pl-detail-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--pl-line-soft);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pl-detail-thumb {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #EEF1F6;
    color: #5A6577;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    overflow: hidden;
}

.pl-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pl-detail-headtext {
    flex: 1;
    min-width: 0;
}

.pl-detail-name {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.35;
}

.pl-detail-code {
    font-size: 12.5px;
    color: var(--pl-muted);
    margin-top: 3px;
    font-feature-settings: 'tnum';
}

.pl-detail-x {
    width: 32px;
    height: 32px;
    border: 0;
    background: #F1F4F9;
    border-radius: 9px;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    flex: 0 0 auto;
}

.pl-detail-stats {
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--pl-line-soft);
}

.pl-detail-stat {
    flex: 1 1 120px;
    background: #F7F9FC;
    border-radius: 11px;
    padding: 10px 12px;
}

.pl-detail-stat-k {
    font-size: 11.5px;
    color: var(--pl-muted);
    font-weight: 500;
}

.pl-detail-stat-v {
    font-size: 20px;
    font-weight: 700;
    margin-top: 2px;
    font-feature-settings: 'tnum';
}

.pl-detail-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 12px 0;
    border-bottom: 1px solid var(--pl-line-soft);
}

.pl-detail-tab {
    height: 36px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #7C8698;
    font-family: inherit;
}

.pl-detail-tab.on {
    color: var(--pl-teal);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--pl-teal);
}

.pl-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 18px;
    overflow: auto;
}

.pl-kv {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--pl-line-soft);
}

.pl-kv span:first-child {
    flex: 0 0 116px;
    font-size: 13px;
    color: var(--pl-muted);
}

.pl-kv span:last-child {
    flex: 1;
    font-size: 13.5px;
    font-weight: 500;
    color: #233043;
    text-align: right;
    font-feature-settings: 'tnum';
}

.pl-note {
    margin-top: 14px;
    padding: 12px 14px;
    background: #F0F7F6;
    border: 1px solid #CFE6E4;
    border-radius: 12px;
}

.pl-note-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pl-teal-dark);
}

.pl-note-body {
    font-size: 12.5px;
    color: #37605D;
    margin-top: 4px;
    line-height: 1.6;
}

.pl-detail-emptytab {
    font-size: 13px;
    color: var(--pl-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.pl-dash-btn {
    width: 100%;
    height: 40px;
    margin-top: 12px;
    border: 1px dashed #C2CCDA;
    background: #FAFBFD;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pl-teal);
    cursor: pointer;
    font-family: inherit;
}

/* ---- detail: lots & movements ---- */
.pl-lotsum {
    font-size: 12.5px;
    color: #4B5666;
    background: #F5F7FA;
    border-radius: 9px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.pl-lotsum .pl-in { color: #0B7A75; }
.pl-lotsum .pl-out { color: #E11D48; }

.pl-lotrow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #E9EDF3;
    border-radius: 11px;
    margin-bottom: 8px;
}

.pl-lotrow-main {
    flex: 1;
    min-width: 0;
}

.pl-lotrow-code {
    font-size: 13.5px;
    font-weight: 600;
    font-feature-settings: 'tnum';
}

.pl-lotrow-sub {
    font-size: 11.5px;
    color: var(--pl-muted);
    margin-top: 2px;
}

.pl-lotrow-qty {
    text-align: right;
    flex: 0 0 auto;
}

.pl-lotrow-remain {
    font-size: 14px;
    font-weight: 700;
    font-feature-settings: 'tnum';
}

.pl-lotrow-cost {
    font-size: 11px;
    color: var(--pl-muted);
    margin-top: 1px;
}

.pl-moverow {
    display: flex;
    gap: 10px;
    padding: 9px 2px;
    border-bottom: 1px dashed var(--pl-line-soft);
}

.pl-movedot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    margin-top: 6px;
}

.pl-moverow-main {
    flex: 1;
    min-width: 0;
}

.pl-moverow-title {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.pl-moverow-qty {
    font-feature-settings: 'tnum';
}

.pl-moverow-sub {
    font-size: 11.5px;
    color: var(--pl-muted);
    margin-top: 2px;
}

.pl-detail-foot {
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid var(--pl-line-soft);
    background: #FAFBFD;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pl-nosel {
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.pl-nosel-ico {
    font-size: 28px;
    color: #C6CFDB;
}

.pl-nosel-title {
    font-size: 14.5px;
    font-weight: 600;
    margin-top: 10px;
}

.pl-nosel-sub {
    font-size: 12.5px;
    color: var(--pl-muted);
    margin-top: 4px;
    line-height: 1.6;
}

/* ---- modal ---- */
.pl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.42);
    backdrop-filter: blur(2px);
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: pl-fade .12s ease-out;
}

.pl-modal {
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 70px -20px rgba(15,23,42,.5);
    animation: pl-slideup .18s ease-out;
}

.pl-modal-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--pl-line-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}

.pl-modal-title {
    font-size: 17px;
    font-weight: 700;
}

.pl-modal-sub {
    font-size: 12.5px;
    color: var(--pl-muted);
    margin-top: 2px;
}

.pl-modal-x {
    width: 32px;
    height: 32px;
    border: 0;
    background: #F1F4F9;
    border-radius: 9px;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
}

.pl-modal-body {
    padding: 18px 20px;
}

.pl-modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--pl-line-soft);
    background: #FAFBFD;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pl-adjust-head {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F7F9FC;
    border-radius: 12px;
    padding: 12px 14px;
}

.pl-adjust-headtext {
    flex: 1;
    min-width: 0;
}

.pl-adjust-name {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-adjust-cur {
    font-size: 12px;
    color: var(--pl-muted);
    margin-top: 2px;
}

.pl-stepper {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #fff;
    border: 1px solid #DDE3EC;
    border-radius: 10px;
    padding: 3px;
}

.pl-stepper button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 16px;
    color: #334155;
    cursor: pointer;
}

.pl-stepper span {
    min-width: 52px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    font-feature-settings: 'tnum';
}

.pl-field-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #6B7688;
    margin: 14px 0 6px;
}

.pl-chiprow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pl-chiprow.pl-center {
    justify-content: center;
    margin-top: 14px;
}

.pl-chip {
    height: 32px;
    padding: 0 12px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #DDE3EC;
    background: #fff;
    color: #475569;
    font-family: inherit;
}

.pl-chip.on {
    border-color: var(--pl-teal);
    background: #ECFAF7;
    color: var(--pl-teal);
}

.pl-warn {
    margin-top: 14px;
    padding: 11px 13px;
    background: #FFF8EB;
    border: 1px solid #F6E2BC;
    border-radius: 11px;
    font-size: 12.5px;
    color: #7A5B18;
    line-height: 1.6;
}

.pl-barcode-preview {
    text-align: center;
    padding: 18px 22px;
    border: 1px solid var(--pl-line);
    border-radius: 12px;
}

.pl-barcode-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 64px;
    justify-content: center;
}

.pl-barcode-bars span {
    display: block;
    background: #0F172A;
}

.pl-barcode-num {
    font-size: 13px;
    letter-spacing: .22em;
    margin-top: 10px;
    font-family: 'IBM Plex Sans', monospace;
}

.pl-barcode-name {
    font-size: 12.5px;
    color: #6B7688;
    margin-top: 6px;
}

.pl-danger-box {
    display: flex;
    gap: 12px;
    padding: 13px 14px;
    background: #FFF1F3;
    border: 1px solid #FBD0D8;
    border-radius: 12px;
    font-size: 13.5px;
    color: #8C1C33;
    line-height: 1.6;
}

.pl-danger-box span {
    font-size: 18px;
    color: #E11D48;
}

.pl-drop {
    border: 1px dashed #C2CCDA;
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    background: #FAFBFD;
    margin-bottom: 12px;
}

.pl-drop-ico {
    font-size: 26px;
    color: #B7C1CF;
}

.pl-drop-title {
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 8px;
}

.pl-drop-sub {
    font-size: 12px;
    color: var(--pl-muted);
    margin-top: 3px;
}

/* ---- toast ---- */
.pl-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 10080;
    background: #0F172A;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 18px 40px -12px rgba(15,23,42,.6);
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: center;
    animation: pl-slideup .18s ease-out;
}

.pl-toast span:first-child {
    color: #5EEAD4;
}

@keyframes pl-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pl-slideup {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pl-pop {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* panel รายละเอียดฝั่งขวา (≥1400px) : เลื่อนเข้าจากขวา */
@keyframes pl-slide-right {
    from { opacity: 0; transform: translateX(34px); }
    to { opacity: 1; transform: translateX(0); }
}

/* panel รายละเอียดแบบ Bottom Sheet (<1400px) : เลื่อนขึ้นจากขอบล่าง */
@keyframes pl-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* จอสูงจำกัด: ส่วนหัว/สถิติ/แท็บ/ปุ่มของ panel ไม่ให้ยุบ */
.pl-detail-head,
.pl-detail-stats,
.pl-detail-tabs,
.pl-detail-foot {
    flex: 0 0 auto;
}

/* ≥1400px : เลือกสินค้า → panel ฝั่งขวาเลื่อนเข้ามา */
.pl-detailwrap:has(.pl-detail) .pl-detail {
    animation: pl-slide-right .24s ease-out;
}

/* =========================================================
   RESPONSIVE — Tablet & Mobile
   ========================================================= */

/* ---- <1400px : เลิกโหมด app-shell + ตารางเต็มความกว้าง + คลิกแล้วเด้งเป็น Popup กลางจอ ---- */
@media (max-width: 1399px) {
    .pl-root {
        height: auto;
        min-height: calc(100vh - 48px);
        overflow: visible;
    }

    .pl-body {
        flex-wrap: wrap;
        overflow: visible;
        align-items: flex-start;
    }

    .pl-listcard {
        flex: 1 1 100%;
        min-height: 0;
    }

    .pl-rows {
        flex: 0 1 auto;
        overflow: visible;
    }

    /* panel = Bottom Sheet ชิดล่าง เลื่อนขึ้น + ฉากหลังมืด */
    .pl-detailwrap {
        flex: 0 0 0;
        min-width: 0;
    }

    .pl-detailwrap:has(.pl-detail) {
        position: fixed;
        inset: 0;
        z-index: 10070;
        display: block;
    }

    .pl-detailwrap:has(.pl-detail)::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        backdrop-filter: blur(2px);
        animation: pl-fade .15s ease-out;
    }

    /* ชิดขอบล่างสุด เต็มความกว้าง สูงตามเนื้อหา (สูงสุด 85vh) เลื่อนขึ้น */
    .pl-detailwrap:has(.pl-detail) .pl-detail {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 85vh;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -22px 60px -18px rgba(15, 23, 42, .5);
        animation: pl-sheet-up .26s cubic-bezier(.16, 1, .3, 1);
        display: flex;
        flex-direction: column;
    }

    /* เนื้อหาไม่ยืดเต็ม — ย่อเมื่อเกิน max-height เท่านั้น */
    .pl-detailwrap:has(.pl-detail) .pl-detail-scroll {
        flex: 0 1 auto;
        min-height: 0;
        overflow: auto;
    }

    /* ไม่มีสินค้าที่เลือก → ไม่ต้องโชว์การ์ด placeholder เปล่า ๆ */
    .pl-nosel {
        display: none;
    }
}

/* ---- ≤1100px : แถวสินค้าเป็นการ์ดซ้อน 2 บรรทัด ---- */
@media (max-width: 1100px) {
    /* ---- แถวสินค้า: การ์ดซ้อน 2 บรรทัด ----
       บรรทัด 1 = checkbox + รูป + ชื่อ/รหัส + ปุ่ม ⋯
       บรรทัด 2 = หมวด · คงเหลือ · ราคา · สถานะ (มี label เล็ก, เยื้องใต้รูป) */
    .pl-head {
        display: none;
    }

    .pl-row {
        flex-wrap: wrap;
        row-gap: 12px;
        align-items: center;
        padding: 14px 16px;
    }

    .pl-c-check {
        order: 0;
        align-self: center;
    }

    .pl-c-name {
        order: 1;
        flex: 1 1 0;
        min-width: 0;
    }

    .pl-c-menu {
        order: 2;
    }

    /* wrapper กลับมาเป็น flex จริง = บรรทัดที่ 2 */
    .pl-rowmeta {
        order: 3;
        flex: 1 1 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 20px;
        margin-left: 50px;
        padding-top: 12px;
        border-top: 1px dashed var(--pl-line-soft);
    }

    .pl-rowmeta .pl-c-cat,
    .pl-rowmeta .pl-c-stock,
    .pl-rowmeta .pl-c-price,
    .pl-rowmeta .pl-c-status {
        flex: 0 0 auto;
        width: auto;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .pl-mlabel {
        display: inline;
        font-size: 11px;
        font-weight: 500;
        color: var(--pl-muted);
    }

    .pl-stockbox {
        display: flex;
        align-items: center;
        gap: 8px;
        width: auto;
    }

    .pl-stockbox .pl-bartrack {
        width: 72px;
        margin-top: 0;
    }

    /* KPI 2 คอลัมน์ */
    .pl-kpi {
        flex: 1 1 calc(50% - 6px);
    }
}

/* ---- ≤760px : Tablet เล็ก / มือถือแนวนอน ---- */
@media (max-width: 760px) {
    .pl-topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .pl-title-wrap,
    .pl-search {
        flex: none;
    }

    .pl-topbar-actions {
        flex-wrap: wrap;
    }

    .pl-topbar-actions .pl-btn {
        flex: 1 1 auto;
    }

    .pl-kpis,
    .pl-toolbar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pl-spills {
        width: 100%;
    }

    .pl-spill {
        flex: 1 1 auto;
        justify-content: center;
    }

    .pl-body {
        padding: 12px 14px;
    }
}

/* ---- ≤560px : มือถือ ---- */
@media (max-width: 560px) {
    .pl-kpi {
        flex: 1 1 100%;
    }

    .pl-kpi-val {
        font-size: 22px;
    }

    /* Bottom sheet เต็มความกว้าง สูงสุด 92vh */
    .pl-detailwrap:has(.pl-detail) .pl-detail {
        max-width: 100%;
        max-height: 92vh;
    }

    .pl-row {
        padding: 14px 12px;
    }

    .pl-rowmeta {
        margin-left: 46px;
        gap: 6px 16px;
    }

    .pl-thumb {
        width: 34px;
        height: 34px;
    }

    .pl-name {
        font-size: 13.5px;
    }

    .pl-pager {
        padding: 12px 14px;
    }

    .pl-pager-btns {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .pl-detail-foot .pl-btn {
        flex: 1 1 100%;
    }

    .pl-modal {
        border-radius: 14px;
    }
}

/* ---- ≤480px : จอแคบมาก — popover / เมนูแถว ไม่ให้ล้นจอ ---- */
@media (max-width: 480px) {
    .pl-pop {
        width: calc(100vw - 28px);
        right: auto;
        left: 0;
    }

    .pl-pop-right {
        left: auto;
        right: 0;
    }

    .pl-rowmenu {
        max-width: calc(100vw - 32px);
    }

    .pl-toolbar-actions,
    .pl-topbar-actions .pl-btn {
        font-size: 13px;
    }
}
/* =========================================================
   BILL-SPECIFIC ADDITIONS (หน้ารายการบิลขายปลีก-ส่ง)
   ต่อยอดจาก design ของหน้ารายการสินค้า — ปรับให้ตรงข้อมูลบิลขาย
   ========================================================= */

/* ช่วงวันที่ใน toolbar */
.pl-daterange {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #DDE3EC;
    border-radius: 10px;
    background: #fff;
    font-size: 12.5px;
    color: #475569;
}

.pl-daterange-label {
    color: var(--pl-muted);
    font-weight: 500;
}

.pl-daterange-field {
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pl-teal-dark);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
}

.pl-daterange-field:hover {
    background: #ECFAF7;
}

.pl-daterange-dash {
    color: var(--pl-muted);
}

.pl-daterange-reset {
    width: 24px;
    height: 24px;
    border: 0;
    background: #F1F4F9;
    border-radius: 7px;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
}

/* คอลัมน์บิล */
.pl-c-billcode {
    flex: 1 1 300px;
    min-width: 0;
}

.pl-c-date {
    flex: 0 0 96px;
    width: 96px;
}

.pl-c-items {
    flex: 0 0 76px;
    width: 76px;
    text-align: right;
}

.pl-c-amount {
    flex: 0 0 118px;
    width: 118px;
    text-align: right;
}

.pl-amounttext {
    font-size: 14.5px;
    font-weight: 700;
    font-feature-settings: 'tnum';
}

.pl-payline {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
}

.pl-payline.paid { color: #0B7A75; }
.pl-payline.partial { color: #B45309; }
.pl-payline.unpaid { color: #BE123C; }

/* ไอคอนหัวบิลแทนรูปสินค้า */
.pl-thumb.pl-billicon,
.pl-detail-thumb.pl-billicon {
    background: #EAF6F4;
    color: var(--pl-teal);
}

/* รายการสินค้าในแผงรายละเอียด (แท็บ "รายการสินค้า") */
.pl-billitem {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed var(--pl-line-soft);
}

.pl-billitem-main {
    flex: 1;
    min-width: 0;
}

.pl-billitem-name {
    font-size: 13px;
    font-weight: 600;
    color: #233043;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-billitem-sub {
    font-size: 11.5px;
    color: var(--pl-muted);
    margin-top: 2px;
    font-feature-settings: 'tnum';
}

.pl-billitem-total {
    font-size: 13px;
    font-weight: 700;
    font-feature-settings: 'tnum';
    flex: 0 0 auto;
}

/* บล็อกสรุปยอด (VAT / สุทธิ / ค้างชำระ) */
.pl-billsum {
    margin-top: 12px;
    border-top: 1px solid var(--pl-line-soft);
    padding-top: 10px;
}

.pl-billsum-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: #4B5666;
    padding: 4px 0;
    font-feature-settings: 'tnum';
}

.pl-billsum-row.net {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--pl-ink);
    border-top: 1px dashed var(--pl-line-soft);
    margin-top: 4px;
    padding-top: 8px;
}

.pl-billsum-row.remain {
    color: #BE123C;
    font-weight: 600;
}

/* ── DateTimePicker: override โทนสีฟ้า → teal ให้เข้าชุดปุ่มในหน้ารายการบิลขาย
   (scoped เฉพาะหน้านี้ผ่าน wrapper .pl-dtp — ไม่กระทบ DateTimePicker ที่อื่น) ── */
.pl-dtp .MineDTP-Head {
    background: linear-gradient(135deg, #095E5A, #0B7A75);
}

.pl-dtp .MineDTP-Day.IsSelected,
.pl-dtp .MineDTP-YearItem.IsSelected {
    background: linear-gradient(135deg, #095E5A, #0B7A75);
    box-shadow: 0 8px 16px -6px rgba(11, 122, 117, .55);
}

.pl-dtp .MineDTP-Day.IsToday,
.pl-dtp .MineDTP-YearItem.IsToday {
    border-color: #0B7A75;
    color: #095E5A;
}

.pl-dtp .MineDTP-Day:hover,
.pl-dtp .MineDTP-YearItem:hover {
    background: #ECFAF7;
    border-color: #CFE6E2;
}

.pl-dtp .MineDTP-TodayBtn {
    background: linear-gradient(135deg, #095E5A, #0B7A75);
}

.pl-dtp .MineDTP-Field:focus-within {
    border-color: #0B7A75;
    box-shadow: 0 0 0 3px rgba(11, 122, 117, .13);
}

/* ── inline edit input ใน detail panel (ใช้โดย AllVenders) ── */
.pl-inlineinput {
    font-family: inherit;
    font-size: 13px;
    color: var(--pl-ink, #1f2937);
    border: 1px solid #DDE3EC;
    border-radius: 7px;
    padding: 5px 8px;
    background: #fff;
    outline: none;
}
.pl-inlineinput:focus {
    border-color: #0B7A75;
    box-shadow: 0 0 0 3px rgba(11,122,117,.13);
}
.pl-kv .pl-inlineinput { max-width: 190px; }

/* ── realtime toggle ใน topbar (ใช้โดย StockRec_Man) ── */
.pl-rt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #475569;
    cursor: pointer;
    user-select: none;
    padding: 0 4px;
}
.pl-rt-toggle input { width: 14px; height: 14px; accent-color: #0B7A75; cursor: pointer; }

/* ===== AllProducts: ปรับสต็อก / พิมพ์บาร์โค้ด / ลบ (ฟังก์ชันจริง) ===== */
.pl-adjust-input { width: 72px; text-align: center; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 16px; -moz-appearance: textfield; }
.pl-adjust-input::-webkit-outer-spin-button, .pl-adjust-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pl-adjust-err { color: #BE123C; }
.pl-adjust-note { width: 100%; margin-top: 8px; }
.pl-barcode-svg { width: 100%; max-width: 260px; height: 70px; margin: 0 auto; }
.pl-barcode-svg svg { display: block; fill: #0f172a; }
.pl-bc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.pl-bc-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748B; }
.pl-bc-grid input { border: 1px solid #DDE3EA; border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 14px; color: #0f172a; }
.pl-bc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; cursor: pointer; }
.pl-bc-check input { accent-color: #0B7A75; }
.pl-del-note { margin-top: 6px; font-size: 12.5px; color: #92400E; }
@media (max-width: 520px) { .pl-bc-grid { grid-template-columns: 1fr 1fr; } }
