/* VAZIO · ตามหน้าจอต้นแบบ (กว้าง 1668 px) · --brand มาจากโทนสีของผู้ใช้บริการ */
:root { --z: 1; --ink: #14213d; --muted: #66758a; --line: #e4e9f1; --bg: #f3f6fb; --navy: #0b2239; --navy2: #0e2a46; --radius: 12px; --blue: #1677ff; --green: #16a34a; --red: #dc2626; --amber: #d97706; --purple: #7c3aed; }
@media (max-width: 1599px) { :root { --z: .95; } }
@media (max-width: 1499px) { :root { --z: .9; } }
@media (max-width: 1399px) { :root { --z: .85; } }
@media (max-width: 900px) { :root { --z: 1; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Kanit', 'Leelawadee UI', sans-serif; font-weight: 400; color: var(--ink); background: var(--bg); font-size: 14px; --brand: #ff6a00; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
small { font-size: 12px; }
button, input, select { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); font-weight: 400; }
.nw { white-space: nowrap; }
.strong { font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ctr { text-align: center; }
[hidden] { display: none !important; }

/* shell */
.shell { display: flex; zoom: var(--z); min-height: calc(100vh / var(--z)); }
.side { width: 236px; flex: none; background: linear-gradient(180deg, var(--navy2), var(--navy)); color: #e9eef6; height: calc(100vh / var(--z)); position: sticky; top: 0; display: flex; flex-direction: column; padding: 12px 0 8px; }
.side-super { background: linear-gradient(180deg, rgba(11, 34, 57, .96) 30%, rgba(11, 34, 57, .55) 100%), var(--art) bottom center / cover no-repeat, var(--navy); width: 232px; }
.side-logo { display: flex; flex-direction: column; align-items: center; background: #fff; margin: 0 14px 12px; border-radius: 16px; padding: 8px 12px 6px; color: #1f2937; }
.side-logo img { max-width: 100%; height: 40px; object-fit: contain; mix-blend-mode: multiply; }
.side-logo span { font-size: 13px; font-weight: 500; line-height: 1.2; }
.side-nav { flex: 1; overflow-y: auto; padding: 0 10px; scrollbar-width: thin; scrollbar-color: #2b4560 transparent; }
.nav-top { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 15px; margin-bottom: 4px; }
.nav-top:hover { background: rgba(255, 255, 255, .07); }
.nav-top.on { background: var(--brand); color: #fff; font-weight: 500; }
.side-super .nav-top { padding: 12px 14px; font-size: 16px; margin-bottom: 8px; }
.nav-group { border-bottom: 1px solid rgba(255, 255, 255, .07); padding: 2px 0 4px; }
.nav-group > summary { display: flex; align-items: center; gap: 12px; padding: 5px 12px; cursor: pointer; font-size: 15px; list-style: none; border-radius: 8px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary span { flex: 1; }
.nav-group[open] > summary .ic:last-child { transform: rotate(180deg); }
.nav-group > summary:hover { background: rgba(255, 255, 255, .07); }
.nav-sub { display: block; padding: 2px 10px 2px 18px; font-size: 13.5px; line-height: 1.4; position: relative; border-radius: 6px; margin: 1px 0 1px 26px; }
.nav-sub::before { content: ''; position: absolute; left: 7px; top: 12px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
a.nav-sub:hover { background: rgba(255, 255, 255, .07); }
.nav-sub.on { background: var(--brand); color: #fff; font-weight: 500; }
.nav-sub.off { color: #7f93aa; cursor: not-allowed; }
.nav-group.soon > summary { color: #a9b8c9; }
.side-foot { padding: 10px 18px 6px; font-size: 13px; line-height: 1.5; color: #d6dee8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; background: #fbfcfe; border-bottom: 1px solid var(--line); padding: 10px 24px; min-height: 76px; }
.top h1 { font-size: 26px; font-weight: 600; line-height: 1.25; }
.top p { color: #475569; font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 20px; }
.bell { position: relative; display: inline-flex; color: var(--ink); }
.bell i { position: absolute; top: -6px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; text-align: center; font-style: normal; background: var(--brand); color: #fff; border-radius: 9px; }
.usermenu { position: relative; }
.usermenu summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 16px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu b { font-weight: 500; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #0f1f33; color: #fff; display: grid; place-items: center; font-size: 18px; }
.pop { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 32, 55, .16); padding: 6px; min-width: 200px; font-size: 14px; text-align: left; }
.pop a, .pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.pop a:hover, .pop button:hover { background: #f1f5fb; }
.page { padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 12px; }

/* cards */
.card { background: #fff; border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.card h3 { font-size: 17px; font-weight: 500; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-h h3 { margin: 0; }
.card-h a:not(.btn) { color: var(--blue); font-size: 13px; }
.card-h.big h2 { font-size: 22px; font-weight: 600; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g2.chart-left { grid-template-columns: 1.67fr 1fr; }
.g2.wide-right { grid-template-columns: 1fr 1.08fr; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* buttons */
.btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; white-space: nowrap; font-weight: 500; line-height: 1.4; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.ghost { background: #fff; border-color: #d6dde8; }
.btn.ghost:hover { background: #f5f8fc; }
.btn.danger { background: #fff; border-color: #f3b4b4; color: var(--red); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.ghost-blue { border-color: #cfe0f7; color: var(--blue); background: #fff; }
.btn.outline-blue { border-color: var(--blue); color: var(--blue); background: #fff; }
.btn.soft-blue-btn { background: #eaf3ff; color: var(--blue); }
.icon-btn { border: 0; background: none; color: var(--red); cursor: pointer; padding: 4px; }

/* forms */
input, select { border: 1px solid #d6dde8; border-radius: 7px; padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input:disabled { background: #eef2f7; color: #64748b; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 3px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span:first-child, .field > legend { font-size: 13.5px; font-weight: 500; padding: 0; }
.field em { color: var(--red); font-style: normal; }
.field small { color: var(--muted); font-size: 11.5px; }
.field input, .field select { width: 100%; }
.static { padding: 8px 0; font-weight: 500; }
.row { display: grid; gap: 10px 14px; }
.row.mt { margin-top: 8px; }
.r2 { grid-template-columns: 1fr 1fr; }
.r4 { grid-template-columns: 1.1fr 1fr 1.1fr .9fr; }
.r5 { grid-template-columns: repeat(5, 1fr); }
.r6 { grid-template-columns: .85fr 1fr 1.25fr 1.1fr 1.25fr 1.25fr; }
.r-cust { grid-template-columns: 1.55fr 1fr 1.8fr; }
.r-basic { grid-template-columns: 1fr 1fr .6fr 2fr; }
.r2p { grid-template-columns: 1.1fr 1fr 1fr; }
.span2 { grid-column: span 2; }
.pw { position: relative; display: block; }
.eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--ink); }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid #d6dde8; border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ink); }
.searchbox input { border: 0; flex: 1; padding: 8px 0; outline: 0; background: none; width: 100%; }
.flash { padding: 10px 14px; border-radius: 8px; background: #e8f7ee; color: #14673a; }
.flash.err { background: #fdecec; color: #a11818; }
.flash.info { background: #eef5ff; color: #1b4f91; }
.flash ul { margin: 4px 0 0; padding-left: 20px; }
.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.chk.dis { opacity: .45; cursor: not-allowed; }
.rad { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.radios { display: flex; gap: 28px; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: #f0f4fa; font-weight: 500; font-size: 13px; padding: 7px 8px; text-align: left; line-height: 1.25; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid #eef1f6; font-size: 13px; line-height: 1.3; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.ctr, .tbl td.ctr { text-align: center; }
.tbl .ck { width: 34px; text-align: center; }
.tbl.roomy td { padding: 10px 12px; font-size: 14.5px; }
.tbl.roomy th { padding: 11px 12px; font-size: 14.5px; }
.tbl.mini td, .tbl.mini th { padding: 6px 8px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px !important; }
.st { display: inline-block; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.st.lg { font-size: 15px; padding: 6px 14px; }
.st.tone-amber { background: #fdeed2; color: #b45f06; }
.st.tone-blue { background: #dcebff; color: #1763c9; }
.st.tone-purple { background: #ecdfff; color: #6d28d9; }
.st.tone-green { background: #d3f5e0; color: #15803d; }
.st.tone-mint { background: #cdf4dc; color: #0f7a3b; }
.st.tone-red { background: #fde0e0; color: #d11a1a; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tag.gray { background: #eff2f7; color: #334155; }
.tag.sky { background: #e3f1ff; color: #1677ff; }
.tag.soft-orange { background: #fff0e4; color: #e8590c; border: 1px solid #ffdcc2; }
.tag.soft-blue { background: #e9f2ff; color: #1677ff; border: 1px solid #cfe2fd; }
.tag.soft-purple { background: #f1eaff; color: #6d3df5; }
.tag.soft-green { background: #e6f8ee; color: #15803d; }
.pf { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pf i { width: 22px; height: 22px; border-radius: 5px; color: #fff; font-style: normal; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.who { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.who i { width: 24px; height: 24px; border-radius: 50%; background: #7b8aa0; color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; }
.cr { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.st-dot { display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px; border-radius: 7px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.st-dot i { width: 11px; height: 11px; border-radius: 50%; background: currentColor; }
.st-dot.tone-green { background: #e6f8ee; color: #15803d; }
.st-dot.tone-amber { background: #fff4df; color: #d98a06; }
.st-dot.tone-red { background: #fde8e8; color: #dc2626; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.tone-green { background: #16a34a; }
.dot.tone-amber { background: #f59e0b; }
.dot.tone-red { background: #dc2626; }
.logo-dot { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; object-fit: cover; font-size: 15px; }
.person { display: flex; gap: 12px; align-items: center; }
.person i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; }
.person span { display: flex; flex-direction: column; }
.person b { font-weight: 500; font-size: 15px; }
.person small { color: var(--muted); font-size: 13px; }
.av-sky { background: #dcecff; color: #1763c9; }
.av-rose { background: #fde4e4; color: #dc2626; }
.av-mint { background: #dcf7e6; color: #15803d; }
.av-violet { background: #ece3ff; color: #6d3df5; }
.av-peach { background: #ffeadb; color: #e8590c; }

/* filter + pager */
.filters { display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr 1fr 1.9fr; gap: 8px 14px; align-items: end; }
.filters label > span { font-size: 13.5px; font-weight: 500; display: block; margin-bottom: 3px; }
.filters select { width: 100%; }
.range { display: flex; align-items: center; gap: 4px; }
.range input { flex: 1; min-width: 0; padding: 7px 6px; }
.range em { font-style: normal; color: var(--muted); }
.f-search { display: flex; flex-direction: column; gap: 8px; grid-row: span 1; }
.filters:has([name=seller]) { grid-template-columns: 1.55fr repeat(5, 1fr); }
.filters:has([name=seller]) .f-search { grid-column: 1 / -1; flex-direction: row; }
.filters:has([name=seller]) .searchbox { flex: 1; }
.f-btn { display: flex; gap: 8px; justify-content: flex-end; }
.filter-row { display: flex; gap: 14px; align-items: end; margin-bottom: 10px; flex-wrap: wrap; }
.filter-row .grow { flex: 1; max-width: 400px; }
.filter-row select { min-width: 150px; padding: 9px 10px; }
.filter-row .lab { display: flex; flex-direction: column; gap: 3px; font-weight: 500; }
.filter-row .searchbox { height: 40px; min-width: 310px; }
.filter-row .push { margin-left: auto; padding: 10px 22px; font-size: 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.toolbar h2 { font-size: 18px; font-weight: 400; color: #475569; }
.toolbar b { color: var(--ink); font-weight: 600; }
.tb-right { display: flex; gap: 10px; align-items: center; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.pop.cols { display: grid; gap: 4px; min-width: 210px; padding: 10px; }
.kebab summary { display: inline-flex; padding: 4px; }
.pager { display: flex; align-items: center; gap: 16px; padding: 8px 4px 0; color: #475569; }
.per select { padding: 4px 6px; margin: 0 4px; }
.pager .count { margin-left: auto; }
.pager nav { display: flex; gap: 6px; }
.pg { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid #dfe5ee; border-radius: 7px; display: grid; place-items: center; background: #fff; font-size: 13.5px; }
.pg.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.pg.dis { opacity: .4; pointer-events: none; }
.pg.dots { border: 0; background: none; }

/* KPI */
.kpi5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { position: relative; background: #fff; border-radius: var(--radius); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.kpi.lg { grid-template-columns: auto 1fr; gap: 20px; }
.kpi.tint-orange { background: #fff7f0; }
.kpi.tint-blue { background: #f2f7ff; }
.kpi.tint-green { background: #f1fbf5; }
.kpi.tint-purple { background: #f6f2ff; }
.kpi.tint-red { background: #fff2f3; }
.kpi-ic { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; align-self: start; }
.kpi.lg .kpi-ic { width: 72px; height: 72px; border-radius: 14px; }
.tone-orange.kpi-ic, .role-ic.tone-orange { background: #fb6a0a; color: #fff; }
.tone-blue.kpi-ic, .role-ic.tone-blue { background: #1677ff; color: #fff; }
.tone-green.kpi-ic, .role-ic.tone-green { background: #0f9d58; color: #fff; }
.tone-purple.kpi-ic { background: #6d3df5; color: #fff; }
.tone-red.kpi-ic { background: #e5344b; color: #fff; }
.kpi-t { display: flex; flex-direction: column; gap: 2px; }
.kpi-t small { font-size: 15px; font-weight: 500; white-space: nowrap; }
.kpi5 .kpi-t small { font-size: 14px; }
.kpi-t strong { font-size: 30px; font-weight: 600; line-height: 1.15; }
.kpi-d { position: absolute; right: 14px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; gap: 2px; white-space: nowrap; }
.kpi-d small { color: var(--muted); font-size: 12px; }
.good { color: #16a34a; }
.bad { color: #dc2626; }
.trend { font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.trend small { color: var(--muted); font-size: 13px; margin-left: 4px; }
.soft-orange { background: #ffebdb; color: #f97316; }
.soft-blue { background: #dcebff; color: #1677ff; }
.soft-amber { background: #fdefcf; color: #d97706; }
.soft-red { background: #fde0e2; color: #e5344b; }
.soft-green { background: #d9f6e3; color: #16a34a; }
.soft-mint { background: #ece1ff; color: #7c3aed; }
.soft-purple { background: #d9f6e3; color: #16a34a; }
.chart { width: 100%; height: auto; display: block; max-height: 240px; }
.chart .grid { stroke: #eef1f6; }
.chart .tick { font-size: 12px; fill: #64748b; font-family: inherit; }
.chart .val { font-size: 12px; fill: #1f2d3d; font-weight: 500; font-family: inherit; }
.donut { width: 170px; height: 170px; flex: none; }
.donut .dc { font-size: 15px; font-weight: 600; fill: var(--ink); font-family: inherit; }
.donut .ds { font-size: 8px; fill: #64748b; font-family: inherit; }
.donut-row { display: flex; gap: 18px; align-items: center; }
.donut-row.big .donut { width: 190px; height: 190px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 52px; gap: 8px; align-items: center; font-size: 13.5px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; }
.legend b { font-weight: 500; }
.legend em { font-style: normal; color: var(--muted); text-align: right; }
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.tabs-line { display: flex; gap: 4px; background: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.tabs-line a { padding: 7px 20px; border-radius: 7px; font-weight: 500; }
.tabs-line a.on { background: var(--brand); color: #fff; }
.badge { background: #e5344b; color: #fff; font-style: normal; font-size: 11px; border-radius: 9px; padding: 0 6px; }
.date-range { display: flex; gap: 6px; align-items: center; background: #fff; border-radius: 10px; padding: 6px 12px; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.date-range input { border: 0; padding: 2px; }
.date-range em { font-style: normal; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.rank .no { width: 26px; height: 26px; border-radius: 50%; background: #f0f4fa; display: grid; place-items: center; font-size: 13px; }
.rk-name { flex: 1; display: flex; flex-direction: column; }
.rk-name b, .rk-n b { font-weight: 500; }
.rk-name small, .rk-n small { color: var(--muted); }
.rk-n { display: flex; flex-direction: column; align-items: flex-end; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 7px 0; }
.f-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.f-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.f-t a, .f-t b { font-weight: 500; }
.f-t small { color: var(--muted); }
.feed time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.soon-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--muted); padding: 24px 12px; }
.soon-box b { color: var(--ink); font-weight: 500; font-size: 16px; }
.soon-box.ok { color: #15803d; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eef1f6; }
.alerts li > div { flex: 1; }
.alerts b { font-weight: 500; }
.alerts p { color: var(--muted); font-size: 13px; }

/* status page */
.status-cards { display: grid; grid-template-columns: 1.15fr repeat(6, 1fr); gap: 8px; }
.sc { background: #fff; border: 1px solid transparent; border-radius: 10px; padding: 12px 10px; display: flex; gap: 10px; align-items: center; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); min-width: 0; }
.sc > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sc small { font-size: 13px; font-weight: 500; line-height: 1.2; }
.sc b { font-size: 21px; font-weight: 600; line-height: 1.3; }
.sc-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sc.on { border-color: #ffb37e; background: #fff4ea; }
.sc.on small { color: var(--brand); }
.sc.on .sc-ic { background: none; }

/* create order */
.tabs-pill { display: flex; justify-content: flex-end; gap: 10px; }
.tabs-pill a { padding: 8px 26px; border-radius: 8px; background: #fff; font-weight: 500; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.tabs-pill a.on { background: var(--brand); color: #fff; }
form[data-order-form] { display: flex; flex-direction: column; gap: 8px; }
.ofs { padding: 10px 18px; }
.step { font-size: 16px !important; font-weight: 500; display: flex; gap: 10px; align-items: center; margin-bottom: 6px !important; }
.step i { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-style: normal; font-size: 13px; display: grid; place-items: center; }
.note { background: #f2f5fa; border-radius: 6px; padding: 5px 12px; color: #475569; font-size: 12.5px; margin-top: 6px; }
.with-add { display: flex; gap: 6px; }
.with-add select { flex: 1; }
.btn-add { width: 36px; border: 1px solid #cfe0f7; border-radius: 7px; background: #eaf3ff; color: var(--blue); cursor: pointer; }
.order-bottom { display: grid; grid-template-columns: 1fr 272px; gap: 10px; align-items: start; }
.admin-row { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.admin-row select { min-width: 200px; }
.add-head { display: flex; gap: 40px; align-items: center; margin-bottom: 6px; }
.add-head .step { margin: 0 !important; white-space: nowrap; }
.prod-search { flex: 1; position: relative; }
.prod-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; list-style: none; margin: 4px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(15, 32, 55, .15); max-height: 260px; overflow: auto; }
.prod-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.prod-list li:hover { background: #f1f5fb; }
.prod-list li small { color: var(--muted); }
.tbl.items td { padding: 4px 8px; }
.tbl.items input, .tbl.items select { width: 100%; padding: 5px 8px; }
.tbl.items td:nth-child(4), .tbl.items td:nth-child(5), .tbl.items td:nth-child(6) { width: 96px; }
.tbl.items td:nth-child(7) { width: 92px; }
.line-total { background: #f2f5fa; text-align: right; border-radius: 6px; width: 96px; }
.item-name { display: inline-flex; gap: 8px; align-items: center; }
.item-name b { font-weight: 400; }
.thumb { width: 32px; height: 32px; border-radius: 6px; background: #eef2f7; display: grid; place-items: center; color: #94a3b8; }
.summary h3 { font-size: 16px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 8px; margin: 0; align-items: center; }
.summary dt { color: #475569; font-size: 13px; white-space: nowrap; }
.summary dd { margin: 0; text-align: right; font-weight: 500; }
.summary input[name=bill_discount] { width: 88px; text-align: right; padding: 5px 8px; }
.summary .rad { white-space: nowrap; }
.summary .vat { display: grid; gap: 3px; justify-items: start; font-weight: 400; }
.summary .grand { font-weight: 600; color: var(--ink); font-size: 14px; }
.summary dd.grand { color: var(--brand); background: #fff0e4; border-radius: 6px; padding: 5px 10px; }
.sum-btn { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* detail */
.detail-top { display: flex; justify-content: space-between; align-items: center; }
.inline { display: flex; gap: 8px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 10px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.cancel-form { margin-top: 14px; display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.cancel-form .field { flex: 1; }
.totals { display: grid; grid-template-columns: 1fr 130px; gap: 4px 12px; margin: 10px 0 0 auto; max-width: 380px; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 600; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(16, 24, 40, .55); display: flex; align-items: center; justify-content: center; padding: 10px; }
.modal { background: #fff; border-radius: 14px; width: min(870px, 100%); max-height: calc(100vh / var(--z) - 20px); overflow: auto; padding: 16px 26px; display: flex; flex-direction: column; gap: 6px; zoom: var(--z); }
.modal.wide { width: min(970px, 100%); padding: 10px 26px; }
.modal-h { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.modal-h h2 { font-size: 22px; font-weight: 600; line-height: 1.2; }
.modal-h p { color: #475569; }
.modal-h div { flex: 1; }
.m-ic { color: var(--brand); }
.m-x { color: #475569; }
.sec { font-size: 16px !important; font-weight: 500; display: flex; gap: 8px; align-items: center; margin: 6px 0 2px !important; }
.sec small { font-size: 12px; margin-left: 8px; }
.model-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; grid-row: span 2; align-content: start; }
.model-pick legend { grid-column: 1 / -1; margin-bottom: 3px; }
.field .pick input { width: 16px; flex: none; }
.pick { display: flex; gap: 8px; align-items: center; border: 1px solid #d6dde8; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--brand); background: #fff4ea; }
.pick span { display: flex; flex-direction: column; }
.pick b { font-weight: 500; font-size: 13px; }
.pick small { color: var(--muted); font-size: 11.5px; }
.unique { display: block; background: #e9f2ff; color: #123a78; font-weight: 600; border-radius: 7px; padding: 8px 12px; }
.brand-row { grid-template-columns: 1.3fr 1fr; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 10px; position: relative; }
.upload { display: flex; flex-direction: column; align-items: center; border: 1px dashed #c9d3e0; border-radius: 8px; padding: 8px 12px; cursor: pointer; width: 62%; font-size: 12px; text-align: center; color: var(--brand); }
.upload b { font-weight: 500; color: #1f2937; }
.upload small { color: var(--muted); font-size: 10.5px; }
.upload input { display: none; }
.logo-preview { position: absolute; right: 14px; top: 44px; width: 30%; height: 62px; object-fit: contain; }
.swatches { display: flex; gap: 8px; margin-top: 8px; }
.swatches label { flex: 1; height: 40px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: #fff; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: none; }
.swatches label:has(input:checked) { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatches label:has(input:checked) i { display: block; }
.pkg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pkg { position: relative; display: flex; flex-direction: column; gap: 3px; border: 1px solid; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; }
.pkg input { position: absolute; opacity: 0; }
.pkg span { display: flex; gap: 8px; align-items: center; }
.pkg.tone-green { border-color: #7fd0a2; }
.pkg.tone-purple { border-color: #b39cf5; }
.pkg.tone-orange { border-color: #ffb37e; }
.pkg.tone-blue { border-color: #9cc4fa; }
.pkg .tick { display: none; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #16a34a; color: #fff; place-items: center; }
.pkg:has(input:checked) { box-shadow: 0 0 0 2px #16a34a; }
.pkg:has(input:checked) .tick { display: grid; }
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.perm-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; padding-bottom: 8px; }
.perm-card header { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 4px; }
.perm-card header div { display: flex; flex-direction: column; line-height: 1.25; }
.perm-card header b { font-weight: 500; font-size: 13.5px; }
.perm-card header small { color: var(--muted); font-size: 11px; }
.perm-card.tone-orange { border-color: #ffd9bf; }
.perm-card.tone-orange header { background: #fff4ea; }
.perm-card.tone-blue { border-color: #cfe2fd; }
.perm-card.tone-blue header { background: #eff5ff; }
.perm-card.tone-green { border-color: #bfeace; }
.perm-card.tone-green header { background: #effaf3; }
.pc-ic { display: inline-flex; }
.perm-card.tone-orange .pc-ic { color: #f97316; }
.perm-card.tone-blue .pc-ic { color: #1677ff; }
.perm-card.tone-green .pc-ic { color: #16a34a; }
.perm-card .chk { padding: 2px 14px; font-size: 13px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 12px; background: #c6cfdb; pointer-events: none; }
.switch i::after { content: ''; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { left: 18px; }
.modal-f { display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: -10px; background: #fff; padding: 8px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.pw-rules { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); font-size: 12.5px; display: grid; gap: 3px; align-content: center; }
.pw-rules li { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.pw-rules li::before { content: '○'; }
.pw-rules li.ok { color: #15803d; }
.pw-rules li.ok::before { content: '●'; }
dialog.quick { border: 0; border-radius: 14px; padding: 18px 22px; width: 520px; box-shadow: 0 20px 50px rgba(15, 32, 55, .3); }
dialog.quick::backdrop { background: rgba(16, 24, 40, .5); }
dialog.quick form { display: flex; flex-direction: column; gap: 8px; }
dialog.quick h3 { font-size: 18px; font-weight: 600; }
dialog.quick footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.q-err { background: #fdecec; color: #a11818; border-radius: 8px; padding: 8px 10px; white-space: pre-line; }

/* วันที่แสดงเป็น พ.ศ. ทับช่อง date ของเบราว์เซอร์ */
.thd { position: relative; display: inline-flex; flex: 1; min-width: 0; }
.thd input { width: 100%; }
.thd input::-webkit-datetime-edit { color: transparent; }
.thd input:focus::-webkit-datetime-edit { color: inherit; }
.thd span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; white-space: nowrap; }
.thd input:focus + span { display: none; }
.date-range .thd span { left: 3px; }

/* Thai address list (th-address.js) */
.th-addr-inline { position: relative; }
.th-addr-list { position: absolute; z-index: 30; left: 0; top: 100%; width: max(100%, 460px); max-height: 300px; overflow: auto; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.th-addr-list li { padding: 7px 12px; cursor: pointer; display: flex; gap: 4px; white-space: nowrap; font-size: 13.5px; }
.th-addr-list li em { margin-left: auto; font-style: normal; color: var(--brand); font-weight: 500; padding-left: 12px; }
.th-addr-list li:hover, .th-addr-list li.on { background: #fff3e8; }
.th-addr-list li.none { color: var(--muted); cursor: default; }

/* auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #1a2a3c var(--bg) center / cover no-repeat fixed; --bg-color: #f3f6fb; }
.auth-card { background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); width: 100%; }
.auth-card.login { max-width: 440px; padding: 28px 34px; display: flex; flex-direction: column; gap: 10px; }
.auth-card.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.auth-logo { width: 280px; max-width: 100%; align-self: center; margin-bottom: 4px; mix-blend-mode: multiply; }
.auth-card.login h1 { font-size: 24px; font-weight: 600; }
.auth-card.login p { color: #475569; }
.err-box { text-align: center; align-items: center; }
.auth-card.select { max-width: 1410px; padding: 22px 30px; aspect-ratio: 1410 / 825; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.sel-head { display: flex; align-items: center; gap: 30px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.sel-head img { mix-blend-mode: multiply; width: 320px; height: 84px; object-fit: contain; padding-right: 30px; border-right: 1px solid var(--line); box-sizing: content-box; }
.sel-head div { flex: 1; }
.sel-head h1 { font-size: 30px; font-weight: 600; }
.sel-head p { font-size: 17px; color: #475569; }
.sel-body { display: grid; grid-template-columns: 395px 1fr; flex: 1; min-height: 0; }
.sel-roles { padding: 26px 24px 0 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.role { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; color: #1f2d3d; }
.role.on { border-color: var(--brand); background: #fff3e8; }
.role-ic { width: 72px; height: 72px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.role-t { flex: 1; display: flex; flex-direction: column; }
.role-t b { font-size: 20px; font-weight: 500; }
.role-t small { font-size: 14.5px; color: #475569; }
.sel-panel { padding: 26px 0 0 32px; min-height: 0; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.panel-head { display: flex; gap: 18px; align-items: center; }
.panel-head .role-ic { width: 58px; height: 58px; }
.panel-head h2 { font-size: 27px; font-weight: 500; line-height: 1.2; }
.panel-head p { font-size: 16.5px; color: #475569; }
.searchbox.wide { padding: 4px 14px; border-color: #bcd0ea; color: var(--blue); }
.wh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wh { display: flex; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 12px; background: #fff; cursor: pointer; text-align: left; }
.wh:hover { border-color: var(--brand); }
.wh img { width: 125px; height: 84px; object-fit: cover; border-radius: 8px; }
.wh span { flex: 1; display: flex; flex-direction: column; }
.wh small { font-size: 14px; color: #334155; }
.wh b { font-size: 19px; font-weight: 500; }
.wh em { font-style: normal; color: #475569; font-size: 14.5px; }

@media (max-width: 1100px) {
  .g2, .g2.chart-left, .g2.wide-right, .g3 { grid-template-columns: 1fr; }
  .kpi5, .kpi4 { grid-template-columns: 1fr 1fr; }
  .status-cards { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .order-bottom { grid-template-columns: 1fr; }
  .r4, .r5, .r6, .r-cust, .r-basic, .r2p { grid-template-columns: 1fr 1fr; }
  .perm-grid, .pkg-grid { grid-template-columns: 1fr; }
  .auth-card.select { aspect-ratio: auto; max-height: none; }
  .sel-body { grid-template-columns: 1fr; }
  .sel-roles { border-right: 0; padding-right: 0; }
  .sel-panel { padding-left: 0; }
}
@media (max-width: 900px) {
  .side { position: static; height: auto; width: 100%; }
  .shell { flex-direction: column; }
  .wh-grid { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; gap: 8px; }
}

/* หน้าเข้าสู่ระบบ: ภาพซ้ายสูงเต็มจอ การ์ดขวา · จอแคบเหลือการ์ดอย่างเดียว */
.login-split { position: fixed; inset: 0; overflow: auto; display: flex; background: #f8f9fb; }
.login-hero { position: relative; flex: none; height: 100%; min-height: 660px; aspect-ratio: 922 / 1024; }
.login-hero img { display: block; width: 100%; height: 100%; }
.login-hero::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 22%; background: linear-gradient(90deg, rgba(248, 249, 251, 0), #f8f9fb); }
.login-side { position: relative; flex: 1; min-width: 0; min-height: 660px; display: grid; place-items: center; padding: 28px; overflow: hidden; }
.login-side::before { content: ''; position: absolute; top: -190px; right: -130px; width: 480px; height: 480px; border-radius: 50%; background: linear-gradient(200deg, #ff8a2b, #ff6a00); }
.auth-card.login-card { position: relative; max-width: 520px; padding: 40px 48px 28px; gap: 8px; text-align: center; box-shadow: 0 18px 50px rgba(20, 33, 61, .12); border-radius: 22px; }
.login-card h1 { margin-top: 12px; }
.login-card form { gap: 16px; margin-top: 14px; text-align: left; }
.lf { position: relative; display: block; }
.lf > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.lf input { width: 100%; height: 52px; padding: 0 44px; border: 1px solid #dfe5ee; border-radius: 12px; background: #fff; font: inherit; font-size: 15px; }
.lf input:focus { outline: 2px solid rgba(255, 106, 0, .35); border-color: var(--brand); }
.lf .eye { right: 12px; color: #64748b; }
.login-row { position: relative; display: flex; justify-content: space-between; align-items: center; }
.remember { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember input { width: 18px; height: 18px; accent-color: var(--brand); }
.forgot { color: var(--brand); }
.login-foot a { color: var(--brand); }
.login-go { height: 52px; font-size: 16px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.login-foot { margin-top: 12px; color: #64748b; }
@media (max-width: 1100px), (max-aspect-ratio: 5/4) { .login-hero { display: none; } .login-side::before { width: 320px; height: 320px; top: -150px; right: -110px; } .auth-card.login-card { padding: 30px 26px 22px; } }
