/* =====================================================================
   หน้าตาแบบ dashboard สะอาด ๆ (โหลดต่อจาก app.css — แก้เฉพาะหน้าตา ไม่แตะการทำงาน) — ไฟล์เดียวกันทั้ง HQ และเว็บร้าน (แก้ที่ HQ แล้วคัดลอก)
   - สี / ขนาด เป็นตัวแปรใน :root  ·  โหมดมืด = html[data-theme=dark] (js/theme.js)
   - ฟอนต์ฝังในเว็บ: Inter (อังกฤษ / ตัวเลข) + Noto Sans Thai (ไทย) — SIL OFL, ดู fonts/LICENSE-*.txt
   - ไอคอนเส้นบาง Lucide (icons.svg + <Icon Name="..." />)
   ===================================================================== */

@font-face {
    font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Noto Sans Thai"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(fonts/noto-sans-thai-thai-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
    color-scheme: light;
    --font: "Inter", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;      /* หัวตาราง / พื้นรอง */
    --hover: #f3f5f9;
    --border: #e6e9f0;
    --border-strong: #d5dae4;
    --text: #151a2d;
    --muted: #6b7280;
    --primary: #059669;        /* เขียวมรกต — สีเดียวกับโปรแกรม POS หน้าร้าน */
    --primary-ink: #ffffff;
    --primary-soft: #e7f7ee;
    --ring: rgba(5, 150, 105, .22);
    --ok: #15803d;
    --ok-bg: #e7f7ee;
    --warn: #b45309;
    --warn-bg: #fff4e0;
    --danger: #dc2626;
    --danger-bg: #fdecec;
    --nav-active: #eef2f7;
    --radius: 13px;
    --radius-control: 10px;
    --shadow-card: 0 1px 2px rgba(21, 26, 45, .06);
    --shadow-pop: 0 12px 32px rgba(21, 26, 45, .14);
    /* พื้นไอคอนสีพาสเทล */
    --tile-blue: #eef2ff;   --tile-blue-ink: #4f46e5;
    --tile-green: #e7f7ee;  --tile-green-ink: #15803d;
    --tile-orange: #fff1e6; --tile-orange-ink: #ea580c;
    --tile-purple: #f3eeff; --tile-purple-ink: #7c3aed;
    --tile-teal: #e6f7f5;   --tile-teal-ink: #0f766e;
}

html[data-theme=dark] {
    color-scheme: dark;
    --bg: #0f1320;
    --surface: #171c2b;
    --surface-2: #1c2233;
    --hover: #212840;
    --border: #2a3147;
    --border-strong: #3a4360;
    --text: #e7eaf3;
    --muted: #9aa3b8;
    --primary: #10b981;
    --primary-ink: #04261a;
    --primary-soft: rgba(16, 185, 129, .14);
    --ring: rgba(16, 185, 129, .3);
    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, .13);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, .13);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, .13);
    --nav-active: #232b42;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
    --tile-blue: rgba(99, 102, 241, .16);   --tile-blue-ink: #a5b4fc;
    --tile-green: rgba(52, 211, 153, .14);  --tile-green-ink: #6ee7b7;
    --tile-orange: rgba(251, 146, 60, .15); --tile-orange-ink: #fdba74;
    --tile-purple: rgba(167, 139, 250, .16); --tile-purple-ink: #c4b5fd;
    --tile-teal: rgba(45, 212, 191, .14);   --tile-teal-ink: #5eead4;
}

/* ---------------------------------------------------------------- พื้นฐาน */
body { font-family: var(--font); font-size: 14px; line-height: 1.55; background: var(--bg); color: var(--text); font-feature-settings: "cv11"; }
code, .mono { font-family: "Inter", ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; font-size: .92em; letter-spacing: .01em; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-weight: 650; }
td, th, .num, .stat strong { font-variant-numeric: tabular-nums; }
a { color: var(--primary); }
::selection { background: var(--primary-soft); }

.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }

/* ---------------------------------------------------------------- โครงหน้า */
.shell { background: var(--bg); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 20px 28px 28px; }

