/* ยอดดี — ระบบบริหารงานขาย · ธีมเขียว = บ้าน, น้ำเงิน = รถ */
@font-face { font-family: Anuphan; font-display: swap; font-weight: 100 700; src: url(../vendor/fonts/anuphan-thai-wght-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: Anuphan; font-display: swap; font-weight: 100 700; src: url(../vendor/fonts/anuphan-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: Jakarta; font-display: swap; font-weight: 200 800; src: url(../vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0020-007E, U+2013; }

:root {
  color-scheme: light;
  --ink: #16213a; --ink2: #43506a; --mute: #64708a; --line: #e3e8f0; --line2: #d3dae6; --card: #fff; --hover: #f4f7fb;
  --green: #0c7a4d; --green-s: #e0f5ea; --red: #c8323c; --red-s: #fde9ea; --amber: #94590a; --amber-s: #fdf0d6; --blue: #245bb8; --blue-s: #e5effd; --slate: #4e5b74; --slate-s: #edf1f6;
  --r: 18px; --r2: 12px; --r3: 9px;
  --font: Anuphan, 'Noto Sans Thai', 'Leelawadee UI', system-ui, sans-serif; --num: Jakarta, Anuphan, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-biz=house] { --brand: #12805f; --brand-d: #0c5b44; --brand-dd: #083f31; --brand-s: #e2f4ec; --brand-t: #0b5f46; --accent: #ef8136; --accent-s: #fdeddf; --accent-t: #984708; --bg: #f3f7f5; --side: #f9fcfa; }
[data-biz=car] { --brand: #3158d8; --brand-d: #2444b4; --brand-dd: #162c7c; --brand-s: #e6ecfd; --brand-t: #2342ab; --accent: #f4643a; --accent-s: #ffe9e2; --accent-t: #a5350f; --bg: #f3f5fb; --side: #f9fafe; }

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; font: 400 14.5px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h6, p, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.3; }
a { color: var(--brand-t); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; height: auto; }
small { font-size: 12.5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.ph, .ph-fill { line-height: 1; }
.num, td.r, th.r { font-family: var(--num); font-variant-numeric: tabular-nums; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 99; background: #fff; padding: 10px 16px; border-radius: 10px; } .skip:focus { top: 12px; }
.mute { color: var(--mute); } .tc { text-align: center; } .nowrap { white-space: nowrap; }
.up { color: var(--green); } .down { color: var(--red); }

/* ---------- โครง ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 252px; background: linear-gradient(#fff, var(--side)); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 50; }
.wrap { margin-left: 252px; min-width: 0; }
.brand { display: flex; gap: 11px; align-items: center; padding: 16px 18px 12px; color: var(--ink); }
.brand b { display: block; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; } .brand small { color: var(--mute); }
.menu { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; }
.menu h6 { font-size: 12px; font-weight: 500; color: var(--mute); padding: 14px 12px 4px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--r3); color: var(--ink2); font-weight: 500; transition: background .15s; }
.menu a i { font-size: 20px; color: var(--brand); } .menu a:hover { background: var(--brand-s); color: var(--brand-t); }
.menu a[aria-current] { background: linear-gradient(100deg, var(--brand-d), var(--brand)); color: #fff; } .menu a[aria-current] i { color: #fff; }
.side-art { display: flex; align-items: center; gap: 4px; margin: 8px 12px 14px; padding: 8px 12px 8px 4px; border-radius: 14px; background: var(--brand-s); color: var(--ink); transition: background .2s; }
.side-art img { width: 92px; flex: none; transition: transform .35s var(--ease); } .side-art:hover img { transform: translateY(-3px); } .side-art small { color: var(--mute); display: block; line-height: 1.3; } .side-art b { font-size: 13.5px; color: var(--brand-t); white-space: nowrap; }
@media (max-height: 800px) { .side-art img { width: 56px; } .menu a { padding: 6px 12px; } .menu h6 { padding-top: 9px; } }
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: 66px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.page { padding: 8px 28px 48px; max-width: 1560px; margin: 0 auto; }
.ib { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; font-size: 20px; color: var(--ink2); position: relative; list-style: none; cursor: pointer; flex: none; } .ib:hover { border-color: var(--line2); background: var(--hover); }
.dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font: 700 11px/19px var(--num); text-align: center; }
.only-m { display: none; }
.gs { position: relative; flex: 1; max-width: 420px; } .gs > i { position: absolute; left: 14px; top: 12px; font-size: 18px; color: var(--mute); }
.gs input { width: 100%; height: 42px; padding: 0 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; } .gs input::placeholder { color: var(--mute); }
.gs kbd { position: absolute; right: 11px; top: 10px; font: 600 12px/20px var(--num); color: var(--mute); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; }
.gs-r { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border-radius: 14px; box-shadow: 0 18px 50px -12px rgba(22, 33, 58, .3), 0 0 0 1px var(--line); padding: 6px; max-height: 420px; overflow: auto; }
.gs-r a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--ink); } .gs-r a:hover, .gs-r a.on { background: var(--brand-s); } .gs-r small { display: block; color: var(--mute); } .gs-r i { font-size: 20px; color: var(--brand); }
.sw { display: flex; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-left: auto; flex: none; }
.sw a { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--ink2); font-weight: 500; font-size: 14px; white-space: nowrap; } .sw a i { font-size: 18px; } .sw a[aria-current] { background: var(--brand-s); color: var(--brand-t); }
.me { display: flex; gap: 9px; align-items: center; flex: none; } .me b { display: block; font-size: 14px; line-height: 1.25; white-space: nowrap; } .me small { color: var(--mute); }
.face { width: 38px; height: 38px; flex: none; border-radius: 50%; } .face.s { width: 28px; height: 28px; } .face.l { width: 58px; height: 58px; } .face.xl { width: 84px; height: 84px; }
.pop { position: relative; flex: none; } .pop summary::-webkit-details-marker { display: none; }
.pop-b { position: absolute; right: 0; top: 50px; width: 340px; max-width: 88vw; background: #fff; border-radius: 16px; box-shadow: 0 22px 60px -14px rgba(22, 33, 58, .34), 0 0 0 1px var(--line); padding: 12px 8px 8px; z-index: 5; } .pop-b h3 { font-size: 15px; padding: 2px 10px 6px; }
.pop-b a { display: flex; gap: 11px; padding: 9px 10px; border-radius: 11px; color: var(--ink); } .pop-b a:hover { background: var(--hover); } .pop-b b { display: block; font-weight: 600; font-size: 14px; } .pop-b small { color: var(--mute); }
.ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-s); color: var(--brand); font-size: 19px; flex: none; }
.tabbar { display: none; }
.veil { display: none; }

/* ---------- หัวหน้า / ปุ่ม / ชิป ---------- */
.page-h { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin: 10px 0 18px; } .page-h h1 { font-size: 26px; font-weight: 700; letter-spacing: -.015em; } .page-h p { color: var(--ink2); max-width: 70ch; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; } .btn i { font-size: 18px; }
.btn:hover { background: var(--hover); border-color: #bcc6d6; } .btn:active { transform: translateY(1px); } .btn[disabled] { opacity: .55; pointer-events: none; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.pri:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; } .top .btn.sm { min-height: 42px; border-radius: 12px; padding: 0 15px; }
.btn.red { color: var(--red); } .btn.ghost { border-color: transparent; background: none; color: var(--brand-t); } .btn.ghost:hover { background: var(--brand-s); }
.lk { font-weight: 600; font-size: 13.5px; white-space: nowrap; } .lk:hover { text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--slate-s); color: var(--slate); } .chip i { font-size: 14px; }
.t-green { background: var(--green-s); color: var(--green); } .t-red { background: var(--red-s); color: var(--red); } .t-amber { background: var(--amber-s); color: var(--amber); } .t-blue { background: var(--blue-s); color: var(--blue); } .t-slate { background: var(--slate-s); color: var(--slate); }
.t-brand { background: var(--brand-s); color: var(--brand-t); } .t-accent { background: var(--accent-s); color: var(--accent-t); }
.delta { color: var(--mute); font-size: 12.5px; } .delta b { font-family: var(--num); } .delta.up b, .delta.up i { color: var(--green); } .delta.down b, .delta.down i { color: var(--red); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg a, .seg button { flex: none; height: 34px; line-height: 34px; padding: 0 14px; border: 0; background: none; border-radius: 9px; color: var(--ink2); font-weight: 500; white-space: nowrap; } .seg a:hover { color: var(--brand-t); } .seg [aria-current=true] { background: var(--brand-s); color: var(--brand-t); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pill { height: 42px; padding: 0 34px 0 14px; border: 1px solid var(--line); border-radius: 12px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364708a' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m2.5 4.500 3.500 3.500 3.500-3.500'/%3E%3C/svg%3E") no-repeat right 13px center; font-weight: 500; max-width: 240px; }
.filters .filters { margin: 0; flex: 1; }
.find { position: relative; flex: 1 1 220px; max-width: 360px; } .find i { position: absolute; left: 13px; top: 12px; font-size: 18px; color: var(--mute); } .find input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 12px 0 39px; }

/* ---------- การ์ด / กริด ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; } .card.flush > .card-h { padding: 18px 20px 0; }
.card-h { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; } .card-h > div:nth-child(2) { min-width: 0; flex: 1; } .card-h h2 { font-size: 16.5px; font-weight: 650; } .card-h p { color: var(--mute); font-size: 13px; line-height: 1.4; } .card-h .r { display: flex; gap: 8px; align-items: center; flex: none; }
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.kpis > * { padding: 17px 20px 16px; box-shadow: -1px 0 var(--line), 0 -1px var(--line); color: var(--ink); min-width: 0; } .kpis a:hover { background: var(--hover); }
.kpis .k { display: flex; align-items: center; gap: 7px; color: var(--ink2); font-weight: 500; font-size: 13.5px; } .kpis .k i { color: var(--brand); font-size: 18px; }
.kpis .v, .big { font: 700 28px/1.25 var(--num); letter-spacing: -.025em; margin: 5px 0 3px; } .v small, .big small { font: 500 14px var(--font); color: var(--ink2); letter-spacing: 0; margin-left: 5px; }
.meter { display: block; height: 8px; border-radius: 5px; background: color-mix(in srgb, var(--brand) 16%, #fff); overflow: hidden; } .meter i { display: block; height: 100%; border-radius: 5px; background: var(--brand); } .meter.good i { background: var(--green); } .meter.warn { background: var(--accent-s); } .meter.warn i { background: var(--accent); } .meter.thin { height: 6px; }

/* ---------- แบนเนอร์หน้าหลัก ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 400px; border-radius: 24px; background: linear-gradient(112deg, var(--brand-dd), var(--brand-d) 48%, var(--brand)); color: #fff; padding: 30px 32px 28px; margin: 4px 0 16px; overflow: hidden; min-height: 252px; }
.hero::before { content: ''; position: absolute; right: -60px; top: -120px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .2), transparent); }
.hero > div { position: relative; z-index: 1; max-width: 640px; } .hero h1 { font-size: 29px; font-weight: 700; letter-spacing: -.015em; } .hero p { color: rgba(255, 255, 255, .88); font-size: 16px; margin: 4px 0 16px; max-width: 54ch; } .hero p b { color: #fff; }
.hero-art { position: absolute; right: 4px; top: 50%; width: 468px; transform: translateY(-51%); }
.goal { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: baseline; max-width: 520px; margin-bottom: 20px; } .goal span { color: rgba(255, 255, 255, .88); } .goal b { font: 700 17px var(--num); } .goal .meter { grid-column: 1/-1; height: 12px; border-radius: 7px; background: rgba(255, 255, 255, .2); } .goal .meter i { background: linear-gradient(90deg, #ffd08a, var(--accent)); border-radius: 7px; }
.hero .btn { border-color: transparent; } .hero .btn.gl { background: rgba(255, 255, 255, .14); color: #fff; } .hero .btn.gl:hover { background: rgba(255, 255, 255, .24); } .hero .btn.w { color: var(--brand-t); }

/* ---------- รายการ ---------- */
.list { display: flex; flex-direction: column; } .list > * { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--ink); min-width: 0; } .list > :first-child { border-top: 0; padding-top: 2px; } .list > :last-child { padding-bottom: 0; } a.row:hover b.t { color: var(--brand-t); }
.list .bd { flex: 1; min-width: 0; } .list b.t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .list small { color: var(--mute); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .list .rt { text-align: right; flex: none; } .list .rt b { font-family: var(--num); }
.rank { width: 24px; font: 700 14px var(--num); color: var(--mute); text-align: center; flex: none; }
.funnel { display: grid; gap: 4px; } .funnel a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; margin: 0 -10px; border-radius: 11px; color: var(--ink); } .funnel a:hover { background: var(--hover); } .funnel i.ph { font-size: 20px; color: var(--brand); } .funnel span b { font-weight: 600; } .funnel em { font: 600 14px var(--num); } .funnel em small { font: 400 12.5px var(--font); color: var(--mute); } .funnel .meter { grid-column: 2/-1; }
.empty { text-align: center; padding: 34px 16px; color: var(--mute); } .empty > i { font-size: 38px; color: var(--brand); opacity: .7; } .empty b { display: block; color: var(--ink); font-size: 15.5px; margin-top: 8px; } .empty .btn { margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; } .kv dt { color: var(--mute); } .kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; } .kv .tot { font: 700 18px var(--num); }

/* ---------- ตาราง ---------- */
.tw { overflow-x: auto; } table { width: 100%; border-collapse: collapse; } th { text-align: left; font-weight: 500; font-size: 13px; color: var(--mute); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfcfe; } td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; } th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; } th.r, td.r { text-align: right; } td small { display: block; color: var(--mute); } tbody tr:hover { background: var(--hover); } td a b, td b { font-weight: 600; color: var(--ink); } td a:hover b { color: var(--brand-t); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; } .who b { display: block; white-space: nowrap; } .who small { white-space: nowrap; } tfoot td { font-weight: 700; background: #fbfcfe; border-top: 1px solid var(--line2); }
.pager { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); } .pager span { margin-right: auto; color: var(--mute); font-size: 13px; } .pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--ink2); font: 600 13.5px var(--num); } .pager a:hover { background: var(--hover); } .pager [aria-current] { background: var(--brand-s); color: var(--brand-t); }

/* ---------- ฟอร์ม / กล่องโต้ตอบ ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .wide { grid-column: 1/-1; }
.fld span { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 5px; } .fld em { display: block; font-style: normal; font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.fld input, .fld select, .fld textarea { width: 100%; min-height: 43px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 11px; background: #fff; } .fld textarea { resize: vertical; line-height: 1.5; } .fld :focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); } ::placeholder { color: #78849b; opacity: 1; }
.dlg { width: 600px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border: 0; padding: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 40px 100px -20px rgba(16, 26, 52, .5); } .dlg::backdrop { background: rgba(16, 26, 52, .45); backdrop-filter: blur(3px); } .dlg[open] { animation: pop .25s var(--ease); } @keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); } .dlg header { display: flex; align-items: center; gap: 11px; padding: 18px 20px 12px; } .dlg header h2 { font-size: 18px; flex: 1; } .dlg-b { padding: 6px 20px 18px; overflow: auto; } .dlg footer { display: flex; gap: 8px; justify-content: flex-end; padding: 13px 20px; border-top: 1px solid var(--line); background: #fbfcfe; } .x { border: 0; background: none; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; color: var(--mute); display: grid; place-items: center; } .x:hover { background: var(--hover); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 90px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 500; z-index: 200; transition: transform .35s var(--ease), visibility .35s; max-width: 90vw; visibility: hidden; } #toast.on { transform: translate(-50%, 0); visibility: visible; } #toast.err { background: var(--red); }

/* ---------- กราฟ ---------- */
.chart { position: relative; width: 100%; } .chart svg { width: 100%; display: block; overflow: visible; } .chart text { font: 500 12px var(--num); fill: var(--mute); } .chart .grid { stroke: #e7ebf2; } .chart .bar { transition: opacity .15s; } .chart .hit:hover ~ .x, .chart g.col:hover .bar, .chart g.col:focus .bar { opacity: .82; } .chart g.col { outline: 0; }
.tip { position: absolute; pointer-events: none; background: #fff; border-radius: 11px; box-shadow: 0 12px 34px -8px rgba(22, 33, 58, .32), 0 0 0 1px var(--line); padding: 9px 12px; font-size: 13px; white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); } .tip h5 { margin: 0 0 4px; font: 500 12.5px var(--font); color: var(--mute); } .tip div { display: flex; align-items: center; gap: 7px; } .tip b { font-family: var(--num); } .tip i { width: 12px; height: 3px; border-radius: 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 11px; height: 11px; border-radius: 3px; } .legend i.ln { height: 3px; width: 16px; border-radius: 2px; }
.bars { display: grid; gap: 12px; } .bars > * { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; color: var(--ink); } .bars b { font: 600 14px var(--num); } .bars .meter { grid-column: 1/-1; } .bars small { color: var(--mute); }

/* ---------- ไปป์ไลน์ ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 28px 14px; margin: 0 -28px; scroll-snap-type: x proximity; }
.lane { background: color-mix(in srgb, var(--brand) 5%, #eef1f6); border-radius: 18px; padding: 12px 9px; display: flex; flex-direction: column; min-height: 420px; max-height: calc(100dvh - 226px); scroll-snap-align: start; scroll-margin-left: 28px; } .lane header { padding: 2px 7px 10px; } .lane header h2 { font-size: 15px; display: flex; align-items: center; gap: 7px; } .lane header h2 i { font-size: 19px; color: var(--brand); } .lane header h2 em { margin-left: auto; font: 700 13px var(--num); background: #fff; border-radius: 8px; padding: 2px 9px; } .lane header p { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.cards { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; scrollbar-width: thin; padding: 1px 2px; } .kc { background: #fff; border-radius: 14px; padding: 12px 13px 11px; box-shadow: 0 1px 2px rgba(22, 33, 58, .07); cursor: grab; color: var(--ink); display: block; border: 1px solid transparent; flex: none; } .kc:hover { border-color: color-mix(in srgb, var(--brand) 45%, #fff); } .kc.sortable-ghost { opacity: .35; } .kc.sortable-drag { cursor: grabbing; }
.kc .l1 { display: flex; align-items: center; gap: 6px; } .kc .l1 b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .kc .l1 i { font-size: 16px; } .kc p { color: var(--ink2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .kc .l3 { display: flex; align-items: center; gap: 7px; margin-top: 8px; } .kc .l3 strong { font: 700 14.5px var(--num); flex: 1; white-space: nowrap; } .hot { color: var(--red); } .warm { color: #d98a00; } .cold { color: #4f8fd6; }
.done-lane { display: grid; gap: 10px; align-content: start; } .drop { border: 2px dashed var(--line2); border-radius: 18px; padding: 18px 14px; text-align: center; color: var(--ink2); position: relative; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; } .drop > i { font-size: 32px; } .drop b { color: var(--ink); } .drop.win > i { color: var(--green); } .drop.lose > i { color: var(--red); } .drop .cards { position: absolute; inset: 0; opacity: 0; } .drop:has(.sortable-ghost) { border-color: var(--brand); background: var(--brand-s); }

/* ---------- ดีล / ลูกค้า ---------- */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr); gap: 5px; overflow-x: auto; scrollbar-width: none; } .steps button, .steps span { border: 0; min-height: 48px; padding: 6px 12px; border-radius: 11px; background: var(--slate-s); color: var(--ink2); font-weight: 500; font-size: 13.5px; line-height: 1.25; display: flex; align-items: center; justify-content: center; gap: 6px; } .steps button:hover { background: var(--brand-s); color: var(--brand-t); } .steps .ok { background: var(--brand-s); color: var(--brand-t); } .steps .on { background: var(--brand) !important; color: #fff !important; font-weight: 600; } .steps .bad { background: var(--red-s); color: var(--red); }
.tl { position: relative; padding-left: 34px; display: grid; gap: 16px; } .tl::before { content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--line); } .tl > div { position: relative; } .tl > div > i { position: absolute; left: -34px; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-s); color: var(--brand); font-size: 15px; box-shadow: 0 0 0 4px #fff; } .tl .mv > i { background: var(--brand); color: #fff; } .tl b { font-weight: 600; } .tl small { color: var(--mute); display: block; } .tl p { color: var(--ink2); }
.checks { display: grid; gap: 2px; } .checks label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 9px; cursor: pointer; } .checks label:hover { background: var(--hover); } .checks input { width: 19px; height: 19px; accent-color: var(--brand); flex: none; margin: 0; } .checks input:checked + span { color: var(--mute); text-decoration: line-through; }
.art { background: radial-gradient(closest-side, #fff, var(--brand-s)); border-radius: 14px; display: grid; place-items: center; overflow: hidden; } .art img { width: 100%; max-width: 210px; }

/* ---------- สต็อก ---------- */
.stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px; } .pc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 9px 14px; text-align: left; color: var(--ink); transition: border-color .2s, transform .25s var(--ease); } .pc:hover { border-color: var(--brand); transform: translateY(-2px); } .pc .art img { max-width: 178px; padding: 6px 0; } .pc .b { padding: 10px 7px 0; display: block; } .pc .b > * { display: block; } .pc .b .tp { display: flex; align-items: center; gap: 6px; justify-content: space-between; } .pc small { color: var(--mute); } .pc strong { font: 700 17px var(--num); margin-top: 5px; } .pc strong small { font: 400 12.5px var(--font); }
.map { overflow: auto; text-align: center; background: radial-gradient(60% 70% at 50% 45%, #fff, transparent), var(--brand-s); border-radius: 14px; } .map svg { min-width: 900px; width: 100%; margin: 0 auto; } .map .pl { cursor: pointer; transition: transform .2s; outline: 0; } .map .pl:hover, .map .pl:focus-visible { filter: brightness(1.06) drop-shadow(0 5px 5px rgba(16, 30, 60, .35)); }

/* ---------- ปฏิทิน ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); } .cal > b { padding: 10px; text-align: center; font-weight: 500; color: var(--mute); font-size: 13px; background: #fbfcfe; border-bottom: 1px solid var(--line); } .cal > a { min-height: 108px; padding: 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); min-width: 0; } .cal > a:nth-child(7n) { border-right: 0; } .cal > a:hover { background: var(--hover); } .cal > a.off { background: #fafbfd; color: var(--mute); } .cal > a > em { font: 600 13.5px/26px var(--num); width: 26px; display: block; text-align: center; border-radius: 50%; } .cal > a.now > em { background: var(--brand); color: #fff; } .cal > a.sel { box-shadow: inset 0 0 0 2px var(--brand); } .cal span { display: block; font-size: 12.5px; padding: 1px 7px; margin-top: 3px; border-radius: 6px; background: var(--brand-s); color: var(--brand-t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal span.late { background: var(--red-s); color: var(--red); } .cal span.ok { background: var(--slate-s); color: var(--slate); } .cal small { color: var(--mute); padding-left: 7px; }

/* ---------- รายงานสัปดาห์ ---------- */
.rep { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 34px 38px; max-width: 1120px; margin: 0 auto; } .rep-h { display: flex; gap: 16px; align-items: center; padding-bottom: 20px; border-bottom: 3px solid var(--brand); } .rep-h img { width: 56px; } .rep-h h2 { font-size: 24px; letter-spacing: -.015em; } .rep-h p { color: var(--ink2); } .rep-h .r { margin-left: auto; text-align: right; color: var(--ink2); font-size: 13.5px; }
.rep h3 { font-size: 17px; margin: 28px 0 10px; } .rep-top { display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; padding: 24px 0 22px; border-bottom: 1px solid var(--line); align-items: center; } .rep-top .big { font-size: 50px; line-height: 1.12; } .rep-top .big small { font-size: 18px; } .rep-top .meter { height: 12px; margin: 10px 0 8px; } .rep-n { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; } .rep-n div > b { display: block; font: 700 22px/1.3 var(--num); } .rep-n div > b small { font: 500 13px var(--font); color: var(--ink2); margin-left: 4px; } .rep-n div > span:first-child { color: var(--ink2); font-size: 13.5px; }
.rep table { border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; } .rep .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; } .rep .fld textarea { background: #fcfdfe; } .flow { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 14px; } .flow div { padding: 13px 16px; border-left: 1px solid var(--line); } .flow div:first-child { border: 0; } .flow span { color: var(--ink2); font-size: 13px; } .flow b { display: block; font: 700 19px var(--num); } .flow b small { font: 500 12.5px var(--font); color: var(--ink2); }
.p-only { display: none; }

@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }
@media (max-width: 1320px) { .me span { display: none; } .hero { grid-template-columns: minmax(0, 1fr) 320px; } .hero-art { width: 400px; } }
@media (max-width: 1120px) { .s3, .s4, .s5 { grid-column: span 6; } .s7, .s8, .s9 { grid-column: span 12; } .s7 + .s5, .s8 + .s4, .s5:has(+ .s7), .s4:has(+ .s8) { grid-column: span 12; } .top .btn span, .gs kbd { display: none; } .sw a span { display: none; } }
@media (max-width: 900px) {
  .side { transform: translateX(-102%); transition: transform .3s var(--ease), visibility .3s; width: 272px; visibility: hidden; } body.nav .side { transform: none; visibility: visible; } body.nav .veil { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(16, 26, 52, .45); } .wrap { margin: 0; } .only-m { display: grid; }
  .top { padding: 0 16px; gap: 8px; height: 60px; } .me { display: none; } .page { padding: 6px 16px 104px; } .board { margin: 0 -16px; padding: 2px 16px 14px; grid-auto-columns: 82vw; } .lane { scroll-margin-left: 16px; max-height: none; } .cards { max-height: 62dvh; }
  .g12 { gap: 12px; } .g12 > * { grid-column: span 12 !important; } .hero { grid-template-columns: 1fr; padding: 22px 20px; } .hero-art { position: relative; order: -1; right: auto; top: auto; transform: none; width: 78%; max-width: 320px; margin: -14px auto 4px; } .hero h1 { font-size: 24px; } .page-h h1 { font-size: 23px; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpis > * { padding: 13px 14px; } .kpis .v { font-size: 22px; } .kpis > :last-child:nth-child(odd) { grid-column: 1/-1; } .grid2 { grid-template-columns: 1fr; } .card { padding: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 42; background: #fff; border-top: 1px solid var(--line); padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); } .tabbar a, .tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--ink2); font-weight: 500; } .tabbar i { font-size: 23px; } .tabbar [aria-current] { color: var(--brand-t); } #toast { bottom: 84px; }
  .rep { padding: 20px 16px; } .rep-top, .rep .two { grid-template-columns: 1fr; gap: 20px; } .rep-top .big { font-size: 38px; } .flow { grid-template-columns: 1fr 1fr; } .flow div { border: 0; } .rep-h { flex-wrap: wrap; } .rep-h .r { margin: 0; text-align: left; } .cal > a { min-height: 62px; padding: 4px; } .cal span { height: 7px; padding: 0; text-indent: -99em; } .cal small { display: none; } .stock { grid-template-columns: 1fr 1fr; gap: 10px; }
  .list .rt small { max-width: 110px; }
}
@media print {
  @page { size: A4; margin: 11mm; } body { background: #fff; font-size: 11.5px; } .side, .top, .tabbar, .page-h, .no-p, #toast, .veil, .skip { display: none !important; } .wrap { margin: 0; } .page { padding: 0; max-width: none; } .rep { border: 0; padding: 0; max-width: none; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .rep h3 { margin: 16px 0 6px; font-size: 14px; } td, th { padding: 5px 8px !important; } tr, .flow, .rep-top { break-inside: avoid; } .rep-top { grid-template-columns: 1.15fr 1fr; padding: 14px 0; } .rep-top .big { font-size: 36px; } .rep .two { grid-template-columns: 1fr 1fr; } .flow { grid-template-columns: repeat(5, 1fr); } .p-only { display: block; } .face { width: 24px; height: 24px; }
}

/* ---------- อันดับทีมขาย ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; } .podium .card { position: relative; display: flex; gap: 16px; align-items: center; color: var(--ink); transition: border-color .2s; } .podium .card:hover { border-color: var(--brand); } .podium .bd { flex: 1; min-width: 0; } .podium .bd > b { display: block; font-size: 16px; font-weight: 650; } .podium small { color: var(--mute); display: block; } .podium .big { display: block; } .podium .big small { display: inline; } .podium .meter { margin: 10px 0 4px; }
.medal { position: absolute; right: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--num); background: #ffe08a; color: #6b4a00; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6); } .medal.m2 { background: #dbe2ec; color: #46536b; } .medal.m3 { background: #f3c9a4; color: #6f3c12; }
@media (max-width: 1080px) { .podium { grid-template-columns: 1fr; } }
.tin { width: 132px; height: 38px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 10px; font: 600 14px var(--num); background: #fff; } .tin:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.calw { align-items: start; } @media (min-width: 901px) { .calw > .s4 { max-height: 700px; overflow-y: auto; scrollbar-width: thin; } .calw .cal > a { min-height: 116px; } } .mon { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 900px) { .filters .filters { flex: 1 0 100%; } .filters .pill { flex: 1 1 120px; min-width: 0; max-width: none; } .filters .find { flex: 1 0 100%; max-width: none; } }

/* ---------- พรีวิวบ้าน 3 มิติ ---------- */
.v3 { padding: 8px; } .h3d { position: relative; height: 560px; border-radius: 12px; overflow: hidden; background: #cfdce8; isolation: isolate; } .h3d:fullscreen { height: 100vh; border-radius: 0; }
.h3d canvas { display: block; width: 100%; height: 100%; cursor: grab; opacity: 0; transition: opacity .6s; } .h3d canvas:active { cursor: grabbing; } .h3d.on canvas { opacity: 1; } .h3d canvas:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.h3d .wait { position: absolute; inset: 0; z-index: 1; transition: opacity .6s; pointer-events: none; } .h3d .wait img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px); } .h3d .wait p { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); background: #fff; border-radius: 12px; padding: 10px 16px; width: 240px; text-align: center; font-size: 14px; } .h3d .wait i { display: block; height: 5px; border-radius: 5px; background: var(--line); margin-top: 8px; overflow: hidden; } .h3d .wait b { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.h3d.on .wait { opacity: 0; } .h3d.off .wait img { filter: none; } .h3d.off .wait i, .h3d:not(.on) :is(.fl, .tl3, .how) { display: none; }
.h3d .fl, .h3d .tl3 { position: absolute; z-index: 2; display: flex; background: rgba(255, 255, 255, .94); border-radius: 12px; padding: 4px; gap: 2px; } .h3d .fl { left: 14px; bottom: 14px; } .h3d .tl3 { right: 14px; top: 14px; flex-direction: column; }
.h3d button { border: 0; background: none; color: var(--ink2); border-radius: 9px; min-width: 40px; height: 40px; padding: 0 12px; font: 600 14px var(--font); cursor: pointer; } .h3d .tl3 button { padding: 0; font-size: 19px; } .h3d button:hover { background: var(--brand-s); color: var(--brand-t); } .h3d button[aria-pressed=true] { background: var(--brand); color: #fff; }
.h3d .how { position: absolute; z-index: 2; left: 14px; top: 14px; background: rgba(16, 26, 52, .62); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 20px; pointer-events: none; }
@media (max-width: 900px) { .h3d { height: 420px; } }
@media (max-width: 480px) { .h3d { height: 380px; } .h3d .fl button { padding: 0 10px; } }
.art img.pic, .pc .art img.pic { width: 100%; height: auto; max-width: none !important; padding: 0; aspect-ratio: 1.28; object-fit: cover; }
.dz { margin-bottom: 14px; } .dzs { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; } .dzs a { flex: 0 0 190px; scroll-snap-align: start; color: var(--ink); } .dzs img { display: block; width: 100%; height: auto; aspect-ratio: 1.28; object-fit: cover; border-radius: 12px; margin-bottom: 8px; transition: transform .25s var(--ease); } .dzs a:hover b { color: var(--brand-t); } .dzs b, .dzs small { display: block; } .dzs small { color: var(--mute); }
@media (max-width: 480px) { .h3d .tl3 :is([data-do=in], [data-do=out]) { display: none; } }

/* คลังเอกสาร */
.fo { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(92px, 1fr); gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding: 2px; }
.fo a { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 14px 6px 11px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-align: center; transition: transform .2s var(--ease), border-color .2s; } .fo a:hover { transform: translateY(-2px); border-color: var(--brand); }
.fo span { position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--brand-s); color: var(--brand-t); margin-bottom: 5px; } .fo b { font-size: 13.5px; font-weight: 600; line-height: 1.25; } .fo small { color: var(--mute); font-family: var(--num); } .fo em { position: absolute; top: -5px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #b3560b; color: #fff; font: 700 11.5px/20px var(--num); }
.fo [aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; } .fo [aria-current] small { color: inherit; } .fo [aria-current] span { background: rgba(255, 255, 255, .18); color: #fff; }
.lib { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
.fold { border-top: 1px solid var(--line); } .fold:first-child { border-top: 0; } .fold summary { display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; list-style: none; } .fold summary::-webkit-details-marker { display: none; } .fold summary .bd { flex: 1; min-width: 0; } .fold summary b, .fold summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fold summary small { color: var(--mute); } .fold summary > i { transition: transform .2s; color: var(--mute); } .fold[open] summary > i { transform: rotate(180deg); } .fold summary:hover b { color: var(--brand-t); }
.fold .list { margin: 0 0 12px; } .lib .list > .row { padding: 9px 10px; border: 0; border-radius: 12px; } .lib .list > .row:hover { background: var(--hover); } .lib .list > .row[aria-current] { background: var(--brand-s); }
.peek { position: sticky; top: 84px; padding: 0; overflow: hidden; } .peek header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); } .peek header b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .peek iframe { display: block; width: 100%; height: calc(100dvh - 190px); min-height: 480px; border: 0; background: #dfe4ea; }
@media (max-width: 1100px) { .lib { grid-template-columns: minmax(0, 1fr); } .peek { display: none; } }
.dl .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; } .dl .list > .row { padding: 8px; margin: 0 -8px; border: 0; border-radius: 12px; } .dl .list > .row:hover { background: var(--hover); }
@media (max-width: 760px) { .dl .list { grid-template-columns: minmax(0, 1fr); } }