.side {
    width: 252px; background: var(--surface); color: var(--text); border-right: 1px solid var(--border);
    padding: 16px 12px; gap: 2px; z-index: 40;
}
.brand-row { padding: 0 4px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #fff; flex-shrink: 0; }
.brand-mark .ic { width: 18px; height: 18px; }
.brand span.brand-text span { color: var(--primary); }
.side-toggle { width: 32px; height: 32px; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.side-toggle:hover { background: var(--hover); color: var(--text); }

.side a { display: flex; align-items: center; gap: 10px; color: #3b4256; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
html[data-theme=dark] .side a { color: #c3c9da; }
.side a .ic { color: #8a93a8; }
.side a:hover { background: var(--hover); color: var(--text); }
.side a.active { background: var(--nav-active); color: var(--text); font-weight: 600; }
.side a.active .ic { color: var(--primary); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-sec > summary {
    gap: 10px; justify-content: flex-start; padding: 7px 10px; margin-top: 10px;
    font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--muted); opacity: 1;
}
.nav-sec > summary::after { content: none; }
.nav-sec > summary .sec-icon { display: none; }
.nav-sec > summary .sec-caret { margin-left: auto; width: 15px; height: 15px; transition: transform .15s; }
.nav-sec[open] > summary .sec-caret { transform: rotate(90deg); }
.nav-sec > summary:hover { background: var(--hover); color: var(--text); }
.nav-sec.has-active > summary { color: var(--text); }
.nav-sec > a { padding-left: 10px; }

.user { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--border); padding: 14px 6px 4px; margin-top: auto; }
.user-info { min-width: 0; }
.user-info .app-version { display: block; opacity: .75; font-size: .75rem; }
.user-name { font-weight: 600; font-size: 14px; }
.user small { opacity: 1; color: var(--muted); margin-bottom: 6px; }
.user-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.side .user a.small { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: var(--muted); font-size: 13px; opacity: 1; }
.side .user a.small:hover { color: var(--text); background: none; }
.user .btn.small { display: inline-flex; align-items: center; gap: 6px; }
.user .ic { width: 15px; height: 15px; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--tile-green); color: var(--tile-green-ink); font-weight: 700; font-size: 14px;
}

/* แถบบน: วันที่ซ้าย, ปุ่มขวา */
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid transparent;
}
.topbar-date { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--radius-control);
    border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }
.nav-open-btn { display: none; }
html[data-theme=dark] .when-light, html:not([data-theme=dark]) .when-dark { display: none; }

/* แถบย่อ: เหลือไอคอน */
.nav-collapsed .side { width: 68px; padding: 16px 10px; }
.nav-collapsed .side .brand-text, .nav-collapsed .side .nav-label, .nav-collapsed .side .sec-caret,
.nav-collapsed .side .user-info { display: none; }
.nav-collapsed .side .side-body { display: flex; }
.nav-collapsed .brand-row { flex-direction: column; gap: 10px; }
.nav-collapsed .side a { justify-content: center; padding: 9px 0; }
.nav-collapsed .nav-sec > summary { justify-content: center; padding: 8px 0; margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0; }
.nav-collapsed .nav-sec > summary .sec-icon { display: block; }
.nav-collapsed .nav-sec > a { padding-left: 0; }
.nav-collapsed .user { justify-content: center; padding: 12px 0 0; }

/* ---------------------------------------------------------------- หัวหน้า */
.page-head { align-items: flex-end; margin-bottom: 20px; gap: 12px 16px; }
.page-head > div:has(> h1) { display: block; }
.page-head h1 { font-size: 30px; margin: 0; }
.page-head h1 + p { font-size: 15px; margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.page-head h1 + p.muted { color: var(--muted); }
.toolbar { gap: 10px; }
.toolbar label { font-size: 13px; gap: 4px; }

/* ---------------------------------------------------------------- ช่องกรอก / ปุ่ม */
input, select, textarea {
    font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-control);
    background: var(--surface); color: var(--text); padding: 8px 12px; min-height: 40px;
}
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--primary); }
input[type=file] { min-height: 0; border: 0; padding: 0; background: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
select:not([multiple]) {
    appearance: none; -webkit-appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input[type=search] {
    padding-left: 36px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px center / 16px;
}
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--muted); }
::placeholder { color: #9aa1b1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 8px 14px; border-radius: var(--radius-control); border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-card);
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--primary); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn .ic { width: 16px; height: 16px; }
.link-btn, .crumb-link { color: var(--primary); }

/* ---------------------------------------------------------------- การ์ด */
.panel, .table-wrap, .stat, .tree-panel, .detail:not(tr), .login-box, .import-kind, .set-slot, .sk-table {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.panel { padding: 20px; margin-bottom: 16px; }
.table-wrap { margin-bottom: 16px; }
.panel h2 { margin-bottom: 14px; }
.panel h3, .form-subhead { border-top-color: var(--border); }
.form-grid { gap: 14px 16px; }
.form-grid label, label.block { font-size: 13px; gap: 6px; color: var(--muted); }

/* การ์ดตัวเลข (KPI) */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat > span:first-child, .stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat .stat-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .stat-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.icon-tile { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.icon-tile .ic { width: 17px; height: 17px; }
.icon-tile.blue { background: var(--tile-blue); color: var(--tile-blue-ink); }
.icon-tile.green { background: var(--tile-green); color: var(--tile-green-ink); }
.icon-tile.orange { background: var(--tile-orange); color: var(--tile-orange-ink); }
.icon-tile.purple { background: var(--tile-purple); color: var(--tile-purple-ink); }
.icon-tile.teal { background: var(--tile-teal); color: var(--tile-teal-ink); }
.stat.stat-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.stat.stat-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* ---------------------------------------------------------------- ตาราง */
table { font-size: 14px; }
th, td { border-bottom: 1px solid var(--border); padding: 11px 14px; }
th { background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; border-bottom: 1px solid var(--border); }
.table-wrap thead th { background: var(--surface-2); }
.table-wrap thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.table-wrap thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
tbody tr { transition: background .1s; }
tbody tr:hover > td { background: var(--hover); }
table.clickable tbody tr:not(.detail):hover { background: var(--hover); }
tr.open, tr.open > td { background: var(--primary-soft) !important; }
tr.detail > td { background: var(--surface-2); }
table.inner { background: var(--surface); border-color: var(--border); border-radius: 10px; }
table.product-list thead .pin { background: var(--surface-2); }
table.clickable.product-list tbody tr:not(.detail):hover > td.pin { background: var(--hover); }
table.product-list tbody tr.open > td.pin { background: var(--primary-soft); }
tr.refund td { background: color-mix(in srgb, var(--danger-bg) 55%, transparent); }

/* ป้ายสถานะ: มนเต็ม + จุดสี */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.status.on::before { background: var(--ok); }

/* ข้อความแจ้ง */
.error, .notice, .dev-note, .warn-notice { border-radius: var(--radius-control); padding: 10px 14px; }
.notice { background: var(--ok-bg); color: var(--ok); }
.error { background: var(--danger-bg); color: var(--danger); }

/* แท็บ */
.tabs { gap: 4px; border-bottom-color: var(--border); }
.tab { padding: 8px 12px; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }

/* เมนูเลือก / dropdown */
.combo-box { border-radius: var(--radius-control); background: var(--surface); border-color: var(--border); min-height: 40px; }
.combo-box:focus-within { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.combo-box input, .combo-box input:focus { min-height: 0; box-shadow: none; }
.combo-list, .hit-list { background: var(--surface); border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); }
.combo-list li.active { background: var(--hover); }
.chip { background: var(--primary-soft); }

/* modal */
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.modal-backdrop { background: rgba(15, 19, 32, .45); backdrop-filter: blur(2px); }

/* ต้นไม้หมวด / master-detail */
.tree-row:hover { background: var(--hover); }
.tree-row.selected { background: var(--primary-soft); }
.tree-label .count { background: var(--surface-2); }
.detail-head { border-bottom-color: var(--border); }

/* โหลด */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%) 0 0 / 200% 100%; }
.sk-row-head { background: var(--surface-2); }
#nav-progress { background: var(--primary); box-shadow: none; }

/* login */
.center-page { background: var(--bg); }
.login-box { padding: 32px; border-radius: 16px; }
.login-box h1 { font-size: 26px; }

/* ---------------------------------------------------------------- โหมดมืด: พื้นที่ app.css ใส่สีขาวไว้ตรง ๆ */
html[data-theme=dark] .sup-grid, html[data-theme=dark] .bp-add, html[data-theme=dark] .pimg-thumb,
html[data-theme=dark] .po-print-tools, html[data-theme=dark] .key-panel pre { background: var(--surface-2); }
html[data-theme=dark] .sup-head, html[data-theme=dark] tr.group-row th, html[data-theme=dark] tr.bp-row > td { background: var(--surface-2); }
html[data-theme=dark] .stepper li, html[data-theme=dark] .margin.none, html[data-theme=dark] .type-tag.unit, html[data-theme=dark] .vat-tag.exempt { background: var(--surface-2); color: var(--muted); }
html[data-theme=dark] .cost-locked input[readonly], html[data-theme=dark] .sup-line select:disabled { background: var(--surface-2); color: var(--text); }
html[data-theme=dark] .key-panel { background: var(--warn-bg); }
html[data-theme=dark] .import-table tr.row-error td, html[data-theme=dark] .import-table tr.row-current td { background: var(--hover); }
html[data-theme=dark] .info-tip::after { background: #2a3147; }
/* เอกสารพิมพ์ / ตัวอย่างพิมพ์ คงเป็นกระดาษขาวเสมอ */
html[data-theme=dark] .po-print, html[data-theme=dark] .pl-doc { color: #111; }

/* ---------------------------------------------------------------- จอเล็ก */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .shell { flex-direction: row; }
    /* เมนูเป็นแถบเลื่อนออกมาจากซ้าย */
    .side {
        position: fixed; top: 0; bottom: 0; left: 0; height: 100vh; width: 280px; max-width: 86vw;
        flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 16px 12px; overflow-y: auto;
        transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-pop);
    }
    .nav-open .side { transform: none; }
    .side-backdrop { position: fixed; inset: 0; background: rgba(15, 19, 32, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .nav-open .side-backdrop { opacity: 1; pointer-events: auto; }
    .side-toggle { display: none; }
    .nav-collapsed .side { width: 280px; padding: 16px 12px; }
    .nav-collapsed .side .brand-text, .nav-collapsed .side .nav-label, .nav-collapsed .side .user-info, .nav-collapsed .side .sec-caret { display: initial; }
    .nav-collapsed .brand-row { flex-direction: row; }
    .nav-collapsed .side a { justify-content: flex-start; padding: 8px 10px; }
    .nav-collapsed .nav-sec > summary { justify-content: flex-start; border-top: 0; padding: 7px 10px; }
    .nav-collapsed .nav-sec > summary .sec-icon { display: none; }
    .nav-open-btn { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 12px 16px 24px; }
    .page-head h1 { font-size: 24px; }
    .stats { grid-template-columns: 1fr; }
}
@media (min-width: 761px) { .side-backdrop { display: none; } }

@media print {
    .side, .topbar, .side-backdrop { display: none !important; }
    .content { padding: 0; }
    html[data-theme=dark] body { background: #fff; color: #111; }
}
.content:has(> .md-layout) { height: calc(100vh - 60px); }
@media (max-width: 900px) { .content:has(> .md-layout) { height: auto; } }
/* app.css ตั้ง .stat span เป็น block / .brand span เป็นสีเขียว — แก้ทับเฉพาะชิ้นใหม่ */
.stat .icon-tile { display: grid; }
.brand .brand-text { color: var(--text); }
.brand .brand-mark { color: #fff; }
.nav-collapsed .side .brand { display: flex; }

/* ---------------------------------------------------------------- เก็บรายละเอียดรายหน้า */
/* หน้าสินค้า: ช่องค้นหา + หมวดติดกัน, คอลัมน์แคบ (ภาษี) ไม่ให้ padding กินที่ */
.search-box select { background-color: var(--surface-2); }
table.product-list th, table.product-list td { padding-left: 10px; padding-right: 10px; }
table.product-list td.col-vat, table.product-list th.col-vat { padding-left: 4px; padding-right: 4px; text-overflow: clip; text-align: center; }
html[data-theme=dark] .type-tag.weight { background: var(--tile-orange); color: var(--tile-orange-ink); }
html[data-theme=dark] .type-tag.multi { background: var(--tile-purple); color: var(--tile-purple-ink); }
html[data-theme=dark] .type-tag.set { background: var(--tile-blue); color: var(--tile-blue-ink); }
html[data-theme=dark] .set-slot.selectable { border-left-color: var(--tile-blue-ink); }
/* หน้ารายการที่ชื่อหน้าอยู่แถวเดียวกับตัวกรอง */
.page-head > h1 { align-self: center; }
/* ช่องติ๊กในแถวตัวกรอง: ติ๊ก + ข้อความแถวเดียว ชิดล่างให้ตรงกับช่องกรอก */
.pc-filters label.check { flex-direction: row; align-items: center; align-self: flex-end; gap: 8px; min-height: 40px; color: var(--text); font-size: 14px; }
.pc-filters label.check input { min-width: 0; }
.pc-filters { gap: 12px 14px; }
.pc-filters label { font-size: 13px; gap: 6px; }
.login-box h1 span { color: var(--primary); }

/* ---------------------------------------------------------------- ตัวอย่างใบเสร็จ (หน้า "ใบเสร็จ") — ฟอนต์เดียวกับที่เครื่องขายวาด */
@font-face { font-family: "Rc Mono"; src: url(fonts/receipt/IBMPlexMono-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rc Mono"; src: url(fonts/receipt/IBMPlexMono-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rc Looped"; src: url(fonts/receipt/NotoSansThaiLooped-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rc Looped"; src: url(fonts/receipt/NotoSansThaiLooped-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rc Modern"; src: url(fonts/receipt/IBMPlexSansThai-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rc Modern"; src: url(fonts/receipt/IBMPlexSansThai-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
.rc-stage { background: #d9dde5; border-radius: var(--radius); padding: 20px; display: flex; justify-content: center; position: sticky; top: 76px; }
.rc-paper {
    width: var(--rc-width); background: #fff; color: #111; padding: 14px 10px 22px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
    font-size: calc(var(--rc-width) / (var(--rc-cols) * 0.6)); line-height: 1.32; font-variant-numeric: tabular-nums;
    -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
}
.rc-paper.receipt { font-family: "Rc Mono", "Rc Looped", monospace; }
.rc-paper.modern { font-family: "Rc Modern", sans-serif; }
.rc-line { display: flex; justify-content: space-between; gap: 6px; white-space: pre-wrap; min-height: 1.32em; }
.rc-line.c { justify-content: center; text-align: center; }
.rc-line.b { font-weight: 700; }
.rc-line.l { font-size: 1.6em; line-height: 1.2; }
.rc-right { white-space: nowrap; }
.rc-sep { border-top: 1px dashed #333; margin: .45em 0; }
.rc-center { display: flex; flex-direction: column; align-items: center; margin: .3em 0; }
.rc-logo { max-width: 100%; image-rendering: pixelated; }
.rc-barcode { width: 70%; height: 38px; background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 3px, #111 3px 4px, #fff 4px 7px, #111 7px 10px, #fff 10px 11px); }
.rc-small { font-size: .8em; }
.rc-qr { width: 96px; height: 96px; display: grid; place-items: center; font-weight: 700; color: #111;
         background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 16px 16px; outline: 6px solid #fff; outline-offset: -6px; }
.rc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .rc-layout { grid-template-columns: 1fr; } .rc-stage { position: static; } }
.rc-paper-toggle { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.rc-tax { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 14px 4px; margin: 0 0 12px; }
.rc-tax legend { font-weight: 600; padding: 0 6px; }

/* License (docs/LICENSING-AND-UPDATES.md) */
.license-banner { margin: 0 0 14px; }
.license-banner a { margin-left: 8px; font-weight: 600; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
