@charset "UTF-8";

@font-face { font-family:"THSarabunNew"; src:url("assets/fonts/THSarabunNew.ttf") format("truetype"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"THSarabunNew"; src:url("assets/fonts/THSarabunNew-Bold.ttf") format("truetype"); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:"THSarabunNew"; src:url("assets/fonts/THSarabunNew-Italic.ttf") format("truetype"); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:"THSarabunNew"; src:url("assets/fonts/THSarabunNew-BoldItalic.ttf") format("truetype"); font-weight:700; font-style:italic; font-display:swap; }
/* doc-designer label uses THSarabunNew */
.dd-paper, .dd-pvpaper { font-family:"THSarabunNew","Noto Sans Thai","Sarabun",sans-serif !important; }

/* ============================================================================
   BURAPAYONT UI-MASTER · DESKTOP SHELL STYLES
   Desktop-first Operations App. Reuses tokens from styles.css.
   Driver/Delivery mobile preview reuses the phone styles in styles.css.
   ========================================================================== */

.desk {
  font-family: var(--ff);
  color: var(--ink);
  background: var(--bg);
}
.desk * { box-sizing: border-box; }

/* ---------- App shell grid ---------- */
.dapp {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Sidebar ---------- */
.dside {
  background: linear-gradient(185deg, #0f2244 0%, #0a1730 100%);
  color: #d7deec;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid rgba(255,255,255,.06);
  min-width: 0; overflow: hidden;
}
.dside__brand { display:flex; align-items:center; gap:12px; padding: 6px 8px 4px; }
.dside__brandtx { min-width:0; flex:1; }
.dside__collapse {
  flex:none; width:28px; height:28px; border-radius:8px; border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04); color:#aebbd4; display:grid; place-items:center; cursor:pointer;
  transition:background .14s, color .14s;
}
.dside__collapse:hover { background:rgba(255,255,255,.12); color:#fff; }
.dside__mark {
  width: 42px; height: 42px; border-radius: 12px; flex:none;
  overflow:hidden; display:grid; place-items:center;
  box-shadow: 0 4px 14px rgba(8,16,34,.45);
}
.dside__mark img { width:100%; height:100%; object-fit:cover; display:block; }
.costeye { margin-left:auto; flex:none; width:30px; height:30px; border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; }
.yntag { margin-left:auto; flex:none; width:26px; height:26px; border-radius:7px; border:1.5px solid; font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:800; cursor:pointer; display:grid; place-items:center; }
.yntag + .costeye { margin-left:7px; }
.yntag--y { color:var(--ok-ink); border-color:#a7d7bd; background:var(--ok-bg); }
.yntag--n { color:var(--danger-ink,#9c2b2b); border-color:#e6b4b4; background:var(--danger-bg); }
.yntag:hover { filter:brightness(.97); }
.whswitch { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:none; background:none; border-radius:var(--r-pill); padding:4px 6px; min-width:38px; cursor:default; font-family:var(--ff); margin-right:4px; }
.whswitch:hover { border-color:transparent; background:rgba(20,40,90,.06); }
.bookmode { display:flex; align-items:center; gap:10px; padding:9px 15px; border-radius:var(--r-md); margin-bottom:12px; font-family:var(--ff); }
.bookmode--all { background:var(--info-bg); border:1px solid #b9d3ee; }
.bookmode--y { background:var(--ok-bg); border:1px solid #a7d7bd; }
.bookmode__sym { font-family:"Noto Sans",sans-serif; font-weight:800; font-size:14px; width:28px; height:28px; flex:none; border-radius:8px; display:grid; place-items:center; }
.bookmode__sym--all { color:var(--navy-700); background:#fff; border:1.5px solid #b9d3ee; }
.bookmode__sym--y { color:var(--ok-ink); background:#fff; border:1.5px solid #a7d7bd; }
.bookmode__tx { font-size:12.5px; font-weight:700; color:var(--ink-2); flex:1; min-width:0; }
.bookmode kbd { font-family:"Noto Sans",sans-serif; font-size:10px; background:rgba(255,255,255,.7); border:1px solid var(--line-2); border-radius:5px; padding:2px 7px; color:var(--dim); flex:none; }
.whswitch__nm { font-size:12px; font-weight:700; color:var(--ink); white-space:nowrap; max-width:150px; overflow:hidden; text-overflow:ellipsis; }
.whswitch__bang { font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:800; color:var(--navy-600); }
.whswitch kbd { font-family:"Noto Sans",sans-serif; font-size:9px; background:var(--surface-3); border-radius:4px; padding:1px 5px; color:var(--dim); }
@media (max-width:1100px){ .whswitch kbd, .whswitch__nm { display:none; } }rsor:pointer; transition:background .14s,color .14s,border-color .14s; }
.costeye:hover { background:var(--surface-2); }
.costeye.is-on { background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.dside__name { font-weight:700; font-size:16px; color:#fff; line-height:1.1; white-space:nowrap; }
.dside__sub { font-size:10px; letter-spacing:2px; text-transform:uppercase; color:#8fa0bd; font-family:"Noto Sans",sans-serif; margin-top:2px; }

.dside__tag {
  margin: 16px 8px 8px; font-size:10px; letter-spacing:.6px; color:#cdb778;
  font-family:"Noto Sans",sans-serif; text-transform:uppercase; font-weight:600;
  display:flex; align-items:center; gap:6px;
}
.dside__nav { margin-top: 6px; display:flex; flex-direction:column; gap:4px; overflow-y:auto; flex:1 1 0; min-height:0; scrollbar-width:none; -ms-overflow-style:none; }
.dside__nav::-webkit-scrollbar { width:0; height:0; display:none; }
.dside, .dside::-webkit-scrollbar { scrollbar-width:none; }
.dside::-webkit-scrollbar { width:0; height:0; display:none; }
.dside__label { font-size:10px; letter-spacing:1.6px; text-transform:uppercase; color:#6f80a0; font-weight:600; padding: 12px 12px 6px; font-family:"Noto Sans",sans-serif; }

.dnav {
  display:flex; align-items:center; gap:12px; cursor:pointer; width:100%;
  padding: 11px 12px; border-radius: var(--r-md); border:1px solid transparent;
  background:none; color:#cdd6e6; font-family:var(--ff); font-size:14px; font-weight:500;
  transition: all .14s ease; text-align:left;
}
.dnav:hover { background: rgba(255,255,255,.06); }
.dnav.is-active { background: linear-gradient(120deg, rgba(245,164,0,.20), rgba(245,164,0,.05)); border-color: rgba(245,164,0,.45); color:#fff; }
.dnav__ic { width:24px; height:24px; flex:none; display:grid; place-items:center; }
.dnav.is-active .dnav__ic { color: var(--gold-400); }
.dnav__l { flex:1; white-space:nowrap; overflow:hidden; }
.dnav__badge { font-size:11px; font-weight:700; background: var(--gold-500); color:var(--navy-900); border-radius:99px; padding:1px 8px; flex:none; }
.dnav__count { font-size:11px; font-weight:800; background: var(--gold-500); color:var(--navy-900); border-radius:99px; min-width:20px; height:20px; padding:0 6px; flex:none; display:grid; place-items:center; line-height:1; }
.dnav.is-active .dnav__count { background:#fff; color:var(--navy-900); }
.dnav.is-mobile { border:1px dashed rgba(255,255,255,.2); }
.dnav.is-mobile .dnav__ic { color:#9fb0cd; }

.dside__user {
  margin-top: 10px; flex:none; padding: 11px 10px; border-radius: var(--r-md);
  background: rgba(255,255,255,.05); display:flex; align-items:center; gap:11px;
}
.dside__ava { width:36px;height:36px;border-radius:99px;flex:none;display:grid;place-items:center;background:linear-gradient(150deg,var(--gold-400),var(--gold-600));color:var(--navy-900);font-weight:800; }

/* ---------- Collapsible sidebar (mini + hover-expand) ---------- */
.dapp.is-narrow { grid-template-columns: 74px 1fr; position:relative; }
.dapp.is-narrow .dside {
  width:74px; padding:18px 13px 14px; overflow:hidden; white-space:nowrap;
  transition: width .2s ease, box-shadow .2s ease;
  z-index:60;
}
/* clip the labels while collapsed */
.dapp.is-narrow .dside__brandtx,
.dapp.is-narrow .dside__tag,
.dapp.is-narrow .dside__label,
.dapp.is-narrow .dside__group,
.dapp.is-narrow .dnav__l,
.dapp.is-narrow .dnav__badge,
.dapp.is-narrow .dnav__count,
.dapp.is-narrow .dside__user .meta {
  opacity:0; transition:opacity .12s ease;
}
.dapp.is-narrow .dnav { justify-content:flex-start; }
.dapp.is-narrow .dside__collapse { opacity:0; pointer-events:none; }
/* keep main content anchored in column 2 even when the sidebar floats (absolute) */
.dapp.is-narrow .dmain { grid-column: 2; }
/* the chevron toggle floats so it's reachable even while collapsed */
.dapp.is-narrow .dside__brand { position:relative; }

/* expand on hover — float over content, no layout shift */
.dapp.is-narrow.is-open .dside,
.dapp.is-narrow .dside:hover {
  position:absolute; top:0; left:0; bottom:0; height:100vh;
  width:250px; padding:18px 14px 14px;
  box-shadow: 16px 0 46px rgba(6,13,28,.5);
  overflow:hidden;
}
.dapp.is-narrow.is-open .dside__brandtx,
.dapp.is-narrow.is-open .dside__tag,
.dapp.is-narrow.is-open .dside__label,
.dapp.is-narrow.is-open .dside__group,
.dapp.is-narrow.is-open .dnav__l,
.dapp.is-narrow.is-open .dnav__badge,
.dapp.is-narrow.is-open .dnav__count,
.dapp.is-narrow.is-open .dside__user .meta,
.dapp.is-narrow.is-open .dside__collapse,
.dapp.is-narrow .dside:hover .dside__brandtx,
.dapp.is-narrow .dside:hover .dside__tag,
.dapp.is-narrow .dside:hover .dside__label,
.dapp.is-narrow .dside:hover .dside__group,
.dapp.is-narrow .dside:hover .dnav__l,
.dapp.is-narrow .dside:hover .dnav__badge,
.dapp.is-narrow .dside:hover .dnav__count,
.dapp.is-narrow .dside:hover .dside__user .meta,
.dapp.is-narrow .dside:hover .dside__collapse {
  opacity:1; pointer-events:auto;
}

/* ---------- Main column ---------- */
.dmain { display:flex; flex-direction:column; min-width:0; height:100vh; }

.dtop {
  height:56px; flex:none; background: var(--surface); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:10px; padding: 0 18px;
}
.dtop__title { font-size:19px; font-weight:800; color:var(--ink); white-space:nowrap; }
.dtop__crumb { font-size:12.5px; color:var(--dim); margin-left:2px; }
.dtop__back { width:38px;height:38px;border-radius:11px;border:1px solid var(--line-2);background:var(--surface-2);
  display:grid;place-items:center;cursor:pointer;color:var(--ink-2);flex:none;transition:all .14s ease;margin-right:2px; }
.dtop__back:hover:not(:disabled) { background:var(--surface-3);color:var(--navy-700);border-color:var(--line); }
.dtop__back:active:not(:disabled) { transform:translateX(-1px); }
.dtop__back:disabled { opacity:.34;cursor:default; }
.dtop__search {
  margin-left:auto; display:flex; align-items:center; gap:10px;
  background: var(--surface-2); border:1px solid var(--line-2); border-radius: var(--r-md);
  padding: 9px 14px; width: 280px;
}
.dtop__search input { flex:1; border:none; background:none; outline:none; font-family:var(--ff); font-size:13.5px; color:var(--ink); min-width:0; }
.dtop__ic { width:40px;height:40px;border-radius:11px;border:1px solid var(--line-2);background:var(--surface-2);display:grid;place-items:center;cursor:pointer;color:var(--ink-2);position:relative;flex:none; }
.dtop__store { width:40px;height:40px;display:grid;place-items:center;border-radius:11px;border:1px solid var(--navy-600);background:var(--navy-700);color:#fff;cursor:pointer;flex:none;transition:background .14s, box-shadow .14s; }
.dtop__store:hover { background:var(--navy-600);box-shadow:0 3px 10px rgba(20,40,80,.22); }
.dtop__store svg { color:var(--gold-400, #e9b949); }
.rolesel { font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); padding:9px 10px; cursor:pointer; outline:none; flex:none; }

/* ---------- document lifecycle stepper ---------- */
.lcflow { display:flex; align-items:center; flex-wrap:wrap; gap:2px 0; padding:11px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); }
.lcstep { display:inline-flex; align-items:center; gap:7px; border:none; background:none; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--dim); padding:4px 7px; border-radius:var(--r-sm); }
.lcstep[disabled] { cursor:default; }
.lcstep:not([disabled]) { cursor:pointer; }
.lcstep:not([disabled]):hover { background:var(--surface-2); }
.lcstep__dot { width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-weight:800; background:var(--surface-3); color:var(--dim); border:2px solid var(--line); flex:none; font-family:"Noto Sans",sans-serif; }
.lcstep.is-done .lcstep__dot { background:var(--ok); border-color:var(--ok); color:#fff; }
.lcstep.is-done { color:var(--ink-2); }
.lcstep.is-now .lcstep__dot { background:var(--navy-700); border-color:var(--navy-700); color:#fff; box-shadow:0 0 0 4px var(--info-bg); }
.lcstep.is-now { color:var(--navy-800); font-weight:800; }
.lcbar { width:20px; height:2px; background:var(--line-2); flex:none; }
.lcbar.is-done { background:var(--ok); }
@media (max-width:760px){ .lcbar{ width:9px; } .lcstep__l{ display:none; } }
@keyframes scanline { 0%{ top:8%; } 50%{ top:88%; } 100%{ top:8%; } }
.dtop__ic .dot { position:absolute; top:9px; right:10px; width:7px;height:7px;border-radius:9px;background:var(--gold-500); }
/* ---- ศูนย์แจ้งเตือน (กระดิ่ง) ---- */
.notifwrap { position:relative; }
.notifbadge { position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px; border-radius:99px; background:#E53935; color:#fff; font-size:10.5px; font-weight:800; display:grid; place-items:center; line-height:1; box-shadow:0 0 0 2px var(--surface); }
.notifpop { position:absolute; top:calc(100% + 9px); right:0; z-index:120; width:340px; max-width:88vw; background:#fff; border:1px solid var(--line); border-radius:13px; box-shadow:0 18px 50px rgba(8,18,40,.22); overflow:hidden; }
.notifpop__hd { display:flex; align-items:center; justify-content:space-between; padding:13px 15px; border-bottom:1px solid var(--line); }
.notifpop__hd b { font-size:14px; color:var(--ink); }
.notifpop__hd button { border:none; background:none; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.notifpop__bd { max-height:340px; overflow-y:auto; }
.notifpop__empty { display:flex; flex-direction:column; align-items:center; gap:9px; padding:34px 10px; color:var(--dim); }
.notifpop__empty span { font-size:13px; }
.notifitem { display:flex; align-items:flex-start; gap:10px; width:100%; border:none; background:none; padding:12px 15px; cursor:pointer; text-align:left; font-family:var(--ff); border-bottom:1px solid var(--line); }
.notifitem:hover { background:var(--bg-1,#f4f6fa); }
.notifitem.unread { background:rgba(11,61,145,.045); }
.notifitem__ic { width:32px; height:32px; border-radius:9px; background:rgba(11,61,145,.09); color:var(--navy-700); display:grid; place-items:center; flex-shrink:0; }
.notifitem.unread .notifitem__ic { background:var(--navy-700,#0B3D91); color:#fff; }
.notifitem__tx { flex:1; min-width:0; display:flex; flex-direction:column; }
.notifitem__tx b { font-size:12.5px; color:var(--ink); }
.notifitem__tx span { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.notifitem__ago { font-size:10.5px; color:var(--dim); white-space:nowrap; flex-shrink:0; padding-top:2px; }
.notifpop__ft { padding:11px 15px; text-align:center; border-top:1px solid var(--line); background:#fafbfd; }
.notifpop__ft button { border:none; background:none; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.dtop__shift { display:flex; align-items:center; gap:7px; padding-left:2px; }
.dtop__shift .av { width:38px;height:38px;border-radius:11px;background:var(--surface-3);display:grid;place-items:center;color:var(--navy-700);font-weight:700;flex:none; }
.dtop__shift .av--logo { background:none; overflow:hidden; }
.dtop__shift .av--logo img { width:100%; height:100%; object-fit:cover; display:block; }

.dcontent { flex:1; min-height:0; overflow-y:auto; padding: 16px 26px 26px; }
.dwrap { max-width: 1280px; margin: 0 auto; }
.dwrap--wide { max-width: none; }

/* ===== แยกหน้าจอ (Split workspace) — เปิดเมนูคู่กัน ===== */
.splitwrap { flex:1; min-height:0; display:flex; align-items:stretch; overflow:hidden; background:var(--surface-2); }
.splitpane { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--surface); position:relative; }
.splitpane.is-focus { box-shadow: inset 0 2.5px 0 0 var(--gold-500,#c9a347); }
.splitpane__hd { display:flex; align-items:center; gap:8px; padding:6px 8px 6px 10px; border-bottom:1px solid var(--line); background:linear-gradient(180deg,var(--surface),var(--surface-2)); flex:none; }
.splitpane.is-focus .splitpane__hd { background:linear-gradient(180deg,#fbf6e9,var(--surface-2)); }
.splitpane__no { flex:none; width:18px; height:18px; border-radius:5px; background:var(--navy-700); color:#fff; font-size:11px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.splitpane.is-focus .splitpane__no { background:var(--gold-500,#c9a347); color:#1b2a4a; }
.splitpane__sel { font-size:12.5px; font-weight:700; color:var(--navy-800); border:1px solid var(--line); border-radius:7px; padding:3px 8px; background:#fff; max-width:210px; cursor:pointer; }
.splitpane__crumb { flex:1; min-width:0; font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.splitpane__tools { flex:none; display:flex; gap:4px; align-items:center; }
.splitpane__zoom { display:flex; align-items:center; gap:1px; border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#fff; margin-right:2px; }
.splitpane__zbtn { width:22px; height:24px; border:none; background:#fff; cursor:pointer; font-size:13px; font-weight:800; color:var(--navy-700); display:flex; align-items:center; justify-content:center; }
.splitpane__zbtn:hover { background:var(--surface-2); }
.splitpane__zbtn svg { display:block; }
.splitpane__zlbl { min-width:38px; height:24px; border:none; border-left:1px solid var(--line); border-right:1px solid var(--line); background:#fff; cursor:pointer; font-size:11px; font-weight:700; color:var(--navy-800); padding:0 4px; }
.splitpane__zlbl:hover { background:#fbf2da; }
.splitpane__zlbl--fit { min-width:26px; padding:0; color:var(--navy-700); display:flex; align-items:center; justify-content:center; }
.splitpane__zlbl--fit svg { display:block; }
.splitpane__btn { width:24px; height:24px; border-radius:6px; border:1px solid var(--line); background:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--navy-700); }
.splitpane__btn:hover { background:var(--surface-2); }
.splitpane__btn--x:hover { background:#fdecec; color:#c0392b; border-color:#f3c6c6; }
.splitpane__scroll { flex:1; min-height:0; overflow:auto; scrollbar-gutter:stable; }
.splitpane__fit { transform-origin:top left; }
.splitpane__content { padding:14px 18px 22px; overflow:visible; height:auto; }
.splitdiv { flex:none; width:7px; cursor:col-resize; background:var(--surface-2); border-left:1px solid var(--line); border-right:1px solid var(--line); display:flex; align-items:center; justify-content:center; position:relative; z-index:2; }
.splitdiv:hover, .splitdiv:active { background:#f3e6c2; }
.splitdiv__grip { width:3px; height:36px; border-radius:3px; background:var(--line-2,#c9d2e0); }
.splitdiv:hover .splitdiv__grip { background:var(--gold-500,#c9a347); }
.splitctrl { position:relative; }
.splitctrl__btn.is-on { color:var(--navy-800); background:#fbf2da; border-color:#e6d3a0; }
.splitctrl__badge { position:absolute; top:-4px; right:-4px; min-width:15px; height:15px; padding:0 3px; border-radius:8px; background:var(--gold-500,#c9a347); color:#1b2a4a; font-size:10px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.splitctrl__pop { position:absolute; top:calc(100% + 8px); right:0; width:270px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 38px -10px rgba(20,40,80,.34); padding:8px; z-index:60; }
.splitctrl__hd { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--navy-800); padding:4px 6px 8px; }
.splitctrl__sec { font-size:10.5px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.4px; padding:7px 6px 3px; }
.splitctrl__row { display:flex; align-items:center; gap:8px; width:100%; text-align:left; font-size:12.5px; font-weight:600; color:var(--ink-2); padding:8px; border-radius:8px; border:none; background:none; cursor:pointer; }
.splitctrl__row:hover { background:var(--surface-2); }
.splitctrl__row--exit { color:#c0392b; }
.splitctrl__sel { width:100%; font-size:12.5px; border:1px solid var(--line); border-radius:8px; padding:7px 9px; background:#fff; cursor:pointer; margin-top:2px; }
.splitctrl__div { height:1px; background:var(--line); margin:7px 4px; }
@media (max-width:820px){ .splitwrap { flex-direction:column; } .splitdiv { width:auto; height:7px; cursor:row-resize; } .splitdiv__grip { width:36px; height:3px; } }

/* mobile top nav (hidden on desktop) */
.dtopnav { display:none; }

/* ---------- Generic blocks ---------- */
.dgrid-kpi { display:grid; grid-template-columns: repeat(4,1fr); gap:16px; }
.kpi { background: var(--surface); border:1px solid var(--line); border-radius: var(--r-lg); padding:18px 18px 16px; box-shadow: var(--sh-sm); position:relative; overflow:hidden; }
.kpi__k { font-size:12.5px; color:var(--dim); font-weight:600; padding-right:52px; }
.kpi__v { font-size:29px; font-weight:800; letter-spacing:-.5px; margin-top:9px; color:var(--ink); padding-right:52px; line-height:1.15; }
.kpi__v small { font-size:13px; font-weight:600; color:var(--dim); margin-left:4px; letter-spacing:0; }
.kpi__sub { font-size:12px; color:var(--dim); margin-top:6px; }
.kpi__ic { position:absolute; top:16px; right:16px; width:40px;height:40px;border-radius:12px;display:grid;place-items:center; box-shadow:0 1px 3px rgba(16,32,72,.10); }
.kpi--gold { background: linear-gradient(150deg,#16294f,#0e1f3f); border-color:transparent; color:#fff; }
.kpi--gold .kpi__k,.kpi--gold .kpi__sub { color:#9fb0cd; }
.kpi--gold .kpi__v { color: var(--gold-400); }

.sectitle { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin: 0 0 13px; }
.sectitle h2 { font-size:15px; font-weight:800; color:var(--ink); }
.sectitle .link { font-size:13px; font-weight:600; color:var(--navy-600); cursor:pointer; }

.panel { background:var(--surface); border:1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.panel__hd { padding: 15px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel__hd h3 { font-size:14.5px; font-weight:700; }
.panel__bd { padding: 6px 0; }
.panel__bd--pad { padding:18px; }

/* ---------- Tables ---------- */
.tbl { width:100%; border-collapse:collapse; }
.tbl th { text-align:left; font-size:11.5px; color:var(--dim); font-weight:700; padding:11px 16px; border-bottom:1px solid var(--line); white-space:nowrap; text-transform:uppercase; letter-spacing:.4px; font-family:"Noto Sans",sans-serif; }
.tbl td { padding:13px 16px; border-bottom:1px solid var(--line); font-size:13.5px; vertical-align:middle; }
.tbl tbody tr { cursor:pointer; transition: background .12s ease; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.is-sel td { background: #fdf6e6; }
.tbl tbody tr.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--gold-500); }
.docreg__tbl thead th { border-right:1px solid var(--line); }
.docreg__tbl thead th:last-child { border-right:none; }
.bg-tbl thead th { border-right:1px solid var(--line); }
.bg-tbl thead th:last-child { border-right:none; }
.posbrowse thead th { border-right:1px solid var(--line); }
.posbrowse thead th:last-child { border-right:none; }
.tbl tbody tr:last-child td { border-bottom:none; }
.tbl .num { text-align:right; font-weight:700; white-space:nowrap; }
.tbl .cell-main { font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tbl .cell-sub { font-size:11.5px; color:var(--dim); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cellflex { display:flex; align-items:center; gap:11px; min-width:0; }
.cellflex > div:last-child { min-width:0; }
.cellav { width:38px;height:38px;border-radius:11px;flex:none;display:grid;place-items:center;background:var(--surface-3);color:var(--navy-700);font-weight:700;font-size:15px; }

/* ---------- Filters / chips ---------- */
.dchips { display:flex; gap:8px; flex-wrap:wrap; }
.dchips--bal { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.dchips--bal .dchip { text-align:center; padding-left:8px; padding-right:8px; }
.dchips--bal .dchip:first-child { grid-column:1 / -1; }
.dchip { font-size:13px; font-weight:500; padding:8px 14px; border-radius:var(--r-pill); background:var(--surface); border:1px solid var(--line-2); color:var(--ink-2); cursor:pointer; font-family:var(--ff); transition: all .14s ease; }
.dchip.is-active { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }

.dsearch { display:flex; align-items:center; gap:10px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); padding:10px 14px; }
.dsearch input { flex:1; border:none; background:none; outline:none; font-family:var(--ff); font-size:14px; min-width:0; }
.bsfilter { font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink); padding:7px 11px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); outline:none; cursor:pointer; }
.bsfilter:focus { border-color:var(--gold-500); }
.bskpi { display:flex; gap:1px; background:var(--line); border-top:1px solid var(--line); }
.bskpi__c { flex:1; background:var(--surface); padding:11px 16px; display:flex; flex-direction:column; gap:2px; }
.bskpi__c span { font-size:11.5px; color:var(--dim); }
.bskpi__c b { font-size:17px; font-weight:800; color:var(--navy-800); }
.bskpi__c--due b { color:var(--warn-ink); }
.bsact { width:30px; height:30px; border-radius:7px; border:1px solid var(--line-2); background:var(--surface); color:var(--navy-700); display:inline-grid; place-items:center; cursor:pointer; margin-left:5px; transition:.12s; }
.bsact:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
/* ===== POS โปรโมชั่นบอร์ด (customer-facing, luxe) ===== */
.pospromo{ padding-bottom:14px; }
.pospromo__hero{ position:relative; overflow:hidden; border-radius:22px; padding:26px 30px; margin-bottom:20px; color:#fff; display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  background:radial-gradient(130% 170% at 0% 0%, #20407a 0%, #16294f 46%, #091530 100%);
  border:1px solid rgba(246,201,91,.38); box-shadow:0 22px 54px -26px rgba(8,18,40,.85); }
.pospromo__hero::before{ content:""; position:absolute; right:-50px; top:-60px; width:260px; height:260px; border-radius:50%; background:radial-gradient(circle, rgba(246,201,91,.20), transparent 70%); pointer-events:none; }
.pospromo__heroL{ position:relative; z-index:1; min-width:0; }
.pospromo__eyebrow{ font-size:11.5px; letter-spacing:3px; font-weight:800; color:#F6C95B; text-transform:uppercase; }
.pospromo__ttl{ font-size:30px; font-weight:900; margin-top:7px; letter-spacing:.3px; line-height:1.1; }
.pospromo__sub{ font-size:13px; color:#aebfdc; margin-top:7px; }
.pospromo__seal{ position:relative; z-index:1; display:flex; align-items:center; gap:11px; padding:12px 18px; border-radius:16px; background:linear-gradient(150deg,#fbe7a8,#e3b54e 75%); color:#3a2a08; box-shadow:0 10px 26px -12px rgba(227,181,78,.7); }
.pospromo__seal b{ display:block; font-size:14px; font-weight:900; }
.pospromo__seal span{ font-size:11.5px; font-weight:600; opacity:.85; }
.pospromo__seal-ic{ width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.45); flex:none; }

.pospromo__grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; margin-bottom:24px; }
.pospromo-card{ position:relative; overflow:hidden; border-radius:18px; padding:20px 20px 15px; color:#fff; min-height:190px; display:flex; flex-direction:column; isolation:isolate;
  border:1px solid rgba(255,255,255,.12); box-shadow:0 18px 42px -22px rgba(8,18,40,.9); }
.pospromo-card::before{ content:""; position:absolute; inset:0; background:linear-gradient(158deg, rgba(255,255,255,.18), transparent 44%); pointer-events:none; z-index:0; }
.pospromo-card > *{ position:relative; z-index:1; }
.pospromo-card__wm{ position:absolute; right:-20px; bottom:-26px; opacity:.12; z-index:0; pointer-events:none; }
.pospromo-card.is-feat{ grid-column:span 2; min-height:210px; }
@media (max-width:640px){ .pospromo-card.is-feat{ grid-column:span 1; } }
.pospromo-card__seal{ position:absolute; top:15px; right:15px; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.28); z-index:1; }
.pospromo-card__badge{ align-self:flex-start; font-size:11px; font-weight:800; letter-spacing:.4px; padding:5px 13px; border-radius:99px; color:#1a1206; box-shadow:0 3px 9px rgba(0,0,0,.22); }
.pospromo-card__value{ font-size:40px; font-weight:900; line-height:1; margin-top:13px; letter-spacing:.5px; text-shadow:0 2px 16px rgba(0,0,0,.3); }
.pospromo-card.is-feat .pospromo-card__value{ font-size:56px; }
.pospromo-card__name{ font-size:16px; font-weight:800; margin-top:11px; line-height:1.25; }
.pospromo-card__detail{ font-size:12.5px; color:rgba(255,255,255,.82); margin-top:5px; line-height:1.5; flex:1; }
.pospromo-card__foot{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:13px; padding-top:11px; border-top:1px solid rgba(255,255,255,.16); }
.pospromo-card__period{ display:inline-flex; align-items:center; gap:5px; font-size:11px; color:rgba(255,255,255,.85); }
.pospromo-card__brand{ font-size:11px; font-weight:800; letter-spacing:1px; color:rgba(255,255,255,.66); text-transform:uppercase; }

.pospromo-mem{ background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:18px 20px; box-shadow:var(--sh-sm); }
.pospromo-mem__hd{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.pospromo-mem__k{ display:block; font-size:15px; font-weight:800; color:var(--ink); }
.pospromo-mem__s{ display:block; font-size:12px; color:var(--dim); margin-top:2px; }
.pospromo-mem__link{ border:none; background:none; color:var(--navy-700); font-weight:700; font-size:12.5px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.pospromo-mem__link:hover{ color:var(--gold-600); }
.pospromo-tiers{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media (max-width:720px){ .pospromo-tiers{ grid-template-columns:1fr; } }
.pospromo-tier{ position:relative; overflow:hidden; border-radius:15px; padding:15px 17px; color:#3a2a08; border:1px solid rgba(0,0,0,.07); box-shadow:0 12px 28px -18px rgba(0,0,0,.45); }
.pospromo-tier::before{ content:""; position:absolute; inset:0; background:linear-gradient(158deg, rgba(255,255,255,.55), transparent 46%); pointer-events:none; }
.pospromo-tier__top{ position:relative; display:flex; align-items:center; gap:7px; font-size:14px; font-weight:900; letter-spacing:.3px; }
.pospromo-tier__benefit{ position:relative; font-size:12px; font-weight:600; margin-top:6px; line-height:1.5; color:#4a3a14; }
.pospromo-card__read{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:800; letter-spacing:.3px; color:rgba(255,255,255,.92); }
/* สินค้าบริการ (service product) */
.svc-btn--gold{ border-color:var(--gold-400) !important; background:#fffaf0 !important; color:var(--gold-700) !important; }
.svc-btn--gold:hover{ background:#fff3d6 !important; }
.svcp-panel{ max-width:580px; }
.svcp-srch{ display:flex; align-items:center; gap:8px; border:1px solid var(--line-2); border-radius:10px; padding:8px 12px; margin-bottom:7px; background:var(--surface); }
.svcp-srch:focus-within{ border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.svcp-srch__t{ width:18px; height:18px; flex:none; border-radius:50%; background:var(--navy-700); color:#fff; font-size:11px; font-weight:800; display:grid; place-items:center; }
.svcp-srch input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); }
.svcp-matches{ display:flex; flex-direction:column; gap:5px; margin:4px 0 2px; max-height:190px; overflow-y:auto; }
.svcp-match{ text-align:left; border:1px solid var(--line); border-radius:9px; padding:8px 11px; background:var(--surface-2); cursor:pointer; font-family:var(--ff); }
.svcp-match:hover{ border-color:var(--gold-400); background:#fffdf6; }
.svcp-match.is-on{ border-color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700); background:#fff; }
.svcp-match b{ display:block; font-size:13px; font-weight:700; color:var(--ink); }
.svcp-match span{ font-size:11px; color:var(--dim); }
.svcp-none{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #f0d488; border-radius:9px; padding:8px 11px; margin:4px 0; }
.svcp-sugwrap{ margin:6px 0 2px; padding:8px 10px 9px; background:var(--warn-bg); border:1px solid #f0d488; border-radius:10px; }
.svcp-sughd{ display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; color:var(--warn-ink); margin-bottom:6px; }
.svcp-match--sug{ background:#fff; border-color:#ecd9a6; }
.svcp-match--sug:hover{ border-color:var(--gold-500); }
.svcp-ack{ display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--ink-2); background:var(--warn-bg); border:1px solid #f0d488; border-radius:9px; padding:9px 11px; margin:10px 0 2px; cursor:pointer; line-height:1.45; }
.svcp-ack input{ margin-top:1px; flex:none; width:15px; height:15px; accent-color:var(--gold-600); cursor:pointer; }
.svcp-ack b{ color:var(--warn-ink); }
.svcp-staffsel{ width:100%; height:36px; box-sizing:border-box; border:1px solid var(--line-2); border-radius:8px; padding:0 10px; font-family:var(--ff); font-size:12.5px; color:var(--ink); background:var(--surface); }
/* สินค้าตัดแบ่ง — dropdown แบบคอลัมน์ (รหัส · ชื่อ · ราคา/หน่วย) */
.cutsel{ position:relative; }
.cutsel__btn{ display:grid; grid-template-columns:96px 1fr auto 18px; align-items:center; gap:10px; width:100%; box-sizing:border-box; border:1px solid var(--line-2); border-radius:8px; padding:9px 11px; background:var(--surface); cursor:pointer; font-family:var(--ff); text-align:left; }
.cutsel__btn:hover{ border-color:var(--navy-300,#9db3d6); }
.cutsel__dd{ position:absolute; z-index:20; left:0; right:0; top:calc(100% + 4px); max-height:240px; overflow-y:auto; background:var(--surface); border:1px solid var(--line-2); border-radius:9px; box-shadow:0 16px 40px -12px rgba(18,40,90,.32); padding:4px; }
.cutsel__opt{ display:grid; grid-template-columns:96px 1fr auto; align-items:center; gap:10px; width:100%; box-sizing:border-box; border:none; border-radius:7px; padding:8px 9px; background:none; cursor:pointer; font-family:var(--ff); text-align:left; }
.cutsel__opt:hover{ background:var(--surface-2); }
.cutsel__opt.is-on{ background:var(--navy-50,#eef3fb); }
.cutsel__code{ font-size:12px; font-weight:700; color:var(--navy-700); }
.cutsel__nm{ font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.cutsel__pr{ font-size:12px; font-weight:700; color:var(--ink-2); white-space:nowrap; text-align:right; }
.svc__ship3{ display:flex; gap:6px; }
.svc__shipbtn{ flex:1; border:1px solid var(--line-2); background:var(--surface); border-radius:8px; padding:8px 4px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.svc__shipbtn:hover{ border-color:var(--navy-300,#9db3d6); }
.svc__shipbtn.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
/* คืนสินค้าบริการ — เพิ่มรายการเข้าใบคืน */
.srv-addbox{ border:1px solid var(--line-2); border-radius:10px; padding:10px 12px; background:var(--surface-2); }
.srv-addbox__hd{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--ink); }
.srv-addbox__x{ margin-left:auto; border:none; background:none; color:var(--dim); font-size:12px; text-decoration:underline; cursor:pointer; font-family:inherit; }
.srv-addlist{ display:flex; flex-direction:column; gap:5px; max-height:200px; overflow-y:auto; }
.srv-additem{ display:grid; grid-template-columns:96px 1fr auto; align-items:center; gap:9px; text-align:left; border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:var(--surface); cursor:pointer; font-family:var(--ff); }
.srv-additem:hover{ border-color:var(--gold-400); background:#fffdf6; }
.srv-additem__code{ font-size:12px; font-weight:700; color:var(--navy-700); }
.srv-additem__nm{ font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.srv-additem__sup{ display:inline-flex; align-items:center; gap:4px; font-size:11px; color:var(--ink-2); white-space:nowrap; }
/* ใบสรุปคืน/เปลี่ยน — ให้อ่านง่าย จัดคอลัมน์ ราคาชิดขวา */
.rr-doc{ font-size:13px; line-height:1.5; border:1px solid var(--line); border-radius:12px; padding:16px 18px; background:var(--surface); }
.rr-sec{ font-size:11px; font-weight:800; color:var(--navy-700); margin:14px 0 6px; padding-bottom:4px; border-bottom:1px solid var(--line); }
.rr-sec:first-child{ margin-top:0; }
.rr-line{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; padding:5px 0; }
.rr-line > span{ min-width:0; }
.rr-line > b{ flex:none; white-space:nowrap; }
.rr-line--big{ font-size:14.5px; font-weight:800; padding:8px 0 2px; }
/* ซ่อนแถบเลื่อนในจอสินค้าบริการ — ยังเลื่อนได้ปกติ */
.svcp-panel,.svcp-panel .impbody{ scrollbar-width:none; -ms-overflow-style:none; }
.svcp-panel::-webkit-scrollbar,.svcp-panel .impbody::-webkit-scrollbar{ width:0; height:0; display:none; }

/* ===== \u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d\u0e41\u0e1f\u0e49\u0e21\u0e2a\u0e34\u0e19\u0e04\u0e49\u0e32: \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 / \u0e23\u0e2b\u0e31\u0e2a\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e23\u0e2d\u0e15\u0e23\u0e27\u0e08 (31) ===== */
.partsec{ display:flex; gap:6px; margin-bottom:4px; }
.partsec__b{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:6px 12px; border-radius:8px; cursor:pointer; }dding:8px 15px; border-radius:9px; cursor:pointer; }
.partsec__b:hover{ border-color:var(--navy-300,#9db3d6); }
.partsec__b.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.partsec__n{ min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--danger); color:#fff; font-size:11px; font-weight:800; display:inline-grid; place-items:center; }
.partsec__b.is-on .partsec__n{ background:#fff; color:var(--navy-700); }

.scr-wrap{ flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:hidden; }
.scr-intro{ display:flex; gap:8px; align-items:flex-start; font-size:12.5px; line-height:1.5; color:var(--ink-2); background:var(--navy-50,#eef3fb); border:1px solid var(--navy-100,#d6e2f5); border-radius:10px; padding:11px 14px; }
.scr-intro b{ color:var(--navy-700); }
.scr-filters{ display:flex; gap:7px; }
.scr-chip{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:6px 13px; border-radius:8px; cursor:pointer; }
.scr-chip.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.scr-chip__n{ min-width:17px; height:17px; padding:0 5px; border-radius:9px; background:var(--line); color:var(--ink-2); font-size:10.5px; font-weight:800; display:inline-grid; place-items:center; }
.scr-chip.is-on .scr-chip__n{ background:rgba(255,255,255,.25); color:#fff; }
.scr-tblwrap{ flex:1; min-height:0; overflow:auto; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.scr-tbl{ width:100%; }
.scr-tbl th{ position:sticky; top:0; z-index:1; background:var(--surface-2); }
.scr-tbl .cell-main{ font-weight:600; color:var(--ink); }
.scr-sub{ display:block; font-size:11px; color:var(--dim); margin-top:1px; }
.scr-note{ display:inline-flex; align-items:center; gap:3px; font-size:10.5px; color:var(--warn-ink); margin-top:2px; }
.scr-empty{ text-align:center; color:var(--dim); padding:26px 0; }
.scr-acts{ display:flex; gap:6px; flex-wrap:wrap; }
.scr-btn{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:var(--surface); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:5px 10px; border-radius:7px; cursor:pointer; white-space:nowrap; }
.scr-btn--merge{ border-color:var(--navy-300,#9db3d6); color:var(--navy-700); }
.scr-btn--merge:hover{ background:var(--navy-50,#eef3fb); }
.scr-btn--keep{ border-color:#a7d7bd; color:#16794a; }
.scr-btn--keep:hover{ background:var(--ok-bg); }
.scr-stat{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; }
.scr-stat--ok{ color:#16794a; } .scr-stat--navy{ color:var(--navy-700); }
.scr-undo{ margin-left:6px; border:none; background:none; color:var(--dim); font-size:11px; text-decoration:underline; cursor:pointer; font-family:inherit; }
.scr-mfrom{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; font-size:12.5px; color:var(--ink-2); background:var(--warn-bg); border:1px solid #f0d488; border-radius:9px; padding:9px 12px; margin-bottom:12px; }
.scr-mfrom__top{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.scr-mfrom__ids{ display:flex; gap:7px; flex-wrap:wrap; }
.scr-idchip{ font-size:11px; color:var(--ink-2); background:#fff; border:1px solid #ecd9a6; border-radius:6px; padding:2px 8px; }
.scr-idchip b{ color:var(--navy-700); font-family:"Noto Sans Thai Looped",var(--ff); }
.scr-idchip--typed{ color:var(--warn-ink); } .scr-idchip--typed b{ color:var(--warn-ink); }
.scr-idsub{ display:block; font-size:9.5px; color:var(--dim); margin-top:1px; }
.scr-mfrom__tag{ font-size:10.5px; font-weight:800; color:var(--warn-ink); background:#fff; border:1px solid #ecd9a6; border-radius:6px; padding:2px 7px; }
.scr-mlbl{ font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:6px; }
.scr-msearch{ display:flex; align-items:center; gap:8px; border:1px solid var(--line-2); border-radius:9px; padding:9px 12px; background:var(--surface); }
.scr-msearch input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); }
.scr-cand{ display:flex; flex-direction:column; gap:5px; margin-top:7px; max-height:210px; overflow-y:auto; }
.scr-cand__row{ display:flex; flex-direction:column; gap:5px; align-items:stretch; text-align:left; border:1px solid var(--line); border-radius:8px; padding:9px 12px; background:var(--surface-2); cursor:pointer; font-family:var(--ff); }
.scr-cand__row:hover{ border-color:var(--gold-400); background:#fffdf6; }
.scr-cand__row.is-on{ border-color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700); background:#fff; }
.scr-cand__l1{ display:flex; align-items:baseline; gap:9px; }
.scr-cand__code{ font-weight:700; color:var(--navy-700); font-size:12.5px; flex:none; }
.scr-cand__nm{ flex:1; min-width:0; font-size:13px; color:var(--ink); font-weight:600; line-height:1.35; }
.scr-cand__l2{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding-left:2px; }
.scr-cand__model{ font-size:11.5px; color:var(--ink-2); font-weight:600; }
.scr-cand__oem{ font-size:11px; color:var(--dim); flex:none; white-space:nowrap; }
.scr-cand__brand{ flex:none; font-size:10.5px; font-weight:700; color:var(--navy-700); background:var(--navy-50,#eef3fb); border:1px solid var(--navy-100,#d6e2f5); border-radius:5px; padding:1px 7px; white-space:nowrap; }
.scr-cand__sup{ display:inline-flex; align-items:center; gap:4px; font-size:11px; color:var(--ink-2); }
.scr-mto__sup{ color:var(--navy-700); font-weight:600; }
.scr-mhint{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); margin:8px 0 2px; }
.scr-mhint b{ color:var(--navy-700); }
.scr-cand__row--match{ border-color:#a7d7bd; background:#f3fbf6; }
.scr-cand__row--match:hover{ border-color:#16794a; background:#eef9f2; }
.scr-cand__match{ display:inline-flex; align-items:center; gap:3px; font-size:10.5px; font-weight:800; color:#16794a; background:#e3f5ea; border:1px solid #a7d7bd; border-radius:5px; padding:1px 6px; flex:none; }
.scr-cand__sup.is-match{ color:#16794a; font-weight:700; }
.scr-mto--warn{ background:var(--warn-bg); border-color:#f0d488; color:var(--ink-2); }
.scr-mto--warn b{ color:var(--warn-ink); }
.scr-cnone{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #f0d488; border-radius:9px; padding:9px 12px; margin-top:7px; }
.scr-mto{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-2); background:var(--ok-bg); border:1px solid #a7d7bd; border-radius:9px; padding:9px 12px; margin-top:10px; }
.svcp-pick{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-2); background:var(--ok-bg); border:1px solid #a7d7bd; border-radius:9px; padding:9px 12px; margin-top:10px; }
.svcp-pick b{ color:var(--ink); } .svcp-pick button{ margin-left:auto; border:none; background:none; color:var(--navy-700); font-weight:700; font-size:12px; cursor:pointer; font-family:inherit; text-decoration:underline; }
.svcp-div{ height:1px; background:var(--line); margin:14px 0; }
.svcp-seg{ display:flex; gap:0; border:1px solid var(--line-2); border-radius:9px; overflow:hidden; margin-top:5px; }
.svcp-seg button{ flex:1; border:none; background:var(--surface); padding:8px 6px; font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; font-family:var(--ff); border-left:1px solid var(--line-2); }
.svcp-seg button:first-child{ border-left:none; }
.svcp-seg button.is-on{ background:var(--navy-700); color:#fff; }
.svcp-route{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:9px 12px; margin-top:12px; margin-bottom:6px; }
.svcp-panel .impact{ margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.svcp-billauto{ display:flex; align-items:center; flex-wrap:wrap; gap:5px; font-size:11.5px; color:var(--ink-2); margin-top:5px; line-height:1.5; }
.svcp-billauto b{ font-family:var(--mono,monospace); color:var(--navy-700); font-weight:700; }
.svcp-billauto button{ border:1px solid var(--navy-300,#9db3d6); background:#fff; color:var(--navy-700); border-radius:6px; padding:1px 8px; font-size:11px; font-weight:600; cursor:pointer; }
.svcp-billauto button:hover{ background:var(--navy-50,#eef3fb); }
/* picking — resolved internal SKUs (web option → real SKU) */
.pickresolve{ margin-top:5px; border:1px dashed #e0c98a; background:#fffdf5; border-radius:8px; padding:6px 8px; }
.pickresolve__hd{ display:flex; align-items:center; gap:4px; font-size:10.5px; font-weight:800; color:var(--gold-700); margin-bottom:4px; }
.pickresolve__row{ display:flex; align-items:center; gap:8px; padding:3px 0; border-top:1px solid #f0e6c8; font-size:11px; }
.pickresolve__row:first-of-type{ border-top:none; }
.pickresolve__sku{ font-weight:800; color:var(--navy-700); flex:none; }
.pickresolve__bin{ display:inline-flex; align-items:center; gap:3px; color:var(--navy-600); font-weight:700; flex:none; }
.pickresolve__sup{ color:var(--dim); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pickresolve__q{ font-weight:800; color:var(--ink); flex:none; }
/* storefront demo proof panel */
.sfd-proof{ margin:12px 0; border:1px solid #c9d6ea; background:linear-gradient(180deg,#f6f9ff,#eef3fb); border-radius:11px; padding:11px 13px; font-size:12px; }
.sfd-proof__hd{ font-size:11px; font-weight:800; color:var(--navy-700); margin-bottom:7px; letter-spacing:.2px; }
.sfd-proof__row{ display:flex; justify-content:space-between; gap:10px; padding:3px 0; color:var(--ink-2); }
.sfd-proof__row b{ color:var(--ink); }
.sfd-proof__pool{ margin:6px 0; display:flex; flex-direction:column; gap:4px; }
.sfd-proof__sku{ display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line); border-radius:7px; padding:5px 9px; }
.sfd-proof__sku .mono{ font-weight:800; color:var(--navy-700); }
.sfd-proof__sup{ flex:1; min-width:0; color:var(--dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sfd-proof__st{ flex:none; font-weight:700; color:var(--ink-2); font-size:11px; }
.sfd-proof__sum{ margin-top:5px; padding-top:7px; border-top:1px dashed #c9d6ea; color:var(--ink-2); }
.sfd-proof__sum b{ color:var(--ok-ink); }
.sfd-proof__alloc{ margin-top:7px; display:flex; flex-wrap:wrap; align-items:center; gap:6px; color:var(--ink-2); }
.sfd-proof__alloc .mono{ background:#fff; border:1px solid #c9d6ea; border-radius:6px; padding:2px 7px; color:var(--navy-700); }
.sfd-proof__short{ color:var(--warn-ink); }
.svcp-manual{ display:flex; align-items:flex-start; gap:7px; font-size:12px; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #f0d488; border-radius:9px; padding:9px 12px; margin-bottom:4px; line-height:1.5; }
.svcp-sup__cv{ position:absolute; right:11px; bottom:11px; pointer-events:none; }
.svcp-sup input{ padding-right:30px !important; }
.svcp-supdd{ position:absolute; left:0; right:0; top:100%; margin-top:4px; z-index:30; background:var(--surface); border:1px solid var(--line); border-radius:11px; box-shadow:0 16px 36px -16px rgba(20,40,90,.4); padding:5px; max-height:208px; overflow-y:auto; }
.svcp-supdd button{ display:flex; align-items:center; gap:8px; width:100%; text-align:left; border:none; background:none; border-radius:8px; padding:9px 11px; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); cursor:pointer; }
.svcp-supdd button:hover{ background:var(--surface-2); }
.svcp-supdd__tag{ margin-left:auto; font-size:10px; font-weight:800; color:var(--gold-700); background:#fffaf0; border:1px solid var(--gold-300,#ecd9a6); border-radius:99px; padding:2px 8px; }
.pospromo__manage{ position:relative; z-index:1; display:inline-flex; align-items:center; gap:7px; border:1px solid rgba(246,201,91,.5); background:rgba(255,255,255,.1); color:#F6C95B; font-weight:800; font-size:13px; padding:11px 17px; border-radius:13px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.pospromo__manage:hover{ background:rgba(246,201,91,.16); }
.pospromo-card.is-paused{ opacity:.56; filter:saturate(.65); }
.pospromo-card__pause{ margin-top:11px; width:100%; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid rgba(255,255,255,.3); background:rgba(255,255,255,.13); color:#fff; font-weight:800; font-size:12px; padding:8px; border-radius:10px; cursor:pointer; font-family:inherit; }
.pospromo-card__pause:hover{ background:rgba(255,255,255,.22); }
/* promo detail modal */
.pospromo-modal{ position:relative; z-index:1; width:min(444px,93vw); max-height:90vh; overflow:auto; background:var(--surface); border-radius:20px; box-shadow:0 30px 80px -28px rgba(8,18,40,.7); margin:auto; }
.pospromo-modal__hd{ position:relative; overflow:hidden; padding:22px 24px 20px; color:#fff; }
.pospromo-modal__hd > *{ position:relative; z-index:1; }
.pospromo-modal__x{ position:absolute; top:14px; right:14px; z-index:2; width:32px; height:32px; border-radius:50%; border:1px solid rgba(255,255,255,.3); background:rgba(255,255,255,.16); color:#fff; cursor:pointer; display:grid; place-items:center; }
.pospromo-modal__x:hover{ background:rgba(255,255,255,.28); }
.pospromo-modal__wm{ position:absolute; right:-16px; bottom:-26px; opacity:.14; z-index:0; pointer-events:none; }
.pospromo-modal__value{ font-size:46px; font-weight:900; line-height:1; margin-top:14px; text-shadow:0 2px 16px rgba(0,0,0,.3); }
.pospromo-modal__name{ font-size:18px; font-weight:800; margin-top:9px; }
.pospromo-modal__code{ font-size:11.5px; color:rgba(255,255,255,.72); margin-top:5px; }
.pospromo-modal__bd{ padding:16px 22px 6px; }
.pospromo-modal__row{ display:flex; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); }
.pospromo-modal__lbl{ flex:none; width:104px; font-size:12.5px; font-weight:700; color:var(--dim); }
.pospromo-modal__val{ font-size:13px; color:var(--ink); line-height:1.55; }
.pospromo-modal__sec{ font-size:13px; font-weight:800; color:var(--navy-700); margin:16px 0 10px; display:flex; align-items:center; gap:7px; }
.pospromo-items{ display:flex; flex-direction:column; gap:8px; }
.pospromo-item{ display:flex; align-items:center; gap:11px; padding:9px 11px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.pospromo-item__ic{ width:34px; height:34px; border-radius:9px; flex:none; display:grid; place-items:center; background:#eef3fb; color:var(--navy-700); }
.pospromo-item__nm{ flex:1; min-width:0; }
.pospromo-item__nm b{ display:block; font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pospromo-item__nm span{ font-size:11px; color:var(--dim); }
.pospromo-item__price{ text-align:right; flex:none; }
.pospromo-item__price s{ display:block; font-size:11px; color:var(--dim); }
.pospromo-item__price b{ font-size:13.5px; font-weight:800; color:var(--gold-700); }
.pospromo-item__price b.plain{ color:var(--navy-800); }
.pospromo-items__empty{ font-size:12px; color:var(--dim); padding:11px 13px; background:var(--surface-2); border:1px dashed var(--line-2); border-radius:11px; text-align:center; }
.pospromo-modal__terms{ margin-top:15px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:13px 15px; }
.pospromo-modal__terms-hd{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--navy-700); margin-bottom:8px; }
.pospromo-modal__terms ul{ margin:0; padding-left:18px; }
.pospromo-modal__terms li{ font-size:12px; color:var(--ink-2); line-height:1.75; }
.pospromo-modal__ft{ padding:14px 22px 20px; }
/* ค้นบิล: keep table (and its expanded preview) contained — scroll inside the card */
.bssearch .panel__bd { overflow-x:auto; }
.bssearch .panel__bd > .tbl { min-width:860px; }
/* ค้นบิล: action column aligned in fixed slots (pill | slip | print) */
.bsactions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.bsactions .rrprevtog { margin-right:0; }
.bsact-slot { width:30px; flex:none; display:inline-flex; align-items:center; justify-content:center; }
.bsact-slot .bsact { margin-left:0; }
.bsact--pay { color:var(--ok-ink); border-color:#a7d7bd; background:var(--ok-bg); }
.bsact--pay:hover { background:#d6efe1; border-color:var(--ok); }
/* ---------- quotation redesign ---------- */
.qtsplit { display:grid; grid-template-columns:340px minmax(0,1fr); gap:18px; align-items:start; }
@media (max-width:1000px){ .qtsplit { grid-template-columns:1fr; } }
.qtcard { display:block; width:100%; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:13px 15px; cursor:pointer; transition:.12s; font-family:var(--ff); }
.qtcard:hover { border-color:var(--gold-400); box-shadow:var(--sh-sm); }
.qtcard.is-sel { border-color:var(--gold-500); box-shadow:0 0 0 1px var(--gold-500),var(--sh-sm); background:#fffdf6; }
.qtdetail { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; position:sticky; top:0; }
.qtdetail__hd { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); background:var(--surface-2); }
.qtdetail__meta { display:grid; grid-template-columns:1fr 1fr; gap:14px 24px; padding:18px 22px; border-bottom:1px solid var(--line); }
.qtdetail__meta > div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.qtdetail__meta span { font-size:11px; color:var(--dim); }
.qtdetail__meta b { font-size:13.5px; font-weight:700; color:var(--ink); }
.qtdetail__meta b.qt-exp { color:var(--danger); }
.qttbl-wrap { padding:6px 14px; min-height:300px; max-height:none; overflow-y:auto; }
/* line-items = the focus of the quotation card */
.qt-items { table-layout:fixed; }
.qt-items thead th { padding:12px 16px; font-size:11.5px; }
.qt-items tbody td { padding:9px 16px; height:48px; font-size:13.5px; vertical-align:middle; }
.qt-items .qt-items__name { white-space:normal; line-height:1.35; text-wrap:pretty; }
.qt-items tbody tr { cursor:default; }
.qt-items tbody tr:hover td { background:var(--surface-2); }
.qttotal { display:flex; align-items:center; justify-content:space-between; padding:14px 22px; border-top:1px solid var(--line); background:var(--surface-2); }
.qttotal span { font-size:13px; font-weight:700; color:var(--ink-2); }
.qttotal b { font-size:24px; font-weight:800; color:var(--navy-800); }
.qtnote { display:flex; align-items:center; gap:7px; padding:10px 22px; font-size:12px; color:var(--ink-2); background:#fbfcfe; border-top:1px solid var(--line); }
.qtactions { display:flex; align-items:center; gap:9px; padding:14px 22px; border-top:1px solid var(--line); flex-wrap:wrap; }
@media (max-width:1180px){ .qtsplit{ grid-template-columns:1fr; } .qtdetail{ position:static; } }

/* ====== AR วางบิล — master/detail (ใช้ .qtsplit เดิม + การ์ดใบวางบิล) ====== */
.billlist { display:flex; flex-direction:column; gap:10px; min-width:0; }
.billlist__hd { display:flex; align-items:baseline; gap:6px; padding:2px 4px 0; font-size:12px; color:var(--dim); }
.billlist__hd b { color:var(--navy-700); font-size:14px; font-weight:800; }
.billlist__hd b.thb { color:var(--navy-800); }
.billlist__rows { display:flex; flex-direction:column; gap:9px; max-height:calc(100vh - 230px); overflow-y:auto; padding:1px 2px 2px; margin:-1px -2px; }
.bcard__top { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.bcard__ref { font-weight:800; color:var(--navy-700); font-size:13px; letter-spacing:.2px; white-space:nowrap; }
.bcard__amt { font-weight:800; color:var(--ink); font-size:14px; white-space:nowrap; }
.bcard__name { margin-top:5px; font-size:13.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bcard__meta { margin-top:8px; display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); }
.bcard__meta .dot { width:3px; height:3px; border-radius:50%; background:var(--line-2); flex:none; }
.bcard__cnt { margin-left:auto; font-size:10.5px; font-weight:700; color:var(--navy-700); background:#eef3fb; border:1px solid #d6e3f5; border-radius:99px; padding:2px 9px; }
.qtcard.is-sel .bcard__cnt { background:#fff; border-color:var(--gold-300); color:var(--gold-600); }
.bcard__cnt--od { color:var(--danger); background:#fdecec; border-color:#f3c9c9; }
/* แถบสัดส่วนอายุหนี้ (ARAging detail + การ์ด) */
.agebar { display:flex; gap:2px; height:11px; border-radius:99px; overflow:hidden; background:var(--surface-3); }
.agebar--mini { height:5px; margin:8px 0 2px; gap:1.5px; }
.agebar__seg { min-width:3px; }
.agebar__seg--ok { background:#3a9d6b; }
.agebar__seg--w1 { background:#e0a92e; }
.agebar__seg--w2 { background:#c2871a; }
.agebar__seg--od { background:var(--danger); }
.agewrap { margin-top:14px; border:1px solid var(--line); border-radius:var(--r-md); padding:15px 16px; background:var(--surface-2); }
.agelist { margin-top:14px; display:flex; flex-direction:column; gap:1px; }
.agelist__row { display:grid; grid-template-columns:14px 1fr auto auto; align-items:center; gap:10px; padding:7px 4px; font-size:13px; border-top:1px solid var(--line); }
.agelist__row:first-child { border-top:0; }
.agedot { width:11px; height:11px; border-radius:3px; }
.agedot--ok { background:#3a9d6b; } .agedot--w1 { background:#e0a92e; } .agedot--w2 { background:#c2871a; } .agedot--od { background:var(--danger); }
.agelist__lb { color:var(--ink-2); }
.agelist__pc { color:var(--dim); font-size:11.5px; min-width:38px; text-align:right; }
.agelist__amt { font-weight:700; min-width:96px; text-align:right; }
/* KPI การ์ดอายุหนี้: แถบสีหัว + แถบ % ที่ฐาน */
.kpi--age { padding-top:20px; }
.kpi--age::before { content:""; position:absolute; left:0; top:0; right:0; height:3px; background:var(--acc); }
.kpi__bar { margin-top:13px; height:6px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.kpi__bar > span { display:block; height:100%; border-radius:99px; min-width:3px; transition:width .4s ease; }
/* แถบสัดส่วนอายุหนี้ย่อในแถวตาราง */
.agebar--row { max-width:180px; margin-top:7px; }
.agebar--row > span { min-width:3px; border-radius:1px; }
.bdt__ref--name { white-space:normal; font-size:17px; line-height:1.25; }
/* รายงานลูกหนี้ค้างชำระ: split บนจอ · ตารางเต็มตอนพิมพ์ */
.arout-print { display:none; }
@media print { .arout-screen { display:none !important; } .arout-print { display:block !important; } }
/* detail header (stacked ref + name on left, status badge on right) */
.qtdetail__hd--bill { align-items:flex-start; }
.qtdetail__hd--bill > div:first-child { min-width:0; }
.bdt__ref { font-size:19px; font-weight:800; color:var(--navy-800); letter-spacing:.3px; white-space:nowrap; }
.bdt__name { margin-top:3px; font-size:13.5px; font-weight:700; color:var(--ink); }
.qtdetail__meta b.warn { color:var(--warn-ink); }
.qtmeta-full { grid-column:1 / -1; }
/* compact 3-col meta for วางบิล detail */
.qtdetail__meta--c3 { grid-template-columns:repeat(3,1fr); gap:10px 20px; padding:13px 22px; }
.qtdetail__meta--c3 > div { gap:1px; }
.qtdetail__meta--c3 span { font-size:10.5px; }
.qtdetail__meta--c3 b { font-size:13px; }
.qtdetail__meta--c3 b.mono { white-space:nowrap; }
.qtdetail__meta--c3 b.qtmeta-addr { white-space:normal; }
.qtdetail__hd--bill { padding-top:15px; padding-bottom:14px; }
.qtmeta-addr { font-weight:600 !important; line-height:1.45; white-space:normal; color:var(--ink-2) !important; }
.qtmeta-tag { margin-left:8px; font-size:10.5px; font-weight:700; color:var(--navy-700); background:#eef3fb; border:1px solid #d6e3f5; border-radius:99px; padding:1px 8px; vertical-align:middle; }
.bdt__cell2 { display:flex; flex-direction:column; gap:1px; line-height:1.25; }
.bdt__empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:72px 30px; text-align:center; color:var(--dim); }
.bdt__empty b { color:var(--ink-2); font-size:14.5px; font-weight:700; }
.bdt__empty span { font-size:12.5px; max-width:240px; line-height:1.55; }
@media (max-width:900px){ .billlist__rows{ max-height:340px; } }

/* ---------- Master-detail ---------- */
.md { display:grid; grid-template-columns: minmax(0,1fr) 440px; gap:20px; align-items:start; }
@media (max-width:1000px){ .md { grid-template-columns:1fr; } }
.md__detail { position:sticky; top:0; }

/* ---------- POS counter layout ---------- */
.pos { display:grid; grid-template-columns: minmax(0,1fr) 416px; gap:20px; height:100%; min-height:0; }
.pos__left { display:flex; flex-direction:column; min-height:0; }
.pos__grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(186px,1fr)); gap:14px; align-content:start; }
.pcard {
  background:var(--surface); border:1px solid var(--line); border-radius: var(--r-lg);
  box-shadow:var(--sh-sm); padding:14px; cursor:pointer; transition: all .14s ease;
  display:flex; flex-direction:column; gap:9px; text-align:left; font-family:var(--ff);
}
.pcard:hover { border-color: var(--gold-400); box-shadow: var(--sh-md); transform: translateY(-2px); }
.pcard__ic { width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:var(--surface-3);color:var(--navy-700); }
.pcard__nm { font-size:13.5px; font-weight:600; line-height:1.3; min-height:35px; }
.pcard__meta { font-size:11px; color:var(--dim); }
.pcard__pr { font-size:16px; font-weight:800; color:var(--navy-700); margin-top:2px; }
.pcard.in-cart { border-color: var(--gold-500); background:#fffdf6; }
.pcard__qty { position:absolute; }

.cartpanel { background:var(--surface); border:1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-md); display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.cartpanel__hd { padding:15px 16px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.cartpanel__cust { padding:13px 16px; border-bottom:1px solid var(--line); cursor:pointer; display:flex; align-items:center; gap:11px; transition: background .12s; }
.cartpanel__cust:hover { background: var(--surface-2); }
.cartpanel__lines { flex:1; min-height:80px; overflow-y:auto; padding: 4px 0; }
.cartpanel__foot { border-top:1px solid var(--line); padding:14px 16px 16px; background: var(--surface-2); }

.cline { display:flex; align-items:center; gap:11px; padding:11px 16px; }
.cline + .cline { border-top:1px solid var(--line); }
.cline__ic { width:38px;height:38px;border-radius:10px;flex:none;display:grid;place-items:center;background:var(--surface-3);color:var(--navy-700); }
.cline__bd { flex:1; min-width:0; }
.cline__nm { font-size:13px; font-weight:600; line-height:1.25; }
.cline__pr { font-size:11.5px; color:var(--dim); margin-top:2px; }

/* payment method tiles (compact, horizontal) */
.paygrid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin: 10px 0 0; }
.paytile { border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-md); padding:10px; cursor:pointer; display:flex; align-items:center; gap:9px; font-family:var(--ff); transition: all .14s; }
.paytile.is-active { border-color: var(--gold-500); background:#fffdf6; }
.paytile.is-dis { opacity:.45; cursor:not-allowed; }
.paytile__ic { width:32px;height:32px;border-radius:9px;flex:none;display:grid;place-items:center;background:var(--surface-3);color:var(--navy-700); }
.paytile.is-active .paytile__ic { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.paytile__t { font-size:12.5px; font-weight:600; line-height:1.1; }

/* ---------- Detail panel pieces ---------- */
.dl { display:flex; flex-direction:column; }
.dl__row { display:flex; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); }
.dl__row:last-child { border-bottom:none; }
.dl__k { font-size:12.5px; color:var(--dim); flex:none; }
.dl__v { font-size:13.5px; font-weight:600; text-align:right; }

.creditbar { height:10px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.creditbar i { display:block; height:100%; border-radius:99px; }

/* file row */
.frow { display:flex; align-items:center; gap:11px; padding:11px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.frow:last-child { border-bottom:none; }
.frow:hover { opacity:.8; }

/* ---------- Delivery: phone preview frame on desktop ---------- */
.devicewrap { display:flex; flex-direction:column; align-items:center; gap:14px; position:sticky; top:0; }
.devicewrap .phone { width: 360px; height: 760px; }
.devicewrap .phone__screen { border-radius: 36px; }
.devicelabel { font-size:12px; color:var(--dim); font-family:"Noto Sans",sans-serif; text-align:center; }
.devicelabel b { color:var(--navy-700); }

/* ---------- Empty state ---------- */
.empty { text-align:center; color:var(--dim); padding: 50px 20px; font-size:13.5px; }

/* ---------- Toast (desktop) ---------- */
.dtoast {
  position:fixed; right:26px; bottom:26px; z-index:200;
  background:var(--navy-900); color:#fff; font-size:13.5px; font-weight:500;
  padding:13px 20px; border-radius:var(--r-md); box-shadow:var(--sh-lg);
  display:flex; align-items:center; gap:11px; animation: pop .26s ease;
}
.dtoast i { color: var(--gold-400); display:flex; }

/* ---------- Modal (desktop center) ---------- */
.dmodal-wrap { position:fixed; inset:0; z-index:180; display:flex; align-items:center; justify-content:center; padding:24px; }
.dmodal-scrim { position:absolute; inset:0; background:rgba(8,20,40,.5); backdrop-filter: blur(3px); animation: fade .2s ease; }
.dmodal { position:relative; background:var(--surface); border-radius:var(--r-xl); box-shadow:var(--sh-lg); width:100%; max-width:440px; max-height:90vh; overflow:hidden; display:flex; flex-direction:column; animation: pop .26s cubic-bezier(.22,1,.36,1); }
.dmodal__bd { overflow-y:auto; }
/* ซ่อน scrollbar ในป๊อปอัป (ยังเลื่อนได้) */
.dmodal, .dmodal *, .dmodal-wrap * { scrollbar-width:none; -ms-overflow-style:none; }
.dmodal ::-webkit-scrollbar, .dmodal-wrap ::-webkit-scrollbar, .dmodal__bd::-webkit-scrollbar { width:0; height:0; display:none; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .pos { grid-template-columns: minmax(0,1fr) 380px; }
  .md { grid-template-columns: minmax(0,1fr) 400px; }
}
@media (max-width: 1080px) {
  .dapp { grid-template-columns: 76px 1fr; }
  .dside { padding:16px 10px; align-items:center; }
  .dside__name, .dside__sub, .dside__tag, .dside__label, .dnav__l, .dnav__badge, .dnav__count, .dside__user .meta, .dside__logouttx { display:none; }
  .dside__brand { justify-content:center; }
  .dnav { justify-content:center; padding:12px; }
  .dside__user { justify-content:center; padding:8px; }
  .pos { grid-template-columns: minmax(0,1fr) 340px; }
  .md { grid-template-columns: 1fr; }
  .md__detail { position:static; }
  .dtop__search { width: 200px; }
}
@media (max-width: 820px) {
  .dgrid-kpi { grid-template-columns: 1fr 1fr; }
  .pos { grid-template-columns: 1fr; }
  .twocol { grid-template-columns: 1fr !important; }
}
@media (max-width: 680px) {
  .dapp { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height:100vh; }
  .dside { display:none; }
  .dtopnav { display:flex; gap:6px; overflow-x:auto; padding:10px 14px; background:linear-gradient(120deg,#0f2244,#0a1730); scrollbar-width:none; }
  .dtopnav::-webkit-scrollbar { display:none; }
  .dtopnav .dnav { width:auto; flex:none; color:#cdd6e6; padding:9px 13px; }
  .dtop { height:auto; padding:12px 16px; flex-wrap:wrap; }
  .dtop__search { width:100%; margin-left:0; order:3; }
  .dcontent { padding:16px 14px 40px; }
  .dgrid-kpi { grid-template-columns: 1fr 1fr; }
}

/* ===== Responsive: tablet/phone — POS stack + wide-table scroll ===== */
@media (max-width: 1024px){
  /* ตารางกว้างเลื่อนแนวนอนได้แทนที่จะดันล้นจอ */
  .dcontent .tbl, .dcontent table.tbl, .dcontent .tbl--dense{ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; white-space:nowrap; }
  .dcontent .tbl thead, .dcontent .tbl tbody, .dcontent .tbl tfoot{ min-width:max-content; }
}
@media (max-width: 900px){
  /* POS: วางซ้อนแนวตั้ง (แคตตาล็อกบน · ตะกร้าล่าง) */
  .pos{ grid-template-columns:1fr; height:auto; }
  .pw__entry{ grid-template-columns:1fr; }
  .pw__billrow{ grid-template-columns:1fr; max-height:none; }
  /* การ์ดสินค้า POS เล็กลงพอดีจอ */
  .pos__grid{ grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
  /* แผงสองคอลัมน์ทั่วไปในแดชบอร์ด → คอลัมน์เดียว */
  .dgrid-2, .md, .dgrid-kpi{ grid-template-columns:1fr 1fr; }
}
@media (max-width: 560px){
  .dgrid-kpi{ grid-template-columns:1fr; }
  .pos__grid{ grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); }
  .dcontent{ padding:12px 10px 40px; }
  .sectitle{ flex-wrap:wrap; gap:10px; }
}

/* ============================================================================
   POS WORKFLOW (modernized KACC9-style bill entry)
   ========================================================================== */
.pw { display:flex; flex-direction:column; height:100%; min-height:0; gap:14px; }

/* sub-tabs + bill meta strip */
.pw__bar { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; }
.pwtabs { display:flex; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:4px; gap:2px; }
.pwtab { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:600; color:var(--dim); padding:8px 15px; border-radius:calc(var(--r-md) - 4px); display:flex; align-items:center; gap:7px; transition:all .14s; }
.pwtab:hover { color:var(--ink-2); }
.pwtab.is-active { background:var(--navy-700); color:#fff; }
.posmc { display:inline-flex; align-items:center; gap:7px; margin-left:auto; flex:none; padding-left:10px; }
.posmc__lbl { font-size:11.5px; font-weight:700; color:var(--ink-2); white-space:nowrap; }
.posmc__sel { font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:700; color:var(--navy-700); padding:6px 10px; border:1px solid var(--gold-400); border-radius:var(--r-sm); background:#fffdf6; cursor:pointer; outline:none; }
.posmc__sel:focus { box-shadow:0 0 0 3px var(--gold-glow); }
@media (max-width:1100px){ .posmc__lbl { display:none; } }
.pwtab__n { font-size:11px; font-weight:800; background:var(--gold-500); color:var(--navy-900); border-radius:99px; padding:0 6px; }
.pwtab.is-active .pwtab__n { background:rgba(255,255,255,.25); color:#fff; }

.keyhint { margin-left:auto; display:flex; gap:7px; flex-wrap:wrap; font-family:"Noto Sans",sans-serif; }
.scanhint { position:relative; display:inline-flex; }
.scanhint__btn { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; color:var(--gold-600); background:var(--surface-2); border:1px solid var(--line); cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.scanhint__btn:hover { background:#fdf4e3; border-color:var(--gold-300,#f0d9a8); }
.scanhint__btn.is-open { background:var(--gold-600); color:#fff; border-color:var(--gold-600); }
.scanhint__pop { position:absolute; top:calc(100% + 6px); right:0; z-index:60; width:max-content; max-width:min(260px,80vw); display:flex; align-items:center; gap:7px; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 30px rgba(18,32,60,.16); padding:9px 13px; font-size:11.5px; color:var(--ink-2); white-space:normal; word-break:break-word; animation:scanhintPop .14s ease; }
@keyframes scanhintPop { from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
.kh { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:var(--dim); }
.kh kbd { font-family:"Noto Sans",sans-serif; font-size:10.5px; font-weight:700; background:var(--surface); border:1px solid var(--line-2); border-bottom-width:2px; border-radius:5px; padding:1px 6px; color:var(--ink-2); }

/* entry grid layout */
.pw__entry { display:grid; grid-template-columns:minmax(0,1fr) 372px; gap:18px; flex:1; min-height:0; }
.pw__entry--browse { display:flex; flex-direction:column; gap:14px; }
.pw__entry--browse > .pw__main { flex:1 1 0; min-height:200px; display:flex; flex-direction:column; }
.pw__entry--browse > .pw__main.pw__main--collapsed { flex:0 0 auto; min-height:0; }
.browsebar { display:flex; align-items:center; gap:11px; padding:9px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); flex:none; }
.pw__main:not(.pw__main--collapsed) .browsebar { border-radius:var(--r-lg) var(--r-lg) 0 0; border-bottom:none; margin-bottom:0; }
.browsebar h3 { color:var(--ink); }
.browsebar .docreg__cnt { font-size:12px; color:var(--dim); font-weight:600; }
.browsebar .colreset { margin-left:auto; }
.browsebar__tg { width:30px; height:30px; flex:none; border-radius:8px; border:1px solid var(--line-2); background:var(--surface-2); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; transition:.14s; }
.browsebar__tg:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.pw__main:not(.pw__main--collapsed) .search2box { border-top-left-radius:0; border-top-right-radius:0; }
.pw__main--collapsed + .pw__billrow { max-height:none; flex:1 1 auto; }
.pw__billrow { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:14px; flex:none; min-height:0; max-height:46%; align-items:stretch; }
.pw__billrow > .billsum { margin-top:52px; } /* align billsum card top with the left bill panel card (.billgrid), clearing the cart header row */
.pw__billrow > .pw__cart .billgrid { flex:none; height:100%; } /* match left bill card height to the right summary sidebar (same top + same height) */
.pw__billrow > .pw__cart, .pw__billrow > .billsum { min-height:0; }
.posreg-fill { flex:1 1 auto !important; height:auto !important; min-height:0; margin-top:12px; resize:none !important; }
.posreg-fill .posbrowse { border:none; border-radius:0; margin-top:0; box-shadow:none; flex:1; }
.pw__main { display:flex; flex-direction:column; min-height:0; }

/* คลัง-style catalog browse table inside POS */
.posbrowse { flex:1; min-height:0; overflow:auto; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface); margin-top:12px; box-shadow:var(--sh-sm); }
.posbrowse table { border-collapse:collapse; table-layout:fixed; }
.posbrowse col { }
.posbrowse td, .posbrowse thead th { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.posbrowse thead th { position:relative; }
.colrz { position:absolute; top:0; right:0; width:9px; height:100%; cursor:col-resize; z-index:3; user-select:none; }
.colrz::after { content:""; position:absolute; top:25%; right:3px; width:2px; height:50%; background:transparent; border-radius:2px; transition:background .12s; }
.colrz:hover::after { background:var(--gold-500); }
.posbrowse thead th { position:sticky; top:0; z-index:2; background:var(--surface-2); text-align:center; font-size:11px; color:var(--dim); font-weight:700; padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
.posbrowse thead th.num { text-align:center; }
.posbrowse__row { cursor:pointer; border-bottom:1px solid var(--line); transition:background .1s; }
.posbrowse__row:hover, .posbrowse__row.is-hi { background:#fdf6e6; }
.posbrowse__row.in-cart { background:rgba(31,138,91,.06); }
.posbrowse__row td { padding:8px 12px; font-size:13px; }
.posbrowse__add { opacity:0; transition:opacity .1s; }
.posbrowse__row:hover .posbrowse__add, .posbrowse__row.is-hi .posbrowse__add { opacity:1; }
.incart-tag { margin-left:8px; font-size:10px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border-radius:99px; padding:1px 8px; }
.posbrowse__empty { text-align:center; color:var(--dim); padding:34px 0; font-size:13px; }
.posbrowse__hd { display:flex; align-items:center; gap:11px; padding:10px 16px; background:var(--surface); border:1px solid var(--line); border-bottom:none; border-radius:var(--r-lg) var(--r-lg) 0 0; margin-top:12px; flex:none; }
.posbrowse__hd h3 { font-size:14.5px; font-weight:700; color:var(--ink); }
.posbrowse__hd .docreg__cnt { font-size:12px; color:var(--dim); font-weight:600; }
.posbrowse__hd .posreg__reset { margin-left:auto; }
.posreg__reset { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-pill); padding:6px 13px; cursor:pointer; transition:.14s; }
.posreg__reset:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.posbrowse__hd + .posbrowse { margin-top:0; border-top-left-radius:0; border-top-right-radius:0; }

/* cart pane (middle) */
.pw__cart { display:flex; flex-direction:column; min-height:0; }
.pw__cart-hd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--navy-800); padding:4px 2px 0; }
.pw__cart-n { font-size:11px; font-weight:700; color:#fff; background:var(--navy-700); border-radius:99px; min-width:20px; text-align:center; padding:2px 9px; }
.pw__cart .billgrid { margin-top:8px; }
/* POS inside a split pane: the cart column is narrower, so compact the action header
   (label + เปิดบิลใหม่/สินค้าบริการ/สินค้าตัดแบ่ง/ของแถม/ค่าบริการ) onto one line so
   "รายการในบิล" doesn't wrap/crowd. Full-screen POS (not in .splitpane) is untouched. */
.splitpane .pw__cart-hd { gap:5px; white-space:nowrap; }
.splitpane .pw__cart-hd .newbill-btn,
.splitpane .pw__cart-hd .svc-btn { padding:5px 10px; font-size:12.5px; gap:4px; }
.splitpane .pw__cart-hd .newbill-btn kbd,
.splitpane .pw__cart-hd .svc-btn kbd { font-size:10.5px; padding:0 4px; }
.splitpane .pw__cart-hd .pw__cart-n { padding:1px 6px; font-size:9.5px; min-width:0; }

/* product search w/ live dropdown */
.psearch { position:relative; }
.psearch__box { display:flex; align-items:center; gap:11px; background:var(--surface); border:1.5px solid var(--navy-600); border-radius:var(--r-md); padding:12px 15px; box-shadow:var(--sh-sm); }
.psearch__box input { flex:1; border:none; background:none; outline:none; font-family:var(--ff); font-size:14.5px; min-width:0; }
.psearch__drop { position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); box-shadow:var(--sh-lg); z-index:30; overflow:hidden; max-height:340px; overflow-y:auto; }
.psearch__opt { display:flex; align-items:center; gap:12px; padding:10px 14px; cursor:pointer; border-bottom:1px solid var(--line); }
.psearch__opt:last-child { border-bottom:none; }
.psearch__opt:hover, .psearch__opt.is-hi { background:#fdf6e6; }
.psearch__code { font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:700; color:var(--navy-700); background:var(--surface-3); border-radius:6px; padding:3px 8px; flex:none; min-width:78px; text-align:center; }

/* quick items */
.qstrip { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.qstrip__lbl { font-size:11.5px; color:var(--dim); font-weight:600; }
.qchip { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:500; padding:7px 12px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; transition:all .14s; }
.qchip:hover { border-color:var(--gold-400); background:#fffdf6; }

/* quick bar: category buttons + dropdowns + favorites */
.qbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.qbtnwrap { position:relative; }
.qcat { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; transition:all .14s; }
.qcat:hover { border-color:var(--gold-400); background:#fffdf6; }
.qcat.is-open { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.qcat--fav { border-color:var(--gold-400); color:var(--gold-600); }
.qcat--fav.is-open { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); border-color:transparent; }
.qdrop { position:absolute; top:calc(100% + 6px); left:0; z-index:45; min-width:280px; max-height:320px; overflow-y:auto; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); box-shadow:var(--sh-lg); padding:5px; }
.qopt { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--r-sm); cursor:pointer; }
.qopt:hover { background:#fdf6e6; }

/* bill line grid */
.billgrid { flex:1; min-height:0; overflow:auto; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface); margin-top:12px; box-shadow:var(--sh-sm); }
.billgrid > .scanbar { position:sticky; top:0; z-index:2; }
.billgrid__empty { min-height:180px; }
.bg-tbl { width:100%; border-collapse:collapse; table-layout:fixed; }
.bg-tbl thead th, .bg-tbl tbody td { padding:8px 8px; }
.bg-tbl .c-code { width:100px; }
.bg-tbl th:nth-child(2), .bg-tbl td:nth-child(2) { width:auto; min-width:150px; }
.bg-tbl th:nth-child(3), .bg-tbl td:nth-child(3) { width:120px; }
.bg-tbl .c-unit { width:64px; }
.bg-tbl th:nth-child(5), .bg-tbl td:nth-child(5) { width:74px; }
.bg-tbl th:nth-child(6), .bg-tbl td:nth-child(6) { width:90px; }
.bg-tbl th:nth-child(7), .bg-tbl td:nth-child(7) { width:104px; }
.bg-tbl .c-x { width:48px; text-align:center; padding-right:12px; }
.bg-tbl td > div:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bg-tbl tbody td { vertical-align:middle; }
.linedisc { width:46px; border:1px solid var(--line-2); border-radius:6px; padding:4px 6px; font-family:"Noto Sans",sans-serif; font-size:12.5px; font-weight:700; text-align:right; color:var(--ink); outline:none; background:var(--surface); }
.linedisc:focus { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); }
.lineamt { width:84px; border:1px solid var(--line-2); border-radius:6px; padding:5px 8px; font-family:"Noto Sans",sans-serif; font-size:13.5px; font-weight:800; text-align:right; color:var(--navy-800); outline:none; background:var(--surface); }
.lineamt:hover { border-color:var(--gold-400); }
.lineamt:focus { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); background:#fffdf6; }
.pickersel { font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink); padding:5px 9px; border:1px solid var(--line-2); border-radius:6px; background:var(--surface); outline:none; cursor:pointer; max-width:170px; }
.pickersel:focus { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); }
.billstaff { margin:0 16px 12px; padding:10px 13px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); display:flex; flex-direction:column; gap:7px; }
.billmeta { margin:0 16px 12px; padding:9px 13px; background:#fbfcfe; border:1px solid var(--line); border-radius:var(--r-md); display:flex; flex-direction:column; gap:6px; }
.billmeta__row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--dim); }
.billmeta__row b { color:var(--navy-700); font-weight:700; }
.tierseg { display:inline-flex; gap:3px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:8px; padding:2px; }
.tierseg__b { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); padding:4px 10px; border-radius:6px; }
.tierseg__b.is-on { background:var(--navy-700); color:#fff; }
.mktseg { display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; max-width:230px; }
.mktseg__b { border:1px solid var(--line-2); background:var(--surface); cursor:pointer; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--ink-2); padding:4px 9px; border-radius:99px; transition:.12s; }
.mktseg__b:hover { border-color:var(--navy-400,#aebfdb); }
.taxtype-opt { display:flex; align-items:center; gap:12px; width:100%; padding:13px 14px; border:1.5px solid var(--line-2); border-radius:var(--r-md); background:var(--surface); cursor:pointer; transition:.12s; }
.taxtype-opt:hover { border-color:var(--gold-400); background:#fffdf6; }
.taxtype-opt__ic { width:38px; height:38px; flex:none; border-radius:10px; display:grid; place-items:center; }
.doctype-tg { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-2); background:var(--surface); border-radius:var(--r-pill); padding:4px 11px 4px 9px; cursor:pointer; font-family:var(--ff); }
.doctype-tg:hover { border-color:var(--gold-400); background:#fffdf6; }
.doctype-tg b { font-size:12.5px; }
.mktdrop { font-family:var(--ff); font-size:12.5px; font-weight:700; padding:5px 10px; border:1.5px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); cursor:pointer; outline:none; max-width:150px; }
.mktref { font-family:"Noto Sans",sans-serif; font-size:12.5px; font-weight:600; color:var(--ink); padding:5px 10px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); outline:none; max-width:160px; text-align:right; }
.mktref:focus { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); }
.customline-btn { display:flex; align-items:center; justify-content:center; gap:6px; width:calc(100% - 24px); margin:0 12px 12px; padding:8px; border:1px dashed var(--line-2); border-radius:var(--r-sm); background:var(--surface); color:var(--navy-600); font-family:var(--ff); font-size:12px; font-weight:600; cursor:pointer; }
.customline-btn:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.custhist { margin:0 16px 12px; padding:10px 13px; background:#fbfcfe; border:1px solid var(--line); border-radius:var(--r-md); }
.custhist__hd { display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; color:var(--navy-700); margin-bottom:7px; }
.custhist__list { display:flex; flex-direction:column; gap:5px; }
.custhist__row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; }
.custhist__nm { color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.custhist__pr { color:var(--navy-700); font-weight:700; flex:none; }
.creditinfo { margin:0 16px 12px; padding:9px 13px; background:var(--info-bg); border:1px solid #b9d3ee; border-radius:var(--r-md); display:flex; flex-direction:column; gap:5px; }
.creditinfo__row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; color:var(--ink-2); }
.creditinfo__row span { display:inline-flex; align-items:center; gap:5px; }
.creditinfo__row--rem { border-top:1px dashed #b9d3ee; padding-top:5px; margin-top:1px; font-weight:700; }
.shiftden { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.shiftden__row { display:flex; align-items:center; gap:7px; }
.shiftden__d { font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:700; color:var(--ink-2); width:52px; flex:none; }
.shiftden__in { width:62px; flex:none; border:1px solid var(--line-2); border-radius:6px; padding:6px 8px; font-family:"Noto Sans",sans-serif; font-size:12.5px; text-align:right; outline:none; }
.shiftden__in:focus { border-color:var(--gold-500); }
.shiftden__sub { flex:1; text-align:right; font-size:11.5px; color:var(--dim); font-weight:600; }
/* รายการสินค้าไม่มีรหัส modal */
.nocode__hd { display:flex; align-items:center; gap:12px; padding:15px 18px; background:linear-gradient(120deg,#16294f,#0e1f3f); }
.nocode__ic { width:40px; height:40px; flex:none; border-radius:11px; background:rgba(255,255,255,.12); display:grid; place-items:center; }
.nocode__x { width:30px; height:30px; flex:none; border-radius:8px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.08); color:#fff; display:grid; place-items:center; cursor:pointer; }
.nocode__x:hover { background:rgba(255,255,255,.18); }
.nocode__qty { display:flex; align-items:center; border:1px solid var(--line-2); border-radius:var(--r-sm); overflow:hidden; height:42px; }
.nocode__qty button { width:38px; flex:none; height:100%; border:none; background:var(--surface-2); color:var(--navy-700); font-size:18px; font-weight:700; cursor:pointer; }
.nocode__qty button:hover { background:var(--surface-3); }
.nocode__qty input { flex:1; min-width:0; width:100%; border:none; outline:none; text-align:center; font-family:"Noto Sans",sans-serif; font-size:15px; font-weight:700; -moz-appearance:textfield; }
.nocode__qty input::-webkit-outer-spin-button, .nocode__qty input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.nocode__total { display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding:12px 15px; background:#fdf6e6; border:1px solid #ecd9a6; border-radius:var(--r-md); }
.nocode__total span { font-size:13px; font-weight:700; color:var(--ink-2); }
.nocode__total b { font-size:21px; font-weight:800; color:var(--navy-800); }
.nocode__body { display:flex; align-items:stretch; min-height:0; }
.nocode__form { flex:1; min-width:0; padding:18px 20px 20px; }
.nocode__addmore { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; margin-top:8px; padding:10px; border:1.5px dashed var(--gold-400); border-radius:var(--r-sm); background:#fffdf6; color:var(--gold-600); font-family:var(--ff); font-size:13px; font-weight:700; cursor:pointer; transition:.12s; }
.nocode__addmore:hover:not(:disabled) { background:#fdf0d6; }
.nocode__addmore:disabled { opacity:.4; cursor:not-allowed; }
.nocode__hint { display:flex; align-items:flex-start; gap:7px; margin-top:12px; font-size:11.5px; line-height:1.5; color:var(--dim); }
.nocode__hint b { color:var(--navy-700); font-weight:700; }
.nocode__list { width:280px; flex:none; border-left:1px solid var(--line); background:var(--surface-2); display:flex; flex-direction:column; }
.nocode__list-hd { display:flex; align-items:center; gap:6px; padding:14px 16px 10px; font-size:12.5px; font-weight:700; color:var(--ink-2); }
.nocode__list-hd b { color:var(--ok-ink); }
.nocode__list-body { flex:1; overflow-y:auto; padding:0 12px; display:flex; flex-direction:column; gap:7px; max-height:340px; }
.nocode__list-row { display:flex; align-items:center; gap:9px; padding:9px 11px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); }
.nocode__list-n { width:20px; height:20px; flex:none; border-radius:6px; background:var(--navy-700); color:#fff; font-size:11px; font-weight:800; display:grid; place-items:center; }
.nocode__list-nm { font-size:12.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nocode__list-sub { font-size:10.5px; color:var(--dim); }
.nocode__list-ft { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-top:1px solid var(--line); font-size:13px; font-weight:700; color:var(--ink-2); }
.nocode__list-ft b { font-size:16px; color:var(--navy-800); }
.svc-btn { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; border:1px solid var(--line-2); background:var(--surface); color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; padding:6px 13px; border-radius:var(--r-pill); cursor:pointer; line-height:1.4; }
.svc-btn kbd, .newbill-btn kbd { font-family:"Noto Sans",sans-serif; font-size:9.5px; background:var(--surface-3); border-radius:4px; padding:1px 5px; color:var(--ink-2); margin-left:2px; }
.svc-btn:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.svc__types { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.svc__type { display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:13px 14px; border:1.5px solid var(--line-2); border-radius:var(--r-md); background:var(--surface); cursor:pointer; font-family:var(--ff); text-align:left; transition:.12s; }
.svc__type:hover { border-color:var(--gold-400); }
.svc__type.is-on { border-color:var(--gold-500); background:#fffdf6; }
.svc__type-l { font-size:13.5px; font-weight:700; color:var(--ink); margin-top:4px; }
.svc__type-h { font-size:10.5px; color:var(--dim); }
.nocode__match { position:absolute; left:0; right:0; top:100%; margin-top:4px; z-index:5; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-sm); box-shadow:var(--sh-md); overflow:hidden; }
.nocode__match-row { display:flex; align-items:center; gap:9px; width:100%; padding:9px 12px; border:none; border-bottom:1px solid var(--line); background:var(--surface); cursor:pointer; font-family:var(--ff); text-align:left; }
.nocode__match-row:last-child { border-bottom:none; }
.nocode__match-row:hover { background:#fffdf6; }
.pcode__opt { display:flex; align-items:center; gap:11px; width:100%; padding:10px 13px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); cursor:pointer; font-family:var(--ff); text-align:left; transition:.12s; }
.pcode__opt:hover { border-color:var(--gold-400); background:#fffdf6; }
.pickline { display:flex; align-items:center; gap:9px; padding:7px 9px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); }
.pickline--ok { background:var(--ok-bg); border-color:#a7d7bd; }
.pickline--short { background:var(--warn-bg); border-color:#e6cd97; }
.pickline__ck { width:20px; height:20px; flex:none; border-radius:6px; border:1.5px solid var(--line-2); background:var(--surface); cursor:pointer; display:grid; place-items:center; }
.pickline--ok .pickline__ck { background:var(--ok); border-color:var(--ok); }
.pickline__short { flex:none; border:1px solid var(--line-2); background:var(--surface); color:var(--dim); font-family:var(--ff); font-size:10.5px; font-weight:700; padding:4px 9px; border-radius:var(--r-pill); cursor:pointer; }
.pickline__short:hover { border-color:#e6cd97; color:var(--warn-ink); }
/* pick line — reflect mobile picker: number chips (เบอร์แท้เด่น) + scan/manual tags */
.numchip { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; color:var(--dim); background:var(--surface-2,#f4f6f9); border:1px solid var(--line); border-radius:6px; padding:1px 7px; line-height:1.5; }
.numchip b { color:var(--navy-700); font-family:"Noto Sans",var(--ff); letter-spacing:.2px; font-weight:800; }
.numchip--oem { background:#eef3ff; border-color:#c9d8f5; color:var(--navy-600); }
.numchip--oem b { color:var(--navy-800); }
.pktag { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:800; padding:2px 7px; border-radius:99px; line-height:1.4; white-space:nowrap; }
.pktag--scan { background:#eef3ff; color:var(--info-ink,#1d4ed8); }
.pktag--man { background:var(--warn-bg); color:var(--warn-ink); }
.pickline__short.is-on { background:var(--warn-bg); border-color:#e6cd97; color:var(--warn-ink); }
.orderflow { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 16px; background:var(--surface-2); border-bottom:1px solid var(--line); }
.orderflow__s { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; color:var(--dim); }
.orderflow__s b, .orderflow__s svg { display:inline-grid; place-items:center; width:16px; height:16px; border-radius:50%; background:var(--line-2); color:var(--dim); font-size:9px; font-weight:800; flex:none; }
.orderflow__s.is-done { color:var(--ok-ink); }
.orderflow__s.is-done b, .orderflow__s.is-done svg { background:var(--ok); color:#fff; }
.orderflow__s.is-now { color:var(--navy-700); font-weight:800; }
.orderflow__s.is-now b { background:var(--gold-500); color:var(--navy-900); }
.orderflow__arr { color:var(--line-2); font-size:11px; }
.pickcols { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.pickcol { display:flex; flex-direction:column; gap:12px; min-width:0; }
.pickcol__hd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:800; color:var(--navy-800); padding:8px 12px; border-radius:var(--r-md); }
.pickcol__hd--shop { background:#eef4fb; color:var(--info-ink); }
.pickcol__hd--deliv { background:#f3eefb; color:#5b3a9e; }
.pickcol__n { margin-left:auto; min-width:20px; text-align:center; background:var(--navy-700); color:#fff; border-radius:99px; font-size:11px; padding:1px 8px; }
.pickcol__empty { text-align:center; color:var(--dim); font-size:12.5px; padding:24px; border:1px dashed var(--line-2); border-radius:var(--r-md); }
@media (max-width:880px){ .pickcols{ grid-template-columns:1fr; } }
.billstaff__row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--dim); }
.billstaff__row b { color:var(--ink); font-weight:700; }
.billstaff__row .pickersel { max-width:150px; }
.bg-tbl thead th { position:sticky; top:0; background:var(--surface-2); z-index:2; text-align:center; font-size:11px; color:var(--dim); font-weight:700; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; text-transform:uppercase; letter-spacing:.4px; font-family:"Noto Sans",sans-serif; }
.bg-tbl thead th:nth-child(1), .bg-tbl thead th:nth-child(2) { text-align:left; }
.bg-tbl tbody td { padding:9px 12px; border-bottom:1px solid var(--line); font-size:13px; vertical-align:middle; }
.bg-tbl tbody tr:hover td { background:var(--surface-2); }
.bg-tbl .c-code { font-family:"Noto Sans",sans-serif; font-size:11.5px; color:var(--navy-700); font-weight:700; white-space:nowrap; }
.bg-tbl .c-num { text-align:right; white-space:nowrap; }
.bg-tbl .c-unit { text-align:center; }
.bg-tbl .c-x { text-align:center; }
.bg-x { border:none; background:none; cursor:pointer; color:var(--line-2); display:inline-grid; place-items:center; padding:3px; border-radius:6px; }
.bg-x:hover { color:var(--danger); background:var(--danger-bg); }
.bg-row--sel td { background:#fdf6e6; }
.bg-row--sel td:first-child { box-shadow:inset 3px 0 0 var(--gold-500); }
.newbill-btn { margin-left:auto; display:inline-flex; align-items:center; gap:5px; white-space:nowrap; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); background:var(--surface); border:1px solid var(--line-2); padding:6px 13px; border-radius:var(--r-pill); cursor:pointer; line-height:1.4; }
.newbill-btn:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.newbill-btn kbd { font-family:"Noto Sans",sans-serif; font-size:9.5px; background:var(--surface-3); border-radius:4px; padding:1px 5px; color:var(--ink-2); }
.cardfee__row { display:flex; align-items:center; justify-content:space-between; padding:9px 13px; font-size:12.5px; color:var(--ink-2); border-bottom:1px solid var(--line); }
.cardfee__row b { font-weight:700; color:var(--ink); }
.cardfee__row--tot { background:var(--surface-2); border-bottom:none; font-weight:800; }
.cardfee__row--tot span { font-weight:800; color:var(--navy-800); }
.cardfee__row--tot b { color:var(--navy-800); font-size:15px; }
.billgrid__empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; min-height:180px; color:var(--dim); text-align:center; padding:30px; }

/* summary panel */
.billsum { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-md); display:flex; flex-direction:column; min-height:0; overflow:hidden; align-self:start; max-height:100%; }
.billsum__hd { padding:13px 16px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.billsum__cust { padding:13px 16px; border-bottom:1px solid var(--line); cursor:pointer; display:flex; align-items:center; gap:11px; transition:background .12s; }
.billsum__cust:hover { background:var(--surface-2); }
.billsum__bd { padding:14px 16px; overflow-y:auto; flex:1 1 auto; min-height:0; }
.billsum__foot { border-top:1px solid var(--line); padding:14px 16px 16px; background:var(--surface-2); flex:none; }
.sumrow { display:flex; justify-content:space-between; align-items:center; font-size:13px; padding:5px 0; color:var(--ink-2); }
.disc-input { width:104px; border:1px solid var(--line-2); border-radius:8px; padding:6px 10px; font-family:var(--ff); font-size:13px; text-align:right; outline:none; }
.disc-input:focus { border-color:var(--gold-500); }

/* ⭐ ขายหน้าร้าน (POS) — ขยายขนาดตัวอักษรขึ้น ~1px เพื่ออ่านง่ายขึ้น
   โดยไม่ขยับ layout/UI/UX (กล่องยืดหยุ่น/เลื่อนได้อยู่แล้ว ขนาดเล็กน้อยจึงไม่ดัน) */
.pwtab { font-size:14.5px; }
.pcard__nm { font-size:14.5px; }
.pcard__meta { font-size:12px; }
.pcard__pr { font-size:17px; }
.posbrowse__row td { font-size:14px; }
.posbrowse thead th { font-size:12px; }
.posbrowse__hd h3 { font-size:15.5px; }
.pw__cart-hd { font-size:14px; }
.bg-tbl tbody td { font-size:14px; }
.bg-tbl thead th { font-size:12px; }
.bg-tbl .c-code { font-size:12.5px; }
.linedisc { font-size:13.5px; }
.sumrow { font-size:14px; }
.grandbox__row { font-size:13.5px; }
.grandbox__row b { font-size:16px; }
.grandbox__sub { font-size:13px; }

/* document view (bill detail / receipt) */
.docview { max-width:1280px; }
.bd-items thead th { padding-top:12px; padding-bottom:12px; }
.bd-items tbody td { height:50px; padding-top:11px; padding-bottom:11px; vertical-align:middle; }
.bd-items .cell-main { text-wrap:pretty; }
.docpaper { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.docpaper__hd { padding:20px 24px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; }

@media (max-width: 1280px) {
  .pw__entry--browse { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) 320px; }
}
@media (max-width: 1080px) {
  .pw__entry { grid-template-columns:minmax(0,1fr) 320px; }
  .pw__entry--browse { grid-template-columns:minmax(0,1fr) 320px; }
  .pw__entry--browse .pw__cart { grid-column:1; }
}
@media (max-width: 860px) {
  .pw__entry { grid-template-columns:1fr; }
  .pw__entry--browse { grid-template-columns:1fr; }
  .pw__billrow { grid-template-columns:1fr; }
  .pw__billrow > .billsum { margin-top:12px; } /* stacked: no need to clear a side-by-side header */
  .billsum { max-height:none; }
  .keyhint { display:none; }
}

/* ---------- document sub-tabs (สมุดขาย/สมุดซื้อ) ---------- */
.doctabs { display:flex; align-items:center; gap:2px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:4px; }
.doctab { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:600; color:var(--dim); padding:8px 14px; border-radius:calc(var(--r-md) - 4px); display:inline-flex; align-items:center; gap:7px; transition:all .14s; white-space:nowrap; }
.doctab:hover { background:var(--surface-2); color:var(--ink-2); }
.doctab.is-active { background:linear-gradient(120deg,#16294f,#0e1f3f); color:#fff; }
.doctab__n { font-size:10.5px; font-weight:800; background:var(--surface-3); color:var(--navy-700); border-radius:99px; padding:0 6px; }
.doctab.is-active .doctab__n { background:rgba(255,255,255,.2); color:#fff; }

/* ---------- sidebar nav groups ---------- */
.dside__group { font-size:9.5px; letter-spacing:1.4px; text-transform:uppercase; color:#62739a; font-weight:700; padding:14px 12px 5px; font-family:"Noto Sans",sans-serif; }

/* ---------- global search dropdown ---------- */
.gsearch { position:relative; margin-left:auto; }
.gsearch .dtop__search { margin-left:0; }
.gsearch__drop { position:absolute; top:calc(100% + 8px); right:0; width:380px; max-height:64vh; overflow-y:auto; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); box-shadow:var(--sh-lg); z-index:120; padding:6px; }
.gsearch__opt { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:var(--r-sm); cursor:pointer; }
.gsearch__opt:hover, .gsearch__opt.is-hi { background:#fdf6e6; }
.gsearch__ic { width:34px; height:34px; border-radius:9px; flex:none; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.gsearch__ref { font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:700; color:var(--navy-800); }
.gsearch__sub { font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gsearch__empty { padding:18px; text-align:center; color:var(--dim); font-size:12.5px; }
@media (max-width: 680px) {
  .gsearch__drop { width:calc(100vw - 32px); right:auto; left:0; }
  .doctabs { overflow-x:auto; flex-wrap:nowrap; }
}

/* ============================================================================
   DOCUMENT WORKBENCH (KACC9-style: nav + list + form + items + totals)
   ========================================================================== */
.bookbar { display:flex; flex-direction:column; gap:10px; flex:none; }
.bookbar__row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bookbar__lbl { font-size:11.5px; font-weight:700; color:var(--ink-2); display:inline-flex; align-items:center; gap:6px; }
.bookbar__dates { display:flex; gap:6px; overflow-x:auto; }
.bookdate { flex:none; font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:600; padding:6px 11px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; transition:all .14s; }
.bookdate.is-active { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.bookvol { font-family:var(--ff); font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:var(--r-sm); border:1px solid var(--line-2); background:var(--surface); color:var(--ink); cursor:pointer; outline:none; }

.wbsplit { flex:1; min-height:0; display:flex; flex-direction:column; gap:14px; margin-top:0; }

/* register list (top) */
.docreg { flex:none; height:232px; min-height:120px; max-height:70vh; resize:vertical; display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.docreg__hd { display:flex; align-items:center; gap:10px; padding:10px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.docreg__hd h3 { font-size:14.5px; font-weight:700; }
.docreg--collapsed { height:auto !important; min-height:0; flex:none; resize:none; }
.partsplit-v .partlist-top.docreg--collapsed { flex:0 0 auto !important; min-height:0 !important; height:auto !important; }
.partsplit-v .partdetail-b { min-height:0; overflow:auto; }
.docreg--collapsed .docreg__hd { border-bottom:none; }
.docreg__tg { width:30px; height:30px; flex:none; border-radius:8px; border:1px solid var(--line-2); background:var(--surface-2); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; }
.docreg__tg:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.docreg__cnt { font-size:12px; color:var(--dim); }
.colreset { margin-left:auto; display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11.5px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:5px 11px; cursor:pointer; transition:background .12s, border-color .12s; }
.colreset:hover { background:var(--surface-3,#eef1f6); border-color:var(--navy-300,#9fb3d4); }
.colreset:active { transform:scale(.97); }
.docreg__search { margin-left:auto; padding:7px 12px; width:240px; }
.docreg__search input { font-size:12.5px; }
.docreg__tbl { overflow:auto; flex:1; }
.docreg__tbl .tbl thead th { position:sticky; top:0; background:var(--surface-2); z-index:1; }
.tbl--dense thead th { padding:7px 14px; }
/* detail tab row with action buttons on the right */
.doctabs--wact { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; }
.doctabs--wact .doctabs__tabs { display:flex; gap:6px; flex-wrap:wrap; flex:1; min-width:0; }
.partacts { display:flex; gap:7px; flex:none; margin-left:auto; }
/* match action buttons to the sub-tab size */
.partacts .btn--sm { padding:6px 12px; font-size:12.5px; }
.partacts .btn--sm svg { width:15px; height:15px; }
.tbl--dense tbody td { padding:6px 14px; font-size:12.5px; }
/* resizable list columns */
.tbl--resize { table-layout:fixed; }
.tbl--resize th, .tbl--resize td { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tbl--resize th { position:relative; }
.colresize { position:absolute; top:0; right:-3px; width:8px; height:100%; cursor:col-resize; z-index:2; }
.colresize::after { content:""; position:absolute; top:25%; right:3px; width:2px; height:50%; background:var(--line-2); border-radius:2px; opacity:0; transition:opacity .12s; }
.tbl--resize th:hover .colresize::after, .colresize:hover::after { opacity:1; }
.colresize:hover::after { background:var(--navy-600); }
/* sortable headers */
.tbl--resize thead th { cursor:pointer; user-select:none; }
.tbl--resize thead th, .tbl--resize thead th.num { text-align:center; }
.tbl--resize thead th .colresize { text-align:left; }
.tbl--resize thead th:hover { color:var(--navy-700); background:var(--surface-3); }
.tbl--resize thead th.is-sorted { color:var(--navy-700); }
.sortcaret { font-size:8px; margin-left:4px; color:var(--navy-600); vertical-align:middle; }
.tbl--resize thead th.num .sortcaret { margin-left:3px; }

/* workbench (below) */
.wbdoc { flex:1; min-height:0; overflow:auto; }
.wbdoc__in { display:flex; flex-direction:column; gap:10px; }

/* header card — modern grouped */
.wbh { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.wbh__hero { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:9px 18px; background:linear-gradient(120deg,#16294f,#0d1d3c); color:#fff; }
.wbh__heroL { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; min-width:0; }
.wbh__type { font-size:10.5px; letter-spacing:.5px; color:var(--gold-400); font-weight:700; flex-basis:100%; }
.wbh__no { font-family:"Noto Sans",sans-serif; font-size:18px; font-weight:800; letter-spacing:.5px; line-height:1.1; }
.wbh__date { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:#9fb0cd; }
.wbh__heroR { display:flex; flex-direction:row; align-items:center; gap:10px; flex:none; }
.wbh__paybox { display:flex; flex-direction:row; align-items:center; gap:8px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); border-radius:var(--r-md); padding:5px 10px; }
.wbh__payboxL { font-size:9px; letter-spacing:.4px; color:#9fb0cd; font-weight:600; text-transform:uppercase; }
.wbh__pay { display:flex; gap:4px; }
.wbh__paychip { font-size:11px; font-weight:600; padding:4px 11px; border-radius:var(--r-pill); border:1px solid rgba(255,255,255,.2); color:rgba(255,255,255,.6); }
.wbh__paychip.is-on { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); border-color:transparent; font-weight:700; }
.wbh__paysub { display:flex; gap:4px; padding-left:8px; margin-left:1px; border-left:1px solid rgba(255,255,255,.12); }
.wbh__paysubchip { font-size:10px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill); border:1px solid rgba(255,255,255,.15); color:rgba(255,255,255,.55); }
.wbh__paysubchip.is-on { background:rgba(255,255,255,.18); color:#fff; }
.wbh__cols { display:grid; grid-template-columns:1.1fr 1.3fr 1fr; }
.wbh__col { padding:13px 18px; border-right:1px solid var(--line); display:flex; flex-direction:column; }
.wbh__colbody { flex:1; display:flex; flex-direction:column; justify-content:flex-start; gap:1px; }
.wbh__party { height:51px; overflow:hidden; }
.wbh__col:last-child { border-right:none; }
.wbh__colhd { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; color:var(--navy-700); letter-spacing:.3px; margin-bottom:9px; padding-bottom:7px; border-bottom:1px solid var(--line); text-transform:uppercase; }
.wbh__nm { font-size:14.5px; font-weight:800; color:var(--ink); height:26px; line-height:26px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wbh__addr { font-size:11.5px; color:var(--dim); height:24px; line-height:24px; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wbh__kv { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:12px; min-height:25px; padding:2px 0; }
.wbh__kvsep { height:0; border-top:1px dashed var(--line-2); margin:6px 0; }
.wbh__kv span { color:var(--dim); flex:none; }
.wbh__kv b { color:var(--ink); font-weight:700; text-align:right; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wbh__link { color:var(--navy-600) !important; cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
.wbh__link:hover { color:var(--gold-600) !important; }
@media (max-width:980px){ .wbh__cols { grid-template-columns:1fr 1fr; } .wbh__col:nth-child(2){ border-right:none; } .wbh__col:last-child{ grid-column:1/-1; border-top:1px solid var(--line); } }
.wb-head { background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); box-shadow:var(--sh-sm); padding:0; overflow:hidden; }
.wb-head__top { display:flex; align-items:center; gap:14px; padding:9px 14px; margin-bottom:0; border-bottom:1px solid var(--line-2); background:var(--surface-2); }
.wb-head__type { font-size:10.5px; color:var(--dim); font-weight:600; }
.wb-head__no { font-family:"Noto Sans",sans-serif; font-size:17px; font-weight:800; color:var(--navy-800); letter-spacing:.3px; }
.paychips { display:flex; gap:6px; margin-left:auto; }
.paychip { font-size:11.5px; font-weight:600; padding:5px 12px; border-radius:var(--r-pill); border:1px solid var(--line-2); color:var(--dim); background:var(--surface); }
.paychip.is-active { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); border-color:transparent; box-shadow:var(--sh-gold); }

.wbgrid { display:grid; grid-template-columns:repeat(4,1fr); gap:0; }
.wbf { display:flex; align-items:baseline; gap:7px; min-width:0; line-height:1.3; padding:6px 12px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.wbf:nth-child(4n){ border-right:none; }
.wbf--full { grid-column:1 / -1; border-right:none; }
.wbf__l { font-size:10.5px; color:var(--dim); font-family:var(--ff); flex:none; width:62px; text-align:right; }
.wbf--full .wbf__l { width:62px; }
.wbf__v { font-size:12.5px; font-weight:700; color:var(--ink); display:inline-flex; align-items:center; gap:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wb-paysub { display:flex; align-items:center; gap:7px; padding:7px 14px; border-bottom:1px solid var(--line-2); background:#fbfcfe; }
.wb-paysub__l { font-size:10.5px; color:var(--dim); font-family:var(--ff); margin-right:3px; }
.paychip--sm { font-size:11px; padding:3px 11px; }
.wbf__l { font-size:10.5px; color:var(--dim); font-family:var(--ff); flex:none; width:84px; text-align:right; }
.wbf--full .wbf__l { width:84px; }
.wbgrid { display:grid; grid-template-columns:repeat(4,1fr); gap:0; }
.wbf:nth-child(4n){ border-right:none; }

/* body — KACC9 vertical flow */
.wb-body { display:flex; flex-direction:column; gap:14px; align-items:stretch; }
.wb-items { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.wb-items__hd { display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid var(--line); font-size:13.5px; font-weight:700; color:var(--ink-2); }
.wb-items__scroll { overflow-x:auto; }
.itbl { width:100%; min-width:680px; }
.itbl thead th { font-size:10.5px; padding:9px 11px; background:var(--surface-2); position:sticky; top:0; }
.itbl tbody td { padding:9px 11px; font-size:12.5px; }
.itbl__ed { border:1px solid var(--gold-400); border-radius:6px; padding:4px 7px; font-family:var(--ff); font-size:12.5px; background:#fffdf6; outline:none; }
.itbl__ed.num { font-family:"Noto Sans",sans-serif; text-align:right; }
.itbl__ed:focus { box-shadow:0 0 0 2px var(--gold-glow); }
.wbh__editnm { border:1px solid var(--gold-400); border-radius:6px; padding:4px 9px; font-family:var(--ff); font-size:15px; font-weight:700; background:#fffdf6; outline:none; width:100%; }
.wbh__kvin { border:1px solid var(--gold-400); border-radius:5px; padding:2px 7px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink); background:#fffdf6; outline:none; max-width:150px; text-align:right; }
.wbh__kvin.mono { font-family:"Noto Sans",sans-serif; }
select.wbh__kvin { cursor:pointer; max-width:170px; text-align:left; }
.wbh__kvin:focus { box-shadow:0 0 0 2px var(--gold-glow); }
.wbh__editdate { border:1px solid rgba(255,255,255,.4); border-radius:5px; padding:1px 6px; font-family:var(--ff); font-size:12px; background:rgba(255,255,255,.12); color:#fff; outline:none; width:120px; }
.wb-itembar { display:flex; align-items:center; justify-content:space-between; gap:14px; border-top:1px dashed var(--line-2); padding:8px 12px; background:var(--surface-2); }
.wb-itembar__tax { display:flex; align-items:center; gap:9px; }
.wb-additem { border:1px solid var(--line-2); border-radius:var(--r-pill); background:var(--surface); color:var(--navy-600); font-family:var(--ff); font-weight:600; font-size:12.5px; padding:7px 14px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.wb-additem:hover { background:#fffdf6; border-color:var(--gold-400); color:var(--gold-600); }

/* totals + payment — KACC9 bottom band */
.wb-foot { display:grid; grid-template-columns:minmax(0,1fr) 280px 300px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.wb-foot__col { padding:14px 18px; }
.wb-foot__col + .wb-foot__col { border-left:1px solid var(--line); }
.wb-foot__note { font-size:12.5px; color:var(--ink-2); line-height:1.5; margin:6px 0 14px; min-height:38px; white-space:normal; overflow-wrap:anywhere; }
.wb-foot__taxopt { display:flex; align-items:center; gap:9px; }
.wb-paysel { width:100%; height:32px; border:1px solid var(--line-2); border-radius:7px; padding:0 8px; font-family:var(--ff); font-size:12px; color:var(--ink); background:#fff; outline:none; }
.wb-paysel:focus { border-color:var(--gold-400); }
.wb-pf { display:flex; flex-direction:column; gap:4px; min-width:0; }
.wb-pf > span { font-size:10.5px; color:var(--dim); font-weight:600; }
.wb-pf > input { height:32px; border:1px solid var(--line-2); border-radius:7px; padding:0 9px; font-family:var(--ff); font-size:12px; color:var(--ink); background:#fff; outline:none; width:100%; box-sizing:border-box; }
.wb-pf > input:focus { border-color:var(--gold-400); }
.wb-foot__taxlbl { font-size:11.5px; color:var(--dim); font-weight:600; }
.taxseg { display:inline-flex; gap:3px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:8px; padding:3px; }
.taxseg__b { font-size:11.5px; font-weight:600; color:var(--ink-2); padding:5px 13px; border-radius:6px; cursor:pointer; }
.taxseg__b.is-on { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); font-weight:700; }
.wb-paytype { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:4px; }
.wb-paydetail { margin-top:9px; padding:9px 11px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); width:fit-content; max-width:100%; }
.wb-paydetail__grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; align-items:end; }
.wb-paydetail__grid--2 { grid-template-columns:repeat(2,1fr); max-width:340px; }
.wb-paydetail__grid--3 { grid-template-columns:repeat(3,1fr); max-width:520px; }
.wb-paydetail__grid--4 { grid-template-columns:1.1fr 1fr 1.2fr auto; max-width:620px; }
.wb-paydetail label { display:flex; flex-direction:column; gap:3px; }
.wb-paydetail label span { font-size:10px; color:var(--dim); }
.wb-paydetail__grid--4 .wb-slipbtn { height:33px; }
.wb-paydetail__grid label { display:flex; flex-direction:column; gap:4px; font-size:10.5px; color:var(--dim); font-weight:600; }
.wb-paydetail__grid input { border:1px solid var(--line-2); border-radius:6px; padding:7px 9px; font-family:var(--ff); font-size:12.5px; color:var(--ink); outline:none; background:var(--surface); }
.wb-paydetail__grid input:focus { border-color:var(--gold-500); }
.wb-paydetail__slip { justify-content:flex-end; }
.wb-slipbtn { display:inline-flex; align-items:center; gap:6px; border:1px dashed var(--line-2); border-radius:6px; padding:6px 10px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-600); background:var(--surface); cursor:pointer; }
.wb-slipbtn:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.wb-foot__ct { font-size:11.5px; font-weight:700; color:var(--dim); margin-bottom:7px; }
.wb-foot__tot { background:var(--surface-2); }
.wb-tot { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:16px; position:sticky; top:0; }
.totrow { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--ink-2); padding:5px 0; }
.totnet { display:flex; justify-content:space-between; align-items:baseline; gap:10px; border-top:1px dashed var(--line-2); margin-top:8px; padding-top:10px; }
.totnet span:first-child { font-size:13px; font-weight:700; }
.totnet span:last-child { font-size:19px; font-weight:800; color:var(--navy-800); }
.paybox { margin-top:14px; padding:13px; background:var(--surface-2); border-radius:var(--r-md); }
.paybox__t { font-size:11.5px; font-weight:700; color:var(--dim); margin-bottom:6px; }
.payrow { display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--ink-2); padding:4px 0; }
.payrow span:first-child { display:inline-flex; align-items:center; gap:6px; }
.payrow--out { border-top:1px solid var(--line); margin-top:5px; padding-top:8px; font-weight:700; }
.payrow--out.is-due span:last-child { color:var(--danger); }
.wb-note { margin-top:12px; font-size:12px; color:var(--ink-2); line-height:1.5; }

/* action toolbar */
.wb-actions { flex:none; display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:14px; padding-top:14px; padding-right:84px; border-top:1px solid var(--line); }
.wb-actions__r { margin-left:auto; display:flex; gap:8px; }

@media (max-width: 1080px) {
  .wbgrid { grid-template-columns:repeat(3,1fr); }
  .wb-foot { grid-template-columns:minmax(0,1fr) 260px; }
  .wb-foot__notes { grid-column:1 / -1; border-left:none; border-bottom:1px solid var(--line); }
}
@media (max-width: 860px) {
  .wbgrid { grid-template-columns:repeat(2,1fr); }
  .wb-foot { grid-template-columns:1fr; }
  .wb-foot__col + .wb-foot__col { border-left:none; border-top:1px solid var(--line); }
  .wb-tot { position:static; }
  .docreg { max-height:none; }
  .wb-actions__r { margin-left:0; width:100%; }
  .wb-actions { padding-right:0; }
}

/* ============================================================================
   SETTINGS + INVENTORY MODULES  (navy/gold, dense desktop)
   ========================================================================== */
.mono { font-family:"Noto Sans",sans-serif !important; }

/* ---- shared form controls ---- */
.sin { width:100%; font-family:var(--ff); font-size:13.5px; color:var(--ink); background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:9px 11px; outline:none; transition:border-color .14s, box-shadow .14s; }
.sin:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
textarea.sin { resize:vertical; line-height:1.5; }
select.sin { cursor:pointer; }
.sin--xs { padding:5px 8px; font-size:12.5px; border-radius:7px; }

.setf { display:flex; flex-direction:column; gap:4px; min-width:0; }
.setf--wide { grid-column:1 / -1; }
.setf__l { font-size:11.5px; font-weight:600; color:var(--ink-2); }
.setf__h { font-size:11px; color:var(--dim); }

.tgl { width:42px; height:24px; border-radius:99px; border:none; background:var(--line-2); position:relative; cursor:pointer; flex:none; transition:background .16s; padding:0; }
.tgl i { position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(11,26,51,.3); transition:transform .16s; display:block; }
.tgl.is-on { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); }
.tgl.is-on i { transform:translateX(18px); }

.segbar { display:inline-flex; background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); padding:3px; gap:2px; }
.segbar__b { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--dim); padding:6px 13px; border-radius:calc(var(--r-md) - 4px); transition:all .14s; }
.segbar__b.is-active { background:var(--navy-700); color:#fff; }

/* ---- settings hub: sidebar layout ---- */
.setwrap { display:grid; grid-template-columns:248px minmax(0,1fr); gap:22px; align-items:start; }
.setnav { position:sticky; top:0; display:flex; flex-direction:column; gap:3px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:8px; }
.setnav__i { display:flex; align-items:center; gap:11px; text-align:left; border:1px solid transparent; background:none; cursor:pointer; font-family:var(--ff); padding:10px 11px; border-radius:var(--r-md); color:var(--ink-2); transition:all .14s; }
.setnav__i:hover { background:var(--surface-2); }
.setnav__i.is-active { background:linear-gradient(120deg,rgba(245,164,0,.16),rgba(245,164,0,.04)); border-color:rgba(245,164,0,.4); }
.setnav__ic { width:32px; height:32px; flex:none; border-radius:9px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.setnav__i.is-active .setnav__ic { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.setnav__t { display:block; font-size:13.5px; font-weight:700; color:var(--ink); white-space:nowrap; }
.setnav__s { display:block; font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.setpane { min-width:0; }

/* ---- settings hub: cards layout ---- */
.sethubcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }
.sethubcard { display:grid; grid-template-columns:auto 1fr auto; grid-template-rows:auto auto; column-gap:14px; align-items:center; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:18px; cursor:pointer; font-family:var(--ff); transition:all .14s; }
.sethubcard:hover { border-color:var(--gold-400); box-shadow:var(--sh-md); transform:translateY(-2px); }
.sethubcard__ic { grid-row:1 / 3; width:48px; height:48px; border-radius:13px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.sethubcard:hover .sethubcard__ic { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.sethubcard__t { font-size:15px; font-weight:800; color:var(--ink); }
.sethubcard__s { font-size:12px; color:var(--dim); grid-column:2; }
.sethubcard > svg { grid-row:1 / 3; }
.setspoke-top { display:flex; align-items:center; gap:13px; margin-bottom:18px; }

/* ---- settings hub: tabs layout ---- */
.settabs { display:flex; gap:6px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:5px; margin-bottom:18px; }
.settab { display:inline-flex; align-items:center; gap:7px; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--dim); padding:9px 14px; border-radius:var(--r-sm); white-space:nowrap; transition:all .14s; }
.settab:hover { background:var(--surface-2); color:var(--ink-2); }
.settab.is-active { background:linear-gradient(120deg,#16294f,#0e1f3f); color:#fff; }

/* ---- settings content blocks ---- */
.setstack { display:flex; flex-direction:column; gap:18px; }
.setblock .panel__hd h3 { font-size:14.5px; }
.setgrid { display:grid; grid-template-columns:1fr 1fr; gap:13px 18px; }
.setlist { display:flex; flex-direction:column; }
.setrow { display:flex; align-items:center; gap:13px; padding:12px 0; }
.setrow + .setrow { border-top:1px solid var(--line); }
.setrow.is-off { opacity:.55; }
.setrow__ic { width:42px; height:42px; flex:none; border-radius:12px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.setrow__t { font-size:14px; font-weight:700; color:var(--ink); }
.setrow__s { font-size:12px; color:var(--dim); margin-top:1px; }
.setrow__edit { width:34px; height:34px; flex:none; border-radius:9px; border:1px solid var(--line-2); background:var(--surface-2); display:grid; place-items:center; cursor:pointer; color:var(--ink-2); }
.setrow__edit:hover { background:var(--surface-3); color:var(--navy-700); }

.rolegrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.permsel__all { border:1px solid var(--line-2); background:var(--surface-2); border-radius:7px; padding:4px 11px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.permsel__all:hover { border-color:var(--navy-300,#9fb3d4); }
.permmenu { display:flex; flex-direction:column; gap:12px; }
.permmenu__g { border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.permmenu__ghd { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; background:var(--surface-2); border-bottom:1px solid var(--line); }
.permmenu__ghd > span { font-size:11.5px; font-weight:800; color:var(--ink-2); letter-spacing:.02em; }
.permmenu__gtog { border:none; background:none; font-family:var(--ff); font-size:10.5px; font-weight:700; color:var(--navy-600); cursor:pointer; }
.permmenu__gtog:hover { color:var(--navy-800); text-decoration:underline; }
.permmenu__row { display:flex; align-items:center; gap:10px; padding:8px 12px; cursor:pointer; border-top:1px solid var(--line); }
.permmenu__g .permmenu__row:first-of-type { border-top:none; }
.permmenu__row:hover { background:var(--surface-2); }
.permmenu__ic { width:26px; height:26px; flex:none; border-radius:7px; display:grid; place-items:center; background:var(--surface-3); color:var(--dim); }
.permmenu__row.is-on .permmenu__ic { background:rgba(20,40,90,.1); color:var(--navy-700); }
.permmenu__t { flex:1; min-width:0; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.permmenu__row.is-on .permmenu__t { font-weight:600; color:var(--navy-800); }
.rolecard { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:13px 14px; }
.rolecard--btn { display:block; width:100%; text-align:left; cursor:pointer; font-family:var(--ff); transition:border-color .12s, background .12s; }
.rolecard--btn:hover { border-color:var(--navy-300,#9fb3d4); background:var(--surface); }
.rolecard__menus { display:flex; align-items:center; gap:5px; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line-2); font-size:11px; font-weight:700; color:var(--navy-600); }
.rolecard__hd { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
.rolecard__note { font-size:12px; color:var(--dim); line-height:1.5; }

/* ---- running-number table ---- */
.docnum-tbl { border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; }
.docnum-head, .docnum-row { display:grid; grid-template-columns:minmax(0,2.4fr) .9fr 1.1fr .6fr .8fr 1fr 1.4fr; gap:10px; align-items:center; padding:9px 14px; }
.docnum-tbl:has(.docnum-prev) .docnum-head, .docnum-tbl:has(.docnum-prev) .docnum-row { grid-template-columns:minmax(0,2.2fr) .9fr 1.1fr .55fr .8fr 1fr 1.4fr; }
.docnum-head { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10.5px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.4px; font-family:"Noto Sans",sans-serif; }
.docnum-row + .docnum-row { border-top:1px solid var(--line); }
.docnum-row:hover { background:var(--surface-2); }
.docnum-doc { font-size:13px; font-weight:600; color:var(--ink); min-width:0; }
.docnum-prev { font-size:12.5px; font-weight:800; color:var(--navy-700); background:#fdf6e6; border:1px solid var(--gold-300); border-radius:6px; padding:4px 8px; text-align:center; white-space:nowrap; }

/* ---- document design + live preview ---- */
.setdesign { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:22px; align-items:start; }
.setpreview { position:sticky; top:0; }
.setpreview__lbl { font-size:12px; font-weight:700; color:var(--ink-2); display:flex; align-items:center; gap:7px; margin-bottom:10px; }
.papergrid { display:flex; flex-direction:column; gap:8px; }
.papertile { display:flex; align-items:center; gap:11px; text-align:left; border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-md); padding:11px 13px; cursor:pointer; font-family:var(--ff); color:var(--ink-2); transition:all .14s; }
.papertile.is-active { border-color:var(--gold-500); background:#fffdf6; color:var(--navy-800); }
.papertile__t { font-size:13px; font-weight:700; }
.papertile__s { font-size:11px; color:var(--dim); }
.themegrid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.themetile { display:flex; align-items:center; gap:10px; border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-md); padding:9px 11px; cursor:pointer; font-family:var(--ff); transition:all .14s; }
.themetile.is-active { border-color:var(--gold-500); background:#fffdf6; }
.themetile__sw { display:flex; flex:none; border-radius:6px; overflow:hidden; box-shadow:var(--sh-sm); }
.themetile__sw i { width:14px; height:24px; display:block; }
.themetile__t { font-size:12.5px; font-weight:600; color:var(--ink-2); }

.docprev { background:#fff; border:1px solid var(--line-2); border-radius:8px; box-shadow:var(--sh-md); padding:18px; font-family:"Noto Sans",sans-serif; color:#1a2236; }
.docprev--slip { max-width:230px; margin:0 auto; padding:14px; }
.docprev__hd { display:flex; gap:11px; align-items:flex-start; border-bottom:2px solid var(--dc1); padding-bottom:11px; }
.docprev__logo { width:40px; height:40px; flex:none; border-radius:9px; display:grid; place-items:center; background:linear-gradient(150deg,var(--dc2),var(--dc1)); color:#fff; font-weight:800; font-size:20px; font-family:var(--ff); }
.docprev__name { font-size:14px; font-weight:800; color:var(--dc1); font-family:var(--ff); }
.docprev__htxt { font-size:9.5px; color:#5a6680; margin-top:1px; }
.docprev__addr { font-size:8.5px; color:#8590a8; line-height:1.5; margin-top:3px; }
.docprev__title { text-align:center; font-size:11px; font-weight:800; color:var(--dc1); margin:11px 0 7px; letter-spacing:.3px; font-family:var(--ff); }
.docprev__meta { display:flex; justify-content:space-between; font-size:9px; color:#5a6680; font-family:var(--ff); margin-bottom:8px; }
.docprev__tbl { width:100%; border-collapse:collapse; }
.docprev__tbl th { text-align:left; font-size:8.5px; color:#fff; background:var(--dc1); padding:5px 7px; font-family:var(--ff); }
.docprev__tbl th:last-child, .docprev__tbl td:last-child { text-align:right; }
.docprev__tbl th:nth-child(2), .docprev__tbl td:nth-child(2) { text-align:center; }
.docprev__tbl td { font-size:9.5px; padding:5px 7px; border-bottom:1px solid #eef0f5; }
.docprev__tot { display:flex; justify-content:space-between; align-items:baseline; padding:9px 7px 0; font-size:10px; }
.docprev__tot b { font-size:15px; color:var(--dc1); font-family:var(--ff); }
.docprev__ft { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-top:12px; }
.docprev__note { font-size:8px; color:#8590a8; line-height:1.5; flex:1; }
.docprev__stamp { width:60px; height:60px; flex:none; border:2px dashed var(--dc2); border-radius:50%; display:grid; place-items:center; text-align:center; font-size:8px; color:var(--dc2); font-weight:700; transform:rotate(-8deg); }
.docprev__foot { text-align:center; font-size:8.5px; color:#8590a8; border-top:1px solid #eef0f5; margin-top:11px; padding-top:8px; }

/* ---- inventory: product detail ---- */
.prodhero { display:flex; gap:14px; padding:16px 18px; border-bottom:1px solid var(--line); align-items:center; }
.prodhero__img { width:58px; height:58px; flex:none; border-radius:14px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:24px; }
.prodhero__nm { font-size:15.5px; font-weight:800; line-height:1.25; }
.prodhero__meta { font-size:12px; color:var(--dim); margin-top:2px; }

.barcodebox { border:1px solid var(--line-2); border-radius:var(--r-sm); padding:10px 12px 8px; margin-bottom:14px; background:var(--surface-2); }
.barcodebox__bars { width:100%; height:40px; display:block; }
.barcodebox__no { text-align:center; font-size:12px; font-weight:700; letter-spacing:2px; color:var(--ink-2); margin-top:4px; }

.pricegrid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-bottom:8px; }
.pricecell { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:9px 11px; display:flex; flex-direction:column; gap:2px; }
.pricecell span { font-size:11px; color:var(--dim); }
.pricecell b { font-size:16px; font-weight:800; color:var(--ink); }
.pricecell--main { background:#fdf6e6; border-color:var(--gold-300); }
.pricecell--main b { color:var(--navy-800); }

.unitbox { border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.unitrow { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; font-size:12.5px; color:var(--ink-2); }
.unitrow + .unitrow { border-top:1px solid var(--line); }
.unitrow__b { font-weight:700; color:var(--navy-700); }

.whstock { display:flex; flex-direction:column; gap:7px; }
.whstock__row { display:grid; grid-template-columns:140px 1fr 40px; gap:10px; align-items:center; }
.whstock__nm { font-size:11.5px; color:var(--ink-2); display:flex; align-items:center; gap:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.whstock__bar { height:8px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.whstock__bar i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--navy-600),var(--gold-500)); }
.whstock__n { text-align:right; font-size:12.5px; font-weight:700; color:var(--ink); }

.scanbanner { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ok-ink); background:var(--ok-bg); border:1px solid #bfe6d3; border-radius:var(--r-sm); padding:8px 12px; margin-bottom:12px; }

/* ---- inventory: warehouses ---- */
.whgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.whcard { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; }
.whcard__hd { display:flex; align-items:center; gap:12px; padding:15px 16px; border-bottom:1px solid var(--line); }
.whcard__ic { width:44px; height:44px; flex:none; border-radius:12px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.whcard__nm { font-size:14px; font-weight:800; }
.whcard__sub { font-size:11.5px; color:var(--dim); margin-top:1px; }
.whcard__stats { display:grid; grid-template-columns:repeat(3,1fr); }
.whcard__stats > div { padding:13px 16px; display:flex; flex-direction:column; gap:3px; }
.whcard__stats > div + div { border-left:1px solid var(--line); }
.whcard__stats span { font-size:11px; color:var(--dim); }
.whcard__stats b { font-size:17px; font-weight:800; color:var(--ink); }
.whcard--add { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; min-height:150px; border-style:dashed; border-color:var(--line-2); background:var(--surface-2); cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--navy-600); }
.whcard--add:hover { border-color:var(--gold-400); background:#fffdf6; }

/* ---- inventory: transfer flow + PO refs ---- */
.transfer-flow { display:flex; align-items:center; justify-content:center; gap:18px; padding:14px; background:var(--surface-2); border-radius:var(--r-md); margin:6px 0 16px; }
.transfer-flow__wh { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:12px; color:var(--dim); }
.transfer-flow__wh b { font-size:14px; font-weight:800; color:var(--navy-700); font-family:"Noto Sans",sans-serif; }

.porefs { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:14px 0; }
.poref { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:9px 11px; display:flex; flex-direction:column; gap:3px; }
.poref span { font-size:10.5px; color:var(--dim); }
.poref b { font-size:12px; font-weight:700; color:var(--ink); display:inline-flex; align-items:center; gap:4px; }

/* ---- density tweak ---- */
.dens-compact .tbl td { padding:7px 14px; font-size:12.5px; }
.dens-compact .tbl th { padding:8px 14px; }
.dens-compact .setrow { padding:9px 0; }
.dens-compact .lrow { padding:10px 14px; }
.dens-comfy .tbl td { padding:17px 18px; font-size:14px; }
.dens-comfy .tbl th { padding:14px 18px; }
.dens-comfy .setrow { padding:15px 0; }
.dens-comfy .lrow { padding:18px 18px; }

@media (max-width:1080px){
  .setwrap { grid-template-columns:1fr; }
  .setnav { position:static; flex-direction:row; flex-wrap:wrap; }
  .setnav__i { flex:1 1 200px; }
  .setdesign { grid-template-columns:1fr; }
  .setpreview { position:static; max-width:380px; }
}
/* 🔧 แบ่งจอ: ตั้งค่าระบบ — ช่องแคบทำให้คอลัมน์ nav 248px บีบป้ายย่อย (.setnav__s) จนถูกตัด
   → mirror breakpoint เป็น container query: nav เรียงแนวนอนเต็มกว้าง มีที่พอ (เฉพาะ fluid pane) */
@container pane (max-width:900px){
  .splitpane__scroll--fluid .setwrap { grid-template-columns:1fr; }
  .splitpane__scroll--fluid .setnav { position:static; flex-direction:row; flex-wrap:wrap; }
  .splitpane__scroll--fluid .setnav__i { flex:1 1 200px; }
  .splitpane__scroll--fluid .setdesign { grid-template-columns:1fr; }
}
@media (max-width:860px){
  .setgrid { grid-template-columns:1fr; }
  .docnum-head { display:none; }
  .docnum-row { grid-template-columns:1fr 1fr; gap:8px; }
  .docnum-doc { grid-column:1 / -1; }
}

/* ---- document functions + radio pills ---- */
.docfn-list { display:flex; flex-direction:column; }
.docfn-row { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:24px; padding:16px 2px; align-items:start; }
.docfn-row + .docfn-row { border-top:1px solid var(--line); }
.docfn-row__t { font-size:13.5px; font-weight:700; color:var(--ink); }
.docfn-row__d { font-size:12px; color:var(--dim); line-height:1.55; margin-top:4px; }
.docfn-opts { display:flex; gap:20px; flex-wrap:wrap; padding-top:2px; }
.radiopill { display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-family:var(--ff); font-size:13px; color:var(--ink-2); font-weight:500; border:none; background:none; padding:0; }
.radiopill i { width:18px; height:18px; flex:none; border-radius:50%; border:2px solid var(--line-2); display:grid; place-items:center; transition:all .14s; }
.radiopill.is-on i { border-color:var(--gold-600); }
.radiopill.is-on i::after { content:""; width:9px; height:9px; border-radius:50%; background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); }
.radiopill.is-on { color:var(--navy-800); font-weight:700; }

/* ---- profile + e-signature ---- */
.profilewrap { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:24px; align-items:start; }
.esign { border-left:1px solid var(--line); padding-left:22px; }
.esign__drop { display:block; border:1.5px dashed var(--line-2); border-radius:var(--r-md); background:var(--surface-2); cursor:pointer; overflow:hidden; transition:all .14s; }
.esign__drop:hover { border-color:var(--gold-400); background:#fffdf6; }
.esign__ph { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; height:120px; color:var(--dim); font-size:12.5px; font-weight:600; }
.esign__img { width:100%; height:120px; object-fit:contain; display:block; background:#fff; }
.esign__file { display:flex; align-items:center; gap:8px; margin-top:9px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:7px 10px; font-size:12px; color:var(--ink-2); }
.esign__hint { font-size:11px; color:var(--dim); margin-top:8px; line-height:1.5; }

@media (max-width:1080px){
  .docfn-row { grid-template-columns:1fr; gap:10px; }
  .profilewrap { grid-template-columns:1fr; }
  .esign { border-left:none; padding-left:0; border-top:1px solid var(--line); padding-top:16px; }
  .esign__drop, .esign__img, .esign__ph { max-width:340px; }
}

/* ---- numbering pattern radio ---- */
.numpat { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; }
.numpat__o { display:flex; align-items:center; gap:11px; text-align:left; border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-md); padding:12px 13px; cursor:pointer; font-family:var(--ff); transition:all .14s; }
.numpat__o.is-on { border-color:var(--gold-500); background:#fffdf6; }
.numpat__rad { width:18px; height:18px; flex:none; border-radius:50%; border:2px solid var(--line-2); display:grid; place-items:center; }
.numpat__o.is-on .numpat__rad { border-color:var(--gold-600); }
.numpat__o.is-on .numpat__rad i { width:9px; height:9px; border-radius:50%; background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); display:block; }
.numpat__t { display:block; font-size:13px; font-weight:700; color:var(--ink); }
.numpat__s { display:block; font-size:10.5px; color:var(--dim); }
.numpat__ex { margin-left:auto; font-size:11px; font-weight:700; color:var(--navy-700); background:var(--surface-3); border-radius:6px; padding:3px 7px; white-space:nowrap; }

/* ---- running-number table (rebuilt) ---- */
.runtbl { border:1px solid var(--line); border-radius:var(--r-md); overflow:visible; }
.runhead, .runrow { display:grid; grid-template-columns:minmax(0,2.2fr) 1fr 1fr 1.5fr .6fr .6fr; gap:10px; align-items:center; padding:9px 14px; }
.runhead.no-prev, .runrow.no-prev { grid-template-columns:minmax(0,2.4fr) 1fr 1fr .6fr .6fr; }
.runhead { background:var(--surface-2); border-bottom:1px solid var(--line); border-radius:var(--r-md) var(--r-md) 0 0; font-size:10.5px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.4px; font-family:"Noto Sans",sans-serif; }
.runrow + .runrow { border-top:1px solid var(--line); }
.runrow:hover { background:var(--surface-2); }
.runrow__doc { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:600; color:var(--ink); min-width:0; }
.runrow__doc i { width:4px; height:22px; border-radius:3px; flex:none; }
.runrow__reset { width:30px; height:30px; justify-self:center; border:1px solid var(--line-2); background:var(--surface-2); border-radius:8px; display:grid; place-items:center; cursor:pointer; color:var(--dim); }
.runrow__reset:hover { color:var(--danger); background:var(--danger-bg); border-color:var(--danger-bg); }

/* ---- color swatch picker ---- */
.cswatch { position:relative; }
.cswatch__btn { width:30px; height:24px; border-radius:7px; border:2px solid #fff; box-shadow:0 0 0 1px var(--line-2),var(--sh-sm); cursor:pointer; display:grid; place-items:center; }
.cswatch__pop { position:absolute; top:calc(100% + 6px); right:0; z-index:50; display:grid; grid-template-columns:repeat(4,1fr); gap:6px; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); box-shadow:var(--sh-lg); padding:8px; width:148px; }
.cswatch__opt { width:28px; height:24px; border-radius:6px; border:2px solid #fff; box-shadow:0 0 0 1px var(--line-2); cursor:pointer; }
.cswatch__opt.is-on { box-shadow:0 0 0 2px var(--navy-800); }

/* ---- upload dropzone (logo/stamp) ---- */
.updrop { display:block; border:1.5px dashed var(--line-2); border-radius:var(--r-md); background:var(--surface-2); cursor:pointer; overflow:hidden; transition:all .14s; }
.updrop:hover { border-color:var(--gold-400); background:#fffdf6; }
.updrop__ph { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; height:120px; color:var(--dim); font-size:12px; font-weight:600; text-align:center; line-height:1.5; }
.updrop__img { width:100%; height:120px; object-fit:contain; display:block; background:#fff; }

/* ---- document field checklist ---- */
.fieldgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:8px; }
.fieldchk { display:flex; align-items:center; gap:9px; border:1px solid var(--line); background:var(--surface-2); border-radius:var(--r-sm); padding:9px 11px; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink-2); text-align:left; }
.fieldchk.is-on { border-color:var(--gold-400); background:#fffdf6; color:var(--navy-800); }
.fieldchk.is-lock { cursor:default; opacity:.85; }
.fieldchk__box { width:18px; height:18px; flex:none; border-radius:5px; border:2px solid var(--line-2); background:#fff; display:grid; place-items:center; }
.fieldchk.is-on .fieldchk__box { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); border-color:transparent; }

/* ---- preview extras ---- */
.docprev { position:relative; }
.docprev__corner { position:absolute; top:0; right:0; width:0; height:0; border-top:46px solid var(--dc1); border-left:46px solid transparent; }
.docprev__corner > span { position:absolute; top:-40px; right:2px; color:#fff; font-size:7.5px; font-weight:700; transform:rotate(45deg); white-space:nowrap; font-family:var(--ff); }
.docprev__sum { margin-top:10px; display:flex; flex-direction:column; gap:3px; align-items:flex-end; }
.docprev__sum > div { display:flex; justify-content:space-between; width:60%; font-size:9.5px; color:#5a6680; }
.docprev__sum-net { border-top:1px solid #eef0f5; padding-top:5px; margin-top:3px; font-size:10.5px !important; color:#1a2236 !important; }
.docprev__sum-net b { font-size:13px; font-family:var(--ff); }

/* ---- document notes ---- */
.notecard { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:13px 14px; }
.notecard__row { display:grid; grid-template-columns:56px 1fr 34px; gap:10px; align-items:center; }
.notecard__row + .notecard__row { margin-top:10px; }
.notecard__row--note { align-items:start; }
.notecard__l { font-size:12px; font-weight:600; color:var(--ink-2); }
.notecard__row--note .notecard__l { padding-top:9px; }
.notecard__row .sin { width:100%; }
.notecard__del { width:34px; height:34px; flex:none; border:1px solid var(--line-2); background:#fff; border-radius:8px; cursor:pointer; color:var(--danger); display:grid; place-items:center; transition:background .14s,border-color .14s; }
.notecard__del:hover { background:var(--danger-bg); border-color:#f0c4c4; }
.piconsearch{ display:inline-flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:8px 12px; margin:4px 0 14px; min-width:280px; max-width:420px; }
.piconsearch input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; }
.picongrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.piconcard{ display:flex; flex-direction:column; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface); border-radius:12px; padding:14px 10px; cursor:pointer; transition:border-color .12s, box-shadow .15s, transform .1s; }
.piconcard:hover{ border-color:var(--gold-400); background:#fffdf6; transform:translateY(-2px); box-shadow:0 8px 18px -12px rgba(20,40,90,.4); }
.piconcard__ic{ width:48px; height:48px; display:grid; place-items:center; background:var(--surface-2); border-radius:12px; }
.piconcard__l{ font-size:12.5px; font-weight:700; color:var(--ink); text-align:center; line-height:1.25; }
.piconcard__k{ font-size:10px; color:var(--dim); font-family:ui-monospace,monospace; }
.piconcard__lbl{ width:100%; text-align:center; border:1px solid transparent; background:none; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink); border-radius:6px; padding:3px 4px; }
.piconcard__lbl:hover{ border-color:var(--line-2); }
.piconcard__lbl:focus{ border-color:var(--gold-500); outline:none; background:#fff; }
.piconcard__btns{ display:flex; gap:5px; }
.piconcard__btns button{ display:inline-flex; align-items:center; gap:3px; border:1px solid var(--line-2); background:#fff; border-radius:7px; padding:4px 8px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.piconcard__btns button:hover{ border-color:var(--navy-300,#9db3d6); }
.piconcard__del{ color:var(--danger-ink) !important; }
.piconcard__l{ font-size:12.5px; font-weight:700; color:var(--ink); text-align:center; line-height:1.25; }
.piconcard__badge{ font-size:9.5px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border-radius:5px; padding:1px 7px; }
.piconcard__badge--v{ color:var(--dim); background:var(--surface-3); }
.picon-ov{ position:fixed; inset:0; z-index:120; background:rgba(15,25,45,.42); display:grid; place-items:center; }
.picon-modal{ background:#fff; border-radius:16px; box-shadow:0 20px 50px -16px rgba(15,30,60,.5); padding:18px; width:min(380px,94vw); }
.picon-modal__hd{ display:flex; align-items:center; gap:8px; font-size:15px; color:var(--ink); margin-bottom:14px; }
.picon-modal__hd b{ flex:1; }
.picon-modal__x{ border:none; background:var(--surface-2); border-radius:8px; width:30px; height:30px; display:grid; place-items:center; cursor:pointer; color:var(--ink-2); }
.picon-modal__f{ display:flex; flex-direction:column; gap:5px; margin-bottom:14px; }
.picon-modal__f span{ font-size:12px; font-weight:700; color:var(--ink-2); }
.picon-modal__f input{ border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; font-family:var(--ff); font-size:14px; outline:none; }
.picon-modal__f input:focus{ border-color:var(--gold-500); }
.picon-modal__bt{ display:flex; justify-content:flex-end; gap:8px; }
.picon-modal__cancel{ border:1px solid var(--line-2); background:#fff; border-radius:9px; padding:9px 16px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.picon-modal__ok{ border:none; background:var(--navy-700); color:#fff; border-radius:9px; padding:9px 18px; font-family:var(--ff); font-size:13px; font-weight:700; cursor:pointer; }
.picon-edit__prev{ display:grid; place-items:center; height:110px; background:var(--surface-2); border-radius:12px; margin-bottom:14px; }
.picon-edit__prev img{ max-width:88px; max-height:88px; object-fit:contain; }
.picon-edit__acts{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.picon-edit__up{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--navy-300,#9db3d6); background:#f3f7fe; color:var(--navy-700); border-radius:9px; padding:10px; font-family:var(--ff); font-size:13px; font-weight:700; cursor:pointer; }
.picon-edit__rm, .picon-edit__del{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:#fff; border-radius:9px; padding:10px 12px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.picon-edit__del{ color:var(--danger-ink); border-color:#e9c2c2; }
.mplink__sub{ font-size:12.5px; color:var(--ink-2); margin-bottom:12px; line-height:1.5; }
.mplink__chs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.mplink__ch{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line-2); background:#fff; border-radius:10px; padding:8px 13px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.mplink__ch.is-on{ border-color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700); color:var(--navy-700); }
.mplink__mark{ width:20px; height:20px; border-radius:6px; display:grid; place-items:center; color:#fff; font-size:11px; font-weight:800; }
.mplink__chn{ background:var(--warn-bg); color:var(--warn-ink); font-size:10.5px; font-weight:800; border-radius:99px; padding:1px 7px; }
.mplink__tabs{ display:flex; gap:6px; flex-wrap:wrap; border-bottom:2px solid var(--line); margin-bottom:12px; }
.mplink__tab{ border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--dim); padding:9px 14px; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; }
.mplink__tab span{ font-size:11px; background:var(--surface-3); border-radius:99px; padding:1px 8px; margin-left:3px; }
.mplink__tab.is-on{ color:var(--navy-700); border-bottom-color:var(--navy-700); }
.mplink__bar{ font-size:12px; font-weight:700; color:#fff; background:var(--ink-2); border-radius:8px 8px 0 0; padding:9px 13px; }
.mplink__list{ border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.mplink__row{ display:flex; align-items:center; gap:12px; padding:11px 14px; border-top:1px solid var(--line); flex-wrap:wrap; }
.mplink__row:first-child{ border-top:none; }
.mplink__info{ flex:1; min-width:200px; }
.mplink__info b{ display:block; font-size:13px; color:var(--ink); }
.mplink__info>span{ font-size:11px; color:var(--dim); }
.mplink__sug{ display:block; font-size:11.5px; color:var(--ok-ink); margin-top:3px; }
.mplink__sug b{ display:inline; color:var(--navy-700); }
.mplink__sug em{ color:var(--dim); font-style:normal; }
.mplink__linked{ display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--ink-2); background:var(--ok-bg); border-radius:8px; padding:6px 10px; }
.mplink__linked b{ color:var(--ok-ink); }
.mplink__acts{ display:flex; gap:6px; flex-wrap:wrap; }
.mplink__b{ border:1px solid var(--line-2); background:#fff; border-radius:8px; padding:7px 12px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; white-space:nowrap; }
.mplink__b:hover{ border-color:var(--navy-300,#9db3d6); }
.mplink__b--ok{ border-color:var(--navy-700); background:var(--navy-700); color:#fff; }
.mplink__b--ok:hover{ background:var(--navy-800); }
.mplink__b--new{ border-style:dashed; color:var(--navy-700); }
.mplink__b--del{ color:var(--danger-ink); border-color:#e9c2c2; }
.mplink__empty{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:34px; color:var(--dim); font-size:13px; }
.mplink__search{ display:flex; align-items:center; gap:8px; border:1px solid var(--line-2); border-radius:9px; padding:8px 12px; margin:10px; background:#fff; }
.mplink__search input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; }
.mplink__pktitle{ font-size:13px; font-weight:700; color:var(--ink); margin-bottom:10px; }
.mplink__pktitle .mono{ color:var(--dim); font-weight:400; font-size:11.5px; }
.mplink__pklist{ max-height:50vh; overflow-y:auto; display:flex; flex-direction:column; gap:4px; }
.mplink__pkrow{ display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:9px; padding:9px 11px; background:#fff; cursor:pointer; text-align:left; }
.mplink__pkrow:hover{ border-color:var(--gold-400); background:#fffdf6; }
.mplink__pkid{ flex:none; font-size:12px; color:var(--navy-700); font-weight:700; }
.mplink__pknm{ font-size:12.5px; color:var(--ink); }
.mplink__pknm em{ color:var(--dim); font-style:normal; font-size:11px; }

/* ===== ห้องควบคุม / เบิกจ่ายคลังย่อย (room-control.jsx) ===== */
.rc-intro{ display:flex; gap:9px; align-items:flex-start; font-size:12.5px; line-height:1.55; color:var(--ink-2); background:var(--info-bg); border:1px solid #cfe0f3; border-radius:12px; padding:11px 14px; margin-bottom:14px; }
.rc-intro b{ color:var(--navy-700); }
.rc-alertbar{ display:flex; align-items:center; gap:8px; background:var(--danger); color:#fff; border-radius:10px; padding:10px 14px; font-size:13px; font-weight:700; margin-bottom:12px; }
.rc-tabs{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; border-bottom:2px solid var(--line); margin-bottom:14px; }
.rc-tab{ display:inline-flex; align-items:center; gap:6px; border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--dim); padding:9px 13px; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; }
.rc-tab.is-on{ color:var(--navy-700); border-bottom-color:var(--navy-700); }
.rc-tab__n{ background:var(--warn-bg); color:var(--warn-ink); font-size:10.5px; font-weight:800; border-radius:99px; padding:1px 7px; }
.rc-recon{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--navy-300,#9db3d6); background:#f3f7fe; color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 12px; border-radius:9px; cursor:pointer; }
.rc-panel{ background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--sh-sm); padding:14px 16px; }
.rc-panel__hd{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.rc-panel__hd b{ font-size:14px; color:var(--ink); }
.rc-fil{ display:inline-flex; gap:3px; background:var(--surface-2); border-radius:9px; padding:3px; }
.rc-fil__b{ border:none; background:none; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); padding:6px 12px; border-radius:7px; cursor:pointer; }
.rc-fil__b.is-on{ background:var(--navy-700); color:#fff; }
.rc-tablewrap{ overflow-x:auto; }
.rc-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.rc-table th{ text-align:left; font-size:11px; font-weight:700; color:var(--dim); padding:7px 9px; border-bottom:1.5px solid var(--line); white-space:nowrap; }
.rc-table th.num,.rc-table td.num{ text-align:right; }
.rc-table td{ padding:9px; border-bottom:1px solid var(--line); vertical-align:middle; }
.rc-table tr.rc-over td{ background:#fdf4f3; }
.rc-loc{ font-family:ui-monospace,monospace; font-weight:800; color:var(--navy-700); background:var(--surface-2); border-radius:6px; padding:2px 8px; }
.rc-pname{ font-weight:600; color:var(--ink); }
.rc-pcode{ font-size:10.5px; color:var(--dim); }
.rc-ago{ display:inline-flex; align-items:center; gap:4px; font-size:11.5px; color:var(--warn-ink); font-weight:700; }
.rc-ago--over{ color:var(--danger); }
.rc-chip{ font-size:11px; font-weight:700; border-radius:6px; padding:2px 9px; white-space:nowrap; }
.rc-chip--warn{ background:var(--warn-bg); color:var(--warn-ink); }
.rc-chip--ok{ background:var(--ok-bg); color:var(--ok-ink); }
.rc-chip--dim{ background:var(--surface-3); color:var(--dim); }
.rc-chip--lost{ background:var(--danger-bg); color:var(--danger-ink); }
.rc-b--lost{ border-color:#e9c2c2; color:var(--danger-ink); }
.rc-b--lost:hover{ background:#fff6f6; }
.rc-lostnote{ font-size:11px; color:var(--danger-ink); font-weight:700; }
.rc-oemhint{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); background:var(--info-bg); border:1px solid #cfe0f3; border-radius:9px; padding:7px 11px; margin-top:-4px; }
.rc-oemhint b{ color:var(--navy-700); }
.rc-acts{ display:flex; gap:5px; white-space:nowrap; }
.rc-b{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); background:#fff; border-radius:7px; padding:6px 10px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.rc-b--ok{ border-color:#a7d7bd; background:#f3fbf6; color:var(--ok-ink); }
.rc-empty{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:34px; color:var(--dim); font-size:13px; }
.rc-warn{ color:var(--warn-ink); }
/* issue form */
.rc-issue__hint{ font-size:11.5px; color:var(--dim); }
.rc-issue__grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:11px; }
.rc-f{ display:flex; flex-direction:column; gap:4px; }
.rc-f--wide{ grid-column:span 2; }
.rc-f>span{ font-size:11.5px; font-weight:700; color:var(--ink-2); display:flex; align-items:center; gap:6px; }
.rc-f input,.rc-f select{ font-family:var(--ff); font-size:13.5px; border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; outline:none; background:#fff; }
.rc-f input:focus,.rc-f select:focus{ border-color:var(--gold-500); }
.rc-scan{ font-style:normal; font-size:10px; font-weight:700; color:var(--navy-700); background:#eaf1fb; border-radius:5px; padding:1px 6px; }
.rc-auto{ font-style:normal; font-size:10px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border-radius:5px; padding:1px 6px; }
.rc-locauto{ background:var(--surface-2) !important; font-weight:800; color:var(--navy-700) !important; }
/* POS-style issue */
.rc-pos{ display:grid; grid-template-columns:1fr 300px; gap:14px; align-items:start; }
@media(max-width:1100px){ .rc-pos{ grid-template-columns:1fr; } }
.rc-pos__main{ background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--sh-sm); padding:14px; }
.rc-pos__topbar{ display:grid; grid-template-columns:repeat(3,1fr); gap:11px; margin-bottom:12px; }
.rc-scanbar{ display:flex; align-items:center; gap:10px; border:2px solid var(--gold-400); background:#fffdf5; border-radius:11px; padding:11px 14px; margin-bottom:12px; }
.rc-scanbar input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:15px; font-weight:600; color:var(--ink); }
.rc-scanbar__hint{ font-size:11px; font-weight:700; color:var(--gold-600); background:#fff4d6; border-radius:6px; padding:3px 9px; white-space:nowrap; }
.rc-pos__cart{ border:1px solid var(--line); border-radius:11px; min-height:200px; }
.rc-qty{ display:inline-flex; align-items:center; border:1px solid var(--line-2); border-radius:8px; overflow:hidden; }
.rc-qty button{ border:none; background:var(--surface-2); width:30px; height:30px; font-size:17px; font-weight:800; color:var(--navy-700); cursor:pointer; }
.rc-qty input{ width:46px; border:none; text-align:center; font-family:var(--ff); font-size:14px; font-weight:800; outline:none; }
.rc-del{ border:none; background:none; color:var(--danger); cursor:pointer; }
.rc-pos__side{ background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--sh-sm); padding:16px; position:sticky; top:0; }
.rc-pos__sidehd{ font-size:15px; color:var(--ink); padding-bottom:11px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.rc-pos__sum{ display:flex; align-items:center; justify-content:space-between; font-size:13px; color:var(--ink-2); margin-bottom:12px; }
.rc-pos__sum b{ font-size:15px; color:var(--navy-700); }
.rc-pos__note{ display:flex; align-items:flex-start; gap:7px; font-size:11.5px; color:var(--ink-2); line-height:1.55; background:var(--info-bg); border-radius:9px; padding:10px 12px; margin-bottom:14px; }
.rc-pos__notelist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; flex:1; min-width:0; }
.rc-pos__notelist li{ position:relative; padding-left:12px; }
.rc-pos__notelist li::before{ content:""; position:absolute; left:2px; top:7px; width:3px; height:3px; border-radius:50%; background:var(--navy-600); }
.rc-pos__notelist b{ color:var(--navy-700); font-weight:700; }
.rc-pos__notelist span{ color:var(--dim); }
.rc-pos__save{ width:100%; display:inline-flex; align-items:center; justify-content:center; gap:8px; border:none; background:var(--gold-500); color:#3a2a00; font-family:var(--ff); font-size:16px; font-weight:800; padding:14px; border-radius:11px; cursor:pointer; }
.rc-pos__save:hover{ background:var(--gold-400); }
.rc-pos__clear{ width:100%; margin-top:8px; border:1px solid var(--line-2); background:#fff; border-radius:9px; padding:9px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.rc-pos__bill{ background:var(--surface-2); border-radius:10px; padding:10px 12px; margin-bottom:12px; }
.rc-pos__billrow{ display:flex; align-items:center; justify-content:space-between; font-size:12.5px; color:var(--ink-2); padding:2px 0; }
.rc-pos__billrow b{ color:var(--navy-700); font-weight:800; }
.rc-mv2{ display:inline-flex; align-items:center; gap:5px; font-size:12px; }
.rc-mv2--ov{ color:var(--violet,#6B53C4); } .rc-mv2--pk{ color:var(--ok-ink); }
.rc-mv2__edit{ border:1px solid var(--line-2); background:#fff; border-radius:6px; padding:2px 6px; cursor:pointer; color:var(--ink-2); }
.rc-datechip{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border-radius:8px; padding:5px 11px; }
.rc-okn{ color:var(--ok-ink); }
.rc-overwarn{ font-size:10px; font-weight:700; color:var(--danger); margin-top:2px; }
.rc-today__hello{ font-size:14px; color:var(--ink-2); margin-bottom:12px; }
.rc-today__hello b{ color:var(--navy-700); font-size:15px; }
.rc-today__cards{ display:grid; grid-template-columns:repeat(4,1fr); gap:11px; margin-bottom:18px; }
@media(max-width:900px){ .rc-today__cards{ grid-template-columns:repeat(2,1fr); } }
.rc-tcard{ text-align:left; border:1px solid var(--line); background:var(--surface); border-radius:13px; padding:14px; cursor:pointer; box-shadow:var(--sh-sm); }
.rc-tcard:hover{ border-color:var(--gold-400); transform:translateY(-2px); transition:.15s; }
.rc-tcard--warn{ border-color:#e3a79e; background:#fdf4f3; } .rc-tcard--warn .rc-tcard__n{ color:var(--danger); }
.rc-tcard--ok{ border-color:#a7d7bd; background:#f3fbf6; } .rc-tcard--ok .rc-tcard__n{ color:var(--ok-ink); }
.rc-tcard--soft{ background:var(--surface-2); cursor:default; box-shadow:none; }
.rc-tcard__n{ font-size:30px; font-weight:800; color:var(--navy-700); line-height:1; }
.rc-tcard__l{ font-size:12.5px; color:var(--ink-2); margin-top:6px; font-weight:600; }
.rc-tcard__go{ font-size:11.5px; font-weight:700; color:var(--gold-600); margin-top:8px; }
.rc-today__sec{ font-size:13px; font-weight:800; color:var(--navy-700); margin:6px 0 10px; }
.rc-issue__foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; flex-wrap:wrap; }
.rc-issue__note{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); }
.rc-submit{ display:inline-flex; align-items:center; gap:7px; border:none; background:var(--gold-500); color:#3a2a00; font-family:var(--ff); font-size:14px; font-weight:800; padding:11px 22px; border-radius:10px; cursor:pointer; }
.rc-submit:hover{ background:var(--gold-400); }
.rc-submit--sm{ font-size:12.5px; padding:9px 14px; }
/* people */
.rc-people{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:11px; }
.rc-person{ border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--surface); }
.rc-person--warn{ border-color:#ecd9a6; background:#fffdf5; }
.rc-person__hd{ display:flex; align-items:center; gap:7px; margin-bottom:8px; }
.rc-person__hd b{ flex:1; font-size:13.5px; }
.rc-person__badge{ font-size:10.5px; font-weight:800; color:var(--warn-ink); background:var(--warn-bg); border-radius:99px; padding:1px 8px; }
.rc-person__stat{ display:flex; gap:13px; font-size:12px; color:var(--ink-2); flex-wrap:wrap; }
.rc-person__stat b{ color:var(--navy-700); }
.rc-person__items{ display:flex; flex-direction:column; gap:3px; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); }
.rc-person__item{ font-size:11px; color:var(--ink-2); }
/* rooms */
.rc-roomadd{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.rc-roomadd input{ flex:1; min-width:160px; font-family:var(--ff); font-size:13px; border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; outline:none; }
.rc-maprooms{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:14px; font-size:12px; color:var(--dim); }
.rc-maproom{ border:1px dashed var(--navy-300,#9db3d6); background:#fff; color:var(--navy-700); border-radius:99px; padding:5px 11px; font-family:var(--ff); font-size:12px; font-weight:700; cursor:pointer; }
.rc-roomgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:11px; }
.rc-roomcard{ border:1px solid var(--line); border-radius:12px; padding:13px; background:var(--surface); }
.rc-roomcard.is-off{ opacity:.6; }
.rc-roomcard__hd{ display:flex; align-items:center; gap:7px; }
.rc-roomcard__hd b{ flex:1; font-size:13.5px; }
.rc-roomcard__x{ border:none; background:none; color:var(--danger); cursor:pointer; }
.rc-roomcard__key{ font-size:11px; color:var(--dim); margin:2px 0 10px; }
.rc-roomcard .rc-f{ margin-bottom:10px; }
.rc-toggle{ width:100%; border:1px solid var(--line-2); background:#fff; border-radius:9px; padding:9px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); cursor:pointer; }
.rc-toggle.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.rc-2spot{ display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--ink-2); background:var(--info-bg); border:1px solid #cfe0f3; border-radius:10px; padding:10px 13px; margin-bottom:12px; line-height:1.5; }
.rc-2spot b{ color:var(--navy-700); }
.rc-spotview{ display:flex; align-items:center; gap:12px; margin:12px 0; flex-wrap:wrap; }
.rc-spot{ flex:1; min-width:160px; border:1px solid var(--line-2); border-radius:11px; padding:11px 13px; background:#fff; }
.rc-spot span{ display:block; font-size:11px; color:var(--dim); margin-bottom:3px; }
.rc-spot b{ font-size:15px; font-weight:800; }
.rc-spot--ov{ border-color:#cdb6ec; background:#f6f1fd; } .rc-spot--ov b{ color:var(--violet,#6B53C4); }
.rc-spot--pick{ border-color:#a7d7bd; background:#f3fbf6; } .rc-spot--pick b{ color:var(--ok-ink); }
.rc-spotarrow{ flex:none; }
.rc-refhist{ margin-top:16px; border-top:1px solid var(--line); padding-top:12px; }
.rc-refhist__t{ font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:7px; }
.rc-refrow{ display:flex; align-items:center; gap:12px; font-size:12px; color:var(--ink-2); padding:6px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.rc-refrow .mono{ color:var(--dim); font-size:11px; }
.rc-refrow__mv{ color:var(--violet,#6B53C4); font-weight:700; }
.rc-refrow__by{ margin-left:auto; color:var(--dim); font-size:11px; }
.picon-ov{ position:fixed; inset:0; background:rgba(15,25,45,.42); display:grid; place-items:center; z-index:1200; }
.picon-modal{ width:min(420px,92vw); background:#fff; border-radius:14px; box-shadow:0 20px 50px -16px rgba(10,20,50,.5); padding:18px; }
.picon-modal__hd{ display:flex; align-items:center; gap:8px; font-size:15px; margin-bottom:14px; }
.picon-modal__f{ display:flex; flex-direction:column; gap:5px; margin-bottom:16px; }
.picon-modal__f span{ font-size:12px; font-weight:700; color:var(--ink-2); }
.picon-modal__f input{ font-family:var(--ff); font-size:14px; border:1px solid var(--line-2); border-radius:9px; padding:10px 12px; outline:none; }
.picon-modal__f input:focus{ border-color:var(--gold-500); }
.picon-modal__bt{ display:flex; gap:8px; justify-content:flex-end; }
.picon-modal__cancel{ border:1px solid var(--line-2); background:#fff; color:var(--ink-2); font-family:var(--ff); font-size:13px; font-weight:700; padding:9px 16px; border-radius:9px; cursor:pointer; }
.picon-modal__ok{ border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; padding:9px 18px; border-radius:9px; cursor:pointer; }
.addlink { margin-top:14px; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-600); display:inline-flex; align-items:center; gap:6px; }
.addlink:hover { color:var(--navy-800); }

@media (max-width:1080px){
  .runhead, .runrow { grid-template-columns:minmax(0,1.6fr) .9fr .9fr 1.2fr .6fr .6fr; gap:7px; padding:8px 10px; }
}

/* ============================================================================
   PARTS MASTER (KACC9-style)
   ========================================================================== */
.invwrap { display:flex; flex-direction:column; gap:4px; }
.invtabs { display:flex; align-items:center; gap:10px; flex-wrap:wrap; position:sticky; top:0; z-index:25; background:var(--bg); padding:0; }
.invtabs__sep{ width:1px; height:22px; background:var(--line-2); margin:0 2px; }
.partbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:none; }

/* top/bottom split — list (top ~half) + detail (bottom ~half), fills viewport,
   overflow scrolls INSIDE each pane (no whole-page scroll) — KACC9 style */
.partwrap { height:100%; min-height:0; }
.partsplit-v { flex:1; min-height:0; display:flex; flex-direction:column; gap:0; }
.partsplit-v .partlist-top { flex:1 1 50%; min-height:108px; height:auto; max-height:none; resize:none; }
.partsplit-v .partdetail-b { flex:1 1 50%; min-height:170px; display:flex; flex-direction:column; margin-top:0; }
.partresize { flex:none; height:12px; display:flex; align-items:center; justify-content:center; cursor:row-resize; touch-action:none; }
.partresize::before { content:""; width:52px; height:4px; border-radius:99px; background:var(--line-2); transition:background .14s, width .14s; }
.partresize:hover::before { background:var(--navy-600); width:72px; }
.partresize:active::before { background:var(--navy-700); width:72px; }
.partsplit-v .partdetail-b .doctabs { flex:none; margin-bottom:8px !important; }
.partsplit-v .partdetail-b .partpane { flex:1; min-height:0; overflow:auto; }
@media (max-width:1080px){
  .partwrap { height:auto; }
  .partsplit-v { display:flex; }
  .partsplit-v .partlist-top { flex:none; height:320px; }
  .partsplit-v .partdetail-b .partpane { overflow:visible; }
}

/* ============================================================
   🟦 Products split-pane REFLOW (container queries · pane-scoped)
   Pilot: เฉพาะจอ "แฟ้มสินค้า" (products) เมื่ออยู่ในช่อง Split Workspace.
   - reflow ตามความกว้าง "ช่องจริง" (container query) ไม่ใช่ viewport
   - scope ทุกกฎใต้ .pane-fluid--products (มีเฉพาะช่อง products แบบ fluid)
   - ไม่แตะจอเดี่ยวปกติ · ไม่แตะช่องเมนูอื่น (ยังใช้ scale-to-fit เดิม)
   - ก−/ก+ = ซูมตัวอักษรทับ (zoom) · ปุ่มซูมยังทำงานครบ
   ============================================================ */
.splitpane__scroll--fluid { container-type:inline-size; container-name:pane; }
.splitpane__fit--fluid { transform-origin:top left; }
/* KPI การ์ดในช่องแยกจอ (fluid) แคบกว่าจอเดี่ยว → ลดขนาดกล่องไอคอนไม่ให้ชิด/ทับตัวเลข */
.pane-fluid .kpi__ic { width:30px; height:30px; border-radius:9px; top:14px; right:14px; }
.pane-fluid .kpi__ic svg { width:17px; height:17px; }
.pane-fluid .kpi__k, .pane-fluid .kpi__v { padding-right:42px; }
/* 🟦 GENERIC fluid-pane reflow — ครอบ "ทุกหน้า" ในช่อง split (fallback สำหรับจอที่ไม่มีกฎเฉพาะ)
   ปลด .dwrap max-width (เต็มกว้างช่อง) · KPI 4→2→1 · กัน table/grid ล้น. จอที่มีกฎเฉพาะ
   (products/grreceive/purchasing/dashboard ฯลฯ) ใช้กฎ .pane-fluid--<id> ทับเพิ่มได้ตามเดิม. */
.splitpane__scroll--fluid .dwrap { max-width:none; }
.splitpane__scroll--fluid .dgrid-kpi > * { min-width:0; }
.splitpane__scroll--fluid .panel__bd { overflow-x:auto; }
@container pane (max-width: 900px){ .splitpane__scroll--fluid .dgrid-kpi { grid-template-columns:1fr 1fr; } }
@container pane (max-width: 600px){ .splitpane__scroll--fluid .dgrid-kpi { grid-template-columns:1fr; } }
/* master-detail (.md) + AR master-detail (.qtsplit) สแต็ก 1 คอลัมน์ในช่อง split แคบ */
@container pane (max-width: 1000px){
  .splitpane__scroll--fluid .md { grid-template-columns:1fr; }
  .splitpane__scroll--fluid .qtsplit { grid-template-columns:1fr; }
  .splitpane__scroll--fluid .twocol { grid-template-columns:1fr !important; }
}
.splitpane__scroll--fluid .twocol > * { min-width:0; }
/* 🔧 เชื่อมต่อ (integrations) — การ์ด .intg-cards ล็อก repeat(4,1fr) ด้วย @media viewport
   → ในช่อง split (viewport กว้าง) ไม่ยุบ = ล้น. ยุบตามความกว้างช่องจริง */
.splitpane__scroll--fluid .intg-card { min-width:0; }
@container pane (max-width: 900px){ .splitpane__scroll--fluid .intg-cards { grid-template-columns:repeat(2,1fr); } }
@container pane (max-width: 560px){ .splitpane__scroll--fluid .intg-cards { grid-template-columns:1fr; } }
/* 🔧 แผนที่คลัง (whmap) — การ์ดช่องเก็บ .wm-bld ล็อกคอลัมน์ด้วย @media viewport → ยุบตามช่องจริง */
.splitpane__scroll--fluid .wm-bld > * { min-width:0; }
@container pane (max-width: 900px){ .splitpane__scroll--fluid .wm-bld { grid-template-columns:repeat(2,1fr); } }
@container pane (max-width: 560px){ .splitpane__scroll--fluid .wm-bld { grid-template-columns:1fr; } }
/* กัน grid item (min-width:auto = min-content ของตาราง) ดันช่องกว้างเกิน → ตารางเลื่อนในกล่องแทน */
.splitpane__scroll--fluid .md > *,
.splitpane__scroll--fluid .qtsplit > * { min-width:0; }
.splitpane__scroll--fluid .md .panel__bd,
.splitpane__scroll--fluid .qtsplit .panel__bd { overflow-x:auto; }
/* 🔧 งานส่ง (delivery) — .dlv2 (รายการ+รายละเอียด) + .dlv-grid2 (เส้นทาง+รายการสินค้า) ใช้ @media viewport
   ไม่ reflow ในช่อง split → ล้นจอ. เพิ่ม container query ตามความกว้างช่อง */
@container pane (max-width: 1000px){
  .pane-fluid--delivery .dlv2 { grid-template-columns:1fr; }
  .pane-fluid--delivery .dlv-grid2 { grid-template-columns:1fr; }
}
/* 🔧 ตาราง AR/AP แยกอายุหนี้ (LedgerD) — 8–9 คอลัมน์ มีคอลัมน์ "วงเงิน" + ปุ่มรับชำระ.
   ในช่องแคบ/แยกจอ ถ้าปล่อยให้บีบเต็มกว้าง คอลัมน์วงเงินจะถูกตัดที่ขอบ → ตั้ง min-width
   ให้คอลัมน์คงความกว้างแล้วเลื่อนแนวนอนแทน (เห็นครบทุกคอลัมน์) + เว้นขอบขวาเล็กน้อย. */
.ledger-aging-tbl { min-width:780px; }
.ledger-aging-tbl th:last-child, .ledger-aging-tbl td:last-child { padding-right:14px; }

/* 🔧 PO/BO modal ในช่อง "จัดซื้อ" (split, fluid) = sheet พอดีความกว้างช่อง
   ⚠️ ปัญหาเดิม #1: เคยปลด container-type ของช่อง fluid ตอน modal เปิด (body.bpy-modal-open)
   เพื่อให้ modal หลุดไป viewport — แต่ทำให้ช่อง "แฟ้มสินค้า" ข้าง ๆ เสีย container query
   → reflow กลับเป็น layout เดิมทันทีที่กดปุ่มเปิด modal. (เอาออกแล้ว)
   ⚠️ ปัญหาเดิม #2: container-type:inline-size ใน browser นี้ "ไม่" สร้าง containing block
   ให้ position:fixed (contain:none) → .impmodal หลุดไปกึ่งกลาง viewport แต่ panel กว้างเท่าช่อง
   → คร่อมเส้นแบ่ง. แก้: ให้ JS (zeropad modal-guard) เติมคลาส .bpy-pane-modal ที่ "ช่องที่มี
   modal" → ตั้ง transform เป็น containing block → .impmodal ถูกขังในกรอบช่อง (พอดี ไม่ทับช่องข้าง)
   panel = 100% ของช่อง (ลบ padding). ไม่แตะ container-type ของช่องอื่นเลย. */
.splitpane.bpy-pane-modal { transform: translateZ(0); }
/* modal ที่ถูกขังในช่อง (split): cap ความกว้าง panel ให้พอดีช่อง (96vw/640px อิง viewport จะล้นช่อง) */
.splitpane.bpy-pane-modal .cxmodal { width:min(640px,100%); max-width:100%; }
.splitpane.bpy-pane-modal .carmod { width:min(680px,100%); max-width:100%; }
.splitpane.bpy-pane-modal .carmod-ov { padding:16px; }
.splitpane.bpy-pane-modal .impmodal__panel { max-width:100%; box-sizing:border-box; }
.pane-fluid--purchasing .impmodal { padding:16px; }
.pane-fluid--purchasing .impmodal__panel {
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box;
}
/* ฟอร์มในใบ PO/BO: กัน field ดันกว้าง + ลดคอลัมน์ตามความกว้างช่อง (3→2→1) */
.pane-fluid--purchasing .po-frm > * { min-width:0; }
.pane-fluid--purchasing .impbody { min-width:0; }
@container pane (max-width: 760px){
  .pane-fluid--purchasing .po-frm { grid-template-columns:1fr 1fr; }
}
@container pane (max-width: 520px){
  .pane-fluid--purchasing .po-frm { grid-template-columns:1fr; }
}

/* MEDIUM/NARROW ช่อง (≤ 900px) — รายละเอียดสินค้า: การ์ดในstack เป็น 1 คอลัมน์เต็มความกว้าง
   (เดิม 2 คอลัมน์ช่วง 600–900px บีบจนอ่านยาก → ผู้ใช้ขอให้สแต็กแนวตั้ง เลื่อนลงแทน) */
@container pane (max-width: 900px){
  .pane-fluid--products .pg3 { grid-template-columns:1fr; }
}

/* แถบแท็บ + ปุ่มจัดการ (9 แท็บ + 7 ปุ่ม) — ในช่อง split กว้างไม่พอเรียงบรรทัดเดียวเสมอ
   (เดสก์ท็อปเต็มจอ 1280 ถึงพอ) → บังคับ "สแต็ก" ทุกความกว้างช่อง: แท็บเต็มแถวบน (พับแนวนอน)
   · ปุ่มจัดการลงแถวล่างเอง · กันแท็บยุบเป็นคอลัมน์ตั้งตอนช่อง 900–1080px */
.pane-fluid--products .doctabs--wact { flex-wrap:wrap; row-gap:9px; align-items:flex-start; }
.pane-fluid--products .doctabs--wact .doctabs__tabs { flex:1 1 100%; min-width:0; gap:5px 6px; }
/* ปุ่มจัดการ → กริดปุ่มขนาดเท่ากัน เรียงเป็นคอลัมน์ + เส้นคั่นเหนือกลุ่ม ให้ดูเป็นระเบียบ */
.pane-fluid--products .doctabs--wact .partacts {
  margin-left:0; flex:1 1 100%;
  display:grid; grid-template-columns:repeat(auto-fill, minmax(116px, 1fr)); gap:7px;
  padding-top:10px; border-top:1px solid var(--line);
}
.pane-fluid--products .doctabs--wact .partacts > * { width:100%; }

/* ขยายรายการสินค้าในช่อง split = โชว์ ~10 การ์ดแล้วเลื่อนดูที่เหลือในตัวลิสต์เอง
   (กันรายการ 34 ตัวดันส่วนรายละเอียดลงไปไกล) · เฉพาะตอนขยาย (ไม่ใช่ตอนย่อ) */
.pane-fluid--products .docreg.partlist-top:not(.docreg--collapsed) .docreg__tbl {
  max-height:820px; overflow-y:auto;
}

/* NARROW ช่อง (≤ 600px) — สแต็ก 1 คอลัมน์ + ช่องค้นหาเรียงเต็มความกว้าง */
@container pane (max-width: 600px){
  .pane-fluid--products .pg3 { grid-template-columns:1fr; }
  /* ตัวกรอง/ค้นหา: หมวด + ช่องเลือก + ช่องพิมพ์ ขยายเต็มแถว (ปุ่มเล็กยังพับตามปกติ) */
  .pane-fluid--products .search2__cat,
  .pane-fluid--products .search2__field,
  .pane-fluid--products .search2__in { flex:1 1 100%; max-width:none; min-width:0; }
  .pane-fluid--products .search2__div { display:none; }
  /* ตารางรายการสินค้าแน่น 10 คอลัมน์ — เลื่อนแนวนอนแทนการบีบ (ปลอดภัยกว่าแปลงเป็นการ์ด) */
  .pane-fluid--products .docreg__tbl { overflow:auto; }
  .pane-fluid--products .docreg__tbl .tbl { min-width:720px; }
}

/* ============================================================
   🟦 GR Receive (รับของเข้าคลัง) split-pane REFLOW — container queries
   scope ทุกกฎใต้ .pane-fluid--grreceive (มีเฉพาะช่อง grreceive แบบ fluid).
   ไม่แตะจอเดี่ยว · ไม่แตะช่องเมนูอื่น · ใช้ความกว้างช่องจริง.
   ============================================================ */
/* ตารางรายการสินค้าในบิล (dense, ช่องกรอกแคบหลายคอลัมน์) — เลื่อนแนวนอนเสมอ
   (.panel__bd = กล่องตาราง · แยกจาก .grpick/.panel__bd--pad ที่มี dropdown จึงไม่ตัด popup) */
.pane-fluid--grreceive .panel__bd { overflow-x:auto; }
/* ให้ grid track ย่อพอดีความกว้างช่อง (กัน min-width:auto ของ grid item ดันล้น) +
   ปุ่มเลือก PO ข้อความยาวให้ตัดบรรทัดแทนดันความกว้าง */
.pane-fluid--grreceive .grhead > * { min-width:0; }
.pane-fluid--grreceive .grpobtn { min-width:0; }
.pane-fluid--grreceive .grpobtn > span { white-space:normal; text-align:left; }

/* MEDIUM ช่อง (≤ 900px) — หัวบิล 3 คอลัมน์ → 2 · แถบแท็บ/ปุ่มพับบรรทัด (มีอยู่แล้วแต่ย้ำ) */
@container pane (max-width: 900px){
  .pane-fluid--grreceive .grhead { grid-template-columns:1fr 1fr; }
  .pane-fluid--grreceive .docbar,
  .pane-fluid--grreceive .doctabs { flex-wrap:wrap; }
}

/* NARROW ช่อง (≤ 600px) — สแต็ก 1 คอลัมน์ + ท้ายบิลเรียงเต็มความกว้าง */
@container pane (max-width: 600px){
  .pane-fluid--grreceive .grhead { grid-template-columns:1fr; }
  /* ท้ายบิล: คลัง + ยอดรวม วางซ้อนเต็มแถว (เดิม flex-wrap + min-width อาจล้นช่องแคบ) */
  .pane-fluid--grreceive .grfoot { flex-direction:column; }
  .pane-fluid--grreceive .grfoot__left,
  .pane-fluid--grreceive .grfoot__tot { min-width:0; width:100%; }
}

/* ============================================================
   🟦 สมุดขาย/สมุดซื้อ (DocWorkbench) split-pane REFLOW — container queries
   scope ใต้ .pane-fluid--salesbook / .pane-fluid--purchasebook เท่านั้น.
   แก้อาการ layout เพี้ยน: ท้ายบิล wb-foot เป็น grid 3 คอลัมน์ (1fr 280px 300px)
   ที่ไม่ยุบด้วย viewport @media ในโหมด fluid ช่องแคบ → payment columns ซ้อนกัน.
   ============================================================ */
.pane-fluid--salesbook .wbgrid > *, .pane-fluid--purchasebook .wbgrid > *,
.pane-fluid--salesbook .wb-foot > *, .pane-fluid--purchasebook .wb-foot > * { min-width:0; }
.pane-fluid--salesbook .docreg, .pane-fluid--purchasebook .docreg { max-height:none; }
.pane-fluid--salesbook .panel__bd, .pane-fluid--purchasebook .panel__bd { overflow-x:auto; }
/* หัวข้อแท็บเอกสาร: พับหลายบรรทัดให้มีระยะห่างแนวตั้งเป็นระเบียบ (ไม่กระจัดกระจาย) */
.pane-fluid--salesbook .doctabs, .pane-fluid--purchasebook .doctabs { row-gap:7px; padding:6px; }
.pane-fluid--salesbook .doctabs > *, .pane-fluid--purchasebook .doctabs > * { min-width:0; }
/* ปุ่มจัดการท้ายบิล → บรรทัดเดียว (เลื่อนแนวนอนถ้าช่องแคบ) ตามที่ผู้ใช้ต้องการ */
.pane-fluid--salesbook .wb-actions, .pane-fluid--purchasebook .wb-actions {
  display:flex; flex-wrap:nowrap; align-items:center; gap:8px; padding-right:0;
  overflow-x:auto; overflow-y:visible;
}
.pane-fluid--salesbook .wb-actions > *, .pane-fluid--purchasebook .wb-actions > * { width:auto; flex:0 0 auto; white-space:nowrap; }
.pane-fluid--salesbook .wb-actions__r, .pane-fluid--purchasebook .wb-actions__r { display:contents; margin-left:0; }
/* รายละเอียดการชำระ (โอน/เช็ก/บัตรเครดิต) — grid inline repeat(3,150px) ล้นช่อง fluid ทุกความกว้าง
   → บังคับเต็มช่อง + คอลัมน์ยืด/พับตามความกว้างจริง (กันช่อง "เลขอ้างอิงสลิป" ถูกตัด) */
.pane-fluid--salesbook .wb-paydetail, .pane-fluid--purchasebook .wb-paydetail { margin-left:0 !important; width:100%; max-width:100%; box-sizing:border-box; }
.pane-fluid--salesbook .wb-paydetail > div, .pane-fluid--purchasebook .wb-paydetail > div { grid-template-columns:repeat(auto-fit,minmax(130px,1fr)) !important; width:100%; }
.pane-fluid--salesbook .wb-pf, .pane-fluid--purchasebook .wb-pf { min-width:0; }
.pane-fluid--salesbook .wb-pf > input, .pane-fluid--purchasebook .wb-pf > input,
.pane-fluid--salesbook .wb-paysel, .pane-fluid--purchasebook .wb-paysel { min-width:0; width:100%; box-sizing:border-box; }

/* MEDIUM ช่อง (≤ 1000px): ท้ายบิล 3 → 2 คอลัมน์ (โน้ต/หมายเหตุ เต็มแถว) · แท็บ/ปุ่มพับบรรทัด */
@container pane (max-width: 1000px){
  .pane-fluid--salesbook .wb-foot, .pane-fluid--purchasebook .wb-foot { grid-template-columns:minmax(0,1fr) minmax(0,300px); }
  .pane-fluid--salesbook .wb-foot__notes, .pane-fluid--purchasebook .wb-foot__notes { grid-column:1 / -1; border-left:none; border-bottom:1px solid var(--line); }
  .pane-fluid--salesbook .docbar, .pane-fluid--purchasebook .docbar,
  .pane-fluid--salesbook .doctabs, .pane-fluid--purchasebook .doctabs,
  .pane-fluid--salesbook .wb-actions, .pane-fluid--purchasebook .wb-actions { flex-wrap:wrap; }
  .pane-fluid--salesbook .wbgrid, .pane-fluid--purchasebook .wbgrid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* NARROW ช่อง (≤ 820px): หมายเหตุ/ใบสำคัญ + ประเภทการชำระ วางซ้อนแนวตั้ง (กัน taxseg คร่อมทับใบสำคัญจ่าย)
   — กว้างกว่านี้ (เช่นช่อง ~870px) ยังวางเคียงข้างแบบที่อนุมัติ */
@container pane (max-width: 820px){
  .pane-fluid--salesbook .wb-foot__notes, .pane-fluid--purchasebook .wb-foot__notes { flex-direction:column; align-items:stretch; gap:12px; }
  .pane-fluid--salesbook .wb-foot__notes > div, .pane-fluid--purchasebook .wb-foot__notes > div { flex:1 1 auto !important; min-width:0; width:100%; }
  .pane-fluid--salesbook .wb-paytype, .pane-fluid--purchasebook .wb-paytype { justify-content:flex-start; row-gap:8px; }
  .pane-fluid--salesbook .wb-foot__notes .wb-foot__ct, .pane-fluid--purchasebook .wb-foot__notes .wb-foot__ct { text-align:left !important; }
}

/* NARROW ช่อง (≤ 680px): ท้ายบิลสแต็ก 1 คอลัมน์ · ประเภทการชำระชิดซ้าย (กันปุ่ม taxseg ซ้อน payrow) */
@container pane (max-width: 680px){
  .pane-fluid--salesbook .wb-foot, .pane-fluid--purchasebook .wb-foot { grid-template-columns:1fr; }
  .pane-fluid--salesbook .wb-foot__col + .wb-foot__col, .pane-fluid--purchasebook .wb-foot__col + .wb-foot__col { border-left:none; border-top:1px solid var(--line); }
  .pane-fluid--salesbook .wb-tot, .pane-fluid--purchasebook .wb-tot { position:static; }
  .pane-fluid--salesbook .wb-paytype, .pane-fluid--purchasebook .wb-paytype { justify-content:flex-start; }
  .pane-fluid--salesbook .wb-paydetail, .pane-fluid--purchasebook .wb-paydetail { margin-left:0 !important; width:100%; }
  .pane-fluid--salesbook .wb-paydetail__grid, .pane-fluid--purchasebook .wb-paydetail__grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pane-fluid--salesbook .wbgrid, .pane-fluid--purchasebook .wbgrid { grid-template-columns:1fr; }
  /* wb-foot__ct ที่จัด text-align:right (ประเภทการชำระ) → ซ้ายเมื่อสแต็ก */
  .pane-fluid--salesbook .wb-foot__pay-head, .pane-fluid--purchasebook .wb-foot__pay-head { text-align:left; }
}

/* ============================================================
   🟦 Purchasing (จัดซื้อ) split-pane REFLOW — container queries
   scope ทุกกฎใต้ .pane-fluid--purchasing (มีเฉพาะช่อง purchasing แบบ fluid).
   ไม่แตะจอเดี่ยว · ไม่แตะช่องเมนูอื่น · ใช้ความกว้างช่องจริง (preset จัดซื้อ+แฟ้มสินค้า 57/43).
   หมายเหตุ: โมดอลออกใบ PO/BO/จ่าย เป็น .impmodal (position:fixed) panel max-width:600px
   → ไม่ขึ้นกับความกว้างช่อง อ่านง่ายอยู่แล้ว จึง "ไม่แตะ" (กัน container query บีบฟอร์มผิด).
   ============================================================ */
/* กัน grid/flex child (min-width:auto) ดันช่องให้กว้างเกิน */
.pane-fluid--purchasing .dgrid-kpi > *,
.pane-fluid--purchasing .doctabs,
.pane-fluid--purchasing .docbar > * { min-width:0; }
/* แถบทอง "ออก PO อัตโนมัติ" — ข้อความฝั่งซ้ายตัดบรรทัดแทนดันล้น (ปุ่มขวาคงที่) */
.pane-fluid--purchasing .dwrap > div[style*="FFF6E5"] > div:first-child { min-width:0; }
/* ตารางทะเบียน PO/BO (dense หลายคอลัมน์) — ในช่อง split ให้ "คอลัมน์ข้อความตัดบรรทัดได้"
   เพื่อให้ตารางพอดีความกว้างช่อง ไม่ล้น/ปุ่มสถานะ+ปุ่มการกระทำไม่โดนตัดขอบ
   (คอลัมน์ตัวเลข + ปุ่มการกระทำ `td.num` คงบรรทัดเดียว · overflow-x:auto เป็น safety ตอนช่องแคบสุด)
   ไม่แปลงการ์ด → selection/expand/keyboard เดิมครบ. .panel__bd = กล่องตาราง (> .tbl = ตารางหลัก ไม่โดนตารางย่อยในแถวกาง) */
.pane-fluid--purchasing .panel__bd { overflow-x:auto; }
.pane-fluid--purchasing .panel__bd > .tbl td { white-space:normal !important; }
.pane-fluid--purchasing .panel__bd > .tbl td.num { white-space:nowrap !important; }
.pane-fluid--purchasing .panel__bd > .tbl .badge { white-space:normal; text-align:left; line-height:1.3; }
.pane-fluid--purchasing .panel__bd > .tbl--dense th,
.pane-fluid--purchasing .panel__bd > .tbl--dense td { padding-left:9px; padding-right:9px; }
.pane-fluid--purchasing .po-life { min-width:max-content; }
/* หัวจอให้เป็นระเบียบในช่องแคบ: แท็บที่พับหลายบรรทัดมีระยะห่างแนวตั้งสบายตา ·
   โน้ตขั้นตอน (.apnote) เว้นบรรทัดอ่านง่าย ไม่อัดแน่น */
.pane-fluid--purchasing .doctabs { row-gap:6px; padding:6px; }
.pane-fluid--purchasing .apnote { line-height:1.85; padding:11px 14px; margin-bottom:16px; }

/* MEDIUM ช่อง (≤ 900px) — KPI 4→2 คอลัมน์ · แท็บ/ปุ่มจัดการพับบรรทัด (มี flex-wrap อยู่แล้ว ย้ำไว้) */
@container pane (max-width: 900px){
  .pane-fluid--purchasing .dgrid-kpi { grid-template-columns:1fr 1fr; }
  .pane-fluid--purchasing .doctabs,
  .pane-fluid--purchasing .docbar { flex-wrap:wrap; }
}

/* NARROW ช่อง (≤ 600px) — KPI 2→1 คอลัมน์ (กันการ์ด KPI เล็กจนอ่านยาก) */
@container pane (max-width: 600px){
  .pane-fluid--purchasing .dgrid-kpi { grid-template-columns:1fr; }
}

/* ============================================================
   🟦 Dashboard-type screens split-pane REFLOW — container queries
   ครอบ: แดชบอร์ดหน้าร้าน(dashboard) · ภาพรวมทั้งร้าน(analytics) · คลัง(whdash) ·
         การเงิน(findash) · ออนไลน์(onlineops) · จัดส่ง(deliveryboard)
   scope ใต้ marker .pane-fluid--<id> เท่านั้น · ไม่แตะจอเดี่ยว/ช่องอื่น.
   กริดที่ reflow: KPI (.dgrid-kpi/.an-kpis) 4→2→1 · กริด 2 คอลัมน์
   (.twocol/.md/.an-main/.dlv-grid) สแต็กเป็น 1 คอลัมน์ (กราฟ/ตาราง/การ์ดเต็มกว้าง อ่านง่าย).
   ============================================================ */
.pane-fluid--dashboard .dgrid-kpi > *, .pane-fluid--dashboard .twocol > *,
.pane-fluid--analytics .an-kpis > *, .pane-fluid--analytics .an-main > *,
.pane-fluid--whdash .dgrid-kpi > *, .pane-fluid--whdash .md > *,
.pane-fluid--findash .dgrid-kpi > *, .pane-fluid--findash .md > *,
.pane-fluid--deliveryboard .dgrid-kpi > *, .pane-fluid--deliveryboard .dlv-grid > *,
.pane-fluid--onlineops .dgrid-kpi > * { min-width:0; }
/* ตารางในแดชบอร์ดเลื่อนแนวนอนในกล่องได้เมื่อช่องแคบ */
.pane-fluid--dashboard .panel__bd, .pane-fluid--analytics .panel__bd,
.pane-fluid--whdash .panel__bd, .pane-fluid--findash .panel__bd,
.pane-fluid--deliveryboard .panel__bd, .pane-fluid--onlineops .panel__bd { overflow-x:auto; }
/* 🔧 กัน min-content ของตารางขายดันคอลัมน์ซ้ายเกิน 1.5fr จนบีบ "เครื่องมือผู้ดูแล" แคบ
   → ลูก grid ทุกตัว min-width:0 (ตารางเลื่อนแนวนอนในคอลัมน์ตัวเองแทนดันความกว้าง) */
.pane-fluid--dashboard .twocol > * { min-width:0; }
/* MEDIUM ช่อง (≤ 900px) — KPI 4→2 · กริด 2 คอลัมน์ → สแต็ก 1 คอลัมน์ */
@container pane (max-width: 900px){
  .pane-fluid--dashboard .dgrid-kpi, .pane-fluid--whdash .dgrid-kpi,
  .pane-fluid--findash .dgrid-kpi, .pane-fluid--deliveryboard .dgrid-kpi,
  .pane-fluid--onlineops .dgrid-kpi, .pane-fluid--analytics .an-kpis { grid-template-columns:1fr 1fr; }
  .pane-fluid--dashboard .twocol, .pane-fluid--whdash .md, .pane-fluid--findash .md,
  .pane-fluid--analytics .an-main, .pane-fluid--deliveryboard .dlv-grid { grid-template-columns:1fr !important; }
  .pane-fluid--analytics .an-row--2a, .pane-fluid--analytics .an-row--2, .pane-fluid--analytics .an-row--3 { grid-template-columns:1fr !important; }
}
.pane-fluid--analytics .an-row > * { min-width:0; }
/* NARROW ช่อง (≤ 600px) — KPI 2→1 (กันการ์ด KPI เล็กจนอ่านยาก) */
@container pane (max-width: 600px){
  .pane-fluid--dashboard .dgrid-kpi, .pane-fluid--whdash .dgrid-kpi,
  .pane-fluid--findash .dgrid-kpi, .pane-fluid--deliveryboard .dgrid-kpi,
  .pane-fluid--onlineops .dgrid-kpi, .pane-fluid--analytics .an-kpis { grid-template-columns:1fr; }
}

/* ============================================================
   🟦 จอลิสต์/การ์ด/แชท ในช่อง split (fluid) — reflow ทั่วไป
   ครอบ: ศูนย์แจ้งเตือน(alerts) · กูรูอะไหล่(aiguru) · วิเคราะห์ลูกค้า(custinsight) ·
         ข้อมูลรถ(carinfo) · ระบบสมาชิก(members) · โปรโมชั่นหน้าร้าน(marketing).
   เต็มกว้างช่อง (ปลด .dwrap max-width) · KPI 4→2→1 · กริด 2 คอลัมน์ → สแต็ก · กัน overflow.
   ============================================================ */
.pane-fluid--alerts .dwrap, .pane-fluid--aiguru .dwrap, .pane-fluid--custinsight .dwrap,
.pane-fluid--carinfo .dwrap, .pane-fluid--members .dwrap, .pane-fluid--marketing2 .dwrap { max-width:none; }
.pane-fluid--alerts .dgrid-kpi > *, .pane-fluid--aiguru .dgrid-kpi > *, .pane-fluid--custinsight .dgrid-kpi > *,
.pane-fluid--carinfo .dgrid-kpi > *, .pane-fluid--members .dgrid-kpi > *, .pane-fluid--marketing2 .dgrid-kpi > *,
.pane-fluid--custinsight .twocol > *, .pane-fluid--members .twocol > *, .pane-fluid--marketing2 .twocol > * { min-width:0; }
.pane-fluid--alerts .panel__bd, .pane-fluid--aiguru .panel__bd, .pane-fluid--custinsight .panel__bd,
.pane-fluid--carinfo .panel__bd, .pane-fluid--members .panel__bd, .pane-fluid--marketing2 .panel__bd { overflow-x:auto; }
.pane-fluid--aiguru .guru2 { grid-template-columns:1fr !important; }
@container pane (max-width: 900px){
  .pane-fluid--alerts .dgrid-kpi, .pane-fluid--carinfo .dgrid-kpi, .pane-fluid--custinsight .dgrid-kpi,
  .pane-fluid--members .dgrid-kpi, .pane-fluid--marketing2 .dgrid-kpi { grid-template-columns:1fr 1fr; }
  .pane-fluid--custinsight .twocol, .pane-fluid--members .twocol, .pane-fluid--marketing2 .twocol { grid-template-columns:1fr !important; }
}
@container pane (max-width: 600px){
  .pane-fluid--alerts .dgrid-kpi, .pane-fluid--carinfo .dgrid-kpi, .pane-fluid--custinsight .dgrid-kpi,
  .pane-fluid--members .dgrid-kpi, .pane-fluid--marketing2 .dgrid-kpi { grid-template-columns:1fr; }
}
/* 🔧 ข้อมูลรถ (carinfo) — hero ใช้ @media viewport เดิม ไม่ reflow ตามช่อง split → เพี้ยน.
   เพิ่ม container query ตามความกว้างช่อง: hero รูป+ข้อมูล สแต็ก 1 คอลัมน์เมื่อช่องแคบ
   (ใช้ 900px ให้สแต็กเร็วพอ ก่อนที่ 2 คอลัมน์จะอัดกันจนซ้อน/มีเส้นเชื่อมกลาง) */
@container pane (max-width: 900px){
  .pane-fluid--carinfo .carbro__hero { grid-template-columns:1fr; }
}

/* ============================================================
   🟦 ตารางแน่น → การ์ดกระชับในช่อง split (เลิกเลื่อนแนวนอน)
   เปลี่ยน <table> เป็นการ์ดหลายบรรทัดด้วย CSS grid (วาง td ตาม nth-child คงที่)
   — DOM/handler/selection/sort/input เดิมครบ · เปิดเฉพาะช่อง fluid ที่แคบ (≤820px).
   ช่องกว้าง (>900px) คงตารางแน่นเดิม.
   ============================================================ */
@container pane (max-width: 900px){

  /* ---------- Products / แฟ้มสินค้า : รายการสินค้า → การ์ด 2 บรรทัด ---------- */
  .pane-fluid--products .docreg__tbl { overflow:visible; }
  .pane-fluid--products .docreg__tbl .tbl { min-width:0; display:flex; flex-direction:column; width:100%; max-width:100%; }
  .pane-fluid--products .docreg__tbl colgroup { display:none; }
  /* หัวตาราง → แถบเรียงลำดับแบบชิป (คลิกเรียงได้เหมือนเดิม) */
  .pane-fluid--products .docreg__tbl thead { display:block; }
  .pane-fluid--products .docreg__tbl thead tr { display:flex; flex-wrap:wrap; gap:4px 5px; padding:7px 9px; border-bottom:1px solid var(--line); background:var(--surface-2); }
  .pane-fluid--products .docreg__tbl thead th { display:inline-flex; align-items:center; gap:2px; width:auto !important; padding:2px 8px; font-size:11px; font-weight:600; color:var(--dim); border:1px solid var(--line); border-radius:999px; background:var(--surface); white-space:nowrap; cursor:pointer; }
  .pane-fluid--products .docreg__tbl thead th.is-sorted { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
  .pane-fluid--products .docreg__tbl thead .colresize { display:none; }
  /* แถวข้อมูล → การ์ด grid */
  .pane-fluid--products .docreg__tbl tbody { display:contents; }
  .pane-fluid--products .docreg__tbl tbody tr {
    display:grid; grid-template-columns:132px minmax(0,1fr) auto;
    align-items:baseline; column-gap:9px; row-gap:3px;
    padding:9px 11px; border-bottom:1px solid var(--line); cursor:pointer;
  }
  .pane-fluid--products .docreg__tbl tbody tr.is-sel { background:#fdf6e6; }
  /* ลบขีดทองสั้น ๆ ที่เซลล์รหัส (กล่อง td แรกสูงแค่บรรทัดเดียวในการ์ด) — ใช้พื้นครีมเป็นตัวบอกว่าเลือกแถวพอ */
  .pane-fluid--products .docreg__tbl tbody tr.is-sel td:first-child { box-shadow:none; }
  .pane-fluid--products .docreg__tbl tbody td { display:block; border:none !important; padding:0; white-space:normal; overflow:visible; text-overflow:clip; height:auto; }
  /* แถวว่าง (colspan) — คืนเต็มความกว้าง */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1):last-child { grid-column:1/-1; text-align:center; display:block !important; padding-left:0 !important; }
  /* บรรทัด 1: รหัส (คอลัมน์กว้างคงที่ → ชื่อตรงทุกแถว) · ชื่อ · ยี่ห้ออะไหล่ */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) { grid-column:1; grid-row:1; font-size:13px; display:flex; flex-wrap:wrap; align-items:center; gap:2px 4px; padding-left:0 !important; }
  /* ดาวโปรด (favstar) — ในการ์ดให้ไหลตาม flex (ไม่ absolute) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1).codecell { padding-left:0 !important; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .favstar { position:static; transform:none; }
  /* แท็กสถานะ (โปรโมชั่น/พรีออเดอร์/ของแถม/เลิกผลิต) → ชิปไอคอนกลมเล็ก (ใช้ Icon เดิมของแอป) · ซ่อนข้อความ ชี้เมาส์ดูคำเต็ม (title) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .promotag,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .pretag,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .gifttag,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .disctag {
    margin-left:0; padding:0; width:19px; height:19px; min-width:19px; border-radius:5px;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:0; line-height:0; overflow:visible; cursor:help; gap:0; position:relative;
  }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .promotag svg,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .pretag svg,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .gifttag svg,
  .pane-fluid--products .docreg__tbl tbody td:nth-child(1) .disctag svg { flex:none; }
  /* ชื่อ */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(4) { grid-column:2; grid-row:1; font-weight:600; font-size:13px; line-height:1.35; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(7) { grid-column:3; grid-row:1; text-align:right; font-size:11.5px; max-width:33cqw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  /* บรรทัด 2+: meta ไหลเป็นกริดย่อย (เบอร์แท้ · รุ่นรถ · เกรด · ราคา · ที่เก็บ · คงเหลือ) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(2),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(3),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(6),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(8),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(10),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(11) { font-size:11.5px; display:inline-flex; align-items:baseline; gap:3px; min-width:0; }
  /* 🔧 จัดเรียง 3 บรรทัด (ตาม spec ผู้ใช้):
     บรรทัด1: รหัส+แท็ก(ซ้าย) · ชื่อ(กลาง) · ยี่ห้อ(ขวา)
     บรรทัด2: เบอร์แท้/โรงงาน(ซ้าย) · รุ่นรถ(กลาง) · เกรด(ขวา)
     บรรทัด3: ราคา(ซ้าย) · ที่เก็บ(กลาง ใต้รุ่นรถ) · คงเหลือ(ขวา) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(3) { grid-column:1; grid-row:2; overflow:hidden; }   /* เบอร์แท้/โรงงาน (ซ้าย) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(6) { grid-column:2; grid-row:2; }   /* รุ่นรถ (กลาง) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(8) { grid-column:3; grid-row:2; justify-content:flex-end; }   /* เกรด (ขวา) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(10) { grid-column:1; grid-row:3; }   /* ราคา (ซ้าย) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(2) { grid-column:2; grid-row:3; }   /* ที่เก็บ (กลาง ใต้รุ่นรถ) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(11) { grid-column:3; grid-row:3; justify-content:flex-end; }   /* คงเหลือ (ขวา) */
  /* ค่า meta รอง (เบอร์แท้ · รุ่นรถ · เกรด · ที่เก็บ) — slate-600 อ่านชัด (override inline var(--dim)) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(2),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(3),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(6),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(8) { color:#475569 !important; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(3)::before { content:"เบอร์แท้ "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--products .docreg__tbl .numfield-factory tbody td:nth-child(3)::before { content:"เบอร์โรงงาน "; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(2)::before { content:"ที่เก็บ "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(10)::before { content:"ราคา "; color:#64748B; font-size:10px; font-weight:600; }
  /* ราคา — navy เข้ม เด่น */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(10) { color:var(--navy-700) !important; font-weight:700; }
  /* คงเหลือ — slate-800 เข้มชัด (สำคัญ) */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(11) { color:#1E293B !important; font-weight:700; }
  .pane-fluid--products .docreg__tbl tbody td:nth-child(11)::before { content:"คงเหลือ "; color:#64748B; font-size:10px; font-weight:600; }
  /* ซ่อนคอลัมน์ซ้ำซ้อน/รองในการ์ด (ยี่ห้อรถ · ต้นทุน · หน่วย) — ยังดูเต็มได้ในจอเดี่ยว */
  .pane-fluid--products .docreg__tbl tbody td:nth-child(5),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(9),
  .pane-fluid--products .docreg__tbl tbody td:nth-child(12) { display:none; }
  /* ซ่อนหัวชิปของคอลัมน์ที่ซ่อนในการ์ด ให้สอดคล้อง */
  .pane-fluid--products .docreg__tbl thead th:nth-child(5),
  .pane-fluid--products .docreg__tbl thead th:nth-child(9),
  .pane-fluid--products .docreg__tbl thead th:nth-child(12) { display:none; }

  /* ---------- รหัสบริการรอตรวจ (.scr-tbl, 9 คอลัมน์แน่น) → การ์ดในช่อง split ---------- */
  .pane-fluid--products .scr-tblwrap { overflow-x:visible; }
  .pane-fluid--products .scr-tbl { display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--products .scr-tbl thead { display:none; }
  .pane-fluid--products .scr-tbl tbody { display:contents; }
  .pane-fluid--products .scr-tbl tbody tr { display:grid; grid-template-columns:1fr 1fr; gap:3px 12px; padding:11px 13px; border-bottom:1px solid var(--line); }
  .pane-fluid--products .scr-tbl tbody td { display:block; border:none !important; padding:0; white-space:normal; height:auto; }
  /* บรรทัด1: รหัส 31 (ซ้าย) · วันที่ (ขวา) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(1) { grid-column:1; grid-row:1; font-weight:700; font-size:13px; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(7) { grid-column:2; grid-row:1; text-align:right; color:var(--dim); font-size:11.5px; }
  /* บรรทัด2: ชื่อสินค้า/รุ่น (เต็มแถว) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(2) { grid-column:1 / -1; grid-row:2; }
  /* บรรทัด3: เบอร์แท้ (ซ้าย) · ผู้ขาย (ขวา) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(3) { grid-column:1; grid-row:3; font-size:11.5px; color:#475569; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(4) { grid-column:2; grid-row:3; font-size:11.5px; color:#475569; text-align:right; }
  /* บรรทัด4: ทุน (ซ้าย) · ขาย (ขวา) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(5) { grid-column:1; grid-row:4; text-align:left !important; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(6) { grid-column:2; grid-row:4; text-align:right !important; color:var(--navy-700); font-weight:700; }
  /* บรรทัด5: ปุ่มจัดการ (เต็มแถว) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(9) { grid-column:1 / -1; grid-row:5; margin-top:5px; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(9) .scr-acts { gap:7px; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(9) .scr-acts .scr-btn { flex:1 1 auto; justify-content:center; }
  /* ซ่อน "โดย" ในการ์ด (รองสุด) */
  .pane-fluid--products .scr-tbl tbody td:nth-child(8) { display:none; }
  /* ป้ายกำกับ meta */
  .pane-fluid--products .scr-tbl tbody td:nth-child(3)::before { content:"เบอร์แท้ "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(4)::before { content:"ผู้ขาย "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(5)::before { content:"ทุน "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--products .scr-tbl tbody td:nth-child(6)::before { content:"ขาย "; color:#64748B; font-size:10px; font-weight:600; }
  /* แถวว่าง (colSpan) — เต็มแถว */
  .pane-fluid--products .scr-tbl tbody td.scr-empty { grid-column:1 / -1; grid-row:auto; text-align:center; }

  /* ---------- GR Receive / รับของเข้าคลัง : รายการสินค้าในบิล → การ์ดแก้ไข ---------- */
  .pane-fluid--grreceive .panel__bd { overflow-x:visible; }
  .pane-fluid--grreceive .panel__bd > .tbl { min-width:0; display:flex; flex-direction:column; width:100%; max-width:100%; }
  .pane-fluid--grreceive .panel__bd > .tbl > thead { display:none; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody { display:contents; }
  /* แถวตารางกระชับ 2 บรรทัด (ไม่ใช่การ์ดสูง) — flex + ตัวคั่น ::after บังคับขึ้นบรรทัด 2 */
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr {
    display:flex; flex-wrap:wrap; align-items:center; column-gap:8px; row-gap:5px;
    width:100%; max-width:100%; box-sizing:border-box;
    padding:6px 10px; border-bottom:1px solid var(--line);
  }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td { display:flex; align-items:center; gap:3px; border:none !important; padding:0; min-width:0; white-space:nowrap; }
  /* แถวว่าง (colspan) เต็มแถว */
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(1):last-child { flex-basis:100%; }
  /* === บรรทัด 1: # · รหัส · Y/N · รายการ(ยืด) · อ้างอิง PO · ลบ === */
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(1):not(:last-child){ order:1; font-size:11px; color:var(--dim); }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(2){ order:2; font-size:12px; font-weight:700; color:var(--navy-700); }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(3){ order:3; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(4){ order:4; flex:1 1 80px; min-width:60px; font-size:12px; white-space:normal; display:block; overflow:hidden; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(5){ order:5; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(12){ order:6; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr::after { content:""; flex-basis:100%; height:0; order:7; }
  /* === บรรทัด 2: จำนวน · หน่วย · ราคา · ลด% · ลดรวม · จำนวนเงิน(ขวา) === */
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(6){ order:8; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(7){ order:9; font-size:11.5px; color:var(--ink-2); }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(8){ order:10; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(9){ order:11; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(10){ order:12; font-size:11.5px; color:var(--ink-2); }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(11){ order:13; margin-left:auto; font-weight:700; }
  /* ช่องกรอกกระชับ (override inline width) */
  .pane-fluid--grreceive .panel__bd > .tbl .grin { box-sizing:border-box; padding:4px 7px; height:auto; text-align:right; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(6) .grin { width:54px !important; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(8) .grin { width:84px !important; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(9) .grin { width:46px !important; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(5) .grin { width:132px !important; text-align:left; }
  /* ป้ายกำกับ inline เล็ก (ซ่อน header) */
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(5)::before { content:"PO"; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(6)::before { content:"จำนวน"; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(8)::before { content:"ราคา"; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(9)::before { content:"ลด%"; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(10)::before { content:"ลดรวม"; }
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(5)::before,
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(6)::before,
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(8)::before,
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(9)::before,
  .pane-fluid--grreceive .panel__bd > .tbl > tbody > tr > td:nth-child(10)::before { font-size:9px; color:#64748B; font-weight:600; flex:none; }

  /* ---------- บิลรับเข้าที่บันทึกแล้ว (.grsaved-tbl, 8 คอลัมน์) → การ์ดในช่อง split ---------- */
  .pane-fluid--grreceive .grsaved-tbl { display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--grreceive .grsaved-tbl thead { display:none; }
  .pane-fluid--grreceive .grsaved-tbl tbody { display:contents; }
  .pane-fluid--grreceive .grsaved-tbl tbody tr { display:grid; grid-template-columns:1fr 1fr; gap:3px 12px; padding:11px 13px; border-bottom:1px solid var(--line); }
  .pane-fluid--grreceive .grsaved-tbl tbody td { display:block; border:none !important; padding:0; white-space:normal !important; height:auto; text-align:left !important; }
  /* r1: เลขที่บิลซื้อ (ซ้าย เด่น) · สถานะ (ขวา) */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(3) { grid-column:1; grid-row:1; font-weight:700; }
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(7) { grid-column:2; grid-row:1; text-align:right !important; }
  /* r2: ผู้ขาย (เต็มแถว) */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(4) { grid-column:1 / -1; grid-row:2; color:#475569; }
  /* r3: วันที่ (ซ้าย) · ยอดสุทธิ (ขวา เด่น) */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(1) { grid-column:1; grid-row:3; font-size:11.5px; color:var(--dim); }
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(6) { grid-column:2; grid-row:3; text-align:right !important; color:var(--navy-700); font-weight:700; }
  /* r4: เลขอ้างอิง (ซ้าย) · จัดการ (ขวา) */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(5) { grid-column:1; grid-row:4; font-size:11.5px; color:#475569; }
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(8) { grid-column:2; grid-row:4; text-align:right !important; white-space:nowrap !important; }
  /* ซ่อนเวลา (รอง) ในการ์ด */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(2) { display:none; }
  /* ป้ายกำกับ */
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(1)::before { content:"วันที่ "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(6)::before { content:"ยอดสุทธิ "; color:#64748B; font-size:10px; font-weight:600; }
  .pane-fluid--grreceive .grsaved-tbl tbody td:nth-child(5)::before { content:"อ้างอิง "; color:#64748B; font-size:10px; font-weight:600; }
}

/* price table + master flags */
.pricetbl { border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.pricetbl__hd, .pricetbl__row { display:grid; grid-template-columns:minmax(0,1.4fr) 1fr .7fr 1fr; gap:8px; padding:8px 12px; align-items:center; }
.pricetbl__hd { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10.5px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; font-family:"Noto Sans",sans-serif; }
.pricetbl__hd .num, .pricetbl__row .num { text-align:right; }
.pricetbl__row { font-size:12.5px; }
.pricetbl__row span:first-child { font-weight:600; color:var(--ink-2); }
.pricetbl__row + .pricetbl__row { border-top:1px solid var(--line); }
.flagsrow { display:flex; gap:12px; flex-wrap:nowrap; margin-top:12px; padding-top:12px; padding-bottom:4px; margin-bottom:12px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.flagchk { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:var(--ink-2); white-space:nowrap; min-width:0; }
.flagchk span { overflow:hidden; text-overflow:ellipsis; }

/* product image carousel */
.imgwrap { max-width:520px; }
.imgmain { position:relative; border:1px solid var(--line); border-radius:var(--r-md); background:var(--surface-2); overflow:hidden; }
.imgmain__img { width:100%; height:300px; object-fit:contain; background:#fff; display:block; }
.imgnav { position:absolute; top:50%; transform:translateY(-50%); width:38px; height:38px; border-radius:50%; border:none; background:rgba(11,26,51,.6); color:#fff; display:grid; place-items:center; cursor:pointer; transition:background .14s; }
.imgnav--prev { left:10px; } .imgnav--next { right:10px; }
.imgnav:hover { background:rgba(11,26,51,.88); }
.imgcount { position:absolute; bottom:10px; right:10px; background:rgba(11,26,51,.72); color:#fff; font-size:11px; padding:3px 9px; border-radius:99px; }
.imgthumbs { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.imgthumb { position:relative; width:62px; height:62px; border-radius:8px; overflow:hidden; border:2px solid var(--line); cursor:pointer; }
.imgthumb.is-active { border-color:var(--gold-500); }
.imgthumb img { width:100%; height:100%; object-fit:cover; }
.imgthumb__x { position:absolute; top:2px; right:2px; width:18px; height:18px; border-radius:50%; border:none; background:rgba(11,26,51,.72); color:#fff; display:grid; place-items:center; cursor:pointer; padding:0; }
.imgadd { width:62px; height:62px; border-radius:8px; border:1.5px dashed var(--line-2); background:var(--surface-2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; cursor:pointer; color:var(--navy-600); }
.imgadd:hover { border-color:var(--gold-400); background:#fffdf6; }
/* ---- สตูดิโอภาพสินค้า (จอในแอปหลัก) ---- */
.stuhost { height:calc(100vh - 132px); min-height:520px; border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; background:var(--surface); }
.stuhost .stu { height:100%; }
.imgstudio { position:absolute; bottom:10px; left:10px; display:inline-flex; align-items:center; gap:4px; background:rgba(11,26,51,.72); color:#ffd98a; font-size:11px; padding:3px 9px; border-radius:99px; }
.imgacts { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.imgshared { display:flex; align-items:center; gap:7px; margin-top:10px; padding:7px 12px; border-radius:var(--r-sm); background:#eef3fc; border:1px solid #cfdcf3; color:var(--navy-800); font-size:11.5px; }
.imgqd { display:inline-flex; align-items:center; gap:6px; padding:0 12px; height:30px; border-radius:var(--r-sm); background:#fff8ea; border:1px solid var(--gold-400); color:#7a5600; font-size:11.5px; font-weight:700; }
.imgthumb__cv { position:absolute; bottom:0; left:0; right:0; background:rgba(11,26,51,.78); color:#ffd98a; font-size:9px; text-align:center; padding:1px 0; letter-spacing:.5px; }
.imgthumb__st { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:4px; background:var(--gold-500); color:#1b2537; font-size:9px; font-weight:800; display:grid; place-items:center; }
.partwrap { display:flex; flex-direction:column; gap:10px; }
.partdetail { display:flex; flex-direction:column; margin-top:2px; }
.partpane { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:10px 14px; }

/* 2-layer search — compact single row */
.search2box { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--sh-sm); padding:6px 9px; flex:none; }
.search2row { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.search2__cat { flex:0 1 240px; min-width:150px; max-width:300px; padding:7px 10px; }
.search2__div { width:1px; align-self:stretch; min-height:26px; background:var(--line-2); margin:0 3px; }
.search2__tier { font-family:var(--ff); font-size:10.5px; font-weight:800; color:#fff; background:var(--navy-700); border-radius:var(--r-pill); padding:3px 9px; flex:none; }
.search2__tier--2 { background:var(--gold-600); }
.search2__and { font-size:11.5px; color:var(--dim); font-weight:600; flex:none; }
.search2__field { font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:7px 9px; cursor:pointer; outline:none; flex:none; max-width:150px; }
.search2__in { flex:1 1 110px; min-width:90px; font-family:var(--ff); font-size:13px; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:7px 10px; outline:none; }
.search2__in:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.search2__btn { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:#fff; background:var(--navy-700); border:none; border-radius:var(--r-sm); padding:7px 13px; cursor:pointer; flex:none; }
.search2__btn:hover { background:var(--navy-800); }
.search2__adv { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:7px 11px; cursor:pointer; flex:none; }
.search2__adv:hover { border-color:var(--gold-400); background:#fffdf6; }
.search2__mng { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-sm); cursor:pointer; flex:none; }
.search2__mng:hover { border-color:var(--gold-400); background:#fffdf6; color:var(--navy-700); }
.searchresult { display:flex; align-items:center; gap:8px; flex:none; font-size:12px; color:var(--ink-2); background:#fdf6e6; border:1px solid var(--gold-300); border-radius:var(--r-sm); padding:6px 12px; }
.searchresult b { color:var(--navy-800); }
.searchresult__clear { margin-left:auto; display:inline-flex; align-items:center; gap:5px; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--danger); }

.gradechip { display:inline-flex; align-items:center; font-family:var(--ff); font-size:11px; font-weight:700; padding:2px 9px; border-radius:var(--r-pill); white-space:nowrap; }
.gradechip--real { background:var(--ok-bg); color:var(--ok-ink); }
.gradechip--alt  { background:var(--info-bg); color:var(--info-ink); }

/* รหัสสินค้า → สลับเกรด แท้/เทียม ด้วยลูกศร ↑/↓ (เหมือน KACC9) */
.codegrade { display:inline-flex; align-items:center; gap:7px; padding:2px 7px; border-radius:7px; cursor:pointer; outline:none; border:1px solid transparent; }
.codegrade:hover { border-color:#c3d0ea; background:#f2f6fc; }
.codegrade:focus { border-color:#1657c2; background:#eef3fc; box-shadow:0 0 0 2px rgba(22,87,194,.20); }
.codegrade__sw { font-size:12.5px; font-weight:800; color:#1657c2; line-height:1; }
.codegrade:focus .codegrade__sw { animation:codegradePulse 1.1s ease-in-out infinite; }
@keyframes codegradePulse { 0%,100%{ opacity:.45; } 50%{ opacity:1; } }
.codegrade .gradechip { cursor:pointer; }

/* 🪞 กระจกสะท้อนข้อมูลร่วม (เบอร์แท้เดียวกัน) */
.mirrortog { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:700; color:#1657c2; cursor:pointer; padding:4px 10px; border:1px solid #c7d2e6; border-radius:7px; background:#f2f6fc; user-select:none; white-space:nowrap; }
.mirrortog input { accent-color:#1657c2; cursor:pointer; width:14px; height:14px; }
.mirrornote { font-family:var(--ff); font-size:11.5px; font-weight:700; color:#1657c2; background:#eef3fc; border:1px solid #cdddf3; border-radius:7px; padding:5px 11px; margin:3px 0 5px; }
/* ✨ ปุ่มย่ออัตโนมัติของชื่อย่อ */
.abbrfield { display:inline-flex; align-items:center; gap:4px; min-width:0; }
.abbrfield .specrow__edit { flex:0 1 58px; width:58px; min-width:0; text-align:left; }
.abbrgen { flex:none; display:inline-flex; align-items:center; justify-content:center; font-family:var(--ff); font-size:13px; line-height:1; color:#9a6200; background:#fbf1dd; border:1px solid #e2c073; border-radius:6px; padding:3px 6px; cursor:pointer; }
.abbrgen:hover { background:#f6e3b8; }

/* general tab */
.pg { display:grid; grid-template-columns:minmax(0,1fr) 372px; gap:22px; align-items:start; }
.pg__id { display:flex; gap:14px; align-items:flex-start; padding-bottom:14px; border-bottom:1px solid var(--line); }
.pg__imgph { width:60px; height:60px; flex:none; border-radius:13px; background:var(--surface-3); display:grid; place-items:center; }
.pg__name { font-size:16px; font-weight:800; line-height:1.25; }
.pg__sub { font-size:12px; color:var(--dim); margin-top:3px; }
.pg__sec { font-size:11.5px; font-weight:700; color:var(--ink-2); letter-spacing:.2px; margin:18px 0 10px; padding-bottom:6px; border-bottom:1px solid var(--line); }
.pg__side .pg__sec:first-child { margin-top:0; }

/* draggable layout cards */
.pg2 { display:flex; flex-direction:column; }
.pghint { display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--dim); margin:14px 0 10px; }
.pghint__reset { margin-left:auto; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-600); }
.pgcards { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
.pgcard { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--sh-sm); overflow:hidden; transition:box-shadow .14s, transform .14s, opacity .14s; }
.pgcard--wide { grid-column:1 / -1; }
.pgcard__hd { display:flex; align-items:center; gap:8px; padding:9px 13px; border-bottom:1px solid var(--line); background:var(--surface-2); cursor:grab; user-select:none; }
.pgcard__hd:active { cursor:grabbing; }
.pgcard__grip { color:var(--line-2); display:flex; }
.pgcard__hd:hover .pgcard__grip { color:var(--navy-600); }
.pgcard__t { font-size:12.5px; font-weight:700; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pgcard__bd { padding:14px; }
.pgcard.is-drag { opacity:.4; }
.pgcard.is-over { box-shadow:0 0 0 2px var(--gold-500), var(--sh-md); transform:translateY(-1px); }
.pgcard.is-over .pgcard__hd { background:#fdf6e6; }

@media (max-width:860px){ .pgcards { grid-template-columns:1fr; } }

/* 3-column legacy arrangement — equal width & height */
.pg3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; align-items:stretch; margin-top:0; }
.pgcol { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--sh-sm); overflow:hidden; display:flex; flex-direction:column; }
.pgcol--full { grid-column:1 / -1; }
.pgcol__hd { display:flex; align-items:center; gap:8px; min-height:40px; padding:4px 12px; border-bottom:1px solid var(--line); background:var(--surface-2); }
.pgcol__no { display:grid; place-items:center; width:18px; height:18px; border-radius:5px; background:var(--navy-700); color:#fff; font-size:11px; font-weight:800; flex:none; }
.pgcol__t { font-size:12.5px; font-weight:700; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pghdacts { margin-left:auto; display:flex; align-items:center; gap:6px; flex:none; }
.pghdbtn { width:28px; height:28px; border-radius:7px; border:1px solid var(--line-2); background:var(--surface); color:var(--dim); display:grid; place-items:center; cursor:pointer; transition:background .12s, color .12s, border-color .12s; }
.pghdbtn:hover { background:var(--surface-2); color:var(--ink-2); }
.pghdbtn:active { transform:scale(.92); }
.pghdbtn--fav.is-on { color:var(--gold-600); border-color:var(--gold-300); background:#fdf6e6; }
.pghdbtn--fav.is-on svg { fill:var(--gold-400); }
.pghdbtn--void.is-on { color:var(--danger-ink,#b42318); border-color:#f0c2bd; background:var(--danger-bg,#fdeceb); }
.pghdbtn--disc.is-on { color:var(--warn-ink); border-color:#e6cd97; background:var(--warn-bg); }
.discbadge { display:inline-block; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #e6cd97; border-radius:99px; padding:1px 8px; vertical-align:1px; letter-spacing:0; text-decoration:none; }
.disctag { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; margin-left:7px; font-family:var(--ff); font-size:9.5px; font-weight:800; line-height:1; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #e6cd97; border-radius:4px; padding:2px 5px; vertical-align:1px; letter-spacing:0; }
.pghdbtn--promo.is-on { color:var(--violet); border-color:#cfc4f0; background:var(--violet-bg); }
.gradebadge { display:inline-block; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; border-radius:99px; padding:2px 9px; vertical-align:middle; }
.gradebadge--ok { color:var(--ok-ink); background:var(--ok-bg); border:1px solid #a7d7bd; }
.gradebadge--warn { color:var(--warn-ink); background:var(--warn-bg); border:1px solid #e6cd97; }
.parttags { display:flex; flex-wrap:wrap; align-items:center; gap:6px 7px; padding:7px 0 2px; }
.parttags > span { margin-left:0 !important; }
.codeline { display:grid; grid-template-columns:1.7fr 0.8fr 0.95fr; align-items:baseline; gap:5px 20px; padding:5px 0; border-bottom:1px dotted var(--line); }
.codeline .duospec__pair { flex:0 0 auto; justify-content:flex-start; gap:7px; min-width:0; }
.codeline .specrow__v { text-align:left; }
.codeline .duospec__pair .specrow__v.accent { font-size:14.5px; flex:0 0 auto; overflow:visible; text-overflow:clip; min-width:max-content; }
.pghdbtn { position:relative; }
.pghdbtn__n { position:absolute; top:-5px; right:-5px; min-width:15px; height:15px; padding:0 3px; border-radius:99px; background:var(--violet); color:#fff; font-family:var(--ff); font-size:9.5px; font-weight:800; line-height:15px; text-align:center; box-shadow:0 0 0 1.5px var(--surface); }
.promobadge { display:inline-flex; align-items:center; gap:3px; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; color:#4a3a9e; background:var(--violet-bg); border:1px solid #cfc4f0; border-radius:99px; padding:1px 8px 1px 6px; vertical-align:1px; letter-spacing:0; text-decoration:none; }
.promotag { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; margin-left:7px; font-family:var(--ff); font-size:9.5px; font-weight:800; line-height:1; color:#4a3a9e; background:var(--violet-bg); border:1px solid #cfc4f0; border-radius:4px; padding:2px 5px; vertical-align:1px; letter-spacing:0; }
.pghdbtn--pre.is-on { color:var(--info-ink); border-color:#b9d3ee; background:var(--info-bg); }
.prebadge { display:inline-flex; align-items:center; gap:3px; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; color:var(--info-ink); background:var(--info-bg); border:1px solid #b9d3ee; border-radius:99px; padding:1px 8px 1px 6px; vertical-align:1px; letter-spacing:0; text-decoration:none; }
.pretag { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; margin-left:7px; font-family:var(--ff); font-size:9.5px; font-weight:800; line-height:1; color:var(--info-ink); background:var(--info-bg); border:1px solid #b9d3ee; border-radius:4px; padding:2px 5px; vertical-align:1px; letter-spacing:0; }
.pghdbtn--gift.is-on { color:var(--ok-ink); border-color:#a7d7bd; background:var(--ok-bg); }
.giftbadge { display:inline-flex; align-items:center; gap:3px; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; color:var(--ok-ink); background:var(--ok-bg); border:1px solid #a7d7bd; border-radius:99px; padding:1px 8px 1px 6px; vertical-align:1px; letter-spacing:0; }
.gifttag { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; margin-left:7px; font-family:var(--ff); font-size:9.5px; font-weight:800; line-height:1; color:var(--ok-ink); background:var(--ok-bg); border:1px solid #a7d7bd; border-radius:4px; padding:2px 5px; vertical-align:1px; letter-spacing:0; }
.mergebtn { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:700; color:#fff; background:var(--navy-700); border:none; border-radius:var(--r-pill); padding:6px 14px; cursor:pointer; margin-left:6px; }
.mergebtn:hover { background:var(--navy-800); }
.mergehint { font-size:11px; color:var(--dim); margin-left:6px; }
/* 🏷️ ป้ายแท็กในรายการสินค้า (จอเดี่ยว/ตารางแน่น) → ชิปไอคอนล้วน · ประหยัดพื้นที่ · ชี้เมาส์ดูคำเต็ม (title) · โปรฯ มี badge นับ */
.docreg__tbl .disctag, .docreg__tbl .promotag, .docreg__tbl .pretag, .docreg__tbl .gifttag {
  position:relative; gap:0; margin-left:5px; padding:0; width:19px; height:19px; min-width:19px;
  box-sizing:border-box; justify-content:center; border-radius:5px; overflow:visible; cursor:help;
}
.docreg__tbl .disctag svg, .docreg__tbl .promotag svg, .docreg__tbl .pretag svg, .docreg__tbl .gifttag svg { flex:none; }
.docreg__tbl .ptagn {
  position:absolute; top:-6px; right:-6px; min-width:14px; height:14px; padding:0 3px; box-sizing:border-box;
  border-radius:99px; background:var(--violet,#6b4ee6); color:#fff; border:1.5px solid #fff;
  font-family:var(--ff); font-size:9px; font-weight:800; font-style:normal; line-height:11px;
  display:inline-flex; align-items:center; justify-content:center;
}
.docreg__tbl tr.merge-sel td { background:#eef4fb !important; }
.docreg__tbl tr.merge-primary td { background:#fdf6e6 !important; box-shadow:inset 0 0 0 1px var(--gold-400); }
.docreg__tbl tr.merge-primary td:first-child { box-shadow:inset 3px 0 0 var(--gold-500); }
.mergechip { position:absolute; left:2px; top:50%; transform:translateY(-50%); min-width:15px; height:15px; border-radius:4px; background:#5b6b82; color:#fff; font-size:9px; font-weight:800; display:inline-grid; place-items:center; padding:0 3px; margin-right:4px; }
.mergechip--p { background:var(--gold-600); }
.codecell { position:relative; }
/* ---------- create-promotion flow ---------- */
.pcbody { display:grid; grid-template-columns:1fr 1fr; max-height:62vh; }
.pccol { padding:18px 20px; overflow-y:auto; }
.pccol--form { border-right:1px solid var(--line); background:var(--surface); }
.pccol--prod { background:var(--surface-2); display:flex; flex-direction:column; min-height:0; }
.pclbl { display:block; font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:6px; }
.pcfield { margin-bottom:15px; }
.pcin { width:100%; border:1px solid var(--line-2); border-radius:var(--r-sm); padding:9px 11px; font-family:var(--ff); font-size:13px; color:var(--ink); outline:none; background:var(--surface); }
.pcin:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.pcseg { display:flex; gap:6px; flex-wrap:wrap; }
.pcseg button { font-family:var(--ff); font-size:12px; font-weight:600; padding:7px 11px; border-radius:var(--r-sm); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; }
.pcseg button.is-on { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.pcchip { font-family:var(--ff); font-size:12px; font-weight:600; padding:6px 12px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; }
.pcchip.is-on { background:#fdf6e6; border-color:var(--gold-400); color:var(--gold-600); }
.pcsearch { display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-md); padding:8px 12px; margin-bottom:10px; flex:none; }
.pcsearch input { flex:1; border:none; background:none; outline:none; font-family:var(--ff); font-size:13px; min-width:0; }
.pclist { flex:1; min-height:90px; overflow-y:auto; display:flex; flex-direction:column; gap:6px; }
.pcrow { display:flex; align-items:center; gap:9px; padding:8px 10px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); cursor:grab; }
.pcrow:hover { border-color:var(--gold-400); }
.pcrow:active { cursor:grabbing; }
.pcrow__bc { font-family:"Noto Sans",sans-serif; font-size:11.5px; font-weight:700; color:var(--navy-700); flex:none; }
.pcrow__nm { font-size:12px; color:var(--ink-2); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pcrow__pr { font-size:11.5px; font-weight:700; color:var(--ink); flex:none; }
.pcrow__add { border:none; background:var(--surface-3); color:var(--navy-700); width:24px; height:24px; border-radius:6px; cursor:pointer; display:grid; place-items:center; flex:none; }
.pcrow__add:hover { background:var(--gold-500); color:#fff; }
.pcrow__x { border:none; background:none; color:var(--dim); cursor:pointer; flex:none; display:grid; place-items:center; padding:2px; border-radius:5px; }
.pcrow__x:hover { color:var(--danger); background:var(--danger-bg); }
.pcdroplbl { font-size:12px; font-weight:700; color:var(--ink-2); margin:14px 0 7px; display:flex; justify-content:space-between; align-items:center; }
.pcdrop { border:1.5px dashed var(--line-2); border-radius:var(--r-md); padding:10px; min-height:110px; max-height:190px; overflow-y:auto; background:var(--surface); transition:border-color .12s,background .12s; display:flex; flex-direction:column; gap:6px; }
.pcdrop.is-over { border-color:var(--gold-500); background:#fffdf6; }
.pcdrop__empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; color:var(--dim); text-align:center; font-size:12px; flex:1; min-height:90px; }
.pcfoot { display:flex; align-items:center; gap:12px; padding:14px 20px; border-top:1px solid var(--line); background:var(--surface); }
@media (max-width:760px){ .pcbody{ grid-template-columns:1fr; max-height:72vh; } .pccol--form{ border-right:none; border-bottom:1px solid var(--line); } }
/* ---------- login + loader ---------- */
.loginwrap { position:fixed; inset:0; z-index:120; display:grid; grid-template-columns:1.05fr .95fr; font-family:var(--ff); background:var(--surface); }
.login__brand { background:linear-gradient(160deg,#16294f 0%,#0c1c3a 60%,#0a1730 100%); color:#fff; padding:46px 48px; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.login__brand::after { content:""; position:absolute; right:-120px; bottom:-120px; width:380px; height:380px; border-radius:50%; background:radial-gradient(circle,rgba(245,164,0,.22),transparent 70%); }
.login__brand::before { content:""; position:absolute; left:-90px; top:-90px; width:260px; height:260px; border-radius:50%; background:radial-gradient(circle,rgba(45,108,181,.18),transparent 70%); }
.login__logo { display:flex; align-items:center; gap:12px; position:relative; z-index:1; }
.login__logo .mk { width:46px; height:46px; border-radius:13px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); overflow:hidden; display:grid; place-items:center; }
.login__logo .mk img { width:100%; height:100%; object-fit:cover; }
.login__logo b { font-size:18px; font-weight:800; display:block; line-height:1; font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.login__logo span { font-size:10px; letter-spacing:3px; color:#8fa0bd; text-transform:uppercase; }
.login__hero { position:relative; z-index:1; }
.login__hero h1 { font-size:32px; font-weight:800; line-height:1.2; letter-spacing:-.4px; }
.login__hero h1 em { font-style:normal; color:var(--gold-400); }
.login__hero p { font-size:14px; color:#a9b6cf; margin-top:12px; max-width:380px; line-height:1.6; }
.login__feats { display:flex; gap:18px; margin-top:22px; flex-wrap:wrap; }
.login__feat { display:flex; align-items:center; gap:8px; font-size:12.5px; color:#cdd6e8; }
.login__feat i { width:26px; height:26px; border-radius:8px; background:rgba(255,255,255,.08); display:grid; place-items:center; color:var(--gold-400); }
.login__foot { position:relative; z-index:1; font-size:11.5px; color:#7a8bab; }
.login__form { display:flex; align-items:center; justify-content:center; padding:40px; overflow-y:auto; }
.login__card { width:100%; max-width:372px; }
.login__card h2 { font-size:24px; font-weight:800; }
.login__card .sub { font-size:13px; color:var(--dim); margin-top:4px; margin-bottom:26px; }
.lf { margin-bottom:18px; }
.lf__l { display:block; font-size:12.5px; font-weight:700; color:var(--ink-2); margin-bottom:8px; }
.lf__in { display:flex; align-items:center; gap:10px; border:1.5px solid var(--line-2); border-radius:12px; padding:12px 15px; transition:.14s; background:var(--surface); }
.lf__in:focus-within { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.lf__in input { flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:15px; color:var(--ink); min-width:0; }
.pinrow { display:flex; gap:9px; }
.pinbox { flex:1; width:0; height:54px; text-align:center; font-size:21px; font-weight:800; border:1.5px solid var(--line-2); border-radius:12px; outline:none; font-family:"Noto Sans",sans-serif; color:var(--navy-800); background:var(--surface); transition:.12s; }
.pinbox:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.pinbox.filled { border-color:var(--navy-600); background:#fdf9ef; }
.login__card.err .pinbox { border-color:var(--danger); animation:shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.login__err { font-size:12.5px; color:var(--danger-ink,#9c2b2b); display:flex; align-items:center; gap:6px; margin-bottom:14px; }
.login__btn { width:100%; justify-content:center; height:50px; font-size:15px; border-radius:12px; }
.login__hint { margin-top:18px; padding:11px 14px; background:var(--surface-2); border:1px dashed var(--line-2); border-radius:10px; font-size:12px; color:var(--dim); text-align:center; }
.login__hint b { color:var(--navy-700); font-family:"Noto Sans",sans-serif; }
@media (max-width:840px){ .loginwrap{ grid-template-columns:1fr; } .login__brand{ display:none; } }
@keyframes spin { to{ transform:rotate(360deg); } }

/* ===== Cinematic sign-in loader (loadr) ===== */
.loadr { position:fixed; inset:0; z-index:200; display:grid; place-items:center; overflow:hidden; font-family:var(--ff);
  background:linear-gradient(160deg,#EEF1FB 0%,#E4E9F8 46%,#DBE2F6 100%); }
.loadr__bg { position:absolute; inset:0; overflow:hidden; }
.loadr__blob { position:absolute; border-radius:50%; filter:blur(72px); opacity:.55; will-change:transform; }
.loadr__blob--a { width:46vmax; height:46vmax; left:-13vmax; top:-15vmax; background:radial-gradient(circle,#9db5ee,transparent 68%); animation:ldFloatA 11s ease-in-out infinite; }
.loadr__blob--b { width:42vmax; height:42vmax; right:-13vmax; bottom:-15vmax; background:radial-gradient(circle,#ffd98a,transparent 66%); animation:ldFloatB 13s ease-in-out infinite; }
@keyframes ldFloatA { 0%,100%{ transform:translate(0,0) scale(1); } 50%{ transform:translate(5vmax,4vmax) scale(1.1); } }
@keyframes ldFloatB { 0%,100%{ transform:translate(0,0) scale(1); } 50%{ transform:translate(-4vmax,-5vmax) scale(1.12); } }
.loadr__grid { position:absolute; inset:0; background-image:linear-gradient(rgba(11,61,145,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(11,61,145,.05) 1px,transparent 1px); background-size:46px 46px;
  -webkit-mask:radial-gradient(circle at 50% 44%,#000,transparent 72%); mask:radial-gradient(circle at 50% 44%,#000,transparent 72%); }

.loadr__card { position:relative; width:min(440px,86vw); padding:56px 46px 42px; border-radius:32px; text-align:center;
  background:rgba(255,255,255,.82); backdrop-filter:blur(20px) saturate(1.25); -webkit-backdrop-filter:blur(20px) saturate(1.25);
  border:1px solid rgba(255,255,255,.9); box-shadow:0 44px 100px -34px rgba(20,40,90,.55), 0 2px 0 rgba(255,255,255,.8) inset; }

.loadr__stage { position:relative; width:196px; height:196px; margin:0 auto 32px; display:grid; place-items:center; }
.loadr__halo { position:absolute; width:158px; height:158px; border-radius:50%; background:radial-gradient(circle,rgba(245,164,0,.32),transparent 62%); animation:ldHalo 2.4s ease-in-out infinite; }
@keyframes ldHalo { 0%,100%{ transform:scale(.84); opacity:.5; } 50%{ transform:scale(1.14); opacity:1; } }
.loadr__ring { position:absolute; border-radius:50%; }
.loadr__ring--track { width:176px; height:176px; border:6px solid rgba(11,61,145,.10); }
.loadr__ring--spin { width:176px; height:176px; background:conic-gradient(from 0deg, transparent 0 36%, var(--gold-500) 76%, var(--gold-300) 100%);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 6px),#000 calc(100% - 6px)); mask:radial-gradient(farthest-side,transparent calc(100% - 6px),#000 calc(100% - 6px));
  animation:spin 1.05s linear infinite; }
.loadr__ring--dash { width:196px; height:196px; border:2px dashed rgba(11,61,145,.26); animation:spin 9s linear infinite reverse; }
.loadr__orbit { position:absolute; width:176px; height:176px; animation:spin 3.2s linear infinite; }
.loadr__orbit i { position:absolute; width:11px; height:11px; border-radius:50%; left:50%; margin-left:-5.5px; }
.loadr__orbit i:nth-child(1){ top:-5px; background:var(--navy-700); box-shadow:0 0 0 4px rgba(11,61,145,.12); }
.loadr__orbit i:nth-child(2){ top:50%; left:auto; right:-5px; margin:-5.5px 0 0 0; background:var(--gold-500); box-shadow:0 0 0 4px rgba(245,164,0,.18); }
.loadr__orbit i:nth-child(3){ bottom:-5px; top:auto; background:#9db5ee; box-shadow:0 0 0 4px rgba(157,181,238,.22); }

.loadr__badge { position:relative; width:108px; height:108px; border-radius:27px; overflow:hidden; display:grid; place-items:center;
  background:#fff; box-shadow:0 16px 34px -12px rgba(11,61,145,.55); animation:ldBreathe 2.4s ease-in-out infinite; }
.loadr__badge img { width:100%; height:100%; object-fit:cover; display:block; }
@keyframes ldBreathe { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.05); } }
.loadr__sheen { position:absolute; inset:0; background:linear-gradient(115deg,transparent 36%,rgba(255,255,255,.6) 50%,transparent 64%); transform:translateX(-130%); animation:ldSheen 2.8s ease-in-out infinite; }
@keyframes ldSheen { 0%{ transform:translateX(-130%); } 55%,100%{ transform:translateX(130%); } }

.loadr__title { font-size:25px; font-weight:800; letter-spacing:.3px; line-height:1.2;
  background:linear-gradient(90deg,var(--navy-800),var(--navy-500),var(--navy-800)); background-size:200% 100%;
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:var(--navy-800); animation:ldShine 3s linear infinite; }
@keyframes ldShine { to{ background-position:-200% 0; } }
.loadr__msg { margin-top:9px; font-size:14.5px; font-weight:600; color:var(--dim); min-height:21px; animation:ldFade .42s ease both; }
@keyframes ldFade { from{ transform:translateY(5px); } to{ transform:none; } }
.loadr__bar { margin:28px auto 0; width:248px; height:6px; border-radius:99px; background:rgba(11,61,145,.10); overflow:hidden; }
.loadr__bar i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--gold-400),var(--gold-600)); transition:width .42s cubic-bezier(.3,.8,.3,1); position:relative; overflow:hidden; }
.loadr__bar i::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent); transform:translateX(-100%); animation:ldBarShine 1.3s ease-in-out infinite; }
@keyframes ldBarShine { to{ transform:translateX(260%); } }
.loadr__dots { display:flex; justify-content:center; gap:7px; margin-top:17px; }
.loadr__dots span { width:7px; height:7px; border-radius:50%; background:rgba(11,61,145,.18); transition:.3s ease; }
.loadr__dots span.on { background:var(--gold-500); transform:scale(1.18); box-shadow:0 0 0 3px rgba(245,164,0,.16); }
@media (prefers-reduced-motion: reduce){
  .loadr *{ animation-duration:.001s !important; animation-iteration-count:1 !important; }
  .loadr__ring--spin{ animation:spin 1.2s linear infinite !important; }
}

/* ====================================================================
   LOGIN v2 — immersive "garage" sign-in
   ==================================================================== */
.loginwrap--v2 { display:block; grid-template-columns:none; background:#070f22; overflow-x:hidden; overflow-y:auto;
  --lg-line:rgba(170,190,225,.10); }
.loginwrap--v2 * { box-sizing:border-box; }

/* ---- backdrop ---- */
.lg-bg { position:fixed; inset:0; z-index:0; overflow:hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #122747 0%, #0a1830 42%, #070f22 100%); }
.lg-grid { position:absolute; inset:-2px;
  background-image:linear-gradient(var(--lg-line) 1px,transparent 1px),linear-gradient(90deg,var(--lg-line) 1px,transparent 1px);
  background-size:46px 46px; mask-image:radial-gradient(120% 90% at 50% 30%,#000 30%,transparent 78%);
  -webkit-mask-image:radial-gradient(120% 90% at 50% 30%,#000 30%,transparent 78%); }
.lg-glow { position:absolute; border-radius:50%; filter:blur(10px); pointer-events:none; }
.lg-glow--gold { width:560px; height:560px; right:-160px; bottom:-220px;
  background:radial-gradient(circle,rgba(245,164,0,.30),transparent 62%); animation:lgDrift 14s ease-in-out infinite alternate; }
.lg-glow--blue { width:520px; height:520px; left:-180px; top:-200px;
  background:radial-gradient(circle,rgba(45,108,181,.34),transparent 64%); animation:lgDrift 18s ease-in-out infinite alternate-reverse; }
@keyframes lgDrift { 0%{ transform:translate(0,0) scale(1); } 100%{ transform:translate(40px,30px) scale(1.12); } }
.lg-gauge { position:absolute; width:760px; height:760px; right:-220px; bottom:-260px; opacity:.5;
  animation:lgSpin 90s linear infinite; transform-origin:50% 50%; }
@keyframes lgSpin { to{ transform:rotate(360deg); } }
.lg-vignette { position:absolute; inset:0;
  background:radial-gradient(120% 100% at 50% 40%,transparent 50%,rgba(4,9,20,.7) 100%); pointer-events:none; }

/* ---- stage / brand ---- */
.lg-stage { position:relative; z-index:1; min-height:100%; min-height:100dvh;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:24px;
  padding:34px 22px; }
.lg-brand { display:flex; align-items:center; gap:14px; }
.lg-mark { position:relative; width:54px; height:54px; border-radius:16px; flex:none; overflow:hidden;
  background:linear-gradient(150deg,#1b305c,#0c1c3a); display:grid; place-items:center;
  box-shadow:0 10px 30px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.10); }
.lg-mark img { width:100%; height:100%; object-fit:cover; }
.lg-mark__ring { position:absolute; inset:-2px; border-radius:18px; pointer-events:none;
  box-shadow:0 0 0 1px rgba(245,164,0,.4), 0 0 24px rgba(245,164,0,.35); }
.lg-word b { display:block; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:21px; font-weight:800;
  letter-spacing:3.5px; color:#fff; line-height:1; text-shadow:0 1px 12px rgba(120,160,230,.45); }
.lg-word span { display:block; margin-top:6px; font-size:10px; letter-spacing:3.5px; text-transform:uppercase; color:#9db1d4; }

/* ---- glass card ---- */
.lg-card { position:relative; width:100%; max-width:392px; padding:30px 30px 26px; border-radius:24px;
  background:linear-gradient(165deg,rgba(28,46,82,.62),rgba(12,24,46,.72));
  -webkit-backdrop-filter:blur(18px) saturate(1.3); backdrop-filter:blur(18px) saturate(1.3);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 30px 70px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.10);
  overflow:hidden; }
.lg-card::before { content:""; position:absolute; left:24px; right:24px; top:0; height:2px; border-radius:2px;
  background:linear-gradient(90deg,transparent,var(--gold-400),transparent); opacity:.9; }
.lg-card__sheen { position:absolute; top:-40%; left:-30%; width:80%; height:160%; pointer-events:none;
  background:linear-gradient(75deg,transparent,rgba(255,255,255,.07),transparent); transform:skewX(-18deg); }
.lg-card.shake { animation:lgShake .34s cubic-bezier(.36,.07,.19,.97); }
@keyframes lgShake { 10%,90%{transform:translateX(-2px)} 30%,70%{transform:translateX(4px)} 50%{transform:translateX(-6px)} }

.lg-card__head { margin-bottom:22px; }
.lg-status { display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:700; letter-spacing:.3px;
  white-space:nowrap;
  color:#9fb4d6; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08);
  padding:5px 11px; border-radius:99px; }
.lg-status i { width:7px; height:7px; border-radius:50%; background:#3fd07f; box-shadow:0 0 0 3px rgba(63,208,127,.18); animation:lgPulse 2s ease-in-out infinite; }
@keyframes lgPulse { 50%{ opacity:.45; } }
.lg-card__head h2 { margin:14px 0 0; font-size:27px; font-weight:800; color:#fff; letter-spacing:-.3px; line-height:1.1;
  font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.lg-card__head p { margin:6px 0 0; font-size:13px; color:#9aabc8; line-height:1.5; }

/* ---- fields ---- */
.lg-field { margin-bottom:16px; }
.lg-lbl { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:#b7c6e2;
  margin-bottom:9px; letter-spacing:.2px; white-space:nowrap; }
.lg-lbl em { font-style:normal; margin-left:auto; font-size:10.5px; font-weight:700; letter-spacing:.5px;
  white-space:nowrap; color:var(--gold-300); background:rgba(245,164,0,.12); border:1px solid rgba(245,164,0,.22);
  padding:2px 8px; border-radius:99px; }

.segrow { display:flex; gap:9px; }
.segbox { flex:1; min-width:0; height:54px; text-align:center; border-radius:13px;
  font-family:"Noto Sans",ui-monospace,monospace; font-size:22px; font-weight:800; color:#fff;
  background:rgba(8,16,32,.55); border:1.5px solid rgba(255,255,255,.12); outline:none;
  caret-color:var(--gold-400); transition:border-color .14s, box-shadow .14s, background .14s, transform .12s; }
.segbox::placeholder { color:transparent; }
.segbox:hover { border-color:rgba(255,255,255,.22); }
.segbox.on { border-color:rgba(245,164,0,.55); background:rgba(245,164,0,.07); }
.segbox:focus { border-color:var(--gold-400); background:rgba(245,164,0,.1);
  box-shadow:0 0 0 3px rgba(245,164,0,.22), 0 6px 18px -8px rgba(245,164,0,.6); transform:translateY(-1px); }
.segrow--gold .segbox.on { color:var(--gold-300); }
.lg-card.shake .segbox { border-color:rgba(224,82,82,.7); animation:lgShakeMini .34s; }
@keyframes lgShakeMini { 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }

.lg-err { display:flex; align-items:center; gap:7px; margin:-2px 0 14px; font-size:12.5px; font-weight:600;
  color:#ffb4b4; }
.lg-err svg { flex:none; }

/* ---- CTA ---- */
.lg-go { width:100%; height:52px; margin-top:4px; border:none; border-radius:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:9px; position:relative; white-space:nowrap;
  font-family:var(--ff); font-size:15px; font-weight:800; color:#3a2700;
  background:linear-gradient(140deg,var(--gold-300),var(--gold-500) 55%,var(--gold-600));
  box-shadow:0 14px 30px -10px rgba(245,164,0,.6), inset 0 1px 0 rgba(255,255,255,.4);
  transition:transform .14s, box-shadow .14s, filter .14s; }
.lg-go:hover { transform:translateY(-2px); box-shadow:0 20px 40px -12px rgba(245,164,0,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.lg-go:active { transform:translateY(0) scale(.99); }
.lg-go__arr { transition:transform .16s; opacity:.7; }
.lg-go.ready .lg-go__arr { opacity:1; }
.lg-go.ready:hover .lg-go__arr { transform:translateX(4px); }

.lg-hint { display:flex; align-items:center; justify-content:center; gap:9px; margin-top:16px; flex-wrap:wrap;
  font-size:12px; color:#8093b3; }
.lg-hint span { opacity:.8; }
.lg-hint b { font-family:"Noto Sans",var(--ff); font-weight:700; color:#cdd9ef; letter-spacing:.4px; white-space:nowrap; }
.lg-hint i { width:3px; height:3px; border-radius:50%; background:#5a6c8c; }

/* ---- footer ---- */
.lg-foot { display:flex; flex-direction:column; align-items:center; gap:14px; }
.lg-feats { display:flex; gap:9px; flex-wrap:wrap; justify-content:center; }
.lg-feats span { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:#aebbd6;
  background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); padding:7px 13px; border-radius:99px; }
.lg-feats span svg { color:var(--gold-400); }
.lg-copy { font-size:11px; color:#5d6e8d; }

@media (max-width:480px){
  .lg-card { padding:26px 20px 22px; border-radius:20px; }
  .segbox { height:50px; font-size:20px; gap:7px; }
  .segrow { gap:7px; }
  .lg-card__head h2 { font-size:24px; }
  .lg-gauge { right:-300px; bottom:-320px; }
}
@media (max-height:680px){ .lg-stage { justify-content:flex-start; } }

/* ---- gear / links / locked / modals / toast ---- */
.lg-gear { position:fixed; top:20px; right:20px; z-index:5; width:44px; height:44px; border-radius:13px;
  display:grid; place-items:center; cursor:pointer; color:#c4d3ef;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); transition:.16s; }
.lg-gear:hover { color:#fff; background:rgba(245,164,0,.16); border-color:rgba(245,164,0,.5); transform:rotate(40deg); }

.lg-links { display:flex; align-items:center; justify-content:center; gap:12px; margin-top:16px; flex-wrap:wrap; }
.lg-link { display:inline-flex; align-items:center; gap:5px; background:none; border:none; cursor:pointer;
  font-family:var(--ff); font-size:12.5px; font-weight:600; color:#9fb4d6; padding:2px 0; transition:.14s; }
.lg-link:hover { color:var(--gold-300); }
.lg-link svg { opacity:.85; }
.lg-links__dot { width:3px; height:3px; border-radius:50%; background:#46587a; }

/* locked panel */
.lg-card--locked { text-align:center; }
.lg-card--locked::before { background:linear-gradient(90deg,transparent,#e0696b,transparent); }
.llock { display:flex; flex-direction:column; align-items:center; }
.llock__ic { position:relative; width:74px; height:74px; border-radius:22px; display:grid; place-items:center;
  color:#ffb4b4; background:rgba(224,82,82,.12); border:1px solid rgba(224,82,82,.3); margin:4px 0 18px; }
.llock__ring { position:absolute; inset:-6px; border-radius:26px; border:1px solid rgba(224,82,82,.25); animation:llockPulse 2.2s ease-in-out infinite; }
@keyframes llockPulse { 0%,100%{ transform:scale(1); opacity:.6; } 50%{ transform:scale(1.08); opacity:.15; } }
.llock h2 { margin:0; font-size:24px; font-weight:800; color:#fff; white-space:nowrap; font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.llock p { margin:8px 0 0; font-size:13px; color:#a7b6d2; line-height:1.55; max-width:300px; }
.lunlock-tgt { display:inline-flex; align-items:center; gap:9px; margin:18px 0; padding:9px 14px; border-radius:12px;
  font-size:12.5px; color:#b7c6e2; background:rgba(8,16,32,.5); border:1px solid rgba(255,255,255,.1); }
.lunlock-tgt--center { align-self:center; }
.lunlock-tgt b { font-family:"Noto Sans",var(--ff); font-weight:800; color:#fff; letter-spacing:1px; }
.lunlock-tgt__ic { display:grid; place-items:center; color:var(--gold-400); }
.lg-card--locked .lbtn { margin-top:10px; }
.lg-card--locked .lbtn--ghost { margin-top:10px; }

/* dark buttons (modal / locked) */
.lbtn { width:100%; height:50px; border:none; border-radius:13px; cursor:pointer; display:flex; align-items:center;
  justify-content:center; gap:8px; font-family:var(--ff); font-size:14.5px; font-weight:800; white-space:nowrap; transition:transform .14s, box-shadow .14s, filter .14s, background .14s; }
.lbtn--gold { color:#3a2700; background:linear-gradient(140deg,var(--gold-300),var(--gold-500) 55%,var(--gold-600));
  box-shadow:0 12px 26px -10px rgba(245,164,0,.55), inset 0 1px 0 rgba(255,255,255,.4); }
.lbtn--gold:hover { transform:translateY(-2px); box-shadow:0 18px 34px -12px rgba(245,164,0,.65), inset 0 1px 0 rgba(255,255,255,.4); }
.lbtn--ghost { color:#cdd9ef; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.13); }
.lbtn--ghost:hover { background:rgba(255,255,255,.09); color:#fff; }
.lbtn--sm { width:auto; height:38px; padding:0 16px; font-size:13px; border-radius:10px; }
.lbtn:disabled { opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }

/* modal shell */
.lmod { position:fixed; inset:0; z-index:140; display:flex; align-items:center; justify-content:center; padding:22px;
  background:rgba(5,10,22,.62); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); animation:lmodIn .18s ease; overflow-y:auto; }
@keyframes lmodIn { from{ opacity:0; } to{ opacity:1; } }
.lmod__panel { position:relative; width:100%; max-width:404px; margin:auto; padding:26px 26px 24px; border-radius:22px;
  background:linear-gradient(165deg,rgba(30,49,86,.96),rgba(13,25,47,.98));
  border:1px solid rgba(255,255,255,.12); box-shadow:0 40px 90px -24px rgba(0,0,0,.8);
  animation:lpanelIn .24s cubic-bezier(.22,1,.36,1); }
@keyframes lpanelIn { from{ opacity:0; transform:translateY(14px) scale(.98); } to{ opacity:1; transform:none; } }
.lmod__panel::before { content:""; position:absolute; left:24px; right:24px; top:0; height:2px; border-radius:2px; background:linear-gradient(90deg,transparent,var(--gold-400),transparent); }
.lmod__panel--ok::before { background:linear-gradient(90deg,transparent,#3fd07f,transparent); }
.lmod__panel--warn::before { background:linear-gradient(90deg,transparent,#e0696b,transparent); }
.lmod__close { position:absolute; top:14px; right:14px; width:32px; height:32px; border-radius:10px; cursor:pointer;
  border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.05); color:#9fb4d6; font-size:14px; line-height:1; transition:.14s; }
.lmod__close:hover { background:rgba(255,255,255,.12); color:#fff; }
.lmod__head { display:flex; align-items:flex-start; gap:13px; margin-bottom:20px; padding-right:28px; }
.lmod__ic { flex:none; width:42px; height:42px; border-radius:13px; display:grid; place-items:center; color:var(--gold-300);
  background:rgba(245,164,0,.14); border:1px solid rgba(245,164,0,.26); }
.lmod__ic--ok { color:#7ee2a8; background:rgba(63,208,127,.14); border-color:rgba(63,208,127,.28); }
.lmod__ic--warn { color:#ffb4b4; background:rgba(224,82,82,.14); border-color:rgba(224,82,82,.3); }
.lmod__head h3 { margin:0; font-size:19px; font-weight:800; color:#fff; font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.lmod__head p { margin:4px 0 0; font-size:12.5px; color:#9aabc8; line-height:1.5; }

/* settings */
.lset { display:flex; flex-direction:column; gap:10px; }
.lset-row { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:14px;
  background:rgba(8,16,32,.45); border:1px solid rgba(255,255,255,.08); }
.lset-row__l { display:flex; align-items:center; gap:11px; flex:1; min-width:0; }
.lset-ic { flex:none; width:34px; height:34px; border-radius:10px; display:grid; place-items:center; color:#bcd0f0; background:rgba(255,255,255,.06); }
.lset-row__l b { display:block; font-size:13.5px; font-weight:700; color:#eaf0fb; }
.lset-row__l span { display:block; font-size:11.5px; color:#8295b5; margin-top:1px; }
.lconn { display:inline-flex; align-items:center; gap:6px; }
.lconn i { width:7px; height:7px; border-radius:50%; background:#3fd07f; box-shadow:0 0 0 3px rgba(63,208,127,.18); }
.lselect { position:relative; flex:none; }
.lselect select { appearance:none; -webkit-appearance:none; font-family:var(--ff); font-size:13px; font-weight:600; color:#fff;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:9px 30px 9px 12px; cursor:pointer; outline:none; }
.lselect::after { content:"\0025be"; position:absolute; right:11px; top:50%; transform:translateY(-50%); color:#9fb4d6; pointer-events:none; font-size:11px; }
.lseg { display:flex; gap:4px; padding:3px; border-radius:11px; background:rgba(8,16,32,.6); border:1px solid rgba(255,255,255,.1); flex:none; }
.lseg button { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:700; color:#9fb4d6; padding:6px 13px; border-radius:8px; transition:.14s; }
.lseg button.on { color:#3a2700; background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); }
.lset-foot { display:flex; align-items:center; justify-content:space-between; margin-top:18px; padding-top:15px; border-top:1px solid rgba(255,255,255,.08); font-size:11.5px; color:#7d8fb0; }
.lset-link { background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--gold-300); }
.lset-link:hover { text-decoration:underline; }

/* forgot — method picker + success */
.lmethods { display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.lmethod { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:14px; cursor:pointer; text-align:left;
  background:rgba(8,16,32,.45); border:1px solid rgba(255,255,255,.1); transition:.14s; font-family:var(--ff); }
.lmethod:hover:not(:disabled) { border-color:rgba(245,164,0,.5); background:rgba(245,164,0,.07); transform:translateY(-1px); }
.lmethod:disabled { opacity:.4; cursor:not-allowed; }
.lmethod__ic { flex:none; width:38px; height:38px; border-radius:11px; display:grid; place-items:center; color:var(--gold-300); background:rgba(245,164,0,.12); border:1px solid rgba(245,164,0,.22); }
.lmethod div { flex:1; min-width:0; }
.lmethod b { display:block; font-size:13.5px; font-weight:700; color:#eaf0fb; }
.lmethod span { display:block; font-size:11.5px; color:#8295b5; margin-top:1px; }
.lmethod__chev { color:#5f7193; font-style:normal; font-size:16px; }
.lforgot-ok { text-align:center; }
.lforgot-ok__ic { width:72px; height:72px; margin:0 auto 16px; border-radius:50%; display:grid; place-items:center; color:#7ee2a8; background:rgba(63,208,127,.12); border:1px solid rgba(63,208,127,.3); }
.lforgot-ok p { font-size:13.5px; color:#c4d2ea; line-height:1.6; }
.lforgot-ok p b, .lforgot-ref b { font-family:"Noto Sans",var(--ff); color:#fff; }
.lforgot-ref { display:flex; flex-direction:column; gap:3px; align-items:center; margin:16px 0 20px; padding:12px; border-radius:12px;
  background:rgba(8,16,32,.5); border:1px dashed rgba(255,255,255,.16); font-size:11.5px; color:#8295b5; }
.lforgot-ref b { font-size:16px; letter-spacing:1.5px; }

.lshake { animation:lgShakeMini .34s; }
.ltoast { position:fixed; left:50%; bottom:30px; transform:translateX(-50%); z-index:160; display:flex; align-items:center; gap:9px;
  padding:12px 20px; border-radius:13px; font-family:var(--ff); font-size:13.5px; font-weight:600; color:#fff; white-space:nowrap;
  background:linear-gradient(160deg,rgba(30,49,86,.98),rgba(13,25,47,.98)); border:1px solid rgba(255,255,255,.14);
  box-shadow:0 20px 50px -16px rgba(0,0,0,.7); animation:ltoastIn .26s cubic-bezier(.22,1,.36,1); }
.ltoast svg { color:#7ee2a8; flex:none; }
@keyframes ltoastIn { from{ opacity:0; transform:translate(-50%,14px); } to{ opacity:1; transform:translate(-50%,0); } }

@media (max-width:480px){
  .lg-gear { top:14px; right:14px; width:40px; height:40px; }
  .lmod__panel { padding:22px 18px 20px; }
}

/* ====================================================================
   LOGIN v3 — split: navy auto-parts brand (left) + light form (right)
   ==================================================================== */
.loginwrap--v3 { position:fixed; inset:0; z-index:120; display:grid; grid-template-columns:1.08fr .92fr;
  font-family:var(--ff); background:#FAFAF7; overflow:hidden; --form-bg:#FAFAF7; }
.loginwrap--v3 * { box-sizing:border-box; }

/* left brand panel */
.lgx-brand { position:relative; overflow:hidden; padding:46px 56px 38px; display:flex; flex-direction:column; justify-content:space-between; gap:26px;
  color:#fff; --lg-line:rgba(170,190,225,.09);
  background:linear-gradient(165deg,#143055 0%,#0c1d3b 58%,#0a1730 100%); }
.lgx-brand__bg { position:absolute; inset:0; z-index:0; overflow:hidden; }
.lgx-brand__bg .lg-glow--gold { width:520px; height:520px; right:-170px; bottom:-210px;
  background:radial-gradient(circle,rgba(245,164,0,.26),transparent 62%); animation:lgDrift 16s ease-in-out infinite alternate; }
.lgx-gauge { position:absolute; width:660px; height:660px; right:-220px; bottom:-230px; opacity:.5;
  animation:lgSpin 90s linear infinite; transform-origin:50% 50%; }
.lgx-brand > *:not(.lgx-brand__bg) { position:relative; z-index:1; }
.lgx-brand__lock { display:flex; align-items:center; gap:14px; }

.lgx-eyebrow { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; letter-spacing:.3px; white-space:nowrap;
  color:var(--gold-300); background:rgba(245,164,0,.12); border:1px solid rgba(245,164,0,.24); padding:6px 13px; border-radius:99px; }
.lgx-eyebrow { align-self:flex-start; }
.lgx-hero h1 { margin:16px 0 0; font-size:40px; line-height:1.12; font-weight:800; letter-spacing:-.5px;
  font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.lgx-hero h1 em { font-style:normal; color:var(--gold-400); }
.lgx-hero p { margin:14px 0 0; font-size:14px; color:#a9b6cf; line-height:1.6; max-width:420px; }
.lgx-trust { display:grid; grid-template-columns:1fr 1fr; gap:14px 22px; margin-top:28px; max-width:520px; }
.lgx-trust__i { display:flex; align-items:center; gap:11px; }
.lgx-trust__i > span { flex:none; width:38px; height:38px; border-radius:11px; display:grid; place-items:center; color:var(--gold-300);
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); }
.lgx-trust__i b { display:block; font-size:13px; font-weight:700; color:#eef2fa; line-height:1.2; }
.lgx-trust__i i { display:block; font-style:normal; font-size:11.5px; color:#8a9bbb; margin-top:2px; }
.lgx-brandfoot { font-size:11.5px; color:#7587a6; }

/* layered wave divider */
.lgx-wave { position:absolute; top:0; bottom:0; left:calc(54% - 92px); width:130px; height:100%; z-index:3; pointer-events:none; }
.lgx-wave__solid { fill:var(--form-bg); }
.lgx-wave__edge { stroke:rgba(245,164,0,.45); stroke-width:1.4; }

/* right form panel */
.lgx-form { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 56px; overflow-y:auto; background:var(--form-bg); }
.lgx-gear { position:absolute; top:22px; right:24px; width:42px; height:42px; border-radius:12px; display:grid; place-items:center;
  cursor:pointer; color:var(--ink-2); background:var(--surface); border:1px solid var(--line-2); transition:.18s; z-index:2; }
.lgx-gear:hover { color:var(--navy-700); border-color:var(--gold-400); background:#fffdf6; transform:rotate(45deg); box-shadow:0 4px 14px rgba(20,33,61,.1); }
.lgx-formfoot { display:flex; align-items:center; gap:7px; margin-top:30px; font-size:12px; color:var(--dim); white-space:nowrap; }
.lg-link { white-space:nowrap; }
.lgx-formfoot svg { color:var(--gold-600); }

/* light overrides — reuse the dark lg-* form internals on a light panel */
.lgx-form .lg-card { background:transparent; border:none; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none;
  padding:0; max-width:384px; width:100%; overflow:visible; }
.lgx-form .lg-card::before { display:none; }
.lgx-form .lg-card__head { margin-bottom:24px; }
.lgx-form .lg-status { color:var(--navy-700); background:var(--surface-2); border-color:var(--line); }
.lgx-form .lg-card__head h2 { color:var(--ink); }
.lgx-form .lg-card__head p { color:var(--dim); }
.lgx-form .lg-lbl { color:var(--ink-2); }
.lgx-form .lg-lbl em { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.lgx-form .segbox { background:var(--surface); border:1.5px solid var(--line-2); color:var(--ink); caret-color:var(--gold-500); }
.lgx-form .segbox:hover { border-color:var(--line-2); }
.lgx-form .segbox.on { border-color:var(--gold-500); background:#fffdf7; }
.lgx-form .segrow--gold .segbox.on { color:var(--gold-600); }
.lgx-form .segbox:focus { border-color:var(--gold-500); background:#fffdf7; box-shadow:0 0 0 3px var(--gold-glow), 0 6px 16px -10px rgba(245,164,0,.5); }
.lgx-form .lg-err { color:var(--danger-ink,#9c2b2b); }
.lgx-form .lg-links { margin-top:18px; }
.lgx-form .lg-link { color:var(--navy-600); }
.lgx-form .lg-link:hover { color:var(--gold-600); }
.lgx-form .lg-links__dot { background:var(--line-2); }
.lgx-form .lg-hint { color:var(--dim); }
.lgx-form .lg-hint b { color:var(--navy-700); }
.lgx-form .lg-hint i { background:var(--line-2); }

/* locked panel on light */
.lgx-form .lg-card--locked { text-align:center; }
.lgx-form .llock h2 { color:var(--ink); }
.lgx-form .llock p { color:var(--dim); }
.lgx-form .lunlock-tgt { background:var(--surface-2); border-color:var(--line); color:var(--ink-2); }
.lgx-form .lunlock-tgt b { color:var(--ink); }
.lgx-form .lbtn--ghost { background:var(--surface-2); border-color:var(--line-2); color:var(--ink); }
.lgx-form .lbtn--ghost:hover { background:var(--surface-3); color:var(--navy-700); }

@media (max-width:900px){
  .loginwrap--v3 { grid-template-columns:1fr; }
  .lgx-brand, .lgx-wave { display:none; }
  .lgx-form { padding:40px 24px; }
}
@media (max-width:1180px){
  .lgx-hero h1 { font-size:34px; }
  .lgx-brand { padding:40px 44px 34px; }
  .lgx-form { padding:44px 44px; }
  .lgx-trust { grid-template-columns:1fr; gap:13px; max-width:none; }
}
.dside__logout { margin-left:auto; flex:none; width:30px; height:30px; border-radius:9px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.05); color:#9fb0cd; display:grid; place-items:center; cursor:pointer; transition:.14s; }
.dside__logout:hover { background:rgba(209,67,67,.22); color:#fff; border-color:rgba(209,67,67,.4); }
.dside__logoutbtn { margin-top:8px; flex:none; width:100%; display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:var(--r-md); cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:700; color:#ffb1b1; background:rgba(224,86,86,.10); border:1px solid rgba(224,86,86,.30); transition:.14s; }
.dside__logoutbtn:hover { background:rgba(224,86,86,.22); color:#fff; border-color:rgba(224,86,86,.55); }
.dside__logoutbtn .dnav__ic { width:24px; height:24px; flex:none; display:grid; place-items:center; }

/* ---- Excel import modal (Kacc9 migration) ---- */
.impmodal { position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; padding:24px;
  background:rgba(18,32,60,.42); animation:lmodIn .16s ease; }
.impmodal__panel { position:relative; width:100%; max-width:600px; max-height:88vh; overflow:auto; background:#fff; border-radius:18px;
  border:1px solid var(--line); box-shadow:0 40px 90px -24px rgba(18,40,90,.5); padding:24px; }
.impmodal__x { position:absolute; top:14px; right:14px; width:30px; height:30px; border-radius:9px; cursor:pointer;
  border:1px solid var(--line); background:var(--surface-2); color:var(--dim); font-size:13px; }
.impmodal__x:hover { background:var(--surface-3); color:var(--ink); }
.impmodal__hd { display:flex; align-items:flex-start; gap:12px; margin-bottom:18px; padding-right:30px; }
.impmodal__ic { flex:none; width:42px; height:42px; border-radius:12px; display:grid; place-items:center; color:#1F7A4D; background:#e8f7ee; border:1px solid #b7e4c9; }
.impmodal__hd h3 { margin:0; font-size:17px; font-weight:800; color:var(--ink); }
.impmodal__hd p { margin:3px 0 0; font-size:12.5px; color:var(--dim); line-height:1.5; }
/* ---- ConfirmModal (ลบ/ยืนยัน กลางจอ) ---- */
.cfm { max-width:430px; }
.cfm .impmodal__hd { margin-bottom:6px; }
.cfm__bd { text-align:center; padding:8px 4px 2px; }
.cfm__circle { width:60px; height:60px; border-radius:50%; display:grid; place-items:center; margin:6px auto 14px; background:var(--danger-bg); }
.cfm__circle--info { background:#eef3fb; }
.cfm__q { font-size:15px; font-weight:800; color:var(--ink); }
.cfm__sub { font-size:12.5px; color:var(--dim); margin-top:6px; line-height:1.5; }
.cfm__act { display:flex; gap:10px; margin-top:20px; }
.cfm__btn { flex:1; height:44px; border-radius:11px; font-family:var(--ff); font-size:14px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1px solid var(--line-2); transition:.13s; }
.cfm__btn--cancel { background:#fff; color:var(--ink-2); }
.cfm__btn--cancel:hover { background:var(--surface-2); border-color:var(--ink-2); }
.cfm__btn--del { background:var(--danger); border-color:var(--danger); color:#fff; }
.cfm__btn--del:hover { filter:brightness(.93); }
.cfm__btn--ok { background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.cfm__btn--ok:hover { filter:brightness(.93); }
.cfm__btn:disabled { opacity:.45; pointer-events:none; }
.cfm__pin { margin-top:16px; text-align:left; }
.cfm__pin label { display:block; font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:6px; }
.cfm__pininput { width:100%; height:44px; border:1px solid var(--line-2); border-radius:11px; padding:0 14px; font-size:20px; letter-spacing:8px; text-align:center; background:var(--surface-2); outline:none; }
.cfm__pininput:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); background:#fff; }
.cfm__pininput.is-err { border-color:var(--danger); box-shadow:0 0 0 2px rgba(209,67,67,.14); }
.cfm__pinerr { margin-top:6px; font-size:12px; font-weight:600; color:var(--danger); }
.impbody { display:flex; flex-direction:column; gap:14px; }
.impdrop { display:flex; flex-direction:column; align-items:center; gap:6px; padding:30px 20px; border-radius:14px; cursor:pointer;
  border:2px dashed var(--line-2); background:var(--surface); transition:.14s; font-family:var(--ff); }
.impdrop:hover { border-color:var(--gold-400); background:#fffdf6; }
.impdrop__ic { width:54px; height:54px; border-radius:14px; display:grid; place-items:center; color:var(--navy-600); background:var(--surface-2); margin-bottom:4px; }
.impdrop b { font-size:14.5px; color:var(--ink); }
.impdrop span { font-size:12px; color:var(--dim); }
.impnote { font-size:11.5px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; line-height:1.6; }
.impnote b { color:var(--navy-700); }
.impsample { background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--gold-600); text-align:left; }
.impsample:hover { text-decoration:underline; }
.impfile { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--ink); background:#f0f9f3; border:1px solid #c9e9d5; border-radius:10px; padding:9px 12px; }
.impfile__ok { margin-left:auto; font-size:11.5px; font-weight:600; color:#1F8A5B; }
.imptable-wrap { max-height:280px; overflow:auto; border:1px solid var(--line); border-radius:12px; }
.impsum { font-size:12.5px; color:var(--ink-2); padding:2px; }
.impsum b { color:var(--ink); }
.impact { display:flex; justify-content:flex-end; gap:8px; margin-top:2px; }
.badge--ok { background:#e8f7ee; color:#1F7A4D; }

/* ---- AR/AP flow tab rail (บ้านเดียวต่อฝ่าย เรียงตาม flow) ---- */
.arflow { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-bottom:18px; }
.arflow__tab { font-size:13px; font-weight:600; padding:8px 15px; border-radius:var(--r-pill); background:var(--surface); border:1px solid var(--line-2); color:var(--ink-2); cursor:pointer; font-family:var(--ff); white-space:nowrap; transition:background .12s,color .12s,border-color .12s; }
.arflow__tab:hover { border-color:var(--navy-600); color:var(--navy-700); }
.arflow__tab.is-active { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.arflow__sep { color:var(--line-2); font-size:13px; padding:0 2px; user-select:none; }
.arflow__sep--step { color:var(--gold-600); font-weight:800; }
.dchips--sm .dchip { padding:5px 12px; font-size:12px; }

/* ---- import (Kacc9) intro panel stats ---- */
.impstat { display:flex; gap:10px; flex-wrap:wrap; }
.impstat__cell { flex:1; min-width:130px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:3px; }
.impstat__k { font-size:11.5px; color:var(--dim); }
.impstat__v { font-size:20px; font-weight:800; color:var(--ink); line-height:1.1; }
.impstat__v small { font-size:11.5px; font-weight:600; color:var(--dim); margin-left:2px; }
/* ---- Kacc9 import: redesigned guided layout ---- */
.impgrid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:18px; align-items:start; }
.impgrid .impdrop { padding:38px 22px; }
.impsteps { display:flex; align-items:stretch; gap:10px; margin-top:14px; }
.impstep { flex:1; display:flex; align-items:flex-start; gap:10px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:12px 13px; }
.impstep__n { flex:none; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; background:var(--navy-700); color:#fff; font-size:12.5px; font-weight:800; }
.impstep b { display:block; font-size:13px; color:var(--ink); margin-bottom:2px; }
.impstep span { font-size:11px; color:var(--dim); line-height:1.4; }
.impstep__arr { flex:none; align-self:center; color:var(--line-2); }
.impside { display:flex; flex-direction:column; gap:14px; }
.impside__card { background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:14px 15px; }
.impside__hd { font-size:11.5px; font-weight:700; color:var(--navy-700); text-transform:uppercase; letter-spacing:.4px; margin-bottom:10px; }
.impside__row { display:flex; flex-wrap:nowrap; align-items:baseline; justify-content:space-between; gap:10px; padding:6px 0; font-size:12.5px; color:var(--ink-2); border-top:1px solid var(--line); }
.impside__row > span { white-space:nowrap; flex:1 1 auto; min-width:0; }
.impside__row:first-of-type { border-top:0; }
.impside__row b { white-space:nowrap; flex:none; font-size:14px; font-weight:800; color:var(--ink); }
.impside__row b small { font-size:11px; font-weight:600; color:var(--dim); margin-left:2px; }
.impside__row--total b { color:var(--navy-800); font-size:16px; }
.impcols { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.impcols li { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--ink-2); line-height:1.45; }
.impcols__dot { flex:none; width:6px; height:6px; border-radius:50%; background:var(--gold-400); margin-top:5px; }
@media (max-width:820px){ .impgrid { grid-template-columns:1fr; } .impsteps { flex-direction:column; } .impstep__arr { transform:rotate(90deg); align-self:center; } }
.apnote { display:flex; align-items:flex-start; gap:7px; font-size:12px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 12px; line-height:1.55; margin:0 0 14px; }

/* ปุ่มไอคอน "คำอธิบาย/ขั้นตอน" + popup (จัดซื้อ) — แทนโน้ตยาวที่กินที่ในหัวจอ */
.ponote { position:relative; display:inline-block; margin:0 0 14px; }
.ponote__btn { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:999px; padding:6px 13px; cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.ponote__btn:hover { background:#eef3fb; border-color:#c3d3ee; }
.ponote__btn.is-open { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.ponote__btn > svg:last-child { opacity:.6; }
.ponote__pop { position:absolute; top:calc(100% + 6px); left:0; z-index:60; width:340px; max-width:calc(100vw - 32px); background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 36px rgba(18,32,60,.17); padding:13px 16px; font-size:12px; line-height:1.75; color:var(--ink-2); white-space:normal; word-break:break-word; overflow-wrap:anywhere; line-break:loose; animation:ponotePop .14s ease; }
.ponote__pop b { color:var(--navy-700); }
@keyframes ponotePop { from{ opacity:0; transform:translateY(-5px); } to{ opacity:1; transform:none; } }
/* ในช่อง split แคบ — กัน popup ล้นช่อง (cqw = ความกว้างช่องจริง) */
.pane-fluid--purchasing .ponote__pop { width:300px; max-width:calc(96cqw - 24px); }

/* ---- ลูกหนี้ Y/N tax side (แฟ้มข้อมูลลูกค้า) ---- */
.taxside { display:inline-grid; place-items:center; min-width:26px; height:22px; padding:0 7px; border-radius:6px; font-family:"Noto Sans",sans-serif; font-size:12.5px; font-weight:800; border:1.5px solid; }
.taxside--y { color:var(--ok-ink); border-color:#a7d7bd; background:var(--ok-bg); }
.taxside--n { color:var(--ink-2); border-color:var(--line-2); background:var(--surface-3); }
.taxpill { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:4px 11px; border-radius:var(--r-pill); }
.taxpill--y { color:var(--ok-ink); background:var(--ok-bg); border:1px solid #bfe6d3; }
.taxpill--n { color:var(--ink-2); background:var(--surface-3); border:1px solid var(--line-2); }
.taxtabs { display:inline-flex; gap:3px; padding:3px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-pill); }
.taxtabs .taxtab { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--dim); padding:6px 12px; border-radius:var(--r-pill); white-space:nowrap; }
.taxtabs .taxtab.is-active { background:var(--surface); box-shadow:0 1px 2px rgba(11,26,51,.08); color:var(--ink); }
.taxtabs .taxtab--y.is-active { color:var(--ok-ink); }

/* customer detail info list */
.cinfo { display:grid; grid-template-columns:auto 1fr; gap:9px 16px; font-size:13px; margin:0; }
.cinfo dt { color:var(--dim); font-weight:600; white-space:nowrap; }
.cinfo dd { margin:0; color:var(--ink); text-align:right; font-weight:600; word-break:break-word; }

/* สร้างลูกหนี้ใหม่ form */
.ndseg { display:flex; gap:10px; }
.ndseg button { flex:1; border:1.5px solid var(--line-2); background:var(--surface); border-radius:11px; padding:11px 13px; cursor:pointer; font-family:var(--ff); text-align:left; transition:border-color .12s, background .12s; }
.ndseg button:hover { border-color:var(--line-2); }
.ndseg button.on--y { border-color:#7cc59b; background:var(--ok-bg); }
.ndseg button.on--n { border-color:var(--navy-600); background:#eef3fb; }
.ndseg b { display:block; font-size:13px; font-weight:800; color:var(--ink); }
.ndseg span { display:block; font-size:10.5px; color:var(--dim); line-height:1.45; margin-top:3px; }
.ndform { display:grid; grid-template-columns:1fr 1fr; gap:13px 14px; }
.ndform label { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; color:var(--ink-2); }
.ndform label.col2 { grid-column:1 / -1; }
.ndform label em { font-style:normal; }
.ndform input, .ndform select { height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:var(--ff); font-size:13px; font-weight:500; color:var(--ink); background:var(--surface); outline:none; }
.ndform input::placeholder { color:var(--line-2); }
.ndform input:disabled { background:var(--surface-2); color:var(--dim); }
.ndform input:focus, .ndform select:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.ndsubhd { font-size:12px; font-weight:800; color:var(--navy-700); margin-top:4px; padding-top:13px; border-top:1px solid var(--line); }
.nd-billchk { display:flex; align-items:flex-start; gap:12px; margin-top:10px; padding:11px 13px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); cursor:pointer; }
.nd-billchk input { margin-top:2px; width:16px; height:16px; accent-color:var(--navy-700); flex:none; cursor:pointer; }
.nd-billchk span { display:flex; flex-direction:column; gap:3px; min-width:0; }
.nd-billchk b { display:block; font-size:13px; font-weight:700; color:var(--ink); line-height:1.4; }
.nd-billchk em { display:block; font-size:11.5px; font-style:normal; color:var(--dim); line-height:1.5; }

/* ---- รับของเข้าคลัง (GR) ---- */
.grhead { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px 14px; align-items:end; }
.grby { font-size:11.5px; color:var(--dim); display:inline-flex; align-items:center; gap:5px; }
.grby b { color:var(--navy-700); font-weight:700; }
.grhead .rcfield { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; color:var(--ink-2); position:relative; }
.grhead .rcfield > input, .grhead .rcfield select { height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); background:var(--surface); outline:none; width:100%; }
.grhead .rcfield > input:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.grpick { position:relative; }
.grin { width:78px; border:1.5px solid var(--gold-400); border-radius:6px; padding:5px 8px; font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:700; text-align:right; outline:none; background:#fffdf6; }
.grin:focus { box-shadow:0 0 0 2px var(--gold-glow); }
.grfoot { display:flex; gap:18px; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; padding:15px 16px; border-top:1px solid var(--line); background:#fbfcfe; }
.grfoot__left { display:flex; flex-direction:column; gap:11px; min-width:240px; }
.grtax { display:flex; align-items:center; gap:11px; }
.grtax__lbl { font-size:12.5px; font-weight:700; color:var(--ink-2); }
.grwh { display:flex; align-items:flex-start; gap:8px; border-radius:10px; padding:9px 12px; max-width:340px; }
.grwh--y { background:var(--ok-bg); border:1px solid #bfe6d3; color:var(--ok-ink); }
.grwh--n { background:#eef3fb; border:1px solid #c5d6ef; color:var(--navy-700); }
.grwh b { color:inherit; }
.grfoot__tot { min-width:260px; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:12px 14px; }
.grtot__row { display:flex; justify-content:space-between; align-items:baseline; font-size:12.5px; color:var(--ink-2); padding:3px 0; }
.grtot__row--net { border-top:1px dashed var(--line-2); margin-top:4px; padding-top:8px; font-size:14px; font-weight:800; color:var(--ink); }
.grtot__row--net b { font-size:20px; color:var(--navy-800); }
.grtot__match { display:flex; align-items:center; gap:9px; border-top:1px solid var(--line); margin-top:8px; padding-top:10px; font-size:12px; color:var(--dim); }
.grtot__match span:first-child { flex:1; }
.grmatch { display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:800; padding:3px 9px; border-radius:var(--r-pill); }
.grmatch--ok { color:var(--ok-ink); background:var(--ok-bg); }
.grmatch--no { color:var(--danger); background:var(--danger-bg); }
@media (max-width:760px){ .grhead { grid-template-columns:1fr 1fr; } }
.grsel { width:100%; border:1px solid var(--line-2); border-radius:7px; padding:5px 8px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink); background:var(--surface); outline:none; }
.grsel:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.grpobtn { display:flex; align-items:center; gap:8px; width:100%; height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; background:var(--surface); cursor:pointer; font-family:var(--ff); font-size:13px; text-align:left; }
.grpobtn > b { flex:1; }
.grpobtn > span { flex:1; }
.grpobtn > svg, .grpobtn .icn { margin-left:auto; }
.grpobtn:hover:not(:disabled) { border-color:var(--navy-600); }
.grpobtn:disabled { background:var(--surface-2); cursor:not-allowed; opacity:.65; }
.grpolist { display:flex; flex-direction:column; gap:9px; max-height:340px; overflow:auto; }
.grpo { text-align:left; border:1.5px solid var(--line-2); border-radius:12px; background:var(--surface); padding:11px 13px; cursor:pointer; font-family:var(--ff); display:flex; flex-direction:column; gap:8px; }
.grpo:hover { border-color:var(--navy-600); background:#f7f9fd; }
.grpo.is-on { border-color:var(--navy-600); background:#eef3fb; }
.grpo__hd { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.grpo__items { display:flex; flex-wrap:wrap; gap:6px; }
.grpo__chip { font-size:11.5px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:7px; padding:3px 8px; }
.grpo__chip b { color:var(--navy-700); }
.docbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.greditbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; color:var(--ink-2); background:#eef3fb; border:1px solid #c5d6ef; border-radius:10px; padding:9px 14px; margin-bottom:14px; }
.grbillno { border:none; background:none; font-family:var(--ff-mono,monospace); font-weight:700; color:var(--navy-700); cursor:pointer; padding:0; font-size:inherit; text-decoration:underline; text-decoration-color:transparent; text-underline-offset:3px; transition:text-decoration-color .12s, color .12s; white-space:nowrap; }
.grbillno:hover { color:var(--navy-900,#0f2350); text-decoration-color:currentColor; }
.grbvhead { display:flex; flex-wrap:wrap; gap:7px 24px; padding:13px 18px; background:var(--surface-2); border-bottom:1px solid var(--line); }
.grbvhead > div { display:flex; align-items:baseline; gap:6px; min-width:0; }
.grbvhead span { font-size:11.5px; color:var(--dim); white-space:nowrap; flex:none; }
.grbvhead span::after { content:":"; }
.grbvhead b { font-size:13px; color:var(--ink); white-space:nowrap; }
.greditbar b { color:var(--navy-800); }
.greditbar__x { margin-left:auto; border:1px solid var(--line-2); background:#fff; border-radius:7px; padding:4px 12px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.greditbar__x:hover { border-color:var(--navy-300,#9fb3d4); color:var(--navy-800); }
.docgate { border:none; margin:0; padding:0; min-width:0; }
.docgate[disabled] { opacity:.5; }
.docgate[disabled] * { pointer-events:none !important; }
.docprompt { display:flex; align-items:center; gap:8px; background:#fff8e8; border:1px solid #f0d894; color:#8a6a16; border-radius:11px; padding:11px 14px; margin-bottom:16px; font-size:13px; font-weight:600; }
.docprompt b { color:var(--gold-600); }

/* ---- ระบบวางบิล (สร้างใบวางบิล) ---- */
.bkbtn { width:30px; height:30px; border-radius:8px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); display:grid; place-items:center; cursor:pointer; font-size:20px; line-height:1; padding-bottom:2px; }
.bkbtn:hover { background:var(--surface-2); color:var(--ink); }
.billkeys { font-size:11.5px; color:var(--dim); display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.kbd { display:inline-grid; place-items:center; min-width:24px; height:19px; padding:0 5px; border-radius:5px; border:1px solid var(--line-2); border-bottom-width:2px; background:var(--surface-2); font-family:"Noto Sans",sans-serif; font-size:11px; font-weight:800; color:var(--navy-700); }
.billhead { display:grid; grid-template-columns:1fr 1fr 1.7fr; gap:13px; margin-bottom:16px; }
.billhead label, .billpick label { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; color:var(--ink-2); }
.billhead input, .billpick input { height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); background:var(--surface); outline:none; width:100%; }
.billhead input:focus, .billpick input:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.billpick { position:relative; }
.billpick__drop { position:absolute; top:100%; left:0; right:0; margin-top:5px; background:var(--surface); border:1px solid var(--line-2); border-radius:11px; box-shadow:0 12px 30px rgba(11,26,51,.16); z-index:30; max-height:262px; overflow:auto; padding:5px; }
.billpick__opt { display:flex; align-items:center; gap:10px; padding:8px 9px; border-radius:8px; cursor:pointer; }
.billpick__opt:hover { background:var(--surface-2); }
.billpick__empty { padding:16px; text-align:center; font-size:12.5px; color:var(--dim); }
.billbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; background:var(--surface-2); border:1px solid var(--line); border-radius:11px; padding:10px 13px; margin-bottom:12px; }
.bchk { width:18px; height:18px; border-radius:5px; display:grid; place-items:center; border:1.5px solid; }
.rcsum { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:14px 18px; border-top:1px solid var(--line); background:var(--surface-2); border-radius:0 0 var(--r-lg,16px) var(--r-lg,16px); }
.rcsum__l { font-size:13px; color:var(--ink-2); }
.rcsum__l b { color:var(--ink); }
.billform { display:flex; align-items:center; gap:11px; width:100%; text-align:left; cursor:pointer; border:1.5px solid var(--line-2); background:var(--surface); border-radius:11px; padding:11px 13px; font-family:var(--ff); }
.billform[data-on="1"] { border-color:var(--navy-600); background:#eef3fb; }
.billform__r { flex:none; width:18px; height:18px; border-radius:50%; border:1.5px solid var(--line-2); display:grid; place-items:center; }
.billform[data-on="1"] .billform__r { border-color:var(--navy-600); }
.billform__r i { width:10px; height:10px; border-radius:50%; background:var(--navy-600); display:block; }
.billform b { display:block; font-size:13px; font-weight:700; color:var(--ink); }
.billform span span, .billform > span > span { display:block; font-size:11px; color:var(--dim); margin-top:2px; }
.billhead select { height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); background:var(--surface); outline:none; width:100%; }
.billhead select:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.bnfound { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-2); }
.bnfound b { color:var(--ink); }
.bnmiss { font-size:12.5px; color:var(--danger); font-weight:600; }
.paybox { margin-top:16px; border:1px solid var(--line); border-radius:12px; padding:14px 15px; background:var(--surface-2); }
.paybox__hd { font-size:12.5px; font-weight:800; color:var(--navy-700); margin-bottom:12px; }

/* ---- ใบสำคัญรับเงิน — เลย์เอาต์ 2 คอลัมน์ ---- */
.rcbody { display:grid; grid-template-columns:372px 1fr; gap:16px; padding:18px; align-items:start; }
.rccol { display:flex; flex-direction:column; gap:14px; min-width:0; }
.rccard { border:1px solid var(--line); border-radius:13px; background:var(--surface); }
.rccard__hd { font-size:12.5px; font-weight:800; color:var(--navy-700); padding:10px 14px; border-bottom:1px solid var(--line); background:var(--surface-2); border-radius:13px 13px 0 0; display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; white-space:nowrap; }
.rccard__bd { padding:14px; display:flex; flex-direction:column; gap:12px; }
.rcfield { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; color:var(--ink-2); }
.rcfield input, .rcfield select { height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); background:var(--surface); outline:none; width:100%; }
.rcfield input::placeholder { color:var(--line-2); }
.rcfield input:focus, .rcfield select:focus { border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.rcfield__inrow { display:flex; gap:8px; align-items:stretch; }
.rcfield__inrow input { flex:1; min-width:0; }
.rcpull { flex:none; display:inline-flex; align-items:center; gap:6px; height:38px; padding:0 13px; border:1px solid var(--navy-600); background:#eef3fb; color:var(--navy-700); border-radius:9px; font-family:var(--ff); font-size:12.5px; font-weight:700; cursor:pointer; white-space:nowrap; transition:all .14s; }
.rcpull:hover { background:var(--navy-600); color:#fff; }
.bnpicklist { display:flex; flex-direction:column; gap:8px; max-height:340px; overflow:auto; }
.bnpickrow { display:flex; align-items:center; gap:12px; width:100%; text-align:left; padding:11px 13px; border:1px solid var(--line-2); border-radius:11px; background:var(--surface); cursor:pointer; transition:all .14s; }
.bnpickrow:hover { border-color:var(--navy-600); background:#f6f9fe; box-shadow:0 2px 8px rgba(14,31,63,.08); }
.bnpickrow__ref { font-weight:700; color:var(--navy-600); font-size:12.5px; flex:none; }
.bnpickrow__mid { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.bnpickrow__mid b { font-size:13px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bnpickrow__mid span { font-size:11px; color:var(--dim); }
.bnpickrow__amt { font-weight:800; color:var(--ink); font-size:13px; flex:none; white-space:nowrap; }
.bnpickrow__go { flex:none; }
/* ---------- DateSearch (วันที่/เดือน/ปี + ปฏิทิน) ---------- */
.datesearch { position:relative; display:inline-flex; align-items:center; gap:5px; flex-wrap:wrap; }
.ds-sel { height:32px; border:1px solid var(--line-2); border-radius:8px; padding:0 7px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink); background:var(--surface); cursor:pointer; }
.ds-sel:focus { outline:none; border-color:var(--navy-600); box-shadow:0 0 0 2px rgba(42,79,134,.12); }
.ds-cal { width:32px; height:32px; flex:none; border:1px solid var(--line-2); border-radius:8px; background:var(--surface); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; }
.ds-cal:hover, .ds-cal.is-on { border-color:var(--navy-600); background:#eef3fb; }
.ds-clear { width:26px; height:26px; flex:none; border:none; border-radius:7px; background:var(--surface-3); color:var(--dim); cursor:pointer; font-size:12px; }
.ds-clear:hover { background:#f3d6d0; color:#c0392b; }
.ds-pop { position:absolute; top:38px; right:0; z-index:60; width:250px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 30px rgba(11,26,51,.18); padding:10px; }
.ds-pophd { display:flex; align-items:center; gap:4px; margin-bottom:8px; }
.ds-pophd button { width:28px; height:28px; border:1px solid var(--line-2); border-radius:7px; background:var(--surface); cursor:pointer; font-size:14px; color:var(--navy-700); display:grid; place-items:center; }
.ds-pophd button:hover { background:#eef3fb; border-color:var(--navy-600); }
.ds-popttl { flex:1; text-align:center; font-weight:800; font-size:13px; color:var(--ink); }
.ds-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.ds-grid--dow { margin-bottom:3px; }
.ds-dow { text-align:center; font-size:10.5px; font-weight:700; color:var(--dim); padding:2px 0; }
.ds-day { height:28px; border:none; border-radius:7px; background:none; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink-2); }
.ds-day:hover { background:var(--surface-2); }
.ds-day.is-sel { background:linear-gradient(120deg,#16294f,#0e1f3f); color:#fff; }
.ds-popft { display:flex; gap:6px; margin-top:9px; }
.ds-popft button { flex:1; height:30px; border:1px solid var(--line-2); border-radius:8px; background:var(--surface); cursor:pointer; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); }
.ds-popft button:hover { background:#eef3fb; border-color:var(--navy-600); }
/* ---- รายงานลูกหนี้ค้างจ่าย (as-of) ---- */
.arrep { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--surface); }
.arrep__head { text-align:center; padding:16px 14px 13px; border-bottom:2px solid var(--navy-700); background:var(--surface-2); }
.arrep__co { font-size:13px; font-weight:700; color:var(--navy-700); letter-spacing:.2px; }
.arrep__head h2 { font-size:16.5px; font-weight:800; color:var(--ink); margin-top:5px; }
.arrep__tbl .arrep__cust td { background:var(--surface-3); font-weight:700; color:var(--navy-800); padding:9px 12px; }
.arrep__code { color:var(--navy-600); margin-right:6px; }
.arrep__terms { float:right; font-size:11px; font-weight:600; color:var(--dim); }
.arrep__subt td { background:#fbfcfe; font-weight:700; color:var(--ink-2); border-top:1px solid var(--line); }
.arrep__grand td { background:var(--navy-700); color:#fff !important; font-weight:800; padding:11px 12px; }
@media print {
  body * { visibility:hidden !important; }
  .printdoc, .printdoc * { visibility:visible !important; }
  .printdoc { position:absolute; left:0; top:0; width:100%; border:none; }
  .arrep__grand td, .arrep__head, .arrep__cust td, .arrep__subt td { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
.rcrow2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.rchint { font-size:11.5px; color:var(--dim); line-height:1.5; }
.rccol--right .rccard__hd span { font-size:12.5px; }
.rcempty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:11px; padding:64px 22px; color:var(--dim); font-size:13px; text-align:center; line-height:1.5; }
.rccard--docs .tbl { border-radius:0 0 13px 13px; overflow:hidden; }
/* ---- สร้างใบวางบิล: layout แถบตั้งค่าบน + เอกสารเต็มกว้าง ---- */
.bcrwrap { padding:18px; display:flex; flex-direction:column; gap:14px; }
.bcrsetup { display:grid; grid-template-columns:210px 150px minmax(0,1fr); gap:14px 16px; align-items:start; padding:14px; }
.bcrsetup .rcfield { gap:5px; }
.bcrsetup__cust { position:relative; }
.bcrsetup__hint { grid-column:1 / -1; display:flex; align-items:center; gap:10px; padding:10px 12px; margin-top:2px; background:var(--surface-2); border:1px solid var(--line); border-radius:11px; }
.bcrsetup__hint .cell-main { font-size:13.5px; font-weight:700; color:var(--ink); }
.bcrsetup__hint .cell-sub { font-size:11.5px; color:var(--dim); }
.bcrdocs { min-height:280px; display:flex; flex-direction:column; }
.bcrdocs .rcempty { flex:1; padding:56px 22px; }
@media (max-width:760px){ .bcrsetup { grid-template-columns:1fr; } }
/* สร้างใบสำคัญรับเงิน: setup 3 กลุ่มแนวนอน */
.rcrsetup { display:grid; grid-template-columns:200px minmax(230px,1fr) minmax(230px,1fr); gap:16px 18px; align-items:start; padding:14px; }
.rcrsetup__grp { display:flex; flex-direction:column; gap:10px; min-width:0; }
.rcrsetup__grp .billpick { position:relative; }
.rcrsetup__lb { font-size:11px; font-weight:800; color:var(--navy-700); text-transform:uppercase; letter-spacing:.4px; }
.rcrsetup__hd { justify-content:space-between; align-items:center; gap:12px; }
.rcrsetup__hd .dchips--sm { flex:none; }
@media (max-width:880px){ .rcrsetup { grid-template-columns:1fr; } }
/* 2-คอลัมน์ (ซ้าย: ข้อมูล+อ้างอิง / ขวา: การรับ-จ่ายชำระ) — ลดที่ว่างเมื่อช่องจ่ายยาว */
.rcrsetup--2col { grid-template-columns:minmax(300px,1fr) minmax(320px,1.15fr); }
@media (max-width:880px){ .rcrsetup--2col { grid-template-columns:1fr; } }

/* ---- เว็บหน้าร้าน (storefront) ---- */
.sf-switch { display:flex; gap:4px; padding:3px; border-radius:11px; background:var(--surface-2); border:1px solid var(--line); }
.sf-switch button { display:inline-flex; align-items:center; gap:6px; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); padding:7px 13px; border-radius:8px; }
.sf-switch button.on { background:#fff; color:var(--navy-700); box-shadow:0 1px 4px rgba(20,33,61,.12); }
.sfsite { position:relative; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:#fff; box-shadow:0 18px 50px -30px rgba(20,40,90,.4); }
/* 💬 แชทกับร้าน (floating) */
.sf-chatfab { position:fixed; right:24px; bottom:24px; z-index:60; display:inline-flex; align-items:center; gap:9px; padding:13px 18px 13px 15px; border:none; border-radius:999px; background:linear-gradient(135deg,#1f8a5b,#12714a); color:#fff; font-family:var(--ff); font-size:14px; font-weight:700; cursor:pointer; box-shadow:0 10px 26px rgba(18,113,74,.4); transition:.16s; }
.sf-chatfab:hover { transform:translateY(-2px); box-shadow:0 14px 32px rgba(18,113,74,.5); }
.sf-chatfab.is-hidden { display:none; }
.sf-chat { position:fixed; right:24px; bottom:24px; z-index:61; width:min(370px, calc(100% - 32px)); height:min(540px, calc(100% - 40px)); display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden; box-shadow:0 24px 60px rgba(15,30,70,.32); }
.sf-chat__hd { display:flex; align-items:center; gap:11px; padding:13px 15px; background:linear-gradient(135deg,#16294f,#0e1f3f); color:#fff; }
.sf-chat__ava { flex:none; width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.16); }
.sf-chat__id { flex:1; min-width:0; }
.sf-chat__id b { font-size:14px; font-weight:800; display:block; }
.sf-chat__id span { font-size:11px; color:#bcd; display:flex; align-items:center; gap:5px; }
.sf-chat__dot { width:7px; height:7px; border-radius:50%; background:#33d685; }
.sf-chat__x { flex:none; width:30px; height:30px; display:grid; place-items:center; border:none; border-radius:8px; background:rgba(255,255,255,.12); color:#fff; cursor:pointer; }
.sf-chat__x:hover { background:rgba(255,255,255,.24); }
.sf-chat__bd { flex:1; min-height:0; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px; background:#f4f6fa; }
.sf-chat__day { align-self:center; font-size:10.5px; font-weight:600; color:var(--dim); background:rgba(20,40,90,.07); border-radius:999px; padding:3px 12px; margin-bottom:2px; }
.sf-chatmsg__bub--img { font-style:italic; color:var(--dim); background:#eef3ff !important; border-style:dashed !important; }
.sf-chat__typing { display:inline-flex !important; align-items:center; gap:4px; padding:12px 14px !important; }
.sf-chat__typing span { width:7px; height:7px; border-radius:50%; background:var(--line-2); animation:sfTyping 1.1s infinite ease-in-out; }
.sf-chat__typing span:nth-child(2){ animation-delay:.18s; } .sf-chat__typing span:nth-child(3){ animation-delay:.36s; }
@keyframes sfTyping { 0%,60%,100%{ transform:translateY(0); opacity:.5; } 30%{ transform:translateY(-4px); opacity:1; } }
.sf-chat__attach { flex:none; width:38px; height:38px; display:grid; place-items:center; border:none; border-radius:50%; background:none; color:var(--dim); cursor:pointer; }
.sf-chat__attach:hover { background:#eef3ff; color:var(--navy-700); }
.sf-chatmsg__col { display:flex; flex-direction:column; gap:5px; min-width:0; }
.sf-chatprod { display:flex; align-items:center; gap:9px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:7px; max-width:230px; }
.sf-chatprod__img { flex:none; width:46px; height:46px; border-radius:8px; overflow:hidden; display:grid; place-items:center; background:var(--surface-2); }
.sf-chatprod__img img { width:100%; height:100%; object-fit:cover; }
.sf-chatprod__bd { min-width:0; }
.sf-chatprod__bd b { display:block; font-size:12px; font-weight:700; color:var(--navy-800); line-height:1.35; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.sf-chatprod__price { font-size:12.5px; font-weight:800; color:#1f8a5b; }
.sf-chatmsg { display:flex; align-items:flex-end; gap:7px; max-width:84%; }
.sf-chatmsg--me { align-self:flex-end; flex-direction:row-reverse; }
.sf-chatmsg--shop { align-self:flex-start; }
.sf-chatmsg__av { flex:none; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; background:#16294f; }
.sf-chatmsg__bub { font-size:13px; line-height:1.5; padding:9px 12px 7px; border-radius:14px; position:relative; }
.sf-chatmsg--shop .sf-chatmsg__bub { background:#fff; color:var(--ink); border:1px solid var(--line); border-bottom-left-radius:5px; }
.sf-chatmsg--me .sf-chatmsg__bub { background:#1f8a5b; color:#fff; border-bottom-right-radius:5px; }
.sf-chatmsg__t { display:block; font-size:9.5px; opacity:.6; margin-top:3px; text-align:right; }
.sf-chat__quick { display:flex; flex-wrap:wrap; gap:6px; padding:9px 12px 0; background:#f4f6fa; }
.sf-chat__quick button { font-family:var(--ff); font-size:11.5px; font-weight:600; color:#1f8a5b; background:#fff; border:1px solid #bfe4cd; border-radius:999px; padding:5px 11px; cursor:pointer; }
.sf-chat__quick button:hover { background:#1f8a5b; border-color:#1f8a5b; color:#fff; }
.sf-chat__bar { display:flex; gap:8px; padding:11px 12px; background:#f4f6fa; }
.sf-chat__bar input { flex:1; border:1px solid var(--line); border-radius:999px; padding:9px 14px; font-family:var(--ff); font-size:13px; outline:none; }
.sf-chat__bar input:focus { border-color:#1f8a5b; }
.sf-chat__send { flex:none; width:40px; height:40px; display:grid; place-items:center; border:none; border-radius:50%; background:#1f8a5b; color:#fff; cursor:pointer; }
.sf-chat__send:disabled { opacity:.4; cursor:not-allowed; }
.sf-top { display:flex; align-items:center; gap:18px; padding:12px 20px; border-bottom:1px solid var(--line); background:#fff; position:sticky; top:0; }
.sf-brand { display:flex; align-items:center; gap:10px; }
.sf-brand img { width:34px; height:34px; border-radius:9px; }
.sf-brand b { display:block; font-size:15px; font-weight:800; color:var(--navy-700); font-family:"Sarabun",var(--ff); line-height:1; }
.sf-brand span { font-size:10.5px; color:var(--dim); }
.sf-nav { display:flex; gap:18px; flex:1; }
.sf-nav a { font-size:13px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.sf-nav a:hover { color:var(--gold-600); }
.sf-top__r { display:flex; gap:8px; }
.sf-pts, .sf-cart { border:1px solid var(--line-2); background:#fff; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 12px; border-radius:9px; color:var(--navy-700); }
.sf-pts { color:var(--gold-600); border-color:#f2d89e; background:#fffdf6; }
.sf-cart { background:var(--navy-700); color:#fff; border-color:transparent; }
.sf-hero { display:flex; gap:24px; align-items:center; justify-content:space-between; padding:40px 36px; background:linear-gradient(135deg,#0f2f7a,#143591 60%,#0b3d91); color:#fff; }
.sf-kick { font-size:12px; font-weight:700; letter-spacing:.4px; color:var(--gold-300); background:rgba(245,164,0,.14); border:1px solid rgba(245,164,0,.26); padding:5px 12px; border-radius:99px; display:inline-block; }
.sf-kick--light { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.sf-hero h1 { margin:14px 0 0; font-family:"Sarabun",var(--ff); font-size:34px; font-weight:800; line-height:1.15; }
.sf-hero p { margin:12px 0 0; font-size:14px; color:#c4d2ea; max-width:440px; }
.sf-hero__cta { display:flex; gap:10px; margin-top:20px; }
.sf-btn { border:none; cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:800; padding:11px 20px; border-radius:11px; }
.sf-btn--gold { background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); color:#3a2700; }
.sf-btn--ghost { background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.25); }
.sf-about .sf-btn--ghost, .sf-loc__info .sf-btn--ghost { background:var(--surface-2); color:var(--navy-700); border:1px solid var(--line-2); margin-top:10px; }
.sf-hero__badges { display:flex; flex-direction:column; gap:10px; flex:none; }
.sf-hb { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.16); border-radius:12px; padding:12px 18px; min-width:150px; }
.sf-hb b { display:block; font-size:20px; font-weight:800; font-family:"Sarabun",var(--ff); }
.sf-hb span { font-size:11.5px; color:#bcd0f0; }
.sf-sec { padding:30px 36px; }
.sf-sec--alt { background:#f6f8fc; }
.sf-sec__hd { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:18px; }
.sf-sec__hd h2 { font-size:20px; font-weight:800; color:var(--ink); font-family:"Sarabun",var(--ff); }
.sf-sec__hd span { font-size:12.5px; color:var(--dim); }
.sf-link { background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--gold-600); }
.sf-cars { display:grid; grid-template-columns:repeat(auto-fill,minmax(106px,1fr)); gap:10px; }
.sf-carbrand { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px 10px; min-height:84px; border-radius:12px; cursor:pointer; background:#fff; border:1px solid var(--line); font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink); transition:.14s; }
.sf-carbrand:hover { border-color:var(--gold-400); transform:translateY(-2px); box-shadow:0 10px 22px -14px rgba(20,40,90,.4); }
.sf-carbrand.is-active { border-color:var(--navy-700); background:var(--info-bg,#eef4ff); box-shadow:0 0 0 2px var(--navy-700) inset; }
.sf-carbrand__n { font-size:10px; font-weight:700; color:var(--dim); }
.sf-carbrand.is-active .sf-carbrand__n { color:var(--navy-700); }
.sf-catnote { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:1px solid #bcd6f0; border-radius:10px; padding:9px 13px; margin-bottom:14px; }
.sf-empty2 { grid-column:1/-1; text-align:center; color:var(--dim); padding:30px; font-size:13px; }
.sf-carbrand__m { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; font-size:18px; font-weight:800; color:#fff; background:linear-gradient(140deg,#1b305c,#0b3d91); font-family:"Sarabun",var(--ff); }
.sf-carbrand__logo { width:100%; height:60px; display:grid; place-items:center; }
.sf-carbrand__logo img { max-width:96%; max-height:56px; width:auto; height:auto; object-fit:contain; display:block; }
.sf-carbrand__lbl { font-size:12.5px; font-weight:700; color:var(--ink); }
.sf-partners { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.sf-partner { display:flex; flex-direction:column; align-items:center; text-align:center; padding:13px 10px; border-radius:12px; background:#fff; border:1px solid var(--line); cursor:pointer; font-family:var(--ff); transition:.14s; }
.sf-partner:hover { border-color:var(--gold-400); transform:translateY(-2px); box-shadow:0 10px 22px -14px rgba(20,40,90,.4); }
.sf-partner.is-active { border-color:var(--navy-700); box-shadow:0 0 0 2px var(--navy-700) inset; }
.sf-partner__go { margin-top:6px; font-size:10.5px; font-weight:700; color:var(--gold-600); }
.sf-partner.is-active .sf-partner__go { color:var(--navy-700); }
.sf-partner__logo { height:54px; display:grid; place-items:center; margin-bottom:7px; }
.sf-partner__logo img { max-width:92%; max-height:50px; width:auto; height:auto; object-fit:contain; display:block; }
.sf-partner b { display:block; font-size:18px; font-weight:800; letter-spacing:1px; color:var(--navy-700); font-family:"Sarabun",var(--ff); }
.sf-partner span { font-size:11px; color:var(--dim); }
.sf-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(184px,1fr)); gap:12px; }
.sf-card { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; transition:box-shadow .15s, border-color .15s; }
.sf-card:hover { box-shadow:0 6px 18px rgba(20,30,55,.10); border-color:var(--navy-600); }
.sf-card__img { position:relative; aspect-ratio:1/1; width:100%; display:flex; align-items:center; justify-content:center; color:var(--navy-600); background:#fff; overflow:hidden; }
.sf-card__img img { width:100%; height:100%; object-fit:contain; padding:6px; display:block; }
.sf-card__oos { position:absolute; top:8px; left:8px; background:rgba(20,30,55,.82); color:#fff; font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:999px; }
.sf-card__stock { margin-top:7px; }
.sf-instock { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:#1F8A5B; }
.sf-instock i { width:7px; height:7px; border-radius:50%; background:#1F8A5B; box-shadow:0 0 0 3px rgba(31,138,91,.16); }
.sf-oos2 { font-size:11.5px; font-weight:700; color:var(--dim); }
.sf-card__bd { padding:10px 11px 11px; }
.sf-card__nm { font-size:12.5px; font-weight:600; color:var(--ink); line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:34px; }
.sf-card__sub { font-size:10.5px; color:var(--dim); margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-card__ft { display:flex; align-items:flex-end; justify-content:space-between; gap:6px; margin-top:9px; }
.sf-card__pricewrap { display:flex; flex-direction:column; line-height:1.1; }
.sf-price { font-size:16px; font-weight:800; color:var(--gold-600,#b8860b); font-family:"Sarabun",var(--ff); }
.sf-price__orig { font-size:11px; color:var(--line-2,#9aa7bd); text-decoration:line-through; margin-top:1px; }
.sf-buy { border:none; cursor:pointer; font-family:var(--ff); font-weight:700; width:34px; height:34px; border-radius:9px; background:var(--navy-700); color:#fff; white-space:nowrap; flex-shrink:0; display:grid; place-items:center; transition:filter .12s; }
.sf-buy:hover:not(:disabled) { filter:brightness(1.12); }
.sf-buy:disabled { background:#e3e7ee; color:var(--dim); cursor:not-allowed; }
.sf-card { cursor:pointer; }
.sf-card:hover { box-shadow:0 12px 28px -12px rgba(20,30,55,.4); border-color:var(--navy-600); transform:translateY(-3px); }
.sf-card__imgn { position:absolute; bottom:7px; right:7px; display:inline-flex; align-items:center; gap:3px; background:rgba(20,30,55,.72); color:#fff; font-size:10px; font-weight:700; padding:2px 7px; border-radius:999px; }
/* premium badges */
.sf-card__badges { position:absolute; top:8px; left:8px; display:flex; flex-direction:column; gap:5px; align-items:flex-start; }
.sf-badge { font-size:10px; font-weight:800; letter-spacing:.3px; padding:3px 8px; border-radius:6px; color:#fff; box-shadow:0 2px 6px rgba(0,0,0,.16); }
.sf-badge--disc { background:linear-gradient(135deg,#e8413a,#c0392b); }
.sf-badge--hot { background:linear-gradient(135deg,#ff7a3d,#f25c05); }
.sf-badge--new { background:linear-gradient(135deg,#1F8A5B,#13714a); }
.sf-badge--rec { background:linear-gradient(135deg,#1b3a78,#0b3d91); }
.sf-card__oosov { position:absolute; inset:0; background:rgba(245,247,250,.74); backdrop-filter:saturate(.4); display:grid; place-items:center; }
.sf-card__oosov span { background:rgba(20,30,55,.86); color:#fff; font-size:12px; font-weight:800; padding:6px 16px; border-radius:999px; }
.sf-card__rate { display:flex; align-items:center; gap:6px; margin-top:7px; font-size:11px; }
.sf-stars { position:relative; font-size:12px; letter-spacing:1px; color:#e3e7ee; line-height:1; }
.sf-stars::before { content:"★★★★★"; position:absolute; left:0; top:0; width:var(--r,100%); overflow:hidden; color:#F5A623; white-space:nowrap; }
.sf-card__rate b { font-weight:800; color:var(--ink); }
.sf-card__rate i { color:var(--dim); font-style:normal; margin-left:auto; }
.sf-card__low { display:flex; align-items:center; gap:5px; margin-top:7px; font-size:10.5px; font-weight:700; color:#C0392B; }
.sf-card__ship { display:flex; align-items:center; gap:5px; margin-top:7px; font-size:10.5px; font-weight:600; color:#1F8A5B; }
/* trust bar */
.sf-trustbar { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; padding:18px 22px; margin:0; background:linear-gradient(180deg,#fbfcfe,#f4f7fb); border-bottom:1px solid var(--line); }
.sf-trust2 { display:flex; align-items:center; gap:11px; }
.sf-trust2__ic { width:42px; height:42px; border-radius:11px; background:#fff; border:1px solid var(--line); display:grid; place-items:center; flex-shrink:0; box-shadow:0 2px 6px rgba(20,30,55,.05); }
.sf-trust2 b { display:block; font-size:13px; font-weight:700; color:var(--ink); }
.sf-trust2 span { font-size:11px; color:var(--dim); }
@media (max-width:780px){ .sf-trustbar { grid-template-columns:repeat(2,1fr); } }

/* ---- รายละเอียดสินค้า (product detail modal) ---- */
.sfd-ov { position:absolute; inset:0; background:rgba(12,18,38,.5); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; padding:28px; z-index:60; }
.sfd { position:relative; width:min(880px,100%); max-height:92%; background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.32); overflow:hidden; display:flex; flex-direction:column; }
.sfd__x { position:absolute; top:14px; right:14px; z-index:2; width:34px; height:34px; border:none; border-radius:50%; background:rgba(255,255,255,.85); color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 1px 4px rgba(0,0,0,.12); }
.sfd__x:hover { background:#fff; }
.sfd__body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0; overflow:auto; }
.sfd-gallery { padding:24px; background:#f6f8fb; display:flex; flex-direction:column; gap:12px; }
.sfd-main { position:relative; aspect-ratio:1/1; background:#fff; border:1px solid var(--line); border-radius:14px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.sfd-main img { width:100%; height:100%; object-fit:contain; padding:14px; }
.sfd-main__oos { position:absolute; top:12px; left:12px; background:rgba(20,30,55,.82); color:#fff; font-size:12px; font-weight:700; padding:4px 11px; border-radius:999px; }
.sfd-thumbs { display:flex; gap:8px; flex-wrap:wrap; }
.sfd-thumb { width:60px; height:60px; padding:0; border:1.5px solid var(--line); border-radius:10px; background:#fff; cursor:pointer; overflow:hidden; flex-shrink:0; transition:border-color .12s; }
.sfd-thumb img { width:100%; height:100%; object-fit:contain; padding:4px; }
.sfd-thumb.on { border-color:var(--navy-700); }
.sfd-info { padding:34px 26px 26px; display:flex; flex-direction:column; gap:0; overflow:auto; }
.sfd-brandtag { align-self:flex-start; font-size:11px; font-weight:800; letter-spacing:.4px; color:var(--navy-700); background:rgba(11,61,145,.08); padding:3px 9px; border-radius:6px; margin-bottom:9px; text-transform:uppercase; }
.sfd-nm { font-size:19px; line-height:1.35; font-weight:700; color:var(--ink); margin:0; }
.sfd-part { font-size:13px; color:var(--dim); margin-top:5px; }
.sfd-price { font-family:"Sarabun",var(--ff); font-size:30px; font-weight:800; color:var(--navy-700); margin:14px 0 8px; }
.sfd-stock { margin-bottom:14px; }
.sfd-meta { border-top:1px solid var(--line); padding-top:13px; display:flex; flex-direction:column; gap:8px; }
.sfd-meta__row { display:flex; align-items:baseline; gap:12px; font-size:12.5px; }
.sfd-meta__row span { color:var(--dim); width:108px; flex-shrink:0; }
.sfd-meta__row b { color:var(--ink); font-weight:600; }
.sfd-qtyrow { display:flex; align-items:center; gap:14px; margin:18px 0 16px; flex-wrap:wrap; }
.sfd-qtyrow__lbl { font-size:13px; color:var(--dim); }
.sfd-qty { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:9px; overflow:hidden; }
.sfd-qty button { width:34px; height:34px; border:none; background:#fff; font-size:18px; color:var(--ink); cursor:pointer; }
.sfd-qty button:disabled { color:var(--line-2); cursor:not-allowed; }
.sfd-qty button:hover:not(:disabled) { background:var(--bg-1,#f4f6fa); }
.sfd-qty b { min-width:42px; text-align:center; font-size:14px; font-weight:700; border-left:1px solid var(--line); border-right:1px solid var(--line); height:34px; line-height:34px; }
.sfd-qty__avail { font-size:12px; color:var(--dim); }
.sfd-acts { display:flex; gap:11px; margin-bottom:18px; }
.sfd-add, .sfd-now { flex:1; min-width:0; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-family:var(--ff); font-size:14px; font-weight:700; padding:12px 14px; border-radius:11px; cursor:pointer; }
.sfd-add { border:1.5px solid var(--navy-700); background:rgba(11,61,145,.06); color:var(--navy-700); }
.sfd-add:hover:not(:disabled) { background:rgba(11,61,145,.12); }
.sfd-now { border:none; background:var(--gold-500); color:#3a2700; }
.sfd-now:hover:not(:disabled) { filter:brightness(.96); }
.sfd-add:disabled, .sfd-now:disabled { opacity:.5; cursor:not-allowed; }
.sfd-chat { flex:none; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-family:var(--ff); font-size:14px; font-weight:700; padding:12px 16px; border-radius:11px; cursor:pointer; border:1.5px solid #1f8a5b; background:rgba(31,138,91,.08); color:#1f8a5b; transition:.13s; }
.sfd-chat:hover { background:#1f8a5b; color:#fff; }
.sfd-trust { display:flex; flex-wrap:wrap; gap:8px 16px; border-top:1px solid var(--line); padding-top:14px; margin-top:auto; }
.sfd-trust span { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--ink); }
@media (max-width:720px){ .sfd__body{ grid-template-columns:1fr; } .sfd-info{ padding:20px; } }

/* ---- product options + description (in detail) ---- */
.sf-nav a { cursor:pointer; }
.sfd-opt { margin-top:14px; }
.sfd-opt__lbl { display:block; font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:7px; }
.sfd-opt__vals { display:flex; flex-wrap:wrap; gap:8px; }
.sfd-opt__chip { border:1.5px solid var(--line); background:#fff; color:var(--ink); font-family:var(--ff); font-size:12.5px; font-weight:600; padding:7px 14px; border-radius:9px; cursor:pointer; transition:border-color .12s, background .12s; }
.sfd-opt__chip:hover { border-color:var(--navy-600); }
.sfd-opt__chip.on { border-color:var(--navy-700); background:rgba(11,61,145,.07); color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700) inset; }
.sfd-desc { margin-top:16px; border-top:1px solid var(--line); padding-top:13px; }
.sfd-desc__lbl { display:block; font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:6px; }
.sfd-desc p { margin:0; font-size:13px; line-height:1.7; color:var(--ink-2,#42506a); text-wrap:pretty; }
.sfd-skunote { display:block; font-size:11px; font-weight:600; color:var(--dim); margin-top:3px; }

/* ---- variant modal (สินค้ารวมแบบ / SKU) ---- */
.sfp-tag--var { background:rgba(124,58,237,.1); color:#7c3aed; }
.sfp-mini--var { color:#7c3aed; border-color:#d9c8f7; }
.sfd-opt__chip--oos { opacity:.45; }
.sfv-intro { display:flex; align-items:flex-start; gap:8px; font-size:12px; line-height:1.55; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:1px solid #bcd6f0; border-radius:10px; padding:10px 12px; margin-bottom:14px; }
.sfv-intro b { font-weight:700; }
.sfv-gname { display:flex; flex-direction:column; gap:5px; margin-bottom:13px; }
.sfv-gname span { font-size:12px; font-weight:700; color:var(--ink); }
.sfv-gname input { border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-family:var(--ff); font-size:13px; }
.sfv-gname input:focus { outline:none; border-color:var(--navy-600); }
.sfv-list { display:flex; flex-direction:column; gap:9px; margin-bottom:14px; }
.sfv-row { display:flex; gap:8px; align-items:center; }
.sfv-row__lbl { flex:0 0 110px; border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-family:var(--ff); font-size:13px; font-weight:700; }
.sfv-row__lbl:focus { outline:none; border-color:var(--navy-600); }
.sfv-row__sku { flex:1; min-width:0; }
.sfv-pick { width:100%; border:1.5px dashed var(--navy-600); background:rgba(11,61,145,.04); color:var(--navy-700); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px 12px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.sfv-skuchip { display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:9px; padding:7px 10px; background:var(--bg-1,#f8fafc); }
.sfv-skuchip b { font-family:"Sarabun",monospace; font-size:12.5px; color:var(--navy-700); }
.sfv-skuchip span { flex:1; min-width:0; font-size:11.5px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sfv-skuchip__miss { color:#C0392B !important; }
.sfv-skuchip button { border:none; background:none; color:var(--dim); font-size:14px; cursor:pointer; flex-shrink:0; }
.sfv-pair { border:1px solid var(--line); border-radius:11px; padding:13px 14px; background:var(--bg-1,#f8fafc); }
.sfv-pair__hd { display:flex; align-items:center; justify-content:space-between; }
.sfv-pair__hd b { font-size:13.5px; color:var(--ink); }
.sfv-pair__bd { margin-top:11px; display:grid; grid-template-columns:1fr 140px; gap:11px; align-items:end; }
.sfv-pair__bd label { display:flex; flex-direction:column; gap:5px; }
.sfv-pair__bd label span { font-size:11.5px; font-weight:700; color:var(--ink); }
.sfv-pair__bd input { border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-family:var(--ff); font-size:13px; }
.sfv-pair__bd input:focus { outline:none; border-color:var(--navy-600); }
.sfv-pair__note { grid-column:1/-1; font-size:11px; color:var(--dim); }
.sfv-search { position:absolute; inset:0; background:rgba(12,18,38,.4); display:flex; align-items:flex-start; justify-content:center; padding:48px 20px; z-index:5; border-radius:16px; }
.sfv-search__box { width:min(420px,100%); background:#fff; border-radius:14px; box-shadow:0 16px 50px rgba(8,16,40,.3); overflow:hidden; display:flex; flex-direction:column; max-height:100%; }
.sfv-search__hd { display:flex; align-items:center; justify-content:space-between; padding:13px 15px; border-bottom:1px solid var(--line); }
.sfv-search__hd b { font-size:13.5px; }
.sfv-search__hd button { border:none; background:none; cursor:pointer; color:var(--dim); }
.sfv-search__in { margin:12px 15px; border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-family:var(--ff); font-size:13px; }
.sfv-search__in:focus { outline:none; border-color:var(--navy-600); }
.sfv-search__res { overflow:auto; padding:0 8px 10px; display:flex; flex-direction:column; gap:3px; }
.sfv-res { display:flex; flex-direction:column; align-items:flex-start; gap:1px; text-align:left; border:none; background:none; padding:9px 11px; border-radius:8px; cursor:pointer; }
.sfv-res:hover { background:var(--bg-1,#f1f4f9); }
.sfv-res b { font-family:"Sarabun",monospace; font-size:12.5px; color:var(--navy-700); }
.sfv-res span { font-size:12.5px; color:var(--ink); }
.sfv-res i { font-size:11px; color:var(--dim); font-style:normal; }
.sfv-res__empty { text-align:center; color:var(--dim); font-size:12.5px; padding:18px; }

/* ---- variant rows: OEM/genuine SKU + multiple product codes ---- */
.sfv-vrow { border:1px solid var(--line); border-radius:11px; padding:11px 12px; margin-bottom:10px; background:var(--bg-1,#f8fafc); }
.sfv-vrow__top { display:flex; gap:8px; align-items:center; margin-bottom:9px; }
.sfv-vrow__lbl { flex:0 0 92px; border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-family:var(--ff); font-size:13px; font-weight:700; background:#fff; }
.sfv-vrow__oem { flex:1; min-width:0; border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-family:"Sarabun",var(--ff); font-size:13px; font-weight:700; color:var(--navy-700); background:#fff; }
.sfv-vrow__lbl:focus, .sfv-vrow__oem:focus { outline:none; border-color:var(--navy-600); }
.sfv-codes { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.sfv-priohint { flex:1 1 100%; display:flex; align-items:center; gap:5px; font-size:11px; color:var(--navy-700); margin-bottom:2px; }
.sfv-priorow { flex:1 1 100%; display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:9px; padding:6px 8px; background:#fff; }
.sfv-priotag { flex:none; font-size:10.5px; font-weight:800; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:2px 9px; min-width:78px; text-align:center; }
.sfv-priotag--main { color:#fff; background:var(--navy-700); border-color:var(--navy-700); }
.sfv-priorow__sku { flex:1; min-width:0; display:flex; flex-direction:column; }
.sfv-priorow__sku b { font-family:"Sarabun",monospace; font-size:12px; color:var(--ink); font-weight:800; }
.sfv-priorow__sku span { font-size:11px; color:var(--dim); }
.sfv-priorow__ord { flex:none; display:inline-flex; flex-direction:column; gap:2px; }
.sfv-priorow__ord button { width:22px; height:16px; line-height:1; border:1px solid var(--line-2); background:#fff; border-radius:5px; color:var(--navy-700); font-size:10px; cursor:pointer; padding:0; }
.sfv-priorow__ord button:hover:not(:disabled) { background:var(--surface-2); }
.sfv-priorow__ord button:disabled { opacity:.3; cursor:default; }
.sfv-priorow__x { flex:none; border:none; background:none; color:var(--dim); font-size:13px; cursor:pointer; padding:0 2px; }
.sfv-priorow__x:hover { color:#C0392B; }
.sfv-codechip { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:8px; padding:5px 8px; background:#fff; }
.sfv-codechip b { font-family:"Sarabun",monospace; font-size:12px; color:var(--ink); }
.sfv-codechip span { font-size:11px; color:var(--dim); }
.sfv-codechip button { border:none; background:none; color:var(--dim); font-size:13px; cursor:pointer; padding:0 0 0 2px; }
.sfv-codechip button:hover { color:#C0392B; }
.sfv-addcode { border:1.5px dashed var(--navy-600); background:rgba(11,61,145,.04); color:var(--navy-700); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:6px 11px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.sfv-vrow__sum { font-size:11.5px; color:var(--dim); margin-top:8px; }
.sfv-vrow__sum b { color:#1F8A5B; font-size:13px; }
.sfv-eq { color:var(--navy-700); font-family:"Sarabun",monospace; }
.sfv-eq em { font-family:var(--ff); font-style:normal; color:var(--dim); }
.sfv-eqsep { font-family:"Sarabun",monospace; font-size:15px; font-weight:800; color:var(--navy-700); align-self:center; padding:0 1px; }

/* ---- per-product carrier picker (ShipDimsModal) ---- */
.shipcarrier { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; margin-top:6px; }
.shipcarrier__b { display:flex; width:100%; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; color:var(--ink); font-family:var(--ff); font-size:12px; font-weight:600; padding:8px 12px; border-radius:10px; cursor:pointer; text-align:left; }
.shipcarrier__b:hover { border-color:var(--navy-600); }
.shipcarrier__b.on { border-color:var(--navy-700); background:rgba(11,61,145,.07); color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700) inset; }
.shipcarrier__dot { width:9px; height:9px; border-radius:50%; }
.shipfld__hint { font-size:11px; color:var(--dim); margin-top:8px; line-height:1.45; }

/* ---- carriers the shop uses (storefront + back office) ---- */
.sf-carriers { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:center; padding:6px 0; }
.sf-carrier { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; border-radius:999px; padding:7px 14px; font-size:12.5px; font-weight:700; color:var(--ink); }
.sf-carrier__dot { width:10px; height:10px; border-radius:50%; }
.sfb-carriers { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; margin-top:4px; }
.sfb-carrier { display:flex; align-items:center; gap:11px; border:1px solid var(--line); background:#fff; border-radius:11px; padding:10px 13px; transition:box-shadow .12s, border-color .12s; }
.sfb-carrier:hover { border-color:var(--navy-300,#aeb8cc); box-shadow:0 4px 12px -8px rgba(20,40,90,.35); }
.sfb-carrier__logo { flex:none; width:46px; height:46px; display:inline-flex; align-items:center; justify-content:center; background:#fff; border:1px solid var(--line); border-radius:11px; padding:0; overflow:hidden; }
.sfb-carrier__logo img { width:100%; height:100%; object-fit:cover; display:block; }
.sfb-carrier__dot { width:11px; height:11px; border-radius:50%; }
.sfb-carrier__tx { min-width:0; display:flex; flex-direction:column; gap:1px; }
.sfb-carrier__tx b { font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sfb-carrier__tx span { font-size:11px; color:var(--dim); font-weight:500; }
.pgship__carrier { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.06); padding:3px 9px; border-radius:999px; }
.pgship__carrier--auto { color:var(--dim); background:var(--bg-1,#f1f4f9); font-weight:600; }
.sf-carrier__logo { height:20px; width:auto; max-width:64px; object-fit:contain; border-radius:3px; }
.sfb-carrier__logo { width:46px !important; height:46px !important; max-width:46px; border-radius:11px; background:#fff; }
.shipcarrier__logo { height:16px; width:auto; max-width:50px; object-fit:contain; border-radius:3px; }
.pgship__carrierlogo { height:14px; width:auto; max-width:42px; object-fit:contain; border-radius:2px; }

/* ---- product bundle (ซื้อคู่สุดคุ้ม) ---- */
.sfd-bundle { border:1px solid #f0d9a8; background:linear-gradient(180deg,#fffdf7,#fff8ec); border-radius:12px; padding:13px 14px; margin-bottom:16px; }
.sfd-bundle__hd { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:700; color:#7a5200; margin-bottom:11px; }
.sfd-bnd { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:9px 0; border-top:1px solid #f3e4c4; }
.sfd-bnd:first-of-type { border-top:none; }
.sfd-bnd__pair { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.sfd-bnd__thumb { width:38px; height:38px; border-radius:8px; border:1px solid var(--line); background:#fff; display:grid; place-items:center; overflow:hidden; flex-shrink:0; }
.sfd-bnd__thumb img { width:100%; height:100%; object-fit:contain; padding:3px; }
.sfd-bnd__plus { font-weight:800; color:var(--dim); }
.sfd-bnd__info { min-width:0; }
.sfd-bnd__info b { display:block; font-size:12.5px; color:var(--ink); line-height:1.3; }
.sfd-bnd__info span { font-size:11px; color:var(--dim); }
.sfd-bnd__buy { display:flex; align-items:center; gap:11px; }
.sfd-bnd__price { display:flex; flex-direction:column; align-items:flex-end; line-height:1.15; }
.sfd-bnd__full { font-size:11px; color:var(--dim); text-decoration:line-through; }
.sfd-bnd__price b { font-family:"Sarabun",var(--ff); font-size:16px; font-weight:800; color:#C0392B; }
.sfd-bnd__off { font-size:10px; font-weight:800; color:#fff; background:#C0392B; padding:1px 6px; border-radius:5px; margin-top:2px; }
.sfd-bnd__btn { border:none; background:var(--gold-500); color:#3a2700; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px 15px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.sfd-bnd__btn:hover { filter:brightness(.96); }

/* ---- campaigns bundle manager ---- */
.cmp-bndform { display:flex; flex-wrap:wrap; align-items:center; gap:9px; border:1px solid var(--line); border-radius:12px; background:var(--bg-1,#f8fafc); padding:13px 14px; margin-bottom:14px; }
.cmp-bndform select { flex:1; min-width:150px; border:1px solid var(--line); border-radius:8px; padding:9px 11px; font-family:var(--ff); font-size:12.5px; background:#fff; }
.cmp-bndform select:focus { outline:none; border-color:var(--navy-600); }
.cmp-bndform__plus { font-weight:800; color:var(--dim); }
.cmp-bndform__disc { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink); white-space:nowrap; }
.cmp-bndform__disc input { width:48px; border:1px solid var(--line); border-radius:8px; padding:8px 9px; font-family:"Sarabun",var(--ff); font-size:13px; font-weight:700; text-align:center; }
.cmp-bndlist { display:flex; flex-direction:column; gap:9px; }
.cmp-bndempty { text-align:center; color:var(--dim); font-size:13px; padding:20px; }
.cmp-bnd2 { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:11px; background:#fff; padding:12px 14px; }
.cmp-bnd2.off { opacity:.55; }
.cmp-bnd2__pair { flex:1; min-width:0; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.cmp-bnd2__pair b { font-size:13px; color:var(--ink); }
.cmp-bnd2__plus { font-weight:800; color:#C77F00; }
.cmp-bnd2__disc { font-size:12px; font-weight:700; color:#C0392B; background:#fdecea; padding:4px 10px; border-radius:999px; white-space:nowrap; }

/* ---- top bar account button ---- */
.sf-acct { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; color:var(--ink); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:5px 12px 5px 5px; border-radius:999px; cursor:pointer; }
.sf-acct:hover { border-color:var(--navy-600); }
.sf-acct__av { width:26px; height:26px; border-radius:50%; background:linear-gradient(140deg,#1b305c,#0b3d91); color:#fff; display:grid; place-items:center; font-size:13px; font-weight:800; }
.sf-memberchip { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12.5px; font-weight:600; color:#1F8A5B; background:rgba(31,138,91,.08); border:1px solid rgba(31,138,91,.25); border-radius:10px; padding:9px 13px; margin:10px 0 4px; }
.sf-memberchip button { margin-left:auto; border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:12px; font-weight:700; padding:5px 12px; border-radius:8px; cursor:pointer; }

/* ---- auth / points modals ---- */
.sf-authov { position:absolute; inset:0; background:rgba(12,18,38,.5); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; padding:28px; z-index:70; }
.sf-auth { position:relative; width:min(380px,100%); background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.32); padding:30px 26px 22px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:4px; }
.sf-auth__x, .sf-acct2 .sf-auth__x, .sf-pts2 .sf-auth__x { position:absolute; top:12px; right:12px; width:32px; height:32px; border:none; border-radius:50%; background:rgba(20,30,55,.06); color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.sf-auth__x:hover { background:rgba(20,30,55,.12); }
/* ---- payment modal (after checkout) ---- */
.sf-paywin { position:relative; width:min(400px,100%); max-height:90vh; background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.32); overflow:hidden; display:flex; flex-direction:column; }
.sf-paywin__hd { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 52px 16px 18px; border-bottom:1px solid var(--line); background:#f9fbfe; }
.sf-paywin__hd b { font-size:14.5px; font-weight:800; color:var(--ink); line-height:1.3; }
.sf-paywin__amt { font-family:"Sarabun",var(--ff); font-size:18px; font-weight:800; color:var(--navy-700); white-space:nowrap; flex:none; }
.sf-paywin__bd { padding:18px; overflow-y:auto; overflow-x:hidden; }
.sf-paycenter { display:flex; flex-direction:column; align-items:center; gap:11px; text-align:center; }
.sf-payppt { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:800; color:var(--navy-700); }
.sf-payppt img { height:20px; }
.sf-qr { border:1px solid var(--line); border-radius:12px; padding:8px; background:#fff; box-shadow:0 2px 8px rgba(20,33,61,.08); }
.sf-qr svg { display:block; }
.sf-paynote { font-size:12.5px; color:var(--ink-2); line-height:1.5; }
.sf-paynote--dim { font-size:11.5px; color:var(--dim); }
.sf-paynote b { color:var(--navy-700); font-weight:700; }
.sf-paybank { border:1px solid var(--line); border-radius:12px; padding:6px 13px; margin-bottom:13px; }
.sf-paybank__row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; }
.sf-paybank__row:last-child { border-bottom:none; }
.sf-paybank__row span { color:var(--ink-2); }
.sf-paybank__row b { font-weight:700; color:var(--ink); }
.sf-paybank__acc { font-family:"Noto Sans",monospace; letter-spacing:1px; font-size:15px; color:var(--navy-700) !important; }
.sf-payslip__lbl { display:block; font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.sf-payslip__drop { display:flex; flex-direction:column; align-items:center; gap:6px; border:1.5px dashed var(--line-2); border-radius:12px; padding:20px; cursor:pointer; color:var(--ink-2); font-size:12.5px; }
.sf-payslip__drop:hover { border-color:var(--navy-600); background:#fbfcfe; }
.sf-payslip__has { position:relative; }
.sf-payslip__has img { width:100%; max-height:200px; object-fit:contain; border:1px solid var(--line); border-radius:10px; }
.sf-payslip__has button { margin-top:8px; width:100%; border:1px solid var(--line); background:#fff; border-radius:9px; padding:8px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.sf-paycod__ic { display:grid; place-items:center; }
.sf-paycod__h { font-size:16px; font-weight:800; color:var(--ink); }
.sf-paycard__saved { display:flex; align-items:center; gap:10px; border:1.5px solid var(--navy-600); border-radius:12px; padding:14px 16px; background:#f6f9ff; }
.sf-paycard__brand { font-size:12px; font-weight:800; color:var(--navy-700); background:#fff; border:1px solid var(--line); border-radius:6px; padding:2px 8px; }
.sf-paycard__saved b { font-family:"Noto Sans",monospace; letter-spacing:2px; font-size:15px; color:var(--ink); flex:1; }
.sf-paycard__exp { font-size:12px; color:var(--ink-2); }
.sf-paycard { display:flex; flex-direction:column; gap:9px; }
.sf-paycardform { display:flex; flex-direction:column; gap:9px; }
.sf-payin { box-sizing:border-box; width:100%; min-width:0; height:42px; border:1.5px solid var(--line-2); border-radius:10px; padding:0 12px; font-family:var(--ff); font-size:14px; outline:none; }
.sf-payin:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(20,40,80,.08); }
.sf-payrow2 { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.sf-payrow2 > * { min-width:0; }
.sf-paysave { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-2); }
.sf-paywin .sf-paywin__cta { box-sizing:border-box; margin:0 18px 18px; width:calc(100% - 36px); }
/* account card management */
.sf-acctcards { display:flex; flex-direction:column; gap:10px; }
.sf-acctcard { display:flex; align-items:center; gap:11px; border:1px solid var(--line); border-radius:12px; padding:13px 15px; background:#fff; }
.sf-acctcard__brand { font-size:11.5px; font-weight:800; color:var(--navy-700); background:var(--surface-2); border-radius:6px; padding:3px 9px; }
.sf-acctcard__no { flex:1; font-family:"Noto Sans",monospace; letter-spacing:2px; font-size:15px; color:var(--ink); }
.sf-acctcard__exp { font-size:12px; color:var(--ink-2); }
.sf-acctcard__rm { border:none; background:none; cursor:pointer; color:var(--line-2); display:grid; place-items:center; padding:4px; }
.sf-acctcard__rm:hover { color:var(--danger,#d1453b); }
.sf-acctcard__add { display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1.5px dashed var(--line-2); background:#fff; border-radius:11px; padding:12px; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-700); margin-top:2px; }
.sf-acctcard__add:hover { border-color:var(--navy-600); background:#fbfcfe; }
.sf-auth__ic { width:52px; height:52px; border-radius:50%; background:rgba(11,61,145,.08); display:grid; place-items:center; margin-bottom:6px; }
.sf-auth h3 { margin:4px 0 0; font-size:17px; font-weight:700; color:var(--ink); }
.sf-auth p { margin:4px 0 12px; font-size:12.5px; color:var(--dim); line-height:1.5; }
.sf-auth__perm { width:100%; text-align:left; background:var(--bg-1,#f5f7fb); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.sf-auth__permrow { display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:600; color:var(--ink); }
.sf-authcancel { border:none; background:none; color:var(--dim); font-family:var(--ff); font-size:13px; font-weight:700; cursor:pointer; padding:9px; }
.sf-auth__note { font-size:10.5px; color:var(--line-2,#9aa7bd); margin-top:2px; }
.sf-pts2 { position:relative; width:min(430px,100%); max-height:90vh; background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.32); padding:0; overflow:hidden; display:flex; flex-direction:column; }
.sf-pts2__scroll { overflow-y:auto; padding:18px 18px 6px; display:flex; flex-direction:column; gap:16px; }
/* บัตรสมาชิก */
.sf-loyc { color:#fff; border-radius:16px; padding:18px 18px 16px; box-shadow:0 8px 22px rgba(11,29,62,.28); position:relative; overflow:hidden; }
.sf-loyc::after { content:""; position:absolute; right:-40px; top:-40px; width:140px; height:140px; border-radius:50%; background:rgba(255,255,255,.08); }
.sf-loyc__top { display:flex; align-items:center; justify-content:space-between; }
.sf-loyc__tier { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:800; letter-spacing:.3px; background:rgba(255,255,255,.22); padding:4px 11px; border-radius:999px; }
.sf-loyc__brand { font-size:10px; font-weight:800; letter-spacing:1.5px; opacity:.8; }
.sf-loyc__n { font-family:"Sarabun",var(--ff); font-size:42px; font-weight:800; line-height:1.05; margin-top:14px; }
.sf-loyc__n span { font-size:16px; font-weight:600; opacity:.85; }
.sf-loyc__id { font-size:12px; opacity:.88; margin-top:3px; letter-spacing:.3px; }
.sf-loyc__prog { margin-top:14px; }
.sf-loyc__bar { height:7px; border-radius:999px; background:rgba(255,255,255,.25); overflow:hidden; }
.sf-loyc__bar span { display:block; height:100%; border-radius:999px; background:#fff; transition:width .4s ease; }
.sf-loyc__progtx { font-size:11.5px; margin-top:7px; opacity:.95; }
.sf-loyc__progtx b { font-weight:800; }
.sf-loyc__progtx--max { margin-top:14px; font-weight:700; }
/* sections */
.sf-pts2__sec { display:flex; flex-direction:column; gap:9px; }
.sf-pts2__h { font-size:13px; font-weight:800; color:var(--ink); }
.sf-loyben { display:flex; flex-direction:column; gap:7px; }
.sf-loyben__row { display:flex; align-items:center; gap:9px; font-size:12.5px; color:var(--ink); }
.sf-loyben__row svg { flex:none; }
.sf-loypromo { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sf-loypromo__c { position:relative; display:flex; align-items:center; gap:9px; background:#fbfcfe; border:1px solid var(--line); border-radius:11px; padding:10px 11px; }
.sf-loypromo__ic { flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:9px; background:#fff; border:1px solid var(--line); }
.sf-loypromo__tx { display:flex; flex-direction:column; gap:2px; min-width:0; }
.sf-loypromo__tx b { font-size:12px; font-weight:700; color:var(--ink); line-height:1.15; }
.sf-loypromo__tx span { font-size:10.5px; color:var(--ink-2); line-height:1.2; }
.sf-loypromo__tag { position:absolute; top:8px; right:8px; font-size:9px; font-weight:800; padding:2px 6px; border-radius:6px; }
.sf-loypromo__tag--earn { background:#e7f3ec; color:#1F8A5B; }
.sf-loypromo__tag--redeem { background:#fdeede; color:#C77F00; }
.sf-loypromo__tag--special { background:#eef0fb; color:#5B6CC4; }
.sf-pts2__hist { display:flex; flex-direction:column; }
.sf-pts2__row { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); font-size:12.5px; }
.sf-pts2__row:last-child { border-bottom:none; }
.sf-pts2__d { color:var(--dim); width:62px; flex-shrink:0; }
.sf-pts2__rt { flex:1; color:var(--ink); }
.sf-pts2__row b.plus { color:#1F8A5B; } .sf-pts2__row b.minus { color:#C0392B; }
.sf-pts2__cta { width:calc(100% - 36px); margin:12px 18px 16px; flex:none; }

/* ---- customer account panel ---- */
/* ฉบับเต็มหน้า (เปิดจาก "การสั่งซื้อของฉัน" — แทนที่จะเป็น popup) */
.sf-acctpage { background:var(--bg-1,#f4f6fa); min-height:62vh; padding-bottom:26px; }
.sf-acctpage__bar { display:flex; align-items:center; gap:14px; background:#fff; border-bottom:1px solid var(--line); padding:13px 28px; }
.sf-acctpage__back { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:13px; font-weight:700; padding:8px 14px; border-radius:9px; cursor:pointer; }
.sf-acctpage__back:hover { background:var(--bg-1,#f4f6fa); border-color:var(--navy-600); }
.sf-acctpage__ttl { font-size:16px; font-weight:800; color:var(--ink); }
.sf-acctpage__wrap { width:min(900px,100%); margin:24px auto 0; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 4px 18px rgba(8,18,40,.05); overflow:hidden; }
/* ---- หน้าคะแนนสะสม / สมาชิก (เต็มหน้า) ---- */
.sf-ptspage { background:var(--bg-1,#f4f6fa); min-height:62vh; padding-bottom:30px; }
.sf-ptspage__wrap { width:min(1000px,100%); margin:24px auto 0; padding:0 24px; display:grid; grid-template-columns:minmax(0,420px) minmax(0,1fr); gap:22px; align-items:start; }
.sf-ptspage__main { display:flex; flex-direction:column; gap:16px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 4px 18px rgba(8,18,40,.05); padding:16px; }
.sf-ptspage__cta { width:100%; margin-top:2px; }
.sf-ptspage__prods { min-width:0; }
.sf-ptspage__prodhd { margin-bottom:14px; }
.sf-ptspage__prodhd b { display:block; font-size:17px; font-weight:800; color:var(--ink); }
.sf-ptspage__prodhd span { display:block; font-size:12.5px; color:var(--ink-2); margin-top:3px; }
@media (max-width:820px){ .sf-ptspage__wrap { grid-template-columns:1fr; } }

/* ---- หน้าคะแนนสะสม redesign (sf-loy) ---- */
.sf-loy__wrap { width:min(1040px,100%); margin:22px auto 0; padding:0 24px; display:flex; flex-direction:column; gap:18px; }
.sf-loy__hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); gap:20px; align-items:center; }
.sf-loysum { background:#fff; border:1px solid var(--line); border-radius:18px; box-shadow:0 4px 18px rgba(8,18,40,.05); padding:20px 22px; display:flex; flex-direction:column; gap:14px; }
.sf-loysum__tier { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; border-radius:999px; padding:5px 13px; width:fit-content; }
.sf-loysum__pts { display:flex; flex-direction:column; gap:1px; }
.sf-loysum__pts b { font-family:"Sarabun",var(--ff); font-size:42px; font-weight:900; color:var(--navy-800); line-height:1; }
.sf-loysum__pts span { font-size:12.5px; color:var(--dim); }
.sf-loysum__prog { display:flex; flex-direction:column; gap:6px; }
.sf-loysum__bar { height:9px; border-radius:999px; background:var(--surface-3,#e8edf5); overflow:hidden; }
.sf-loysum__bar span { display:block; height:100%; border-radius:999px; transition:width .4s ease; }
.sf-loysum__progtx { font-size:12.5px; color:var(--ink-2); }
.sf-loysum__progtx b { color:var(--navy-800); }
.sf-loysum__max { font-size:14px; font-weight:800; color:var(--navy-700); }
.sf-loysum__stats { display:flex; gap:10px; }
.sf-loysum__stat { flex:1; background:var(--surface-2); border-radius:12px; padding:10px 13px; display:flex; flex-direction:column; gap:2px; }
.sf-loysum__stat span { font-size:11px; color:var(--dim); }
.sf-loysum__stat b { font-size:14px; font-weight:800; color:var(--navy-800); }
.sf-loysum__cta { margin-top:6px; width:100%; }
.sf-loy__sec { background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 4px 18px rgba(8,18,40,.05); padding:18px 20px; }
.sf-loy__sech { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.sf-loy__sech b { font-size:16px; font-weight:800; color:var(--ink); }
.sf-loy__sech span { font-size:12.5px; color:var(--ink-2); }
.sf-loy__ways { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.sf-way { position:relative; border:1px solid var(--line); border-radius:13px; padding:14px; display:flex; flex-direction:column; gap:6px; background:var(--surface); }
.sf-way__ic { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:var(--surface-2); color:var(--navy-700); }
.sf-way--redeem .sf-way__ic { background:#fdeef0; color:#c2415a; }
.sf-way--special .sf-way__ic { background:#fff4e0; color:#c2871a; }
.sf-way--earn .sf-way__ic { background:rgba(20,40,90,.08); color:var(--navy-700); }
.sf-way__t { font-size:13.5px; font-weight:800; color:var(--ink); }
.sf-way__d { font-size:12px; color:var(--ink-2); line-height:1.4; }
.sf-way__tag { position:absolute; top:12px; right:12px; font-size:10px; font-weight:800; border-radius:999px; padding:2px 9px; background:var(--surface-3,#e8edf5); color:var(--ink-2); }
.sf-way--redeem .sf-way__tag { background:#fdeef0; color:#c2415a; }
.sf-way--special .sf-way__tag { background:#fff4e0; color:#c2871a; }
.sf-loy__cols { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
@media (max-width:820px){ .sf-loy__hero { grid-template-columns:1fr; } .sf-loy__ways { grid-template-columns:1fr 1fr; } .sf-loy__cols { grid-template-columns:1fr; } }
@media (max-width:520px){ .sf-loy__ways { grid-template-columns:1fr; } }
.sf-acctov { position:absolute; inset:0; background:rgba(12,18,38,.5); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; padding:24px; z-index:70; }
.sf-acct2 { position:relative; width:min(560px,100%); max-height:92%; background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.32); display:flex; flex-direction:column; overflow:hidden; }
.sf-acct2__hd { display:flex; align-items:center; gap:13px; padding:22px 22px 16px; border-bottom:1px solid var(--line); }
.sf-acct2__av { width:48px; height:48px; border-radius:50%; background:linear-gradient(140deg,#1b305c,#0b3d91); color:#fff; display:grid; place-items:center; font-size:22px; font-weight:800; flex-shrink:0; }
.sf-acct2__id { flex:1; min-width:0; }
.sf-acct2__id b { display:block; font-size:16px; font-weight:700; color:var(--ink); }
.sf-acct2__id span { font-size:12px; color:var(--dim); }
.sf-acct2__logout { border:1px solid var(--line); background:#fff; color:#C0392B; font-family:var(--ff); font-size:12px; font-weight:700; padding:6px 11px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.sf-acct2__tabs { display:flex; gap:4px; padding:10px 18px 0; border-bottom:1px solid var(--line); }
.sf-acct2__tabs button { border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--dim); padding:9px 13px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; }
.sf-acct2__tabs button.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.sf-acct2__bd { padding:18px 22px; overflow:auto; }
.sf-acctform { display:flex; flex-direction:column; gap:13px; }
.sf-acctform__row { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.sf-acctform label { display:flex; flex-direction:column; gap:5px; }
.sf-acctform label span { font-size:12px; font-weight:700; color:var(--ink); }
.sf-acctform input, .sf-acctform textarea { border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-family:var(--ff); font-size:13px; color:var(--ink); resize:vertical; }
.sf-acctform input:focus, .sf-acctform textarea:focus { outline:none; border-color:var(--navy-600); }
.sf-acctveh { display:flex; flex-direction:column; gap:9px; }
.sf-acctveh__hint { display:flex; align-items:flex-start; gap:7px; font-size:12px; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:1px solid #bcd6f0; border-radius:10px; padding:9px 12px; }
.sf-acctveh__empty { text-align:center; color:var(--dim); padding:18px; font-size:13px; }
.sf-vehrow { display:flex; gap:8px; align-items:stretch; background:#fbfcfe; border:1px solid var(--line); border-radius:11px; padding:9px; }
.sf-vehrow__grid { flex:1; min-width:0; display:grid; grid-template-columns:repeat(3, 1fr); gap:7px; }
.sf-vehrow input { min-width:0; border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-family:var(--ff); font-size:12.5px; background:#fff; }
.sf-vehrow input:focus { outline:none; border-color:var(--navy-600); }
.sf-vehrow__vin { letter-spacing:.5px; }
.sf-vehrow__rm { border:none; background:rgba(192,57,43,.08); color:#C0392B; width:34px; align-self:center; height:34px; border-radius:8px; cursor:pointer; flex-shrink:0; display:grid; place-items:center; }
@media (max-width:560px){ .sf-vehrow__grid { grid-template-columns:repeat(2, 1fr); } }
.sf-acctveh__add { align-self:flex-start; border:1.5px dashed var(--line-2,#9aa7bd); background:none; color:var(--navy-700); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:8px 14px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.sf-acctord { display:flex; flex-direction:column; gap:8px; }
.sf-ordcard { border:1px solid var(--line); border-radius:10px; overflow:hidden; transition:border-color .15s; }
.sf-ordcard.open { border-color:var(--navy-300,#aebfda); box-shadow:0 4px 14px rgba(11,61,145,.06); }
.sf-ordrow { display:flex; align-items:center; gap:11px; width:100%; border:none; background:none; padding:11px 13px; cursor:pointer; font-family:var(--ff); text-align:left; }
.sf-ordrow:hover { background:var(--bg-1,#f4f6fa); }
.sf-ordcard.open .sf-ordrow > svg:last-child { transform:rotate(180deg); }
.sf-ordrow > svg:last-child { transition:transform .18s; flex-shrink:0; }
.sf-ordrow__l { flex:1; min-width:0; display:flex; flex-direction:column; }
.sf-ordrow__l b { font-size:13px; color:var(--ink); }
.sf-ordrow__l span { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-ordrow__st { font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; background:var(--bg-1,#eef1f6); color:var(--dim); flex-shrink:0; }
.sf-ordrow__st--ship { background:#eaf3ff; color:#0B3D91; } .sf-ordrow__st--done { background:#e7f6ee; color:#1F8A5B; } .sf-ordrow__st--cancel { background:#fdecea; color:#C0392B; }
.sf-ordrow__amt { font-family:"Sarabun",var(--ff); font-size:14px; font-weight:800; color:var(--navy-700); flex-shrink:0; }
/* ----- ติดตามพัสดุ ----- */
.sf-track { border-top:1px dashed var(--line); padding:14px 15px 15px; background:var(--bg-1,#f7f9fc); display:flex; flex-direction:column; gap:14px; }
.sf-track__cancel { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:#C0392B; }
.sf-track__pending { display:flex; align-items:flex-start; gap:8px; font-size:12px; line-height:1.55; color:var(--navy-700); background:#fff; border:1px solid var(--line); border-radius:9px; padding:11px 12px; }
.sf-track__hd { display:flex; align-items:center; gap:11px; background:#fff; border:1px solid var(--line); border-radius:9px; padding:10px 12px; flex-wrap:wrap; }
.sf-track__carlogo { width:40px; height:28px; object-fit:contain; flex-shrink:0; }
.sf-track__no { display:flex; flex-direction:column; flex:1; min-width:120px; }
.sf-track__no span { font-size:10.5px; color:var(--dim); }
.sf-track__no b { font-family:"Sarabun",var(--ff); font-size:14px; font-weight:800; letter-spacing:.5px; color:var(--ink); }
.sf-track__copy, .sf-track__ext { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:7px 11px; border-radius:8px; cursor:pointer; }
.sf-track__ext { background:var(--navy-700,#0B3D91); color:#fff; border-color:var(--navy-700,#0B3D91); }
.sf-track__copy:hover { background:var(--bg-1,#eef1f6); } .sf-track__ext:hover { filter:brightness(1.1); }
.sf-track__steps { display:flex; flex-direction:column; padding-left:2px; }
.sf-tstep { display:flex; gap:11px; position:relative; padding-bottom:14px; }
.sf-tstep:not(:last-child)::before { content:""; position:absolute; left:12px; top:24px; bottom:0; width:2px; background:var(--line-2,#d3dae6); }
.sf-tstep.done:not(:last-child)::before { background:#1F8A5B; }
.sf-tstep:last-child { padding-bottom:0; }
.sf-tstep__dot { width:25px; height:25px; border-radius:50%; background:#fff; border:2px solid var(--line-2,#d3dae6); color:var(--line-2,#b3bdcc); display:grid; place-items:center; flex-shrink:0; z-index:1; }
.sf-tstep.done .sf-tstep__dot { background:#1F8A5B; border-color:#1F8A5B; color:#fff; }
.sf-tstep.active .sf-tstep__dot { background:#0B3D91; border-color:#0B3D91; color:#fff; box-shadow:0 0 0 4px rgba(11,61,145,.13); }
.sf-tstep__tx { display:flex; flex-direction:column; padding-top:3px; }
.sf-tstep__tx b { font-size:12.5px; font-weight:700; color:var(--line-2,#9aa7bd); }
.sf-tstep.done .sf-tstep__tx b, .sf-tstep.active .sf-tstep__tx b { color:var(--ink); }
.sf-tstep.active .sf-tstep__tx b { color:#0B3D91; }
.sf-tstep__tx span { font-size:11px; color:var(--dim); margin-top:1px; }
.sf-track__items { display:flex; flex-direction:column; gap:6px; border-top:1px solid var(--line); padding-top:11px; }
.sf-track__item { display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--ink); }
.sf-track__item b { font-family:"Sarabun",var(--ff); font-weight:700; color:var(--navy-700); }
.sf-ordtabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:1px solid var(--line); margin-bottom:14px; }
.sf-ordtabs button { border:none; background:none; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); padding:8px 11px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; white-space:nowrap; }
.sf-ordtabs button.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.sf-ordempty { display:flex; flex-direction:column; align-items:center; gap:10px; padding:40px 10px; color:var(--dim); }
.sf-ordempty span { font-size:14px; }
.sfe-hours { display:flex; flex-direction:column; gap:7px; }
.sfe-hourrow { display:flex; align-items:center; gap:10px; }
.sfe-hourrow__d { font-size:12.5px; font-weight:700; color:var(--ink); width:78px; flex-shrink:0; }
.sf-hours { margin-top:4px; }
.sf-hours__t { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:5px; }
.sf-hours__r { display:grid; grid-template-columns:84px 1fr; align-items:baseline; gap:12px; font-size:12.5px; padding:3px 0; max-width:240px; }
.sf-hours__r span { color:var(--dim); white-space:nowrap; }
.sf-hours__r b { color:var(--ink); font-weight:600; text-align:left; }
.sf-hours__r--off b { color:#C0392B; font-weight:700; }
.sfe-badge { border:1px solid var(--line); border-radius:9px; padding:9px 10px; margin-bottom:7px; background:var(--bg-1,#f8fafc); }
.sfe-badge__style { display:flex; align-items:center; gap:14px; margin-top:7px; flex-wrap:wrap; }
.sfe-op { display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); flex:1; min-width:150px; }
.sfe-op input[type=range] { flex:1; }
.sfe-op b { color:var(--ink); }
.sfe-opnum { width:52px; border:1px solid var(--line); border-radius:7px; padding:5px 7px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink); text-align:center; }
.sfe-opnum:focus { outline:none; border-color:var(--navy-600); }
.sfe-hint { font-weight:500; font-size:10.5px; color:var(--dim); margin-left:6px; }
.sf-hero { position:relative; overflow:hidden; }
.sf-hero__nav { position:absolute; top:50%; transform:translateY(-50%); z-index:5; width:42px; height:42px; border-radius:50%; border:1px solid rgba(255,255,255,.3); background:rgba(8,18,42,.55); color:#fff; cursor:pointer; display:grid; place-items:center; backdrop-filter:blur(2px); transition:background .15s; }
.sf-hero__nav:hover { background:rgba(8,18,42,.85); }
.sf-hero__nav--prev { left:14px; }
.sf-hero__nav--next { right:14px; }
.sf-hero__nav--next svg { transform:scaleX(-1); }
@media (max-width:700px){ .sf-hero__nav { width:34px; height:34px; } .sf-hero__nav--prev { left:6px; } .sf-hero__nav--next { right:6px; } }
.sf-hero__dots { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); display:flex; gap:8px; z-index:4; margin:0; padding:0; }
.sf-hero__dots .sf-dot { width:22px; height:4px; border-radius:3px; border:none; padding:0; background:rgba(255,255,255,.42); cursor:pointer; transition:background .15s, width .15s; }
.sf-hero__dots .sf-dot:hover { background:rgba(255,255,255,.7); }
.sf-hero__dots .sf-dot.on { width:34px; background:#F5A400; }
.sf-tools { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.sf-search { display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:11px; padding:9px 13px; background:#fff; flex:1; min-width:240px; max-width:440px; }
.sf-search input { border:none; outline:none; flex:1; font-family:var(--ff); font-size:13.5px; color:var(--ink); background:none; }
.sf-search__x { border:none; background:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; }
.sf-cats { display:flex; gap:7px; flex-wrap:wrap; }
.sf-cat { border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); padding:7px 14px; border-radius:999px; cursor:pointer; }
.sf-cat:hover { border-color:var(--navy-600); }
.sf-cat.on { border-color:var(--navy-700); background:rgba(11,61,145,.07); color:var(--navy-700); }
/* ---- กรองตามรุ่น + ปีรถ ---- */
.sf-fmt { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1; min-width:300px; padding:9px 13px; background:var(--bg-1,#f4f6fa); border:1px solid var(--line); border-radius:11px; }
.sf-fmt__lb { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--ink-2); }
.sf-fmt__field { position:relative; display:inline-flex; }
.sf-fmt__field::after { content:"▾"; position:absolute; right:11px; top:50%; transform:translateY(-50%); font-size:11px; color:var(--dim); pointer-events:none; }
.sf-fmt__sel { appearance:none; -webkit-appearance:none; border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink); padding:8px 30px 8px 13px; border-radius:9px; cursor:pointer; min-width:130px; }
.sf-fmt__sel:hover { border-color:var(--navy-600); }
.sf-fmt__sel:focus { outline:none; border-color:var(--navy-700); }
.sf-fmt__sel:disabled { color:var(--dim); background:var(--bg-1,#eef1f6); cursor:not-allowed; }
.sf-fmt__clear { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:#C0392B; font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 12px; border-radius:9px; cursor:pointer; }
.sf-fmt__clear:hover { background:#fdecea; border-color:#C0392B; }
/* ---- แถบหมวดประเภทอะไหล่ (ด้านบน · แนวนอน) ---- */
.sf-catbar { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:12px; padding:11px 13px; background:var(--bg-1,#f4f6fa); border:1px solid var(--line); border-radius:12px; }
.sf-catbar__lb { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--ink); padding:7px 4px 0 0; white-space:nowrap; }
.sf-catbar__list { display:flex; flex-wrap:wrap; gap:7px; flex:1; min-width:0; }
.sf-catchip { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink-2); padding:7px 13px; border-radius:999px; cursor:pointer; }
.sf-catchip:hover { border-color:var(--navy-600); color:var(--ink); }
.sf-catchip.on { border-color:var(--navy-700); background:var(--navy-700,#0B3D91); color:#fff; }
.sf-catchip i { font-style:normal; font-size:10.5px; font-weight:700; color:var(--dim); background:var(--bg-1,#eef1f6); min-width:18px; text-align:center; padding:1px 6px; border-radius:99px; }
.sf-catchip.on i { background:rgba(255,255,255,.24); color:#fff; }
@media (max-width:560px){ .sf-catbar { padding:10px; } .sf-catbar__lb { width:100%; } }
/* ---- แถบตัวกรอง catalog (search + dropdowns) ---- */
.sf-filterbar { display:flex; flex-direction:column; gap:11px; margin-bottom:4px; }
.sf-search--full { max-width:none; width:100%; }
.sf-fdrops { display:flex; flex-wrap:wrap; gap:10px 12px; align-items:flex-end; }
.sf-fdrop { display:flex; flex-direction:column; gap:5px; }
.sf-fdrop__lb { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--ink-2); padding-left:2px; }
.sf-fdrop__sel { position:relative; display:inline-flex; }
.sf-fdrop__sel::after { content:"▾"; position:absolute; right:11px; top:50%; transform:translateY(-50%); font-size:11px; color:var(--dim); pointer-events:none; }
.sf-fdrop__sel select { appearance:none; -webkit-appearance:none; border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); padding:9px 32px 9px 13px; border-radius:10px; cursor:pointer; min-width:150px; }
.sf-fdrop__sel select:hover { border-color:var(--navy-600); }
.sf-fdrop__sel select:focus { outline:none; border-color:var(--navy-700); box-shadow:0 0 0 3px rgba(11,61,145,.1); }
.sf-fdrop__sel select:disabled { color:var(--dim); background:var(--bg-1,#eef1f6); cursor:not-allowed; }
.sf-fdrop__clr { display:inline-flex; align-items:center; gap:5px; height:38px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:#C0392B; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:0 14px; border-radius:10px; cursor:pointer; }
.sf-fdrop__clr:hover { background:#fdecea; border-color:#C0392B; }
@media (max-width:680px){ .sf-fdrop { flex:1; min-width:calc(50% - 6px); } .sf-fdrop__sel, .sf-fdrop__sel select { width:100%; } }
/* ---- ปุ่ม "ดูอะไหล่ทั้งหมด" หน้าแรก ---- */
.sf-seeall { display:flex; justify-content:center; margin-top:20px; }
.sf-seeall__b { display:inline-flex; align-items:center; gap:9px; border:1.5px solid var(--navy-700,#0B3D91); background:#fff; color:var(--navy-700,#0B3D91); font-family:var(--ff); font-size:14px; font-weight:800; padding:12px 26px; border-radius:999px; cursor:pointer; transition:background .15s,color .15s; }
.sf-seeall__b:hover { background:var(--navy-700,#0B3D91); color:#fff; }
/* ---- หน้าแคตตาล็อกสินค้าเต็ม ---- */
.sf-catalog { background:var(--bg-1,#f4f6fa); min-height:60vh; }
.sf-catalog__wrap { width:min(1180px,100%); margin:0 auto; padding:22px 28px 30px; }
.sf-catalog__count { display:flex; align-items:center; flex-wrap:wrap; gap:10px; font-size:13px; font-weight:600; color:var(--ink-2); margin:14px 2px 16px; }
.sf-catalog__clr { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:#C0392B; font-family:var(--ff); font-size:11.5px; font-weight:700; padding:5px 11px; border-radius:99px; cursor:pointer; }
.sf-catalog__clr:hover { background:#fdecea; border-color:#C0392B; }
.sf-catalog .sf-grid { margin-top:0; }
/* ---- แบ่งหน้า (pagination) ---- */
.sf-pager { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:26px; flex-wrap:wrap; }
.sf-pager__b { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2,#c4cdda); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:13px; font-weight:700; padding:8px 15px; border-radius:9px; cursor:pointer; }
.sf-pager__b:hover:not(:disabled) { background:var(--navy-700,#0B3D91); color:#fff; border-color:var(--navy-700,#0B3D91); }
.sf-pager__b:disabled { opacity:.4; cursor:not-allowed; }
.sf-pager__nums { display:flex; align-items:center; gap:5px; }
.sf-pager__n { min-width:36px; height:36px; border:1px solid var(--line); background:#fff; color:var(--ink-2); font-family:var(--ff); font-size:13px; font-weight:700; border-radius:9px; cursor:pointer; }
.sf-pager__n:hover { border-color:var(--navy-600); }
.sf-pager__n.on { background:var(--navy-700,#0B3D91); color:#fff; border-color:var(--navy-700,#0B3D91); }
.sf-pager__dots { color:var(--dim); padding:0 2px; }
@media (max-width:560px){ .sf-catalog__wrap { padding:16px 14px 24px; } }
.sfd-reviews { margin-top:16px; border-top:1px solid var(--line); padding-top:14px; }
.sfd-reviews__hd { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:11px; }
.sfd-reviews__hd b { font-size:13.5px; color:var(--ink); }
.sfd-reviews__score { font-size:12px; font-weight:700; color:#C77F00; }
.sfd-rev { display:flex; gap:10px; padding:9px 0; border-top:1px solid var(--line); }
.sfd-rev:first-of-type { border-top:none; }
.sfd-rev__av { width:32px; height:32px; border-radius:50%; background:linear-gradient(140deg,#1b305c,#0b3d91); color:#fff; display:grid; place-items:center; font-size:14px; font-weight:800; flex-shrink:0; }
.sfd-rev__bd { flex:1; min-width:0; }
.sfd-rev__top { display:flex; align-items:center; gap:9px; }
.sfd-rev__top b { font-size:12.5px; color:var(--ink); }
.sfd-rev__stars { font-size:12px; color:#C77F00; letter-spacing:1px; }
.sfd-rev__stars i { color:#dce0e8; font-style:normal; }
.sfd-rev__bd p { margin:4px 0 0; font-size:12.5px; color:var(--ink-2,#42506a); line-height:1.5; }
.sf-loc__info { display:flex; flex-direction:column; align-items:flex-start; gap:9px; }
.sf-loc__info > div { width:100%; }
.sf-loc__info .sf-hours { width:100%; display:block; }
.sf-loc__info .sf-hours__r { max-width:none; }
.sf-hero__product { position:absolute; right:clamp(180px, 22%, 420px); bottom:0; height:92%; max-height:560px; width:auto; object-fit:contain; object-position:bottom; pointer-events:none; z-index:1; filter:drop-shadow(0 18px 30px rgba(0,0,0,.45)); }
.sf-hero__tx, .sf-hero__badges { position:relative; z-index:2; }
@media (max-width:980px){ .sf-hero__product { opacity:.28; right:0; height:80%; } }

/* ---- brand identity (storefront) ---- */
.sf-brand { display:flex; align-items:center; gap:11px; }
.sf-brand__logofull { height:44px; width:auto; max-width:300px; object-fit:contain; display:block; }
@media (max-width:700px){ .sf-brand__logofull { height:34px; } }
.sf-brand__icon { width:42px; height:42px; border-radius:11px; object-fit:cover; flex-shrink:0; box-shadow:0 2px 8px rgba(11,61,145,.25); }
.sf-brand__tx b { display:block; font-size:16px; font-weight:800; color:var(--navy-700,#0B3D91); line-height:1.1; }
.sf-brand__tx span { font-size:11.5px; color:var(--dim); }
@media (max-width:700px){ .sf-brand__icon { width:36px; height:36px; } .sf-brand__tx b { font-size:14px; } }
.sf-brandband { display:flex; align-items:center; gap:20px; flex-wrap:wrap; background:#fff; border:1px solid var(--line); border-radius:16px; padding:18px 24px; margin:8px 36px 0; }
.sf-brandband__logo { height:74px; width:auto; max-width:420px; object-fit:contain; flex-shrink:0; }
.sf-brandband__icon { width:54px; height:54px; border-radius:13px; object-fit:cover; flex-shrink:0; box-shadow:0 4px 14px rgba(0,0,0,.25); }
.sf-brandband__tx { flex:1; min-width:200px; padding-left:20px; border-left:2px solid var(--line); }
.sf-brandband__tx b { display:block; font-size:15.5px; font-weight:700; color:var(--navy-700,#0B3D91); }
.sf-brandband__tx span { font-size:12.5px; color:var(--dim); line-height:1.5; }
.sf-brandband__tags { display:flex; gap:8px; flex-wrap:wrap; }
.sf-brandband__tags span { font-size:11.5px; font-weight:700; color:#9a6a00; background:rgba(245,164,0,.14); border:1px solid rgba(245,164,0,.5); padding:5px 12px; border-radius:999px; }
@media (max-width:760px){ .sf-brandband__logo { height:54px; } .sf-brandband__tx { border-left:none; padding-left:0; } }

/* ---- full footer (shipping/payment options + 4 columns) ---- */
.sf-footer { border-top:1px solid var(--line); margin-top:18px; padding:22px 36px 0; }
.sf-footer__opts { display:flex; flex-wrap:wrap; gap:40px; padding-bottom:22px; border-bottom:1px solid var(--line); margin-bottom:24px; }
.sf-fopt__hd { font-size:14px; font-weight:700; color:var(--ink); margin-bottom:12px; }
.sf-fopt__icons { display:flex; flex-wrap:wrap; gap:9px; }
.sf-fopt__ic { width:54px; height:54px; border:1px solid var(--line); border-radius:13px; background:#fff; display:grid; place-items:center; overflow:hidden; }
.sf-fopt__ic img { width:100%; height:100%; object-fit:cover; }
.sf-fopt__ic--pay { background:var(--bg-1,#f5f7fb); }
.sf-fopt__ic--pay svg { width:22px; height:22px; }
.sf-fopt__cod { font-size:11px; font-weight:800; color:var(--ink); }
.sf-footer__cols { display:grid; grid-template-columns:1.5fr 1fr 1.1fr 1.2fr 1fr; gap:26px; }
@media (max-width:980px){ .sf-footer__cols { grid-template-columns:1fr 1fr 1fr; gap:24px; } }
@media (max-width:860px){ .sf-footer__cols { grid-template-columns:1fr 1fr; gap:26px; } .sf-footer__opts { gap:28px; } }
@media (max-width:520px){ .sf-footer__cols { grid-template-columns:1fr; } }
.sf-fcol h4 { font-size:15px; font-weight:700; color:var(--ink); margin:0 0 13px; }
.sf-fcol p { font-size:12.5px; color:var(--dim); line-height:1.7; margin:0; max-width:280px; }
.sf-fcol a { display:block; font-size:12.5px; color:var(--dim); cursor:pointer; padding:4px 0; }
.sf-fcol a:hover { color:var(--navy-700); }
.sf-fcol__addr { margin-bottom:12px; }
.sf-fcol__contact { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink); padding:4px 0; }
.sf-fsocial { display:flex; gap:11px; flex-wrap:wrap; }
.sf-fsocial a { width:38px; height:38px; border-radius:50%; border:1px solid var(--line); display:grid; place-items:center; color:var(--ink); cursor:pointer; }
.sf-fsocial a:hover { border-color:var(--navy-600); color:var(--navy-700); background:rgba(11,61,145,.05); }
.sf-footer .sf-foot { border-top:1px solid var(--line); margin-top:24px; }
/* ---- DBD trust band ---- */
.sf-dbd { margin-top:22px; padding:16px 0; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
.sf-dbd__badge { display:inline-flex; align-items:center; gap:12px; border:1px solid var(--line); background:#fff; border-radius:10px; padding:9px 14px 9px 9px; cursor:pointer; font-family:var(--ff); }
.sf-dbd__badge:hover { border-color:var(--navy-600); box-shadow:0 3px 10px rgba(11,61,145,.08); }
.sf-dbd__seal { display:flex; flex-direction:column; align-items:center; justify-content:center; width:54px; height:46px; padding:0 4px; border-radius:8px; background:linear-gradient(150deg,#0B3D91,#1657c2); color:#fff; line-height:1; flex-shrink:0; overflow:hidden; }
.sf-dbd__seal b { font-size:15px; font-weight:800; letter-spacing:.5px; }
.sf-dbd__seal i { font-size:6px; font-style:normal; letter-spacing:.2px; text-transform:uppercase; opacity:.92; margin-top:3px; white-space:nowrap; }
.sf-dbd__tx { display:flex; flex-direction:column; text-align:left; }
.sf-dbd__tx b { font-size:13px; color:var(--ink); }
.sf-dbd__tx span { font-size:11px; color:var(--dim); margin-top:1px; }
.sf-dbd__meta { display:flex; flex-direction:column; gap:6px; }
.sf-dbd__meta span { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); }
/* ---- นโยบายร้านค้า modal ---- */
.sf-pol { width:min(640px,94vw); max-height:88vh; background:#fff; border-radius:14px; position:relative; display:flex; flex-direction:column; box-shadow:0 24px 70px rgba(8,18,40,.34); overflow:hidden; }
.sf-pol__hd { display:flex; align-items:center; gap:9px; padding:18px 22px 12px; }
.sf-pol__hd b { font-size:17px; color:var(--ink); }
.sf-pol__tabs { display:flex; gap:4px; padding:0 22px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.sf-pol__tabs button { border:none; background:none; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); padding:9px 12px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; }
.sf-pol__tabs button.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.sf-pol__bd { padding:18px 24px; overflow-y:auto; }
.sf-pol__title { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:800; color:var(--ink); margin:0 0 14px; }
.sf-pol__sec { margin-bottom:15px; }
.sf-pol__sec h4 { font-size:13px; font-weight:700; color:var(--navy-700); margin:0 0 6px; }
.sf-pol__sec ul { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:4px; }
.sf-pol__sec li { font-size:12.5px; line-height:1.6; color:var(--ink-2); }
.sf-pol__note { display:flex; align-items:flex-start; gap:7px; font-size:11.5px; line-height:1.55; color:var(--dim); background:var(--bg-1,#f4f6fa); border-radius:9px; padding:11px 12px; margin-top:6px; }
.sf-pol__ft { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 22px; border-top:1px solid var(--line); background:#fafbfd; flex-wrap:wrap; }
.sf-pol__dbd { font-size:11px; color:var(--dim); }
.sf-pol__dbd b { display:inline-block; background:var(--navy-700,#0B3D91); color:#fff; font-size:9.5px; font-weight:800; padding:2px 5px; border-radius:4px; margin-right:5px; letter-spacing:.4px; }
.sf-pol__ft .sf-btn { width:auto; padding:9px 22px; }
.sf-acct2__ft { display:flex; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid var(--line); }
.sf-acct2__ft .sf-btn { width:auto; padding:10px 22px; }

/* ---- แฟ้มสินค้า · ตัวเลือก/รายละเอียด (PartOptions) ---- */
.popt { padding:4px 2px 20px; }
.popt__intro { display:flex; align-items:flex-start; gap:8px; font-size:12.5px; line-height:1.55; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:1px solid #bcd6f0; border-radius:10px; padding:11px 14px; margin-bottom:14px; }
.popt__cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
@media (max-width:980px){ .popt__cols { grid-template-columns:1fr; } }
.popt__col { border:1px solid var(--line); border-radius:13px; background:#fff; padding:14px 15px; }
.popt__hd { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13.5px; font-weight:700; color:var(--ink); margin-bottom:12px; flex-wrap:wrap; }
.popt__quick { font-size:11.5px; font-weight:500; color:var(--dim); display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.popt__quick button { border:1px solid var(--line); background:var(--bg-1,#f5f7fb); color:var(--navy-700); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:4px 9px; border-radius:7px; cursor:pointer; }
.popt__quick button:hover { border-color:var(--navy-600); }
.popt__empty { text-align:center; color:var(--dim); font-size:12.5px; padding:18px 8px; }
.popt__grp { border:1px solid var(--line); border-radius:11px; padding:11px 12px; margin-bottom:10px; background:var(--bg-1,#f8fafc); }
.popt__grphd { display:flex; gap:8px; align-items:center; margin-bottom:9px; }
.popt__gname { flex:1; border:1px solid var(--line); border-radius:8px; padding:8px 11px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--ink); background:#fff; }
.popt__gname:focus { outline:none; border-color:var(--navy-600); }
.popt__rmg { border:none; background:rgba(192,57,43,.08); color:#C0392B; width:32px; height:32px; border-radius:8px; cursor:pointer; flex-shrink:0; display:grid; place-items:center; }
.popt__vals { display:flex; flex-wrap:wrap; gap:7px; }
.popt__val { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:8px; background:#fff; overflow:hidden; }
.popt__val input { border:none; padding:7px 9px; font-family:var(--ff); font-size:12.5px; width:96px; color:var(--ink); }
.popt__val input:focus { outline:none; }
.popt__val button { border:none; background:none; color:var(--dim); font-size:16px; cursor:pointer; padding:0 9px 0 2px; line-height:1; }
.popt__val button:hover { color:#C0392B; }
.popt__addv { border:1.5px dashed var(--line-2,#9aa7bd); background:none; color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 12px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.popt__addg { border:1.5px dashed var(--navy-600); background:rgba(11,61,145,.04); color:var(--navy-700); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px 14px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; width:100%; justify-content:center; }
.popt__desc { width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 13px; font-family:var(--ff); font-size:13px; line-height:1.65; color:var(--ink); resize:vertical; }
.popt__desc:focus { outline:none; border-color:var(--navy-600); }
.popt__hint { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--dim); margin-top:8px; }
.popt__ft { display:flex; justify-content:flex-end; margin-top:14px; }
.popt__save { border:none; background:var(--gold-500); color:#3a2700; font-family:var(--ff); font-size:13px; font-weight:700; padding:10px 20px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.popt__save:disabled { background:#e3e7ee; color:var(--dim); cursor:not-allowed; }

/* ===== ข้อมูลรถ (CarInfoD / CarBrochure) ===== */
.carinfo { padding:2px 2px 24px; }
.carinfo__filters { display:flex; flex-direction:column; gap:12px; margin-bottom:14px; }
.carinfo__fgroup { display:flex; align-items:flex-start; gap:12px; }
.carinfo__flbl { font-size:12.5px; font-weight:700; color:var(--dim); padding-top:7px; width:54px; flex-shrink:0; }
.carinfo__chips { display:flex; flex-wrap:wrap; gap:7px; }
.carinfo__chip { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; color:var(--ink); font-family:var(--ff); font-size:12.5px; font-weight:600; padding:6px 13px; border-radius:999px; cursor:pointer; transition:border-color .12s, background .12s; }
.carinfo__chip img { height:18px; width:auto; object-fit:contain; }
.carinfo__chip:hover { border-color:var(--navy-600); }
.carinfo__chip.on { border-color:var(--navy-700); background:rgba(11,61,145,.07); color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700) inset; }
.carinfo__count { font-size:12.5px; color:var(--dim); margin-bottom:12px; }
.carinfo__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:14px; }
.carinfo__empty { grid-column:1/-1; text-align:center; color:var(--dim); padding:36px; font-size:13px; }
.car-card { text-align:left; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; cursor:pointer; padding:0; font-family:var(--ff); transition:box-shadow .15s, border-color .15s, transform .12s; }
.car-card:hover { box-shadow:0 10px 26px -14px rgba(20,40,90,.45); border-color:var(--navy-600); transform:translateY(-2px); }
.car-card__img { height:152px; background:linear-gradient(135deg,#eef2f8,#dde6f2); position:relative; }
.car-card__img image-slot { display:block; width:100%; height:100%; }
.car-card__bd { padding:12px 13px 14px; }
.car-card__top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; min-height:22px; }
.car-card__logo { height:20px; width:auto; max-width:88px; object-fit:contain; }
.car-card__bn { font-size:12px; font-weight:800; color:var(--navy-700); }
.car-card__bodytag { font-size:10.5px; font-weight:700; color:var(--dim); background:var(--bg-1,#f1f4f9); padding:3px 8px; border-radius:999px; white-space:nowrap; }
.car-card__nm { font-size:15px; font-weight:700; color:var(--ink); line-height:1.3; }
.car-card__meta { display:flex; flex-wrap:wrap; gap:5px 13px; margin-top:7px; font-size:11.5px; color:var(--dim); }
.car-card__meta span { display:inline-flex; align-items:center; gap:4px; }
.car-card__price { margin-top:10px; font-size:12px; color:var(--dim); }
.car-card__price b { font-family:"Sarabun",var(--ff); font-size:16px; font-weight:800; color:var(--navy-700); margin-left:4px; }

.carbro { padding:2px 2px 30px; }
.carbro__back { border:1px solid var(--line); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:12.5px; font-weight:700; padding:7px 14px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; margin-bottom:16px; }
.carbro__back:hover { border-color:var(--navy-600); }
.carbro__hero { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:22px; align-items:stretch; margin-bottom:8px; }
@media (max-width:900px){ .carbro__hero { grid-template-columns:1fr; } }
.carbro__heroimg { display:flex; }
.carbro__heroimg image-slot { display:block; width:100%; height:100%; }
.carbro__heroimg .cargal { width:100%; }
/* multi-image gallery (สูงสุด 10 รูป) */
.cargal { display:flex; flex-direction:column; gap:8px; width:100%; }
.cargal__main { position:relative; aspect-ratio:16/10; border-radius:16px; overflow:hidden; background:linear-gradient(135deg,#eef2f8,#dde6f2); display:grid; place-items:center; }
.cargal__main.is-empty { cursor:pointer; border:2px dashed var(--line-2,#c7d2e0); }
.cargal__main.is-empty:hover { border-color:var(--navy-600); background:linear-gradient(135deg,#e9eef6,#d6e0ee); }
.cargal__main.is-drag { border:2px dashed var(--navy-600); background:#e4ecf8; }
.cargal__img { width:100%; height:100%; object-fit:cover; }
.cargal__empty { display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--dim); font-size:13px; pointer-events:none; }
.cargal__browse { font-size:11px; color:var(--navy-600); }
.cargal__del { position:absolute; top:9px; right:9px; width:30px; height:30px; border-radius:8px; border:none; background:rgba(15,23,42,.55); color:#fff; display:grid; place-items:center; cursor:pointer; }
.cargal__del:hover { background:#c0392b; }
.cargal__count { position:absolute; bottom:9px; right:11px; background:rgba(15,23,42,.6); color:#fff; font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px; }
.cargal__nav { position:absolute; top:50%; transform:translateY(-50%); width:34px; height:34px; border-radius:50%; border:none; background:rgba(255,255,255,.85); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; box-shadow:0 1px 6px rgba(15,23,42,.2); }
.cargal__nav:hover { background:#fff; }
.cargal__nav--prev { left:10px; }
.cargal__nav--next { right:10px; }
.cargal__nav--next :is(svg) { transform:rotate(180deg); }
.cargal__thumbs { display:flex; gap:7px; flex-wrap:wrap; }
.cargal__thumb { position:relative; width:58px; height:44px; border-radius:8px; overflow:hidden; border:2px solid transparent; padding:0; cursor:pointer; background:none; }
.cargal__thumb.is-on { border-color:var(--navy-600); }
.cargal__thumb img { width:100%; height:100%; object-fit:cover; }
.cargal__thumbx { position:absolute; top:2px; right:2px; width:16px; height:16px; border-radius:50%; background:rgba(15,23,42,.6); color:#fff; display:grid; place-items:center; opacity:0; transition:opacity .12s; }
.cargal__thumb:hover .cargal__thumbx { opacity:1; }
.cargal__thumbx:hover { background:#c0392b; }
.cargal__add { width:58px; height:44px; border-radius:8px; border:1.5px dashed var(--line-2,#c7d2e0); background:#fff; color:var(--navy-600); display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:pointer; gap:1px; }
.cargal__add small { font-size:9px; color:var(--dim); }
.cargal__add:hover { border-color:var(--navy-600); background:#f3f7fd; }
.carbro__heroinfo { display:flex; flex-direction:column; gap:6px; justify-content:center; }
.carbro__logo { height:30px; width:auto; max-width:140px; object-fit:contain; align-self:flex-start; }
.carbro__brandtxt { font-size:15px; font-weight:800; color:var(--navy-700); }
.carbro__model { margin:6px 0 0; font-size:26px; font-weight:800; color:var(--ink); line-height:1.2; }
.carbro__tag { margin:4px 0 0; font-size:13px; color:var(--dim); line-height:1.5; }
.carbro__badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.carbro__badge { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.07); border:1px solid #cdddf2; padding:5px 11px; border-radius:999px; }
.carbro__price { margin-top:16px; display:flex; flex-direction:column; gap:2px; }
.carbro__price span { font-size:12px; color:var(--dim); }
.carbro__price b { font-family:"Sarabun",var(--ff); font-size:24px; font-weight:800; color:var(--navy-700); }
.carbro__cta { align-self:flex-start; margin-top:16px; border:none; background:var(--gold-500); color:#3a2700; font-family:var(--ff); font-size:13px; font-weight:700; padding:11px 18px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.carbro__cta:hover { filter:brightness(.96); }
.carbro__sec { margin-top:24px; }
.carbro__sechd { display:flex; align-items:center; gap:8px; font-size:15px; font-weight:700; color:var(--ink); padding-bottom:11px; border-bottom:2px solid var(--line); margin-bottom:14px; }
.carbro__gens { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.carbro__gen { position:relative; border:1px solid var(--line); border-radius:12px; padding:14px 15px 14px 18px; background:#fff; }
.carbro__gendot { position:absolute; left:-1px; top:14px; bottom:14px; width:4px; border-radius:4px; background:linear-gradient(var(--navy-700),var(--gold-500)); }
.carbro__genyr { font-size:12px; font-weight:800; color:var(--gold-600); }
.carbro__genname { font-size:14.5px; font-weight:700; color:var(--ink); margin-top:2px; }
.carbro__gennote { font-size:12px; color:var(--dim); margin-top:5px; line-height:1.5; }
.carbro__engs { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.carbro__eng { border:1px solid var(--line); border-radius:12px; padding:14px 15px; background:#fff; }
.carbro__engcode { font-family:"Sarabun",var(--ff); font-size:17px; font-weight:800; color:var(--navy-700); }
.carbro__engtype { font-size:12px; color:var(--dim); margin-top:3px; }
.carbro__engpow { display:flex; gap:18px; margin-top:11px; padding-top:11px; border-top:1px solid var(--line); }
.carbro__engpow span { display:flex; flex-direction:column; font-size:10.5px; color:var(--dim); }
.carbro__engpow b { font-size:14px; font-weight:700; color:var(--ink); }
.carbro__trims { border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.carbro__trow { display:grid; grid-template-columns:2fr 1.3fr 1.3fr 1.3fr 1fr; gap:10px; padding:11px 15px; align-items:center; font-size:12.5px; color:var(--ink); border-top:1px solid var(--line); }
.carbro__trow:first-child { border-top:none; }
.carbro__trow--h { background:var(--bg-1,#f5f7fb); font-weight:700; color:var(--dim); font-size:11.5px; }
.carbro__trow .r { text-align:right; }
.carbro__tnm { font-weight:700; }
.carbro__trow b.r { font-family:"Sarabun",var(--ff); font-size:14px; font-weight:800; color:var(--navy-700); }
@media (max-width:760px){ .carbro__trow { grid-template-columns:1.6fr 1fr; } .carbro__trow span:nth-child(3), .carbro__trow span:nth-child(4) { display:none; } }
.carbro__specs { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:0 22px; border:1px solid var(--line); border-radius:12px; padding:6px 16px; }
.carbro__spec { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:12.5px; }
.carbro__spec span { color:var(--dim); flex-shrink:0; }
.carbro__spec b { color:var(--ink); font-weight:600; text-align:right; }
.carbro__note { display:flex; align-items:flex-start; gap:8px; font-size:11.5px; color:var(--dim); line-height:1.55; background:var(--bg-1,#f6f8fb); border-radius:10px; padding:12px 14px; margin-top:22px; }

/* ---- car CRUD: toolbar + card tools + brochure acts ---- */
.carinfo__bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.carinfo__bar .carinfo__count { margin-bottom:0; }
.carinfo__addbtn { border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; padding:9px 16px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.carinfo__addbtn:hover { filter:brightness(1.08); }
.car-card { cursor:pointer; }
.car-card__img { position:relative; }
.car-card__tools { position:absolute; top:8px; right:8px; display:flex; gap:6px; opacity:0; transition:opacity .12s; }
.car-card:hover .car-card__tools { opacity:1; }
.car-card__tools button { width:28px; height:28px; border:none; border-radius:8px; background:rgba(255,255,255,.92); color:var(--navy-700); cursor:pointer; display:grid; place-items:center; box-shadow:0 1px 4px rgba(0,0,0,.16); }
.car-card__tools button:hover { background:#fff; }
.car-card__tools .car-card__del { color:#C0392B; }
.carbro__topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.carbro__topbar .carbro__back { margin-bottom:0; }
.carbro__topacts { display:flex; gap:8px; }
.carbro__editbtn, .carbro__delbtn { border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:7px 14px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.carbro__editbtn { color:var(--navy-700); }
.carbro__editbtn:hover { border-color:var(--navy-600); }
.carbro__delbtn { color:#C0392B; }
.carbro__delbtn:hover { border-color:#C0392B; background:#fdf3f2; }

/* ---- car edit modal ---- */
.carmod-ov { position:fixed; inset:0; background:rgba(12,18,38,.5); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; padding:28px; z-index:400; }
.carmod { width:min(680px,100%); max-height:92vh; background:#fff; border-radius:16px; box-shadow:0 24px 70px rgba(8,16,40,.34); display:flex; flex-direction:column; overflow:hidden; }
.carmod__hd { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--line); }
.carmod__hd b { font-size:16px; color:var(--ink); }
.carmod__x { width:32px; height:32px; border:none; border-radius:8px; background:rgba(20,30,55,.06); color:var(--ink); cursor:pointer; display:grid; place-items:center; }
.carmod__x:hover { background:rgba(20,30,55,.12); }
.carmod__bd { padding:8px 20px 16px; overflow:auto; }
.carmod__sec { padding:14px 0; border-bottom:1px solid var(--line); }
.carmod__sec:last-child { border-bottom:none; }
.carmod__sechd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:11px; }
.carmod__grid2 { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.carmod label { display:flex; flex-direction:column; gap:5px; margin-bottom:11px; }
.carmod label:last-child { margin-bottom:0; }
.carmod label span { font-size:12px; font-weight:700; color:var(--ink); }
.carmod input, .carmod select { border:1px solid var(--line); border-radius:8px; padding:8px 11px; font-family:var(--ff); font-size:13px; color:var(--ink); background:#fff; }
.carmod input:focus, .carmod select:focus { outline:none; border-color:var(--navy-600); }
.carmod__row { display:flex; gap:7px; align-items:center; margin-bottom:8px; }
.carmod__row input { flex:1; min-width:0; }
.carmod__row__sm { flex:0 0 auto; max-width:128px; }
.carmod__rm { border:none; background:rgba(192,57,43,.08); color:#C0392B; width:32px; height:32px; border-radius:8px; cursor:pointer; flex-shrink:0; display:grid; place-items:center; }
.carmod__rm:hover { background:rgba(192,57,43,.16); }
.carmod__add { border:1.5px dashed var(--navy-600); background:rgba(11,61,145,.04); color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 13px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; margin-top:2px; }
.carmod__ft { display:flex; justify-content:flex-end; gap:10px; padding:14px 20px; border-top:1px solid var(--line); }
.carmod__cancel { border:none; background:none; color:var(--dim); font-family:var(--ff); font-size:13px; font-weight:700; padding:9px 16px; cursor:pointer; }
.carmod__save { border:none; background:var(--gold-500); color:#3a2700; font-family:var(--ff); font-size:13px; font-weight:700; padding:10px 20px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.carmod__save:disabled { background:#e3e7ee; color:var(--dim); cursor:not-allowed; }
@media (max-width:640px){ .carmod__row { flex-wrap:wrap; } .carmod__row__sm { max-width:none; flex:1 1 40%; } .carmod__grid2 { grid-template-columns:1fr; } }

/* ---- car delete confirm ---- */
.cardel { width:min(380px,100%); background:#fff; border-radius:16px; box-shadow:0 24px 70px rgba(8,16,40,.34); padding:26px 24px 20px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:8px; }
.cardel__ic { width:50px; height:50px; border-radius:50%; background:rgba(192,57,43,.1); display:grid; place-items:center; margin-bottom:4px; }
.cardel b { font-size:17px; color:var(--ink); }
.cardel p { margin:0; font-size:13px; color:var(--dim); line-height:1.55; }
.cardel__acts { display:flex; gap:10px; margin-top:14px; }
.cardel__confirm { border:none; background:#C0392B; color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; padding:10px 20px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.cardel__confirm:hover { filter:brightness(1.08); }

/* ---- web product manager (สร้าง/แก้ไข/ลบ) ---- */
.sfp-hd { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.sfp-hd b { font-size:16px; font-weight:800; color:var(--ink); display:block; }
.sfp-hd span { font-size:12.5px; color:var(--dim); }
.sfp-add { display:inline-flex; align-items:center; gap:7px; border:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:800; padding:10px 16px; border-radius:10px; background:var(--gold-500); color:#3a2700; box-shadow:0 8px 18px -8px rgba(245,164,0,.6); }
.sfp-add:hover { filter:brightness(1.04); }
.sfp-add, .sfp-add span { color:#081b45; }
.sfp-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.sfp-card { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:14px; background:#fff; overflow:hidden; transition:box-shadow .14s, transform .08s; }
.sfp-card:hover { box-shadow:0 6px 20px rgba(20,33,61,.1); transform:translateY(-2px); }
.sfp-card__img { position:relative; width:100%; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; background:#f6f8fc; border-bottom:1px solid var(--line); }
.sfp-card__img img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; padding:10px; display:block; }
.sfp-card__bd { flex:1; min-width:0; padding:12px 13px 6px; }
.sfp-card__nm { font-size:13.5px; font-weight:700; color:var(--ink); line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:6px; min-height:37px; }
.sfp-card__meta { display:flex; flex-wrap:wrap; gap:5px; }
.sfp-tag { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; }
.sfp-tag--link { background:var(--info-bg,#eef4ff); color:var(--navy-700); }
.sfp-tag--web { background:#eafaf1; color:#1F8A5B; }
.sfp-card__row { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:9px; }
.sfp-card__price { font-size:17px; font-weight:800; color:var(--navy-700); font-family:"Sarabun",var(--ff); }
.sfp-card__acts { display:flex; gap:7px; padding:10px 13px 13px; border-top:1px solid var(--line); }
.sfp-act { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; height:34px; border-radius:9px; border:1px solid var(--line); background:#fff; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); }
.sfp-act:hover { border-color:var(--navy-700); background:var(--info-bg,#eef4ff); }
.sfp-act--var { color:#7c3aed; border-color:#d9c8f7; }
.sfp-act--var:hover { background:rgba(124,58,237,.07); border-color:#7c3aed; }
.sfp-act--del { flex:none; width:38px; color:var(--danger,#d1453b); }
.sfp-act--del:hover { border-color:var(--danger,#d1453b); background:var(--danger-bg,#fdecec); }
.sfp-up { display:block; width:100%; height:160px; border:1.5px dashed var(--gold-400); border-radius:14px; overflow:hidden; cursor:pointer; background:#fffdf6; margin-bottom:14px; }
.sfp-up img { width:100%; height:100%; object-fit:contain; display:block; }
.sfp-up__ph { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--dim); font-size:13px; font-weight:600; }
.sfp-frm { display:flex; flex-direction:column; gap:12px; }
.sfp-frm label { display:flex; flex-direction:column; gap:5px; flex:1; }
.sfp-frm label > span { font-size:12px; font-weight:700; color:var(--ink-2); }
.sfp-frm__row { display:flex; gap:10px; }
.sfp-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:800; padding:10px 16px; border-radius:10px; }
.sfp-btn--ghost { background:var(--surface-2,#eef1f6); color:var(--ink); }
.sfp-btn--gold { background:var(--gold-500); color:#3a2700; }
.sfp-btn--del { background:var(--danger,#d1453b); color:#fff; }
@media (max-width:560px){ .sfp-grid{ grid-template-columns:1fr 1fr; } }
.sf-member { display:flex; gap:28px; padding:36px; background:linear-gradient(135deg,#fffaf0,#fff7e6); }
.sf-member__l { flex:1; }
.sf-member h2 { margin:12px 0 0; font-size:24px; font-weight:800; color:var(--ink); font-family:"Sarabun",var(--ff); }
.sf-member p { margin:8px 0 0; font-size:13px; color:var(--ink-2); }
.sf-tiers { display:flex; gap:12px; margin-top:18px; flex-wrap:wrap; }
.sf-tier { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px 16px; min-width:140px; }
.sf-tier__dot { width:10px; height:10px; border-radius:50%; display:inline-block; margin-right:6px; }
.sf-tier b { font-size:14px; color:var(--ink); }
.sf-tier i { display:block; font-style:normal; font-size:11px; color:var(--dim); margin:3px 0; }
.sf-tier span { font-size:12px; color:var(--navy-700); font-weight:600; }
.sf-join { width:320px; flex:none; background:#fff; border:1px solid var(--line); border-radius:16px; padding:20px; display:flex; flex-direction:column; gap:10px; box-shadow:0 14px 36px -20px rgba(20,40,90,.4); }
.sf-join b { font-size:15px; color:var(--ink); }
.sf-join input { height:42px; border:1.5px solid var(--line-2); border-radius:10px; padding:0 12px; font-family:var(--ff); font-size:13.5px; outline:none; }
.sf-join input:focus { border-color:var(--gold-500); }
.sf-join__note { font-size:11px; color:var(--dim); line-height:1.5; }
.sf-join__sub { font-size:12px; color:var(--ink-2); line-height:1.5; margin-top:-3px; }
.sf-social { display:flex; align-items:center; justify-content:center; gap:10px; height:46px; border-radius:11px; border:1.5px solid var(--line-2); background:#fff; cursor:pointer; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--ink); transition:.14s; position:relative; }
.sf-social:hover { border-color:var(--navy-600); background:#fafbfe; }
.sf-social__ic { position:absolute; left:14px; display:grid; place-items:center; width:24px; height:24px; }
.sf-social__ic--line { background:#06C755; color:#fff; border-radius:6px; font-size:8.5px; font-weight:900; letter-spacing:.3px; font-family:"Noto Sans",sans-serif; }
.sf-social--line { border-color:#06C75555; }
.sf-social--line:hover { border-color:#06C755; background:#f3fcf6; }
.sf-social--email { color:var(--navy-700); }
/* ===== member tier cards (premium row) ===== */
.sf-mcards { display:grid; grid-template-columns:repeat(auto-fit,minmax(255px,1fr)); align-items:start; gap:16px; padding:22px 0 4px; width:100%; max-width:850px; }
/* ⭐ ขนาดบัตรล็อกตายตัวทั้งระบบ: สัดส่วน 1.45 + กว้างสูงสุด 360px จัดกึ่งกลาง → ทุกที่สัดส่วนเท่ากัน ไม่ยืด/บิด */
/* ⭐ ขนาดบัตร = ต้นฉบับระบบสมาชิก (members.jsx MemberCardModal): สูงตามเนื้อหา (ไม่บีบด้วย aspect-ratio) · padding 20/22 · กว้างสุด 360 */
.sf-mcard { position:relative; display:flex; flex-direction:column; width:100%; max-width:384px; margin-inline:auto; border-radius:16px; padding:20px 22px; overflow:hidden; color:#fff; cursor:default; background:linear-gradient(135deg,#4A3A9E,#241c54); box-shadow:0 16px 32px -16px rgba(40,30,90,.55); transition:transform .35s cubic-bezier(.3,.7,.25,1), box-shadow .35s ease; }
@media (max-width:620px){ .sf-mcards{ max-width:330px; margin:0 auto; } }
.sf-mcard:hover, .sf-mcard:focus-visible { transform:translateY(-12px) scale(1.015); box-shadow:0 38px 66px -22px rgba(40,30,90,.62), inset 0 1px 0 rgba(255,255,255,.24); outline:none; }
.sf-mcard > .sf-mcard__pattern { position:absolute; right:-44px; top:-44px; width:150px; height:150px; border-radius:50%; background:rgba(255,255,255,.08); pointer-events:none; z-index:0; }
.sf-mcard::after { content:""; position:absolute; inset:0; background:linear-gradient(116deg,transparent 32%,rgba(255,255,255,.34) 48%,transparent 64%); transform:translateX(-135%); transition:transform .85s cubic-bezier(.4,.1,.2,1); pointer-events:none; z-index:4; }
.sf-mcard:hover::after, .sf-mcard:focus-visible::after { transform:translateX(135%); }
.sf-mcard > * { position:relative; z-index:1; }
.sf-mcard__top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.sf-mcard__brand b { display:block; font-family:"Noto Sans",sans-serif; font-size:13.5px; font-weight:800; letter-spacing:1px; line-height:1.1; }
.sf-mcard__brand span { font-size:9px; letter-spacing:2.5px; color:rgba(255,255,255,.7); white-space:nowrap; margin-top:1px; display:block; }
.sf-mcard__tier { flex:none; display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800; color:#fff; background:rgba(255,255,255,.16); border-radius:99px; padding:3px 11px; }
.sf-mcard__tier svg { color:var(--gold-400,#e9b949); }
.sf-mcard__chip { position:relative; width:42px; height:31px; border-radius:6px; margin:20px 0 14px; background:linear-gradient(135deg,#fbe7b0 0%,#e6c879 40%,#b8923c 100%); flex:none; box-shadow:inset 0 1px 1px rgba(255,255,255,.6), 0 1px 2px rgba(0,0,0,.25); }
.sf-mcard__chip::after { content:""; position:absolute; inset:5px 6px; border-radius:3px; background:linear-gradient(90deg,transparent 30%,rgba(120,90,30,.5) 31%,transparent 32%,transparent 64%,rgba(120,90,30,.5) 65%,transparent 66%),linear-gradient(0deg,transparent 44%,rgba(120,90,30,.5) 45%,transparent 46%); }
.sf-mcard__name { font-size:18px; font-weight:800; letter-spacing:.2px; line-height:1.2; }
.sf-mcard__no { font-family:"Noto Sans",sans-serif; font-size:16px; letter-spacing:4px; color:rgba(255,255,255,.95); margin-top:6px; }
.sf-mcard__ft { display:flex; align-items:flex-end; justify-content:space-between; margin-top:16px; }
.sf-mcard__ft span { display:block; font-size:9px; letter-spacing:1px; color:rgba(255,255,255,.7); }
.sf-mcard__ft b { font-size:12.5px; font-weight:700; margin-top:1px; display:block; }
.sf-mcard__pts { text-align:right; }
.sf-mcard__pts b { font-size:17px; font-weight:800; color:var(--gold-400,#e9b949); letter-spacing:.3px; }
.sf-mcards__hint { text-align:center; font-size:12px; color:#9aa3b6; margin:15px 0 0; }
/* บัตรสมาชิกบนหน้าคะแนน (ใช้ดีไซน์ sf-mcard เหมือนระบบสมาชิก) */
/* บัตรสมาชิกบนหน้าคะแนน — hover = ยกขึ้น + แสงสะท้อนวิ้ง ๆ */
.sf-loycard { cursor:default; transition:transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s; }
.sf-loycard:hover, .sf-loycard:focus-visible { transform:translateY(-8px) scale(1.018); box-shadow:0 34px 60px -24px rgba(40,30,90,.6), inset 0 1px 0 rgba(255,255,255,.28); outline:none; }
.sf-loycard::after { transition:transform 1.05s cubic-bezier(.22,.7,.25,1); }
.sf-loycard:hover::after, .sf-loycard:focus-visible::after { transform:translateX(135%); }
.sf-loyprog { margin-top:2px; }
.sf-loyprog__bar { height:8px; border-radius:999px; background:var(--line); overflow:hidden; }
.sf-loyprog__bar span { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--gold-500),var(--gold-600)); transition:width .4s ease; }
.sf-loyprog__tx { font-size:12.5px; color:var(--ink-2); margin-top:7px; }
.sf-loyprog__tx b { color:var(--navy-700); font-weight:800; }
.sf-loyprog__max { font-size:13px; font-weight:700; color:var(--navy-700); margin-top:2px; }
/* tiers — luxe finish */
.sf-mcard--plat { background:linear-gradient(135deg,#6253c4 0%,#4A3A9E 38%,#241c54 100%); box-shadow:0 22px 44px -20px rgba(60,45,140,.62); }
.sf-mcard--gold { background:linear-gradient(135deg,#e9cf86 0%,#c9a34a 30%,#8c6c28 64%,#5a4416 100%); box-shadow:0 22px 44px -18px rgba(150,105,30,.6); }
.sf-mcard--silver { background:linear-gradient(135deg,#8995a8 0%,#5B6B82 40%,#2f3b49 100%); box-shadow:0 22px 44px -18px rgba(70,80,100,.55); }
/* metallic sheen + soft top highlight on every tier */
.sf-mcard::before { content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(120% 80% at 18% -10%, rgba(255,255,255,.34), rgba(255,255,255,0) 46%),
    radial-gradient(90% 70% at 110% 120%, rgba(0,0,0,.26), rgba(0,0,0,0) 55%);
}
.sf-mcard--gold .sf-mcard__pattern { background:radial-gradient(circle at 30% 30%, rgba(255,244,205,.5), rgba(255,255,255,.06) 70%); }
@media (prefers-reduced-motion:reduce){ .sf-mcard,.sf-mcard::after{ transition:none; } }
/* truck dispatch animation — PNG truck riding the loading line (new) */
.truckfx { position:fixed; inset:0; z-index:300; background:rgba(8,18,40,.5); backdrop-filter:blur(2px); display:grid; place-items:center; animation:tfxin .2s ease; }
@keyframes tfxin { from{opacity:0;} to{opacity:1;} }
.truckfx__card { background:#fff; border-radius:18px; padding:26px 30px 22px; box-shadow:0 24px 70px rgba(10,22,50,.4); width:min(420px,90vw); }
.truckfx__road { position:relative; height:104px; background:linear-gradient(180deg,#f4f7fb,#e9eef6); border-radius:14px; overflow:hidden; }
/* base dashed track */
.truckfx__track { position:absolute; left:20px; right:20px; bottom:22px; height:7px; border-radius:999px; background:rgba(22,41,79,.10); box-shadow:inset 0 1px 0 rgba(255,255,255,.5); }
.truckfx__track::before { content:""; position:absolute; inset:0; border-radius:inherit; background-image:linear-gradient(90deg,transparent 0 16px,rgba(22,41,79,.18) 16px 30px); background-size:30px 100%; animation:tfxdash .6s linear infinite; }
@keyframes tfxdash { to{ background-position:30px 0; } }
/* gold fill that follows behind the truck */
.truckfx__fill { position:absolute; left:20px; bottom:22px; height:7px; width:0; border-radius:999px; background:linear-gradient(90deg,#f5a400,#ffd772,#fff7e6); box-shadow:0 0 14px rgba(245,164,0,.40), inset 0 1px 0 rgba(255,255,255,.4); animation:tfxfill 2.4s cubic-bezier(.65,0,.35,1) forwards, tfxfade .3s ease 2.5s forwards; }
@keyframes tfxfill { from{ width:0; } to{ width:calc(86% - 20px); } }
/* PNG truck riding the line */
.truckfx__png { position:absolute; bottom:18px; left:2px; width:104px; height:auto; object-fit:contain; user-select:none; -webkit-user-drag:none; filter:drop-shadow(0 8px 9px rgba(4,18,42,.28)); animation:tfxdrive 2.4s cubic-bezier(.65,0,.35,1) forwards, tfxbob .6s ease-in-out infinite, tfxfade .3s ease 2.5s forwards; }
@keyframes tfxdrive { from{ left:2px; } to{ left:calc(100% - 116px); } }
@keyframes tfxbob { 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-2px); } }
@keyframes tfxfade { to{ opacity:0; } }
/* success check pops once the truck has delivered */
.truckfx__check { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) scale(.4); width:52px; height:52px; border-radius:50%; background:rgba(47,199,126,.16); display:grid; place-items:center; opacity:0; animation:tfxpop .5s cubic-bezier(.34,1.56,.64,1) 2.55s forwards; }
.truckfx__check svg { width:28px; height:28px; }
.truckfx__check path { fill:none; stroke:#1F8A5B; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:24; stroke-dashoffset:24; animation:tfxdraw .42s cubic-bezier(.65,0,.35,1) 2.75s forwards; }
@keyframes tfxpop { 0%{ opacity:0; transform:translate(-50%,-50%) scale(.4);} 60%{ opacity:1; transform:translate(-50%,-50%) scale(1.12);} 100%{ opacity:1; transform:translate(-50%,-50%) scale(1);} }
@keyframes tfxdraw { to{ stroke-dashoffset:0; } }
.truckfx__txt { text-align:center; margin-top:16px; font-size:14px; font-weight:800; color:var(--navy-700); animation:tfxtxt .4s ease 2.6s both; }
@keyframes tfxtxt { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:none;} }
@media (prefers-reduced-motion:reduce){ .truckfx__png,.truckfx__fill,.truckfx__track::before{ animation:none; } .truckfx__png{ left:calc(100% - 116px); opacity:1; } .truckfx__fill{ width:calc(86% - 20px); opacity:1; } .truckfx__check{ animation:none; opacity:1; transform:translate(-50%,-50%) scale(1); } .truckfx__check path{ animation:none; stroke-dashoffset:0; } }
.sf-social__ic--fb { background:#1877F2; color:#fff; border-radius:6px; font-size:14px; font-weight:900; font-family:Georgia,serif; display:grid; place-items:center; }
.sf-social--fb { border-color:#1877F255; }
.sf-social--fb:hover { border-color:#1877F2; background:#f3f7fe; }
.sf-social__ic--ig { background:linear-gradient(135deg,#feda75,#d62976 45%,#962fbf 80%,#4f5bd5); border-radius:7px; display:grid; place-items:center; }
.sf-social--ig:hover { border-color:#d62976; background:#fdf3f8; }
.sf-social__ic--tt { background:#000; border-radius:7px; display:grid; place-items:center; }
.sf-social--tt:hover { border-color:#000; background:#f4f4f5; }
.sf-or { display:flex; align-items:center; gap:10px; color:var(--dim); font-size:11.5px; margin:2px 0; }
.sf-or::before, .sf-or::after { content:""; flex:1; height:1px; background:var(--line); }
.sf-promorow { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:16px; }
.sf-promo { border:1.5px solid; border-radius:13px; padding:16px; background:#fff; }
.sf-promo span.sf-promo__tag { display:inline-block; font-size:11px; font-weight:800; color:#ffffff; padding:3px 10px; border-radius:99px; margin-bottom:8px; }
.sf-promo b { display:block; font-size:15px; color:var(--ink); }
.sf-promo span { font-size:12px; color:var(--dim); }
.sf-news { display:flex; flex-direction:column; gap:8px; }
.sf-newsrow { display:flex; gap:14px; align-items:center; padding:11px 14px; border-radius:10px; background:#fff; border:1px solid var(--line); }
.sf-news__d { font-size:11.5px; font-weight:700; color:var(--gold-600); white-space:nowrap; }
.sf-news__t { font-size:13px; color:var(--ink); }
.sf-about { display:flex; gap:28px; align-items:flex-start; }
.sf-about__story { flex:1; }
.sf-about__story p { font-size:13.5px; color:var(--ink-2); line-height:1.8; }
.sf-trust { display:flex; gap:18px; margin-top:14px; flex-wrap:wrap; }
.sf-trust span { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--ink); }
.sf-loc { width:340px; flex:none; }
.sf-map { height:160px; border-radius:13px; position:relative; display:grid; place-items:center; overflow:hidden;
  background:linear-gradient(135deg,#dde7f3,#eef2f9); border:1px solid var(--line); }
.sf-map__pin { width:44px; height:44px; border-radius:50%; display:grid; place-items:center; color:#fff; background:#D14343; box-shadow:0 6px 16px -4px rgba(209,67,67,.6); }
.sf-map__lbl { position:absolute; bottom:10px; left:10px; font-size:11.5px; font-weight:700; color:var(--navy-700); background:rgba(255,255,255,.9); padding:4px 10px; border-radius:8px; }
.sf-loc__info { margin-top:12px; display:flex; flex-direction:column; gap:8px; font-size:12.5px; color:var(--ink-2); }
.sf-loc__info > div { display:flex; align-items:center; gap:7px; }
.sf-foot { padding:18px 36px; text-align:center; font-size:12px; color:var(--dim); border-top:1px solid var(--line); background:#f6f8fc; }
.sf-cart__n { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; margin-left:6px; border-radius:99px; background:#C9A227; color:#fff; font-size:11px; font-weight:800; }
/* ตะกร้า/คำสั่งซื้อ = หน้าเต็ม (เปลี่ยนหน้า ไม่ใช่ popup) */
.sf-cartpageov { position:absolute; inset:0; z-index:40; background:var(--bg-1,#f4f6fa); overflow-y:auto; animation:sfCartPop .2s ease; }
@keyframes sfCartPop { from{ opacity:.4; } to{ opacity:1; } }
.sf-cartpage { width:min(720px,100%); margin:0 auto; padding:16px 18px 36px; }
.sf-cartpage--wide { width:min(1040px,100%); }
.sf-cartpage .sf-steps { border:none; background:none; padding:6px 0 16px; justify-content:center; }
/* step 1 บนหน้าเต็ม */
.sf-cartpage .sf-cartdrawer__bd { overflow:visible; flex:none; padding:0; background:#fff; border:1px solid var(--line); border-radius:14px; padding:6px 16px; }
.sf-cartpage .sf-cartdrawer__bd.sf-cobody { background:none; border:none; border-radius:0; padding:0; }
.sf-cartpage .sf-cartdrawer__ft { border:1px solid var(--line); border-radius:14px; background:#fff; margin-top:14px; }
/* step 2 = 2 คอลัมน์ */
.sf-cartpage .sf-cocols { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:18px; align-items:start; }
.sf-cartpage .sf-cocols .sf-cartdrawer__ft { margin-top:0; position:sticky; top:14px; }
@media (max-width:820px){ .sf-cartpage .sf-cocols { grid-template-columns:1fr; } .sf-cartpage .sf-cocols .sf-cartdrawer__ft { position:static; } }
.sf-cartdrawer__hd { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--line); }
.sf-cartdrawer__hd b { font-size:15px; font-weight:800; color:var(--ink); }
.sf-cartdrawer__hd button { border:none; background:var(--surface-2); width:30px; height:30px; border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; }
.sf-cartdrawer__bd { flex:1; overflow:auto; padding:12px 16px; }
.sf-cartempty { display:flex; flex-direction:column; align-items:center; gap:9px; padding:50px 20px; color:var(--dim); font-size:13px; }
.sf-cartrow { display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); }
.sf-cartrow__ic { width:72px; height:72px; flex:none; border-radius:10px; background:var(--surface-2); display:grid; place-items:center; color:var(--navy-700); overflow:hidden; }
.sf-cartrow__ic img { width:100%; height:100%; object-fit:contain; padding:3px; }
.sf-cartrow__bd { flex:1; min-width:0; }
.sf-cartrow__nm { font-size:13px; font-weight:700; color:var(--ink); line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sf-cartrow__pr { font-size:12px; color:var(--gold-700,#A8852F); font-weight:700; margin-top:2px; }
.sf-cartrow__line { color:var(--dim); font-weight:500; }
.sf-cartback { border:none; background:var(--surface-2); width:30px; height:30px; border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; flex:none; }
/* step indicator */
.sf-steps { display:flex; align-items:center; gap:9px; padding:11px 18px; border-bottom:1px solid var(--line); background:#fbfcfe; }
.sf-steps__s { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--dim); }
.sf-steps__s i { display:grid; place-items:center; width:20px; height:20px; border-radius:99px; background:var(--line-2); color:#fff; font-size:11px; font-weight:800; font-style:normal; }
.sf-steps__s.on { color:var(--navy-700); }
.sf-steps__s.on i { background:var(--navy-700); }
.sf-steps__line { flex:1; height:2px; background:var(--line); border-radius:2px; }
/* promo code */
.sf-promo { margin-bottom:12px; }
.sf-promo__lbl { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:800; color:var(--ink); margin-bottom:7px; }
.sf-promo__row { display:flex; gap:8px; }
.sf-promo__row input { flex:1; min-width:0; height:40px; border:1.5px solid var(--line-2); border-radius:10px; padding:0 12px; font-family:var(--ff); font-size:13px; letter-spacing:.5px; outline:none; text-transform:uppercase; }
.sf-promo__row input:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(20,40,80,.08); }
.sf-promo__row button { flex:none; padding:0 16px; border:none; border-radius:10px; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; cursor:pointer; }
.sf-promo__row button:hover { background:var(--navy-600); }
.sf-promo__applied { display:flex; align-items:center; justify-content:space-between; gap:8px; background:#e7f3ec; border:1px solid #a7d7bd; border-radius:10px; padding:9px 12px; }
.sf-promo__code { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:#1F6B43; }
.sf-promo__applied button { border:none; background:none; color:#C0392B; font-family:var(--ff); font-size:12px; font-weight:700; cursor:pointer; }
/* order summary (step 2 body) */
.sf-ordsec { margin-bottom:13px; }
.sf-ordsec__h { display:block; font-size:12.5px; font-weight:800; color:var(--ink); margin-bottom:8px; }
.sf-ordlist { display:flex; flex-direction:column; }
.sf-ordline { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:12.5px; }
.sf-ordline:last-child { border-bottom:none; }
.sf-ordline__img { width:58px; height:58px; flex:none; border-radius:9px; background:var(--surface-2); display:grid; place-items:center; color:var(--navy-700); overflow:hidden; }
.sf-ordline__img img { width:100%; height:100%; object-fit:contain; padding:3px; }
.sf-ordline__nm { flex:1; min-width:0; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sf-ordline__qty { flex:none; color:var(--dim); font-weight:600; }
.sf-ordline__amt { flex:none; color:var(--ink); font-weight:700; }
.sf-cartqty { display:inline-flex; align-items:center; gap:8px; }
.sf-cartqty button { width:24px; height:24px; border:1px solid var(--line-2); background:#fff; border-radius:6px; cursor:pointer; font-size:15px; color:var(--ink-2); display:grid; place-items:center; }
.sf-cartqty b { min-width:18px; text-align:center; font-size:13px; }
.sf-cartrow__rm { border:none; background:none; cursor:pointer; color:var(--line-2); display:grid; place-items:center; padding:4px; }
.sf-cartrow__rm:hover { color:var(--danger); }
.sf-cartdrawer__ft { padding:16px 18px; border-top:1px solid var(--line); background:#f9fbfe; }
.sf-carttot { display:flex; align-items:center; justify-content:space-between; padding-top:9px; margin-top:5px; border-top:1px dashed var(--line-2); }
.sf-carttot span { font-size:13.5px; font-weight:700; color:var(--ink); }
.sf-carttot b { font-size:21px; font-weight:800; color:var(--navy-700); }
.sf-cartnote { display:block; text-align:center; font-size:11px; color:var(--dim); margin-top:9px; }
/* checkout shipping calculator — redesigned */
.sf-ship { background:#fff; border:1px solid var(--line); border-radius:13px; padding:13px; margin-bottom:12px; display:flex; flex-direction:column; gap:13px; box-shadow:0 1px 3px rgba(20,33,61,.04); }
.sf-ship__step { display:flex; flex-direction:column; gap:8px; }
.sf-ship__steplbl { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:800; color:var(--ink); }
.sf-ship__num { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:99px; background:var(--navy-700); color:#fff; font-size:11px; font-weight:800; font-style:normal; }
.sf-ship__pcrow { display:flex; align-items:center; gap:9px; }
.sf-ship__pcic { flex:none; display:grid; place-items:center; }
.sf-ship__pc { flex:none; width:160px; height:40px; border:1.5px solid var(--line-2); border-radius:10px; padding:0 12px; font-family:"Noto Sans",sans-serif; font-size:14px; font-weight:600; letter-spacing:.5px; outline:none; background:#fbfcfe; transition:border-color .12s, box-shadow .12s; }
.sf-ship__pc:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(20,40,80,.08); background:#fff; }
.sf-ship__zone { flex:1; min-width:0; font-size:12px; font-weight:700; color:#1F8A5B; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-ship__zone.remote { color:#C0392B; }
.sf-ship__zone--dim { color:var(--dim); font-weight:500; }
.sf-ship__cars { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.sf-ship__cars { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.sf-ship__car { position:relative; display:grid; place-items:center; border:none; background:none; padding:8px; cursor:pointer; border-radius:12px; opacity:.5; transition:opacity .14s, box-shadow .14s, transform .08s; }
.sf-ship__car:hover { opacity:.85; }
.sf-ship__car.on { opacity:1; background:var(--surface-2); box-shadow:inset 0 0 0 2px var(--navy-600); }
.sf-ship__carlogo { width:100%; height:64px; display:grid; place-items:center; }
.sf-ship__carlogo img { max-width:100%; max-height:64px; object-fit:contain; }
.sf-ship__cartick { position:absolute; top:-6px; right:-4px; width:20px; height:20px; border-radius:99px; display:grid; place-items:center; border:2px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,.18); }
@media (max-width:520px){ .sf-ship__cars { grid-template-columns:repeat(3,1fr); } }
.sf-ship__cod { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-2); cursor:pointer; padding-top:2px; }
.sf-ship__cod.off { color:var(--dim); cursor:not-allowed; }
.sf-ship__cod input { accent-color:var(--navy-700); width:16px; height:16px; flex:none; }
.sf-ship__codwarn { color:#C0392B; font-size:11px; }
.sf-ship__warn { display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; color:#C0392B; background:#fae9e7; border-radius:8px; padding:7px 10px; }
.sf-sumbox { background:#fff; border:1px solid var(--line); border-radius:12px; padding:11px 13px; margin-bottom:12px; }
.sf-cartline { display:flex; align-items:center; justify-content:space-between; font-size:13px; color:var(--ink-2); padding:3px 0; }
.sf-cartline b { font-weight:700; color:var(--ink); }
.sf-cartline__dim { font-style:normal; font-size:12px; color:var(--dim); font-weight:500; }
.sf-cartline--strong { border-top:1px dashed var(--line-2); margin-top:4px; padding-top:8px; }
.sf-cartline--strong span { font-weight:700; color:var(--ink); }
.sf-cartline--strong b { color:var(--ink); }
.sf-checkoutbtn { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; height:50px; border:none; border-radius:12px; background:linear-gradient(135deg, var(--gold-500), var(--gold-600)); color:var(--navy-900); font-family:var(--ff); font-size:15.5px; font-weight:800; cursor:pointer; box-shadow:0 4px 14px rgba(212,160,40,.32); transition:filter .12s, transform .08s, box-shadow .12s; }
.sf-checkoutbtn:hover { filter:brightness(1.04); box-shadow:0 6px 18px rgba(212,160,40,.4); }
.sf-checkoutbtn:active { transform:translateY(1px); }

/* ===== Shopee-style checkout (step 2 sections) ===== */
.sf-cobody { display:flex; flex-direction:column; gap:12px; }
.sf-cosec { background:#fff; border:1px solid var(--line); border-radius:12px; padding:13px 14px; }
.sf-cosec__hd { display:flex; align-items:center; gap:7px; font-size:13px; margin-bottom:10px; }
.sf-cosec__hd b { font-weight:800; color:var(--ink); }
.sf-cosec__edit { margin-left:auto; border:none; background:none; color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; cursor:pointer; }
.sf-cosec__n { margin-left:auto; font-size:11.5px; color:var(--dim); font-weight:600; }
.sf-coaddr__who { font-size:13px; font-weight:700; color:var(--ink); display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.sf-coaddr__who span { font-weight:500; color:var(--ink-2); }
.sf-coaddr__tag { font-size:10px; font-weight:700; color:#C77F00; border:1px solid #e7c277; border-radius:5px; padding:1px 6px; }
.sf-coaddr__line { font-size:12.5px; color:var(--ink-2); margin-top:5px; line-height:1.5; }
.sf-coaddr__zone { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2); margin-top:7px; }
.sf-coaddr__zone b { color:var(--navy-700); font-weight:700; }
/* payment methods */
.sf-paylist { display:flex; flex-direction:column; gap:8px; }
.sf-paymethod { display:flex; align-items:center; gap:11px; width:100%; text-align:left; border:1.5px solid var(--line-2); background:#fff; border-radius:10px; padding:10px 12px; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
.sf-paymethod:hover { border-color:#aeb8cc; }
.sf-paymethod.on { border-color:var(--navy-700); box-shadow:0 0 0 3px rgba(20,40,80,.07); }
.sf-paymethod.off { opacity:.5; cursor:not-allowed; }
.sf-paymethod__ic { flex:none; display:grid; place-items:center; width:34px; height:34px; border-radius:8px; background:var(--surface-2); color:var(--navy-700); }
.sf-paymethod__tx { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.sf-paymethod__tx b { font-size:13px; font-weight:700; color:var(--ink); }
.sf-paymethod__tx span { font-size:11px; color:var(--dim); }
.sf-paymethod__dot { flex:none; width:18px; height:18px; border-radius:50%; border:2px solid var(--line-2); position:relative; }
.sf-paymethod.on .sf-paymethod__dot { border-color:var(--navy-700); }
.sf-paymethod.on .sf-paymethod__dot::after { content:""; position:absolute; inset:3px; border-radius:50%; background:var(--navy-700); }
.sf-payacct { margin-top:9px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 12px; }
.sf-payacct__hd { display:flex; align-items:center; gap:5px; font-size:11px; font-weight:700; color:var(--navy-700); margin-bottom:6px; }
.sf-payacct__row { display:flex; align-items:center; gap:8px; font-size:12px; padding:3px 0; }
.sf-payacct__nm { flex:1; min-width:0; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-payacct__no { font-family:ui-monospace,monospace; font-weight:800; color:var(--navy-700); letter-spacing:.3px; }
.sf-payacct__pri { flex:none; font-size:9.5px; font-weight:800; color:#1F8A5B; background:#e8f7ef; border-radius:99px; padding:1px 7px; font-style:normal; }
/* checkout footer links */
.sf-cofoot { display:grid; grid-template-columns:1fr 1fr; gap:14px 12px; padding:14px; margin-top:2px; background:var(--surface-2); border-radius:12px; }
.sf-cofoot__col { display:flex; flex-direction:column; gap:6px; }
.sf-cofoot__col b { font-size:11.5px; font-weight:800; color:var(--ink); margin-bottom:1px; }
.sf-cofoot__col a { font-size:11.5px; color:var(--ink-2); cursor:pointer; }
.sf-cofoot__col a:hover { color:var(--navy-700); }
.sf-cofoot__pay { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); }
.sf-cofoot__cod { font-size:9px; font-weight:800; color:#fff; background:#C77F00; border-radius:4px; padding:1px 4px; }
.sf-cofoot__social { display:flex; gap:8px; margin-top:2px; }
.sf-cofoot__social a { display:grid; place-items:center; width:30px; height:30px; border-radius:8px; background:#fff; border:1px solid var(--line); color:var(--navy-700); cursor:pointer; }
.sf-cofoot__social a:hover { border-color:var(--navy-700); }
.sf-coterms { font-size:11px; color:var(--dim); line-height:1.5; margin:0 0 9px; text-align:center; }
.sf-coterms a { color:var(--navy-700); cursor:pointer; }

/* ---- ปรับแต่งเว็บหน้าร้าน (site customizer) ---- */
.sfe { display:grid; grid-template-columns: minmax(0,440px) minmax(0,1fr); gap:18px; align-items:start; }
.sfe-panel { display:flex; flex-direction:column; gap:14px; min-width:0; }
.sfe-note { display:flex; align-items:flex-start; gap:8px; font-size:12px; line-height:1.5; color:var(--navy-700); background:var(--info-bg); border:1px solid #bcd6f0; border-radius:var(--r-md); padding:10px 12px; }
.sfe-sec { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:14px 15px; box-shadow:var(--sh-sm); }
.sfe-sec__hd { display:flex; align-items:center; justify-content:space-between; margin-bottom:11px; }
.sfe-sec__hd b { font-size:13px; font-weight:800; color:var(--ink); }
.sfe-add { border:1px dashed var(--navy-600); background:none; color:var(--navy-600); font-family:var(--ff); font-size:11.5px; font-weight:700; border-radius:var(--r-pill); padding:4px 11px; cursor:pointer; transition:.14s; }
.sfe-add:hover { background:var(--info-bg); }
.sfe-banner { border:1px solid var(--line-2); border-radius:var(--r-md); padding:11px 12px; margin-bottom:11px; background:var(--surface-2); transition:opacity .15s; }
.sfe-banner:last-child { margin-bottom:0; }
.sfe-banner.off { opacity:.5; }
.sfe-banner__top { display:flex; align-items:center; gap:9px; margin-bottom:9px; }
.sfe-toggle { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.sfe-toggle input { accent-color:var(--navy-700); width:15px; height:15px; }
.sfe-banner__no { font-size:11px; font-weight:700; color:var(--dim); }
.sfe-banner__acts { margin-left:auto; display:flex; gap:4px; }
.sfe-banner__acts button { width:24px; height:24px; border:1px solid var(--line-2); background:#fff; border-radius:7px; cursor:pointer; color:var(--ink-2); font-size:12px; display:grid; place-items:center; transition:.14s; }
.sfe-banner__acts button:hover { border-color:var(--navy-600); color:var(--navy-700); }
.sfe-banner__acts button.del:hover { border-color:var(--danger); color:var(--danger); background:var(--danger-bg); }
.sfe-lb { display:block; font-size:10.5px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.4px; margin:9px 0 4px; }
.sfe-lb:first-child { margin-top:0; }
.sfe-in { width:100%; font-family:var(--ff); font-size:13px; color:var(--ink); background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:8px 11px; outline:none; transition:.14s; }
.sfe-in:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.sfe-ta { resize:vertical; line-height:1.45; }
.sfe-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:2px; }
.sfe-swatches { display:flex; gap:6px; flex-wrap:wrap; }
.sfe-sw { width:26px; height:26px; border-radius:8px; border:2px solid #fff; box-shadow:0 0 0 1px var(--line-2); cursor:pointer; padding:0; transition:.12s; }
.sfe-sw:hover { transform:scale(1.08); }
.sfe-sw.on { box-shadow:0 0 0 2px var(--navy-700); transform:scale(1.08); }
.sfe-imgbtns { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.sfe-mini { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:#fff; color:var(--ink-2); font-family:var(--ff); font-size:11.5px; font-weight:700; border-radius:8px; padding:6px 10px; cursor:pointer; transition:.14s; }
.sfe-mini:hover { border-color:var(--navy-600); color:var(--navy-700); }
.sfe-mini.del { color:var(--danger); border-color:#e6b4b4; }
.sfe-mini.del:hover { background:var(--danger-bg); }
.sfe-promo { border:1px solid var(--line-2); border-radius:var(--r-md); padding:10px 11px; margin-bottom:9px; background:var(--surface-2); }
.sfe-promo:last-child { margin-bottom:0; }
.sfe-newsrow { display:grid; grid-template-columns:96px 1fr 30px; gap:8px; align-items:center; margin-bottom:8px; }
.sfe-newsrow:last-child { margin-bottom:0; }
.sfe-in--d { font-size:12px; }
.sfe-foot { display:flex; gap:10px; flex-wrap:wrap; padding-top:2px; }
.sfe-preview { position:sticky; top:8px; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; box-shadow:0 18px 50px -30px rgba(20,40,90,.4); }
.sfe-preview__bar { display:flex; align-items:center; gap:7px; padding:9px 14px; background:#f6f8fc; border-bottom:1px solid var(--line); }
.sfe-dot { width:10px; height:10px; border-radius:50%; }
.sfe-dot.r { background:#ec6a5e; } .sfe-dot.y { background:#f4be4f; } .sfe-dot.g { background:#61c554; }
.sfe-url { margin-left:8px; font-size:11.5px; color:var(--dim); font-weight:600; }
.sfe-preview__scale { height:calc(100vh - 200px); min-height:520px; overflow:auto; background:#eef1f6; }
.sfe-preview__scale .sfsite { border:none; border-radius:0; box-shadow:none; transform:scale(.72); transform-origin:top left; width:138.9%; }
@media (max-width:1180px){ .sfe { grid-template-columns:1fr; } .sfe-preview { position:static; } .sfe-preview__scale { height:auto; max-height:560px; } }

/* ---- ศูนย์การเชื่อมต่อ (integrations hub) ---- */
.intg-flow { display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:12px 16px; box-shadow:var(--sh-sm); margin-bottom:16px; }
.intg-flow b { color:var(--dim); font-size:14px; }
.intg-flow__step { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:700; color:var(--ink-2); }
.intg-flow__ic { width:28px; height:28px; border-radius:8px; background:var(--surface-3); color:var(--navy-700); display:grid; place-items:center; }
.intg-flow__step--live { color:var(--navy-700); }
.intg-flow__step--live .intg-flow__ic { background:var(--navy-700); color:#fff; }
.intg-flow__pend { margin-left:auto; font-size:11.5px; font-weight:700; color:var(--gold-600); background:#fff7e6; border:1px solid #f0dca8; border-radius:var(--r-pill); padding:4px 11px; }
.intg-group { margin-bottom:18px; }
.intg-group__hd { display:flex; align-items:baseline; gap:10px; margin-bottom:10px; }
.intg-group__hd b { font-size:13.5px; font-weight:800; color:var(--ink); }
.intg-group__hd span { font-size:11.5px; color:var(--dim); }
.intg-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:13px; }
.intg-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:14px; box-shadow:var(--sh-sm); display:flex; flex-direction:column; gap:11px; transition:.15s; }
.intg-card.is-off { background:var(--surface-2); }
.intg-card__top { display:flex; align-items:flex-start; gap:10px; }
.intg-card__mark { width:34px; height:34px; flex:none; border-radius:9px; display:grid; place-items:center; font-weight:800; font-size:14px; font-family:"Noto Sans",sans-serif; }
.intg-card__id { flex:1; min-width:0; }
.intg-card__id b { display:block; font-size:13px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.intg-card__id span { font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.intg-card__status { flex:none; display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:700; border-radius:var(--r-pill); padding:3px 8px; }
.intg-card__dot { width:6px; height:6px; border-radius:50%; }
.intg-card__meta { display:flex; flex-direction:column; gap:5px; font-size:11px; color:var(--ink-2); }
.intg-card__meta span { display:flex; align-items:center; gap:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.intg-card__ft { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:10px; border-top:1px solid var(--line); }
.intg-switch { display:inline-flex; align-items:center; gap:7px; font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.intg-switch input { display:none; }
.intg-switch__track { width:34px; height:19px; border-radius:99px; background:var(--line-2); position:relative; transition:.18s; flex:none; }
.intg-switch__knob { position:absolute; top:2px; left:2px; width:15px; height:15px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:.18s; }
.intg-switch input:checked + .intg-switch__track { background:var(--ok,#1F8A5B); }
.intg-switch input:checked + .intg-switch__track .intg-switch__knob { left:17px; }
.intg-btn { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--navy-600); background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:11.5px; font-weight:700; border-radius:8px; padding:6px 12px; cursor:pointer; transition:.14s; }
.intg-btn:hover { filter:brightness(1.08); }
.intg-btn:disabled { opacity:.5; cursor:default; }
.intg-btn--ghost { background:#fff; color:var(--ink-2); border-color:var(--line-2); }
.intg-btn--ghost:hover { border-color:var(--navy-600); color:var(--navy-700); filter:none; }
.intg-clear { border:none; background:none; color:var(--dim); font-family:var(--ff); font-size:11.5px; font-weight:600; cursor:pointer; }
.intg-clear:hover { color:var(--danger); }
.intg-logch { display:inline-flex; align-items:center; gap:7px; font-weight:600; }
.intg-logch__d { width:18px; height:18px; flex:none; border-radius:5px; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:800; font-family:"Noto Sans",sans-serif; }
.intg-card__acts { display:flex; align-items:center; gap:7px; }
.intg-gear { width:30px; height:30px; flex:none; border:1px solid var(--line-2); background:#fff; border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; transition:.14s; }
.intg-gear:hover { border-color:var(--navy-600); color:var(--navy-700); }
.intg-tokenmodal { width:min(480px,96vw); }
.intg-fld { margin-bottom:12px; }
.intg-fld > label { display:block; font-size:11px; font-weight:700; color:var(--dim); margin-bottom:5px; }
.intg-fld__in { position:relative; display:flex; align-items:center; }
.intg-fld input, .intg-fld textarea { width:100%; font-family:var(--ff); font-size:13px; color:var(--ink); background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; outline:none; transition:.14s; }
.intg-fld input.mono, .intg-fld textarea.mono { font-family:"Noto Sans Mono","Menlo",monospace; font-size:12px; }
.intg-fld textarea { resize:vertical; line-height:1.5; }
.intg-fld input:focus, .intg-fld textarea:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.intg-fld__in input { padding-right:38px; }
.intg-fld__eye { position:absolute; right:6px; width:28px; height:28px; border:none; background:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; }
.intg-fld__eye:hover { color:var(--navy-700); }
.intg-tokenmodal__note { display:flex; align-items:flex-start; gap:7px; font-size:11px; line-height:1.5; color:var(--ink-2); background:var(--surface-2); border-radius:var(--r-md); padding:9px 11px; margin-top:4px; }
.intg-histmodal { width:min(760px,97vw); max-height:88vh; }
.intg-histbar { display:flex; align-items:center; gap:10px; padding:11px 17px; border-bottom:1px solid var(--line); background:var(--surface-2); flex-wrap:wrap; }
.intg-histbar select { font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:7px 10px; cursor:pointer; }
.intg-histsearch { flex:1; min-width:160px; display:flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:7px 11px; }
.intg-histsearch input { flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); min-width:0; }
.intg-histcount { font-size:11.5px; font-weight:700; color:var(--dim); white-space:nowrap; }
.intg-histbody { overflow:auto; padding:0 4px; }
.finrefund { display:flex; align-items:center; gap:13px; padding:13px 16px; margin-bottom:20px; background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--danger,#D14343); border-radius:var(--r-lg); box-shadow:var(--sh-sm); cursor:pointer; transition:.14s; }
.finrefund:hover { background:var(--surface-2); }
.finrefund__ic { width:34px; height:34px; flex:none; border-radius:9px; background:var(--danger-bg); color:var(--danger-ink,#C0392B); display:grid; place-items:center; }
.finrefund b { display:block; font-size:13px; font-weight:700; color:var(--ink); }
.finrefund span { font-size:11.5px; color:var(--dim); }
.promolock { display:flex; align-items:flex-start; gap:9px; font-size:12.5px; line-height:1.55; color:var(--ink-2); background:var(--info-bg); border:1px solid #bcd6f0; border-radius:var(--r-md); padding:11px 14px; }
.promolock b { color:var(--navy-700); font-weight:700; }
.promolock__lnk { border:none; background:none; padding:0; font-family:var(--ff); font-size:12.5px; font-weight:800; color:var(--navy-600); cursor:pointer; text-decoration:underline; }
.promolock__lnk:hover { color:var(--gold-700,#A8852F); }
/* product master — น้ำหนัก & ขนาด */
.prodship { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.prodship__c { background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:8px 10px; display:flex; flex-direction:column; gap:2px; }
.prodship__c span { font-size:10.5px; color:var(--dim); }
.prodship__c b { font-size:13px; font-weight:700; color:var(--ink); }
.prodship__c--hi { background:var(--info-bg); border-color:#bcd6f0; }
.prodship__c--hi b { color:var(--navy-700); }
.prodship__edit { display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:11px; font-weight:700; border-radius:7px; padding:4px 9px; cursor:pointer; }
.prodship__edit:hover { border-color:var(--navy-600); }
/* ship dims modal */
.shipfld { margin-bottom:10px; }
.shipfld > label, .shipfld__lb { display:block; font-size:11px; font-weight:700; color:var(--dim); margin-bottom:5px; }
.shipfld input { width:120px; height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 11px; font-family:"Noto Sans",sans-serif; font-size:14px; outline:none; }
.shipfld input:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.shipdim3 { display:flex; align-items:flex-end; gap:8px; margin-bottom:14px; }
.shipdim3 b { color:var(--dim); padding-bottom:18px; }
.shipdim3 > div { flex:1; display:flex; flex-direction:column; gap:4px; }
.shipdim3 input { width:100%; height:38px; border:1px solid var(--line-2); border-radius:9px; padding:0 10px; font-family:"Noto Sans",sans-serif; font-size:14px; outline:none; text-align:center; }
.shipdim3 input:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.shipdim3 span { font-size:10.5px; color:var(--dim); text-align:center; }
.shipcalc { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:11px 13px; display:flex; flex-direction:column; gap:7px; }
.shipcalc > div { display:flex; align-items:center; justify-content:space-between; font-size:12.5px; color:var(--ink-2); }
.shipcalc > div b { font-weight:700; color:var(--ink); }
.shipcalc--hi { border-top:1px solid var(--line); padding-top:7px; }
.shipcalc--hi b { color:var(--navy-700); font-size:14px; }
.pgship { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.pgship__row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pgship__row:last-child .pgship__edit { margin-left:auto; }
.pgship__v { font-size:12.5px; font-weight:600; color:var(--ink); }
.pgship__chg { font-size:10.5px; font-weight:700; color:var(--navy-700); background:var(--info-bg); border:1px solid #bcd6f0; border-radius:var(--r-pill); padding:2px 8px; }
.pgship__edit { display:inline-flex; align-items:center; gap:3px; border:1px solid var(--line-2); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:10.5px; font-weight:700; border-radius:6px; padding:2px 7px; cursor:pointer; }
.pgship__edit:hover { border-color:var(--navy-600); }
/* น้ำหนัก/ส่ง — บรรทัดเดียวประหยัดพื้นที่ */
.pgship--1line { flex-direction:row; align-items:center; flex-wrap:wrap; gap:7px 9px; }
.pgship__seg { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; color:var(--ink); white-space:nowrap; }
.pgship__seg .pgship__carrierlogo { margin-left:1px; }
.pgship--1line .pgship__carrier--auto { color:var(--dim); font-weight:600; }
.pgship--1line .pgship__edit--ic { margin-left:auto; padding:4px; }
.pgship__chg--ic { display:inline-flex; align-items:center; gap:4px; }
@media (max-width:1280px){ .intg-cards { grid-template-columns:repeat(3,1fr); } }
@media (max-width:980px){ .intg-cards { grid-template-columns:repeat(2,1fr); } }

/* ---- ศูนย์ขายออนไลน์ (online ops) ---- */
.oops-pack { }
.oops-cctv { display:flex; gap:18px; }
.oops-cctv__scr { flex:none; width:300px; height:180px; border-radius:14px; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  background:linear-gradient(160deg,#1a2233,#0c0f16); color:#fff; overflow:hidden; }
.oops-cctv__live { position:absolute; top:10px; left:12px; font-size:11px; font-weight:700; color:#ff5a5a; }
.oops-cctv__lbl { font-size:11.5px; color:rgba(255,255,255,.6); }
.oops-cctv__scr::after { content:""; position:absolute; inset:0; background:repeating-linear-gradient(0deg,transparent 0 3px,rgba(255,255,255,.03) 3px 4px); pointer-events:none; }
.oops-cctv__info { flex:1; }
.oops-cctv__info b { font-size:14.5px; color:var(--ink); }
.oops-cctv__info p { font-size:12.5px; color:var(--ink-2); line-height:1.6; margin:5px 0 10px; }
.oops-cctv__info p b { color:var(--navy-700); }
.oops-checks { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.oops-checks span { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink); }
.oops-ev { display:flex; gap:5px; }
.oops-ev__b { width:26px; height:26px; border-radius:7px; display:grid; place-items:center; cursor:pointer; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); }
.oops-ev__b:hover { border-color:var(--gold-400); color:var(--gold-600); }
.oops-ev__b.off { opacity:.4; cursor:default; }
.badge--muted { background:var(--surface-2); color:var(--dim); }
.oops-flow { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.oops-flowbar { display:flex; align-items:center; gap:9px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 15px; }
.oops-flowbar > b { color:var(--dim); font-weight:700; }
.oops-fb { display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; }
.oops-fb__ic { width:30px; height:30px; border-radius:8px; display:grid; place-items:center; background:var(--surface-2); color:var(--navy-700); flex:none; }
.oops-fb--live { color:var(--gold-600); }
.oops-fb--live .oops-fb__ic { background:var(--gold-500); color:#3a2700; }

/* ---- จัดซื้อ PO ---- */
.po-frm { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.po-frm label { display:flex; flex-direction:column; gap:4px; font-size:11.5px; font-weight:600; color:var(--ink-2); }
.po-frm > label > input { width:100%; height:36px; box-sizing:border-box; border:1px solid var(--line-2); border-radius:8px; padding:0 10px; font-family:var(--ff); font-size:12.5px; color:var(--ink); background:#fff; outline:none; }
.po-frm > label > input::placeholder { color:var(--dim); }
.po-frm > label > input:focus { border-color:var(--gold-400); box-shadow:0 0 0 3px var(--gold-glow); }
.po-frm select { height:36px; border:1px solid var(--line-2); border-radius:8px; padding:0 8px; font-family:var(--ff); font-size:12.5px; color:var(--ink); background:#fff; }
.po-vat { font-size:11.5px; font-weight:600; padding:8px 11px; border-radius:8px; background:var(--surface-2); }
.po-items { margin-top:2px; }
.po-in { width:100%; border:1px solid var(--line-2); border-radius:7px; height:30px; padding:0 8px; font-family:var(--ff); font-size:12.5px; outline:none; }
.po-in:focus { border-color:var(--gold-500); }
.po-in--n { text-align:right; }
.po-del { width:22px; height:22px; border-radius:6px; border:none; background:var(--danger-bg,#fdeceb); color:var(--danger,#d14343); cursor:pointer; font-size:11px; }
.po-add { font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:1px dashed var(--line-2); border-radius:8px; padding:7px 12px; cursor:pointer; font-family:var(--ff); }
.po-add:hover { border-color:var(--gold-400); color:var(--gold-600); }
.po-total { display:flex; align-items:center; justify-content:space-between; padding:11px 14px; background:var(--surface-2); border-radius:10px; font-size:13px; color:var(--ink-2); }
.po-total b { font-size:17px; color:var(--navy-700); }
.po-frm .billpick label { display:flex; flex-direction:column; gap:5px; }
.po-frm .billpick input { width:100%; }
.po-reorder { border:1px solid var(--line); border-radius:11px; background:var(--surface-2); padding:10px 12px; display:flex; flex-direction:column; gap:7px; max-height:230px; overflow:auto; }
.po-reorder__hd { font-size:11.5px; font-weight:700; color:var(--ink-2); display:flex; align-items:center; gap:6px; }
.po-ro { display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:8px 11px; }
.po-ro__name { font-size:13px; font-weight:700; display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.po-ro__sub { font-size:11px; color:var(--dim); margin-top:1px; }
.po-urg { font-size:9.5px; font-weight:800; color:#fff; background:var(--danger); border-radius:5px; padding:2px 6px; }
.po-okk { font-size:9.5px; font-weight:700; color:#1F8A5B; background:var(--ok-bg); border-radius:5px; padding:2px 6px; }
.po-tags { display:flex; align-items:center; gap:8px; }
.po-tags__lbl { font-size:12px; font-weight:600; color:var(--ink-2); }
.po-tag { font-size:11.5px; font-weight:700; border:1.5px solid var(--line-2); background:var(--surface); color:var(--dim); border-radius:var(--r-pill); padding:5px 13px; cursor:pointer; font-family:var(--ff); }
.po-tag--urgent.is-on { border-color:var(--danger); background:var(--danger-bg); color:var(--danger); }
.po-tag--hold.is-on { border-color:var(--navy-600); background:#eef3fb; color:var(--navy-700); }
/* แท็กในตารางใบ PO — ไม่ให้ขอบล่างชิป โดนตัด + เพิ่มระยะห่างระหว่างบรรทัด */
.tbl--potags tbody td { padding-top:16px; padding-bottom:16px; }
.tbl--potags .cell-main { overflow:visible; line-height:1.45; }
.tbl--potags .cell-main .po-tag { display:inline-flex; align-items:center; vertical-align:middle; line-height:1; }
/* บรรทัดรอง: วันที่ (เน้น) · ชื่อเจ้าหนี้ (ตัดท้ายถ้ายาว) · จำนวนรายการ */
.po-sub { display:flex; align-items:center; gap:6px; min-width:0; }
.po-sub__date { flex:none; font-weight:600; color:var(--ink-2); white-space:nowrap; }
.po-sub__sup { min-width:0; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.po-sub__cnt { flex:none; color:var(--dim); white-space:nowrap; }
.po-sub__sep { flex:none; color:var(--line-2); }

/* ---- ติดตามการสั่งซื้อ — รายตัวอะไหล่ : การ์ดหลายบรรทัด (สไตล์เดียวกับแฟ้มสินค้า) ---- */
.potrk-list { display:flex; flex-direction:column; gap:8px; padding:12px 14px; }
.potrk-card { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(112px,auto); column-gap:16px; row-gap:5px; align-items:center; padding:11px 15px; border:1px solid var(--line); border-radius:11px; }
.potrk-c { min-width:0; font-size:12px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.potrk-lbl { color:var(--dim); font-weight:600; font-size:10.5px; margin-right:5px; }
/* บรรทัด 1: รหัส + ป้าย PO/BO · ชื่อสินค้า · ยี่ห้อ */
.potrk-c--code { display:flex; align-items:center; gap:7px; overflow:visible; }
.potrk-code { font-weight:800; color:var(--navy-700); font-size:13px; }
.potrk-kind { font-size:9px; font-weight:800; padding:1px 5px; line-height:1.5; }
.potrk-c--name { font-weight:700; color:var(--ink); font-size:13px; }
.potrk-c--brand { text-align:right; color:var(--ink-2); font-weight:600; }
/* บรรทัด 2: ผู้ขาย · รุ่น/รถ · สถานะสั่ง */
.potrk-c--ord { text-align:right; }
.potrk-ok { color:var(--ok-ink); font-weight:700; }
.potrk-pend { color:var(--dim); font-weight:600; }
/* บรรทัด 3: วันที่+เลขที่ใบสั่งซื้อ · ราคา×จำนวน · รับ */
.potrk-c--doc { display:flex; align-items:center; gap:8px; overflow:visible; }
.potrk-date { color:var(--dim); font-weight:600; flex:none; }
.potrk-link { display:inline-flex; align-items:center; gap:3px; border:none; background:none; padding:0; cursor:pointer; color:var(--navy-600); font-weight:700; font-family:inherit; font-size:12px; text-decoration:underline; text-underline-offset:2px; }
.potrk-c--price .thb { color:var(--navy-700); font-weight:700; }
.potrk-x { color:var(--dim); margin-left:6px; font-size:11px; }
.potrk-c--recv { text-align:right; font-weight:700; }
.potrk-recv-ok { color:var(--ok-ink); }
.potrk-recv-part { color:var(--warn-ink); }
.potrk-recv-no { color:#C0392B; }

/* ---- PO/BO lifecycle timeline (expanded row: ออก→รับของ→ตั้งหนี้→จ่าย) ---- */
.po-life { display:flex; align-items:flex-start; gap:0; padding:4px 2px 2px; }
.po-life__node { display:flex; flex-direction:column; align-items:center; gap:4px; flex:none; width:96px; text-align:center; }
.po-life__dot { width:24px; height:24px; border-radius:99px; display:grid; place-items:center; font-size:11px; font-weight:800; font-family:'Noto Sans',var(--ff); background:var(--surface-3); color:var(--dim); border:2px solid transparent; }
.po-life__node.is-on .po-life__dot { background:var(--ok); color:#fff; }
.po-life__k { font-size:11px; font-weight:700; color:var(--dim); }
.po-life__node.is-on .po-life__k { color:var(--ink); }
.po-life__sub { font-size:10px; color:var(--line-2); }
.po-life__node.is-on .po-life__sub { color:var(--navy-600); }
.po-life__line { flex:1; height:2px; background:var(--line-2); margin-top:11px; min-width:18px; }
.po-life__line.is-on { background:var(--ok); }
.po-rcv { font-size:9.5px; font-weight:800; color:var(--ok); background:var(--ok-bg,#e8f7ee); border-radius:99px; padding:1px 7px; margin-left:7px; vertical-align:middle; }

/* ---- จ่ายเจ้าหนี้ modal — meta row ---- */
.po-paymeta { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; background:var(--surface-2); border-radius:10px; padding:11px 13px; margin-bottom:12px; }
.po-paymeta > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.po-paymeta__full { grid-column:1 / -1; }
.po-paymeta span { font-size:10.5px; color:var(--dim); }
.po-paymeta b { font-size:12.5px; color:var(--ink); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.oops-flow__step--live { border-color:var(--gold-400); background:#fffdf6; }
.oops-flow__step--live span { background:var(--gold-500); color:#3a2700; }
.oops-flow__ar { color:var(--dim); font-size:18px; }
.oops-price { display:inline-flex; align-items:center; gap:2px; border:1.5px solid var(--line-2); border-radius:8px; padding:0 8px; background:#fff; }
.oops-price span { color:var(--dim); font-size:12px; }
.oops-price input { width:64px; border:none; outline:none; text-align:right; font-family:"Sarabun",var(--ff); font-size:14px; font-weight:700; color:var(--navy-700); padding:6px 0; background:none; }
.oops-chans { display:flex; gap:4px; }
.oops-fee { color:var(--danger,#b42318); font-weight:700; }
.oops-chan { font-size:10px; font-weight:700; padding:3px 7px; border-radius:6px; }
.oops-chan.on { background:#e8f7ee; color:#1F7A4D; }
.oops-chan.off { background:var(--surface-2); color:var(--line-2); text-decoration:line-through; }
.oops-alert { display:flex; align-items:center; gap:9px; font-size:13px; color:var(--ink); background:var(--surface-2); border:1px solid var(--line); border-radius:11px; padding:11px 14px; }
.oops-alert b { color:var(--navy-700); }
.oops-rt__ic { width:42px; height:42px; border-radius:11px; flex:none; display:grid; place-items:center; }
.oops-fee__plat { width:40px; height:40px; border-radius:11px; flex:none; display:grid; place-items:center; color:#fff; font-weight:800; font-size:17px; font-family:"Sarabun",var(--ff); }

/* ---- แดชบอร์ดจัดส่ง (delivery board) ---- */
.dlv-grid { display:grid; grid-template-columns:1fr 320px; gap:16px; align-items:start; }
.dlv-job { display:flex; align-items:center; gap:14px; padding:13px 16px; border-bottom:1px solid var(--line); cursor:pointer; }
.dlv-job:hover { background:var(--surface); }
.dlv-job:last-child { border-bottom:none; }
.dlv-job__l { flex:1; min-width:0; }
.dlv-job__top { display:flex; align-items:center; gap:8px; }
.dlv-job__top b { font-size:13px; font-weight:700; color:var(--ink); }
.dlv-job__sub { font-size:11.5px; color:var(--ink-2); margin-top:2px; }
.dlv-steps { display:flex; gap:4px; margin-top:7px; }
.dlv-step { width:30px; height:4px; border-radius:3px; background:var(--line-2); }
.dlv-step.on { background:#2D6CB5; }
.dlv-step.on.err { background:#D14343; }
.dlv-job__r { text-align:right; flex:none; }
.dlv-job__drv { font-size:11px; color:var(--ink-2); display:inline-flex; align-items:center; gap:4px; }
.dlv-job__eta { font-size:12px; font-weight:700; margin-top:3px; }
.dlv-ev { display:inline-flex; align-items:center; gap:4px; margin-top:5px; font-size:10.5px; font-weight:700; color:#1F7A4D; background:#e8f7ee; padding:3px 8px; border-radius:7px; cursor:pointer; }
.dlv-ev--wait { color:var(--dim); background:var(--surface-2); cursor:default; }
.dlv-call { margin-top:5px; font-size:10.5px; font-weight:700; color:#fff; background:#D14343; border:none; padding:4px 10px; border-radius:7px; cursor:pointer; font-family:var(--ff); }
.dlv-drv { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:11px; background:var(--surface); border:1px solid var(--line); }
.dlv-drv.off { opacity:.55; }
.dlv-drv__av { position:relative; width:36px; height:36px; border-radius:50%; flex:none; display:grid; place-items:center; font-weight:800; color:#fff; background:linear-gradient(140deg,#1b305c,#0b3d91); font-family:"Sarabun",var(--ff); }
.dlv-drv__av i { position:absolute; right:-1px; bottom:-1px; width:11px; height:11px; border-radius:50%; background:var(--line-2); border:2px solid #fff; }
.dlv-drv__av i.on { background:#34c759; }
.dlv-drv__tx { flex:1; min-width:0; }
.dlv-drv__tx b { display:block; font-size:12.5px; color:var(--ink); }
.dlv-drv__tx span { font-size:10.5px; color:var(--dim); }
.dlv-drv__j { text-align:center; flex:none; }
.dlv-drv__j b { font-size:16px; font-weight:800; color:var(--navy-700); font-family:"Sarabun",var(--ff); }
.dlv-drv__j span { display:block; font-size:9.5px; color:var(--dim); }
.dlv-drv__offt { font-size:11px; color:var(--dim); }
.dlv-assign { margin-top:4px; padding:10px; border-radius:10px; border:1px dashed var(--line-2); background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-600); }
.dlv-assign:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
@media (max-width:1100px){ .dlv-grid{ grid-template-columns:1fr; } }
.sf-admincards { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.sf-admincard { display:flex; align-items:center; gap:13px; padding:16px; border-radius:14px; cursor:pointer; text-align:left;
  background:#fff; border:1px solid var(--line); transition:.14s; font-family:var(--ff); }
.sf-admincard:hover { border-color:var(--gold-400); transform:translateY(-2px); box-shadow:0 12px 26px -16px rgba(20,40,90,.4); }
.sf-admincard__ic { width:44px; height:44px; border-radius:12px; flex:none; display:grid; place-items:center; color:var(--navy-700); background:var(--surface-2); }
.sf-admincard__tx { flex:1; min-width:0; }
.sf-admincard__tx b { display:block; font-size:14px; color:var(--ink); }
.sf-admincard__tx span { display:block; font-size:11.5px; color:var(--dim); margin:2px 0; }
.sf-admincard__tx i { font-style:normal; font-size:11px; font-weight:700; color:var(--gold-600); }
.sf-admincard__go { color:var(--dim); font-size:18px; }
@media (max-width:1100px){ .sf-grid{grid-template-columns:repeat(auto-fill,minmax(158px,1fr));} .sf-promorow,.sf-admincards{grid-template-columns:1fr 1fr;} .sf-member,.sf-about,.sf-hero{flex-direction:column;} .sf-join,.sf-loc{width:100%;} }
.dside__logouttx { flex:1; white-space:nowrap; overflow:hidden; text-align:left; }
.dapp.is-narrow .dside__logouttx { opacity:0; transition:opacity .12s ease; }
.dapp.is-narrow.is-open .dside__logouttx,
.dapp.is-narrow .dside:hover .dside__logouttx { opacity:1; }
.dapp.is-narrow .dside__logoutbtn { justify-content:flex-start; }
/* ---------- POS barcode scan bar ---------- */
.scanbar { display:flex; align-items:center; gap:10px; margin:12px; padding:11px 14px; border-radius:var(--r-md); border:1.5px solid var(--gold-400); background:linear-gradient(0deg,#fffdf6,#fff); box-shadow:0 0 0 3px var(--gold-glow); }
.scanbar input { flex:1; border:none; outline:none; background:none; font-family:"Noto Sans",var(--ff); font-size:14px; font-weight:600; letter-spacing:.5px; color:var(--navy-800); min-width:0; }
.scanbar input::placeholder { font-family:var(--ff); font-weight:500; letter-spacing:0; color:var(--dim); }
.scanbar__hint { flex:none; font-size:10.5px; font-weight:700; color:var(--gold-600); background:#fdf6e6; border-radius:99px; padding:3px 9px; }
/* POS frequent-search chips (custom favorites) */
.freqbar { display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding:0 0 10px; margin-bottom:10px; border-bottom:1px dashed var(--line-2); }
.freqbar--inbar { padding:0 16px 11px; margin-bottom:0; border-bottom:none; }
.freqbar__lbl { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--ink-2); margin-right:2px; }
.freqchip { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); border-radius:var(--r-pill); background:var(--surface); cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink-2); padding:6px 13px; transition:.12s; }
.freqchip:hover { border-color:var(--gold-400); }
.freqchip--t.is-on { border-color:var(--gold-500); background:#fdf6e6; color:var(--gold-600); }
.freqchip--del { border-color:#e6b4b4; color:var(--danger); background:#fdeceb; }
.freqchip--del:hover { background:#f9dcdb; border-color:var(--danger); }
.freqchip--delmode { color:var(--dim); }
.freqchip--delmode:hover { border-color:#e6b4b4; color:var(--danger); }
.freqchip--delmode.is-on { background:var(--danger-bg); border-color:#e6b4b4; color:var(--danger); }
.freqchip--add { border-style:dashed; border-color:var(--gold-400); color:var(--gold-600); }
.freqchip--add:hover { background:#fffdf6; }
/* bank dropdown + slip lightbox */
.banksel { width:100%; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink); padding:10px 12px; border:1.5px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); outline:none; cursor:pointer; }
.banksel:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.slipzoom { position:absolute; top:5px; right:5px; width:26px; height:26px; border-radius:7px; border:none; background:rgba(13,29,60,.72); color:#fff; display:grid; place-items:center; cursor:pointer; backdrop-filter:blur(2px); transition:background .12s; }
.slipzoom:hover { background:var(--navy-800); }
.slipread { position:absolute; inset:0; border-radius:14px; background:rgba(13,29,60,.78); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:#fff; pointer-events:none; }
.slipread__spin { width:24px; height:24px; border-radius:50%; border:2.5px solid rgba(255,255,255,.28); border-top-color:#fff; animation:slipspin .7s linear infinite; }
.slipread__t { font-size:10.5px; font-weight:700; letter-spacing:.02em; }
@keyframes slipspin { to { transform:rotate(360deg); } }
.slipauto { display:flex; align-items:center; gap:8px; margin-top:10px; padding:8px 11px; background:var(--ok-bg); border:1px solid #bfe3cf; border-radius:9px; }
.slipauto__t { flex:1; min-width:0; font-size:11px; font-weight:700; color:var(--ok-ink); line-height:1.4; }
.slipauto__re { display:inline-flex; align-items:center; gap:4px; flex:none; border:1px solid #bfe3cf; background:#fff; border-radius:7px; padding:4px 9px; font-family:var(--ff); font-size:10.5px; font-weight:700; color:var(--ok-ink); cursor:pointer; }
.slipauto__re:hover { background:#f2fbf6; }
.sliplb { position:fixed; inset:0; z-index:140; background:rgba(8,15,30,.82); backdrop-filter:blur(3px); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; padding:28px; cursor:zoom-out; }
.sliplb__bar { display:flex; align-items:center; gap:14px; color:#fff; font-family:var(--ff); font-size:13.5px; font-weight:600; }
.sliplb__bar span { display:inline-flex; align-items:center; gap:7px; }
.sliplb__x { width:32px; height:32px; border-radius:9px; border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.1); color:#fff; display:grid; place-items:center; cursor:pointer; }
.sliplb__x:hover { background:rgba(255,255,255,.2); }
.sliplb img { max-width:min(560px,90vw); max-height:74vh; border-radius:12px; box-shadow:0 18px 60px rgba(0,0,0,.5); cursor:default; background:#fff; }
.sliplb__hint { color:rgba(255,255,255,.6); font-family:var(--ff); font-size:12px; }
/* slip camera button + upload/view popup (doc workbench transfer row) */
.slipbtn { width:22px; height:22px; flex:none; border-radius:5px; padding:0; cursor:pointer; display:grid; place-items:center; border:1px dashed var(--line-2); background:var(--surface-2); color:var(--navy-600); overflow:hidden; transition:.14s; }
.slipbtn:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.slipbtn--has { border:1px solid var(--ok,#1F8A5B); background:none; }
.slipbtn--has img { width:100%; height:100%; object-fit:cover; }
.slipmodal-ov { position:fixed; inset:0; z-index:410; background:rgba(15,23,42,.55); backdrop-filter:blur(2px); display:grid; place-items:center; padding:30px; }
.slipmodal { width:min(440px,94vw); background:var(--surface); border-radius:15px; box-shadow:0 24px 70px rgba(10,22,50,.4); overflow:hidden; }
.slipmodal__hd { display:flex; align-items:center; justify-content:space-between; padding:14px 17px; border-bottom:1px solid var(--line); }
.slipmodal__hd b { font-size:14px; font-weight:800; color:var(--ink); }
.slipmodal__x { width:30px; height:30px; border:none; background:var(--surface-2); border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; }
.slipmodal__x:hover { background:var(--surface-3); }
.slipmodal__bd { padding:17px; }
.slipdrop { display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; border:2px dashed var(--line-2); border-radius:13px; padding:30px 20px; cursor:pointer; background:var(--surface-2); transition:.15s; }
.slipdrop:hover { border-color:var(--gold-400); background:#fffdf6; }
.slipdrop.is-drag { border-color:var(--navy-600); background:var(--info-bg); }
.slipdrop__ic { width:58px; height:58px; border-radius:50%; background:var(--surface); display:grid; place-items:center; box-shadow:var(--sh-sm); margin-bottom:2px; }
.slipdrop b { font-size:14px; font-weight:700; color:var(--ink); }
.slipdrop__sub { font-size:11.5px; color:var(--dim); line-height:1.5; }
.slipdrop__btn { margin-top:8px; display:inline-flex; align-items:center; gap:6px; border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; border-radius:9px; padding:9px 16px; cursor:pointer; }
.slipdrop__btn:hover { filter:brightness(1.08); }
.slipview { display:flex; flex-direction:column; gap:12px; }
.slipview img { width:100%; max-height:52vh; object-fit:contain; border-radius:10px; border:1px solid var(--line); background:repeating-linear-gradient(135deg,#f6f8fc 0 10px,#f1f4fa 10px 20px); cursor:zoom-in; }
.slipview__acts { display:flex; gap:8px; }
.slipbtn2 { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-family:var(--ff); font-size:12px; font-weight:700; border-radius:9px; padding:8px 6px; cursor:pointer; transition:.14s; }
.slipbtn2:hover { border-color:var(--navy-600); color:var(--navy-700); }
.slipbtn2--del:hover { border-color:var(--danger); color:var(--danger); background:var(--danger-bg); }
/* promo enrollment modal */
.promomodal__sub { font-size:12.5px; color:var(--dim); padding:8px 0 12px; }
.promomodal__sub b { color:var(--navy-700); }
.promolist { display:flex; flex-direction:column; gap:8px; padding:2px 20px; max-height:48vh; overflow-y:auto; }
.promoitem { display:flex; align-items:center; gap:12px; width:100%; text-align:left; font-family:var(--ff); background:var(--surface); border:1.5px solid var(--line-2); border-radius:var(--r-md); padding:11px 14px; cursor:pointer; transition:border-color .12s,background .12s; }
.promoitem:hover { border-color:#cfc4f0; background:#faf8ff; }
.promoitem.is-on { border-color:var(--violet); background:var(--violet-bg); }
.promoitem__chk { flex:none; width:20px; height:20px; border-radius:6px; border:1.5px solid var(--line-2); background:var(--surface); display:grid; place-items:center; }
.promoitem__chk.is-on { background:var(--violet); border-color:var(--violet); }
.promoitem__bd { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.promoitem__top { display:flex; align-items:center; gap:8px; }
.promoitem__nm { font-size:13.5px; font-weight:700; color:var(--ink); }
.promoitem__kind { font-family:var(--ff); font-size:10px; font-weight:800; color:#4a3a9e; background:var(--violet-bg); border:1px solid #cfc4f0; border-radius:99px; padding:1px 8px; flex:none; }
.promoitem.is-on .promoitem__kind { background:#fff; }
.promoitem__detail { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.promoitem__period { flex:none; font-family:var(--ff); font-size:11px; font-weight:600; color:var(--ink-2); background:var(--surface-2); border-radius:6px; padding:4px 9px; white-space:nowrap; }
.promomodal__ft { display:flex; align-items:center; gap:10px; padding:14px 20px 18px; margin-top:4px; border-top:1px solid var(--line); }
.promomodal__cnt { font-size:12.5px; font-weight:700; color:var(--navy-700); }
/* ---------- AI กูรูอะไหล่ chat ---------- */
.aichat { display:flex; flex-direction:column; height:min(740px, calc(100vh - 196px)); }
.aichat__feed { flex:1; min-height:0; overflow-y:auto; padding:18px 20px; display:flex; flex-direction:column; gap:16px; }
.aimsg { display:flex; gap:11px; max-width:82%; }
.aimsg--user { align-self:flex-end; flex-direction:row-reverse; }
.aimsg__ava { width:34px; height:34px; border-radius:10px; flex:none; display:grid; place-items:center; }
.aimsg__ava--ai { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.aimsg__ava--user { background:var(--navy-700); color:#fff; font-weight:700; font-size:13px; }
.aimsg__bubble { padding:11px 14px; border-radius:14px; font-size:13.5px; line-height:1.6; white-space:pre-wrap; word-break:break-word; }
.aimsg--ai .aimsg__bubble { background:var(--surface-2); color:var(--ink); border-top-left-radius:4px; }
.aimsg--user .aimsg__bubble { background:linear-gradient(135deg,#16294f,#0e1f3f); color:#fff; border-top-right-radius:4px; }
.aimsg__bubble b { font-weight:700; }
.aitype { display:inline-flex; gap:4px; align-items:center; padding:4px 2px; }
.aitype i { width:7px; height:7px; border-radius:50%; background:var(--dim); animation:aiblink 1.2s infinite both; }
.aitype i:nth-child(2){ animation-delay:.2s; } .aitype i:nth-child(3){ animation-delay:.4s; }
@keyframes aiblink { 0%,80%,100%{ opacity:.25; transform:translateY(0);} 40%{ opacity:1; transform:translateY(-3px);} }
.aichips { display:flex; flex-wrap:wrap; gap:8px; padding:0 20px 12px; }
.aichip { font-family:var(--ff); font-size:12.5px; font-weight:500; text-align:left; padding:8px 13px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer; transition:border-color .12s,background .12s; }
.aichip:hover { border-color:var(--gold-400); background:#fffdf6; }
.aibar { display:flex; gap:10px; align-items:flex-end; padding:14px 18px; border-top:1px solid var(--line); }
.aibar textarea { flex:1; resize:none; border:1px solid var(--line-2); border-radius:var(--r-md); padding:11px 14px; font-family:var(--ff); font-size:13.5px; line-height:1.5; color:var(--ink); outline:none; max-height:120px; background:var(--surface); }
.aibar textarea:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.aisend { width:44px; height:44px; flex:none; border:none; border-radius:var(--r-md); background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); display:grid; place-items:center; cursor:pointer; transition:transform .1s,opacity .12s; }
.aisend:hover { transform:translateY(-1px); } .aisend:active { transform:scale(.94); }
.aisend:disabled { opacity:.4; cursor:not-allowed; transform:none; }

/* =========================================================================
   กูรูอะไหล่ — workspace (chat + side rail), mascot avatar, stock cards
   ========================================================================= */
.guru-wrap { display:flex; flex-direction:column; }
.guru-clear { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--dim); background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-pill); padding:6px 12px; cursor:pointer; }
.guru-clear:hover { color:var(--navy-700); border-color:var(--navy-300,#aebfdb); }

/* ฐานความรู้กูรู — KB modal */
.gkb-modal { width:min(620px,96vw); }
.gkb-add { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:12px; }
.gkb-add__row { display:flex; gap:8px; margin-bottom:8px; }
.gkb-add__row select { flex:none; width:128px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:8px 9px; cursor:pointer; }
.gkb-add__row input { flex:1; min-width:0; font-family:var(--ff); font-size:13px; color:var(--ink); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:8px 11px; outline:none; }
.gkb-add textarea { width:100%; font-family:var(--ff); font-size:13px; color:var(--ink); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:8px 11px; outline:none; resize:vertical; line-height:1.45; }
.gkb-add__row input:focus, .gkb-add textarea:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.gkb-add__ft { display:flex; justify-content:flex-end; margin-top:8px; }
.gkb-list { margin-top:14px; }
.gkb-list__hd { display:flex; align-items:center; justify-content:space-between; margin-bottom:9px; }
.gkb-list__hd b { font-size:12.5px; font-weight:800; color:var(--ink); }
.gkb-reset { border:none; background:none; color:var(--dim); font-family:var(--ff); font-size:11.5px; font-weight:600; cursor:pointer; }
.gkb-reset:hover { color:var(--navy-700); }
.gkb-item { display:flex; align-items:flex-start; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); }
.gkb-item:last-child { border-bottom:none; }
.gkb-item__type { flex:none; font-size:10px; font-weight:800; border-radius:var(--r-pill); padding:3px 9px; white-space:nowrap; margin-top:1px; }
.gkb-item__bd { flex:1; min-width:0; }
.gkb-item__q { font-size:13px; font-weight:700; color:var(--ink); }
.gkb-item__a { font-size:12px; color:var(--ink-2); margin-top:3px; line-height:1.5; }
.gkb-item__edit { flex:1; }
.gkb-item__acts { flex:none; display:flex; gap:5px; }
.gkb-ic { width:26px; height:26px; border:1px solid var(--line-2); background:#fff; border-radius:7px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; transition:.14s; }
.gkb-ic:hover { border-color:var(--navy-600); color:var(--navy-700); }
.gkb-ic--del:hover { border-color:var(--danger); color:var(--danger); background:var(--danger-bg); }
.gkb-mini { font-family:var(--ff); font-size:12px; font-weight:700; color:#fff; background:var(--navy-700); border:none; border-radius:7px; padding:6px 13px; cursor:pointer; }
.gkb-mini--ghost { background:#fff; color:var(--ink-2); border:1px solid var(--line-2); }
.gkb-empty { display:flex; flex-direction:column; align-items:center; gap:8px; padding:30px; color:var(--dim); font-size:12.5px; text-align:center; }
.guru { display:grid; grid-template-columns:minmax(0,1fr) 288px; gap:16px; align-items:stretch; }
.guru__chat { display:flex; flex-direction:column; height:min(740px, calc(100vh - 196px)); }
.guru__chat .aichat__feed { gap:18px; }
.guru__chat--full { width:100%; height:calc(100vh - 236px); min-height:460px; }
.guru2 { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:14px; align-items:stretch; }
.guru__right { display:flex; flex-direction:column; gap:14px; min-width:0; }

/* compact tool bar: รถ · หมวด · อะไหล่ (2 scrollable rows) */
.gbar { display:flex; flex-direction:column; gap:5px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:8px 12px; margin-bottom:12px; }
.gbar__row { display:flex; align-items:center; gap:7px; overflow-x:auto; scrollbar-width:none; padding-bottom:1px; }
.gbar__row::-webkit-scrollbar { height:0; }
.gbar__lbl { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:800; color:var(--navy-800); white-space:nowrap; flex:none; }
.gbar__sep2 { width:1px; height:18px; background:var(--line); flex:none; margin:0 4px; }
.gbar__row .gtool__chip { flex:none; white-space:nowrap; }
/* แถว "อะไหล่ในร้าน" — ตัดขึ้นบรรทัดใหม่แทนเลื่อน/ล้นถูกตัด */
.gbar__row--wrap { flex-wrap:wrap; overflow:visible; row-gap:6px; }
.gbar__sel { flex:none; font-family:var(--ff); font-size:11.5px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-pill); padding:5px 11px; cursor:pointer; max-width:200px; }
.gbar__sel:hover { border-color:var(--gold-400); background:#fffdf6; }
/* 🟦 กูรูอะไหล่ — top panel: tool bar (ซ้าย) + มาสคอตสี่เหลี่ยมจัตุรัส (ขวาบน, ภาพล้วน ไม่มีหัว/ท้าย) */
.guruTopPanel { display:grid; grid-template-columns:minmax(0,1fr) 140px; align-items:start; gap:14px; margin-bottom:14px; }
.guruTopMain { margin-bottom:0; min-width:0; }
.guruTopMascot { position:relative; width:140px; height:140px; aspect-ratio:1/1; border-radius:16px; overflow:hidden; cursor:pointer; background:radial-gradient(120% 90% at 50% 12%,#f3f6fd,#e7edf8); border:1px solid var(--line); box-shadow:0 2px 8px rgba(15,23,42,.07); display:grid; place-items:center; }
.guruTopMascot:hover { border-color:var(--gold-400); }
.guruTopMascot .guru-mascot-stage { width:100%; height:100%; border-radius:0; background:none; }
.guruTopMascot--png { background:none; }
/* ช่องแยกจอ (fluid): ย่อมาสคอตตามความกว้างช่อง */
@container pane (max-width: 900px){
  .pane-fluid--aiguru .guruTopPanel { grid-template-columns:minmax(0,1fr) 120px; }
  .pane-fluid--aiguru .guruTopMascot { width:120px; height:120px; }
}
@container pane (max-width: 560px){
  .pane-fluid--aiguru .guruTopPanel { grid-template-columns:minmax(0,1fr) 96px; }
  .pane-fluid--aiguru .guruTopMascot { width:96px; height:96px; }
}

/* auto-fill phrase row above the composer */
.gauto { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:10px 18px 0; }
.gauto__lbl { display:inline-flex; align-items:center; font-size:11px; font-weight:800; color:var(--dim); margin-right:2px; }
.gauto__chip { font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px dashed var(--line-2); border-radius:var(--r-pill); padding:5px 11px; cursor:pointer; transition:.14s; }
.gauto__chip:hover { border-style:solid; border-color:var(--gold-400); background:#fffdf6; }

/* save-answer-to-note button under an AI message */
.gsavenote { align-self:flex-start; display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11px; font-weight:600; color:var(--dim); background:none; border:1px solid var(--line); border-radius:99px; padding:4px 10px; cursor:pointer; }
.gsavenote:hover { color:var(--navy-700); border-color:var(--gold-400); background:#fffdf6; }

/* embedded avatar card (top-right) */
.gav2 { flex:none; background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.gav2__bar { display:flex; align-items:center; gap:7px; padding:9px 12px; background:linear-gradient(120deg,#16294f,#0e1f3f); }
.gav2__title { flex:1; display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:#fff; }
.gav2__voice { width:26px; height:26px; flex:none; border:none; border-radius:8px; background:rgba(255,255,255,.12); color:#cdd8ef; display:grid; place-items:center; cursor:pointer; }
.gav2__voice.is-on { background:var(--gold-500); color:var(--navy-900); }
.gav2__btn { width:26px; height:26px; flex:none; border:none; border-radius:8px; background:rgba(255,255,255,.12); color:#cdd8ef; display:grid; place-items:center; cursor:pointer; transition:.14s; }
.gav2__btn:hover { background:rgba(255,255,255,.22); color:#fff; }
.gav2__btn.is-on { background:var(--gold-500); color:var(--navy-900); }
.gav2__stage { position:relative; aspect-ratio:1/1; height:auto; display:grid; place-items:center; background:radial-gradient(120% 90% at 50% 12%,#f3f6fd,#e7edf8); overflow:hidden; }
.gav2__stage::after { content:""; position:absolute; left:50%; bottom:14px; transform:translateX(-50%); width:118px; height:13px; border-radius:50%; background:rgba(20,40,90,.13); filter:blur(3px); }
.gav2__img { max-width:80%; max-height:80%; object-fit:contain; position:relative; z-index:1; border-radius:12px; }
.gav2__img.is-talk { animation:gbob .5s ease-in-out infinite; }
.gav2__img.is-think { animation:gtilt 2.4s ease-in-out infinite; }
.gav2__status { display:flex; align-items:center; gap:7px; padding:9px 13px; font-size:11.5px; font-weight:600; color:var(--navy-700); border-top:1px solid var(--line); }
.gav2__pulse { width:8px; height:8px; border-radius:50%; background:var(--ok-ink,#1F8A5B); }
.gav2__pulse--think { background:var(--gold-500); animation:gpulse 1s ease-in-out infinite; }
.gav2__pulse--talk { background:#2D6CB5; animation:gpulse .6s ease-in-out infinite; }
.gav2__tools { display:flex; gap:7px; padding:0 12px 12px; }
.gav2__tool { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:7px 8px; cursor:pointer; transition:.14s; }
.gav2__tool--ghost { flex:0 0 auto; color:var(--dim); }
.gav2__tool:hover { border-color:var(--gold-400); background:#fffdf6; }

/* ---- animated mascot panel (idle / thinking / speaking) — PNG-based ---- */
.gav2__stage--png { background:none; }
.gav2__stage--png::after { display:none; }
.guru-mascot-stage {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 65%, rgba(245, 164, 0, 0.13), transparent 46%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  isolation: isolate;
}
.guru-mascot-img {
  position: relative;
  z-index: 2;
  width: auto;
  height: auto;
  max-height: 86%;
  max-width: 86%;
  object-fit: contain;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 12px 16px rgba(15, 23, 42, 0.18));
  animation: guruIdleFloat 3.2s ease-in-out infinite;
  will-change: transform;
}
.guru-mascot-glow {
  position: absolute;
  z-index: 1;
  width: 96px;
  height: 34px;
  bottom: 16px;
  border-radius: 999px;
  background: rgba(11, 61, 145, 0.12);
  filter: blur(10px);
  transform: scale(1);
  animation: guruShadowPulse 3.2s ease-in-out infinite;
}
.guru-thinking-dots {
  position: absolute;
  z-index: 3;
  right: 28px;
  top: 18px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
.guru-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #0b3d91;
  animation: guruDotPulse 1s ease-in-out infinite;
}
.guru-thinking-dots span:nth-child(2) { animation-delay: 0.14s; }
.guru-thinking-dots span:nth-child(3) { animation-delay: 0.28s; }
.guru-mascot-stage[data-guru-state="idle"] .guru-mascot-img { animation: guruIdleFloat 3.2s ease-in-out infinite; }
.guru-mascot-stage[data-guru-state="thinking"] .guru-mascot-img { animation: guruThinking 1.35s ease-in-out infinite; }
.guru-mascot-stage[data-guru-state="thinking"] .guru-thinking-dots { opacity: 1; transform: translateY(0); }
.guru-mascot-stage[data-guru-state="thinking"] .guru-mascot-glow { background: rgba(245, 164, 0, 0.2); animation: guruThinkingGlow 1.35s ease-in-out infinite; }
.guru-mascot-stage[data-guru-state="speaking"] .guru-mascot-img { animation: guruSpeaking 0.8s ease-in-out infinite; }
.guru-mascot-stage[data-guru-state="speaking"] .guru-mascot-glow { background: rgba(34, 197, 94, 0.18); animation: guruSpeakingGlow 0.8s ease-in-out infinite; }
@keyframes guruIdleFloat { 0%,100% { transform: translateY(0) rotate(0deg) scale(1); } 50% { transform: translateY(-5px) rotate(-1deg) scale(1.015); } }
@keyframes guruShadowPulse { 0%,100% { transform: scale(0.95); opacity: 0.55; } 50% { transform: scale(1.08); opacity: 0.35; } }
@keyframes guruThinking { 0%,100% { transform: translateY(0) rotate(-2deg) scale(1); } 50% { transform: translateY(-3px) rotate(2deg) scale(1.01); } }
@keyframes guruThinkingGlow { 0%,100% { transform: scale(0.9); opacity: 0.35; } 50% { transform: scale(1.15); opacity: 0.65; } }
@keyframes guruSpeaking { 0%,100% { transform: translateY(0) rotate(0deg) scale(1); } 25% { transform: translateY(-2px) rotate(-2deg) scale(1.018); } 50% { transform: translateY(-4px) rotate(1.5deg) scale(1.025); } 75% { transform: translateY(-1px) rotate(-1deg) scale(1.01); } }
@keyframes guruSpeakingGlow { 0%,100% { transform: scale(0.96); opacity: 0.35; } 50% { transform: scale(1.16); opacity: 0.6; } }
@keyframes guruDotPulse { 0%,100% { transform: translateY(0); opacity: 0.35; } 50% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .guru-mascot-img, .guru-mascot-glow, .guru-thinking-dots span { animation: none !important; }
}

/* notes panel (bottom-right) */
.gnote { flex:1; min-height:0; display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.gnote__hd { display:flex; align-items:center; gap:7px; padding:11px 13px; border-bottom:1px solid var(--line); font-size:12.5px; font-weight:800; color:var(--navy-800); }
.gnote__clear { margin-left:auto; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--dim); background:none; border:none; cursor:pointer; }
.gnote__clear:hover { color:var(--danger-ink,#b42318); }
.gnote__list { flex:1; min-height:0; overflow-y:auto; padding:11px; display:flex; flex-direction:column; gap:8px; }
.gnote__empty { display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; color:var(--dim); font-size:11.5px; padding:22px 12px; line-height:1.5; }
/* ===== Sticky Notes style (กระดาษโน้ตสีอ่อน) ===== */
.gnote__item { position:relative; background:var(--sticky-bg,#fff8e1); border:1px solid var(--sticky-bd,#f0e0b8); border-top:4px solid var(--sticky,#f6c544); border-radius:6px; padding:22px 13px 15px; box-shadow:0 1px 2px rgba(20,30,55,.08); overflow:hidden; transition:box-shadow .12s ease; }
.gnote__item:hover { box-shadow:0 3px 9px rgba(20,30,55,.14); }
.gnote__t { font-size:12px; color:var(--ink); line-height:1.5; white-space:pre-wrap; word-break:break-word; cursor:text; padding-right:2px; }
.gnote__time { position:absolute; top:7px; right:13px; font-size:10px; font-weight:600; color:var(--dim); letter-spacing:.01em; }
/* ปุ่มแก้ไข/ลบ (โผล่เมื่อชี้เมาส์) */
.gnote__acts { position:absolute; bottom:3px; right:3px; z-index:2; display:flex; gap:3px; opacity:0; transition:opacity .12s; }
.gnote__item:hover .gnote__acts { opacity:1; }
.gnote__acts button { border:none; background:rgba(255,255,255,.72); border-radius:6px; width:22px; height:22px; cursor:pointer; color:var(--dim); display:grid; place-items:center; transition:color .12s, background .12s; }
.gnote__acts button:hover { background:#fff; color:var(--navy-700); }
.gnote__acts .gnote__del:hover { color:var(--danger-ink,#b42318); }
/* โหมดแก้ไขในการ์ด */
.gnote__edit { width:100%; box-sizing:border-box; resize:vertical; min-height:46px; border:1px solid var(--sticky,#f6c544); border-radius:6px; background:rgba(255,255,255,.78); padding:7px 9px; font-family:var(--ff); font-size:12px; line-height:1.5; color:var(--ink); outline:none; }
.gnote__editbar { display:flex; justify-content:flex-end; align-items:center; gap:7px; margin-top:7px; }
.gnote__ecancel { border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:11px; font-weight:600; color:var(--dim); padding:4px 6px; border-radius:6px; }
.gnote__ecancel:hover { color:var(--ink); background:rgba(0,0,0,.05); }
.gnote__esave { display:inline-flex; align-items:center; gap:4px; border:none; background:var(--navy-700); color:#fff; border-radius:7px; padding:5px 11px; font-family:var(--ff); font-size:11px; font-weight:700; cursor:pointer; }
.gnote__esave:hover { background:var(--navy-800); }
/* folded corner */
.gnote__item::after { content:""; position:absolute; right:0; bottom:0; border-width:0 0 12px 12px; border-style:solid; border-color:transparent transparent rgba(20,30,55,.1) transparent; }
/* sticky color palette (พื้นอ่อน + แถบบน) */
.gnote__item.sticky--y { --sticky:#f6c544; --sticky-bg:#fff8e1; --sticky-bd:#f0e2b4; }
.gnote__item.sticky--g { --sticky:#6dbb5d; --sticky-bg:#eef8ea; --sticky-bd:#cfe9c6; }
.gnote__item.sticky--b { --sticky:#4f9fdb; --sticky-bg:#eaf4fc; --sticky-bd:#cbe3f4; }
.gnote__item.sticky--p { --sticky:#e070a6; --sticky-bg:#fcedf3; --sticky-bd:#f3d3e1; }
.gnote__item.sticky--o { --sticky:#ee8b43; --sticky-bg:#fdf1e7; --sticky-bd:#f6dcc4; }
.gnote__item.sticky--t { --sticky:#3fbcb5; --sticky-bg:#e8f7f6; --sticky-bd:#c7eae7; }
.gnote__add { display:flex; gap:7px; padding:10px 11px; border-top:1px solid var(--line); align-items:flex-end; }
.gnote__add textarea { flex:1; resize:none; border:1px solid var(--line-2); border-radius:9px; padding:8px 11px; font-family:var(--ff); font-size:12px; line-height:1.4; outline:none; max-height:90px; }
.gnote__add textarea:focus { border-color:var(--gold-500); }
.gnote__add button { width:36px; height:36px; flex:none; border:none; border-radius:9px; background:var(--navy-700); color:#fff; cursor:pointer; display:grid; place-items:center; }
.gnote__add button:disabled { opacity:.4; cursor:not-allowed; }
@media (max-width: 1080px){ .guru2 { grid-template-columns:1fr; } .guru__right { flex-direction:row; flex-wrap:wrap; } .guru__right .gav2 { flex:1 1 240px; } .guru__right .gnote, .guru__right .gnb { flex:1 1 260px; height:320px; } }

/* ---------- สมุดโน้ตหลายเล่ม (notebook) ---------- */
.gnb { flex:1; min-height:0; position:relative; display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.gnb__hd { display:flex; align-items:center; gap:7px; padding:10px 12px; font-size:12.5px; font-weight:800; color:var(--navy-800); border-bottom:1px solid var(--line); }
.gnb__menu { flex:none; width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); color:var(--navy-700); cursor:pointer; transition:.13s; }
.gnb__menu:hover { border-color:var(--gold-400); background:#fffaf0; color:var(--navy-800); }
.gnb__hdt { margin-left:1px; }
.gnb__count { font-size:10.5px; font-weight:800; color:var(--gold-700,#9a7b2e); background:#fff4d6; border:1px solid var(--gold-200,#f0e0b8); border-radius:999px; padding:1px 8px; }
.gnb__user { margin-left:auto; display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; color:var(--navy-700); background:#eef3ff; border:1px solid #d8e3f7; border-radius:999px; padding:2px 9px; }
/* popup: รายการโน้ตทั้งหมด */
.gnb__menuov { position:absolute; inset:0; z-index:8; }
.gnb__pop { position:absolute; top:8px; left:8px; right:8px; max-height:calc(100% - 16px); display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:13px; box-shadow:0 16px 40px rgba(15,30,70,.22); overflow:hidden; }
.gnb__pophd { display:flex; align-items:center; gap:7px; padding:10px 12px; border-bottom:1px solid var(--line); font-size:12px; color:var(--navy-800); }
.gnb__pophd b { font-weight:800; }
.gnb__popx { margin-left:auto; width:24px; height:24px; display:grid; place-items:center; border:none; border-radius:6px; background:none; color:var(--dim); cursor:pointer; }
.gnb__popx:hover { background:var(--surface-2); color:var(--navy-700); }
.gnb__poplist { flex:1; min-height:0; overflow-y:auto; padding:7px; display:flex; flex-direction:column; gap:4px; }
.gnb__poprow { display:flex; align-items:center; gap:2px; border-radius:9px; }
.gnb__poprow.is-on { background:#fffdf6; }
.gnb__poprow-sel { flex:1; min-width:0; display:flex; align-items:center; gap:8px; font-family:var(--ff); text-align:left; background:none; border:none; padding:8px 9px; border-radius:9px; cursor:pointer; }
.gnb__poprow-sel:hover { background:var(--surface-2); }
.gnb__poprow-nm { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12.5px; font-weight:700; color:var(--navy-800); }
.gnb__poprow-n { flex:none; font-size:10px; font-weight:800; color:var(--gold-700,#9a7b2e); background:#fff4d6; border-radius:999px; padding:0 7px; }
.gnb__poprow-del { flex:none; width:28px; height:28px; display:grid; place-items:center; border:none; border-radius:7px; background:none; color:var(--dim); cursor:pointer; }
.gnb__poprow-del:hover { color:var(--danger-ink,#b42318); background:#fdecec; }
.gnb__popnew { display:flex; align-items:center; justify-content:center; gap:6px; margin:0 7px 8px; padding:9px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--gold-700,#9a7b2e); background:#fffaf0; border:1px dashed var(--gold-300,#e3cf95); border-radius:10px; cursor:pointer; }
.gnb__popnew:hover { background:#fff4e0; border-color:var(--gold-400); }
.gnb__page { flex:1; min-height:0; display:flex; flex-direction:column; }
.gnb__pagehd { display:flex; align-items:center; gap:7px; padding:10px 11px 8px; }
.gnb__titlein { flex:1; min-width:0; font-family:var(--ff); font-size:13px; font-weight:800; color:var(--navy-800); background:transparent; border:none; border-bottom:1.5px dashed transparent; padding:2px 2px 3px; outline:none; }
.gnb__titlein:hover { border-bottom-color:var(--line-2); }
.gnb__titlein:focus { border-bottom-color:var(--gold-500); }
.gnb__act { flex:none; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--dim); background:none; border:none; cursor:pointer; display:grid; place-items:center; padding:3px 5px; border-radius:6px; }
.gnb__act:hover { color:var(--navy-700); background:var(--surface-2); }
.gnb__act--del:hover { color:var(--danger-ink,#b42318); background:#fdecec; }
.gnb__list { flex:1; min-height:0; overflow-y:auto; padding:2px 11px 11px; display:flex; flex-direction:column; gap:8px; }
.gnb__mgr { display:flex; align-items:center; justify-content:center; gap:6px; margin:0 11px 11px; padding:9px; font-family:var(--ff); font-size:12px; font-weight:700; color:#fff; background:var(--navy-700); border:none; border-radius:10px; cursor:pointer; transition:.14s; }
.gnb__mgr:hover { background:var(--navy-800); }
.gnb .gnote__add { margin-top:auto; }
/* คำตอบที่ถูกบล็อก (คำต้องห้าม) */
.aiblock { display:inline-flex; align-items:center; gap:5px; align-self:flex-start; font-size:10.5px; font-weight:800; letter-spacing:.01em; color:var(--danger-ink,#b42318); background:#fdecec; border:1px solid #f6cccc; border-radius:999px; padding:2px 9px; margin-bottom:5px; }
.aimsg__bubble--block { background:#fff7f6; border:1px solid #f3d2cf; }

/* ---------- manager: ดูโน้ตทุกคน ---------- */
.gmgr-modal { max-width:560px; width:92vw; }
.gmgr-user { border:1px solid var(--line); border-radius:12px; margin-bottom:9px; overflow:hidden; background:#fff; }
.gmgr-user__hd { display:flex; align-items:center; gap:9px; width:100%; padding:10px 12px; background:var(--surface-2); border:none; cursor:pointer; font-family:var(--ff); text-align:left; }
.gmgr-user__hd:hover { background:#f1f5fc; }
.gmgr-user__ava { flex:none; width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-size:13px; font-weight:800; color:#fff; background:var(--navy-600); }
.gmgr-user__nm { font-size:13px; font-weight:800; color:var(--navy-800); }
.gmgr-user__cnt { font-size:11px; color:var(--dim); margin-left:8px; }
.gmgr-user__hd > svg:last-child { margin-left:auto; }
.gmgr-user__bd { padding:10px 12px; display:flex; flex-direction:column; gap:10px; }
.gmgr-note { border:1px solid var(--gold-200,#f0e0b8); border-radius:10px; padding:9px 11px; background:#fffdf6; }
.gmgr-note__title { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--navy-800); margin-bottom:6px; }
.gmgr-note__n { margin-left:auto; font-size:10px; font-weight:800; color:var(--gold-700,#9a7b2e); background:#fff4d6; border-radius:999px; padding:0 7px; }
.gmgr-note__empty { font-size:11.5px; color:var(--dim); font-style:italic; }
.gmgr-note__item { display:flex; gap:9px; align-items:flex-start; padding:6px 0; border-top:1px solid #f1e8cf; }
.gmgr-note__item:first-of-type { border-top:none; }
.gmgr-note__t { flex:1; font-size:12px; color:var(--ink); line-height:1.45; white-space:pre-wrap; word-break:break-word; }
.gmgr-note__time { flex:none; font-size:10.5px; color:var(--dim); }

/* feed: ai message column so cards/follow-ups sit under the bubble */
.aimsg__col { display:flex; flex-direction:column; gap:9px; min-width:0; }
.aimsg--ai { max-width:90%; }
.airich-p { margin:0; }
.airich-p + .airich-p { margin-top:7px; }
.airich-ul { margin:6px 0 2px; padding-left:4px; list-style:none; display:flex; flex-direction:column; gap:5px; }
.airich-ul li { position:relative; padding-left:17px; }
.airich-ul li::before { content:""; position:absolute; left:3px; top:8px; width:6px; height:6px; border-radius:50%; background:var(--gold-500); }

/* inline stock cards */
.gstockwrap { display:flex; flex-direction:column; gap:7px; padding:10px 11px; background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:13px; }
.gstockwrap__h { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:800; letter-spacing:.02em; color:var(--gold-700,#9a7b2e); text-transform:uppercase; }
.gstockwrap__n { margin-left:auto; font-size:10.5px; font-weight:700; letter-spacing:0; text-transform:none; color:var(--gold-700,#9a7b2e); background:#fff4d6; border:1px solid var(--gold-200,#f0e0b8); border-radius:999px; padding:1px 8px; }
.gstockmore { display:flex; align-items:center; justify-content:center; gap:5px; width:100%; margin-top:1px; padding:8px 11px; font-family:inherit; font-size:12px; font-weight:700; color:var(--gold-700,#9a7b2e); background:#fff; border:1px dashed var(--gold-300,#e3cf95); border-radius:11px; cursor:pointer; transition:background .12s,border-color .12s; }
.gstockmore:hover { background:#fffaf0; border-color:var(--gold-400); }
/* ออกเอกสารจากรายการ */
.gstockdoc { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:3px; padding-top:9px; border-top:1px dashed var(--gold-200,#f0e0b8); }
.gstockdoc__lbl { font-size:10.5px; font-weight:800; letter-spacing:.02em; color:var(--gold-700,#9a7b2e); text-transform:uppercase; margin-right:auto; }
.gstockdoc__btn { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:700; border-radius:9px; padding:7px 13px; cursor:pointer; transition:.13s; border:1px solid; }
.gstockdoc__btn--quote { color:var(--ok-ink,#1F8A5B); background:#f1f9f4; border-color:#bfe4cd; }
.gstockdoc__btn--quote:hover { background:var(--ok-ink,#1F8A5B); border-color:var(--ok-ink,#1F8A5B); color:#fff; }
.gstockdoc__btn--po { color:var(--navy-700); background:#eef3ff; border-color:#cfe0f7; }
.gstockdoc__btn--po:hover { background:var(--navy-700); border-color:var(--navy-700); color:#fff; }

/* ---------- กูรู: เอกสาร (ใบเสนอราคา / ใบจัดซื้อ) ---------- */
.cxmodal.gdoc-modal { max-width:none; width:min(1320px, calc(100vw - 48px)); max-height:calc(100vh - 48px); }
.gdoc-modal .cxmodal__hd { flex:none; }
.gdoc-modal .cxmodal__bd { flex:1 1 auto; min-height:0; background:#f3f5f9; scrollbar-width:none; -ms-overflow-style:none; }
.gdoc-modal .cxmodal__bd::-webkit-scrollbar { width:0; height:0; }
.gdoc-modal .gdoc-modal__ft { flex:none; }
.gdoc-modal .gdoc { max-width:none; margin:0; }
/* line-item blocks (no horizontal scroll) */
.gditems { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.gditems__hd { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:800; letter-spacing:.02em; color:var(--gold-700,#9a7b2e); text-transform:uppercase; }
.gditem { border:1px solid var(--line); border-radius:13px; padding:13px 15px; background:#fff; }
.gditem__top { display:flex; align-items:flex-start; gap:11px; }
.gditem__no { flex:none; width:25px; height:25px; display:grid; place-items:center; font-size:12.5px; font-weight:800; color:#fff; background:var(--navy-600); border-radius:8px; }
.gditem__id { flex:1; min-width:0; }
.gditem__nm { font-size:14.5px; font-weight:700; color:var(--navy-800); line-height:1.3; }
.gditem__tot { text-align:right; flex:none; padding-right:4px; }
.gditem__tot span { display:block; font-size:10px; color:var(--dim); }
.gditem__tot b { font-size:16px; font-weight:800; color:var(--navy-800); }
.gditem__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:11px 13px; margin-top:12px; }
.gdf { display:flex; flex-direction:column; gap:4px; min-width:0; }
.gdf>span { font-size:10.5px; font-weight:700; color:var(--dim); }
.gdf .gdoc__in { width:100%; }
.gdf--grow { grid-column:span 2; }
@media (max-width:720px){ .gdf--grow { grid-column:span 1; } }
/* grid-table line items (intentional columns, no dead space) */
.gdgrid { margin-top:10px; border:1px solid var(--line); border-radius:12px; background:#fff; overflow:hidden; overflow-x:auto; }
.gdgrid__head, .gdgrid__row { display:grid; align-items:center; gap:11px; padding:10px 14px; min-width:980px; }
.gdgrid__head { background:#f7f9fc; border-bottom:1.5px solid var(--line); font-size:11px; font-weight:800; color:var(--navy-700); }
.gdgrid__head .num { text-align:right; }
.gdgrid__row { border-bottom:1px solid var(--line); }
.gdgrid__row:last-child { border-bottom:none; }
.gdgrid .gdoc__in { width:100%; }
.gdgrid .gdoc__in.num, .gdgrid input.num { text-align:right; }
.gdr__no { width:24px; height:24px; display:grid; place-items:center; font-size:12px; font-weight:800; color:#fff; background:var(--navy-600); border-radius:7px; }
.gdr__prod { min-width:0; }
.gdr__prod .gditem__nm { font-size:13.5px; font-weight:700; color:var(--navy-800); line-height:1.3; }
.gdr__qty { display:flex; align-items:center; gap:6px; min-width:0; }
.gdr__tot { text-align:right; font-size:13.5px; font-weight:800; color:var(--navy-800); }
/* รุ่น field + popup */
.modelfield { display:flex; align-items:center; gap:7px; width:100%; }
.modelfield .specrow__edit { flex:1; }
.modelfield__add { flex:none; display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); background:#eef3ff; border:1px solid #cfe0f7; border-radius:8px; padding:6px 11px; cursor:pointer; transition:.13s; white-space:nowrap; }
.modelfield__add:hover { background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.mdl-hint { display:flex; align-items:flex-start; gap:6px; font-size:12px; color:var(--dim); line-height:1.5; margin-bottom:9px; }
.mdl-hint b { color:var(--navy-700); }
.mdl-ta { width:100%; resize:vertical; border:1px solid var(--line-2); border-radius:10px; padding:11px 13px; font-family:var(--ff); font-size:13.5px; line-height:1.7; outline:none; }
.mdl-ta:focus { border-color:var(--gold-500); }
.mdl-prev { display:flex; flex-wrap:wrap; gap:6px; margin-top:11px; }
.mdl-chip { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--navy-800); background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:999px; padding:3px 11px 3px 4px; }
.mdl-chip b { display:grid; place-items:center; min-width:17px; height:17px; font-size:10px; color:#fff; background:var(--navy-600); border-radius:50%; padding:0 4px; }
.mdl-count { margin-top:9px; font-size:11.5px; font-weight:700; color:var(--gold-700,#9a7b2e); }
.gdoc { background:#fff; border:1px solid var(--line); border-radius:12px; padding:20px 22px; box-shadow:0 2px 10px rgba(15,30,70,.06); }
.gdoc__top { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; padding-bottom:14px; border-bottom:2px solid var(--navy-700); }
.gdoc__shop { display:flex; flex-direction:column; gap:2px; }
.gdoc__shop b { font-size:17px; font-weight:800; color:var(--navy-800); }
.gdoc__shop span { font-size:11.5px; color:var(--dim); }
.gdoc__meta { text-align:right; font-size:11.5px; color:var(--ink); display:flex; flex-direction:column; gap:2px; }
.gdoc__title { font-size:13px; font-weight:800; color:var(--navy-700); margin-bottom:2px; }
.gdoc__party { display:flex; align-items:center; gap:10px; margin:13px 0 9px; }
.gdoc__party label { font-size:12px; font-weight:700; color:var(--navy-700); flex:none; }
.gdoc__party input { flex:1; border:none; border-bottom:1.5px dashed var(--line-2); padding:5px 4px; font-family:var(--ff); font-size:13px; outline:none; }
.gdoc__party input:focus { border-bottom-color:var(--gold-500); }
/* required-info form */
.gdoc__form { display:flex; flex-wrap:wrap; gap:10px 14px; margin:13px 0 4px; }
.gdoc__fld { flex:1 1 220px; display:flex; flex-direction:column; gap:4px; }
.gdoc__fld--sm { flex:0 0 130px; }
.gdoc__fld label { font-size:11px; font-weight:700; color:var(--navy-700); }
.gdoc__fld label i { color:var(--danger-ink,#b42318); font-style:normal; }
.gdoc__in { border:1px solid var(--line-2); border-radius:7px; padding:6px 9px; font-family:var(--ff); font-size:12.5px; outline:none; background:#fff; }
.gdoc__in:focus { border-color:var(--gold-500); }
.gdoc__in--wide { width:100%; }
.gdoc__in--bad { border-color:var(--danger-ink,#b42318); background:#fdf4f3; }
.gdoc__vatbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:10px 0 2px; font-size:12px; color:var(--navy-700); font-weight:700; }
.gdoc__seg { font-family:var(--ff); font-size:12px; font-weight:700; color:var(--dim); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:5px 12px; cursor:pointer; }
.gdoc__seg.is-on { background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.gdoc__vathint { font-weight:500; font-size:11px; color:var(--dim); }
.gdoc__alerts { display:flex; flex-direction:column; gap:6px; margin:11px 0 2px; }
.gdoc__alert { display:flex; gap:8px; align-items:flex-start; font-size:11.5px; line-height:1.45; color:#8a5a00; background:#fff8e8; border:1px solid #f3dca0; border-radius:9px; padding:8px 11px; }
.gdoc__alert svg { flex:none; margin-top:1px; color:#c8901a; }
.gdoc__item { min-width:320px; }
.gdoc__code { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:3px; }
.gdoc__codetag { font-size:10.5px; font-weight:700; color:var(--navy-700); background:#eef3ff; border:1px solid #d8e3f7; border-radius:6px; padding:1px 7px; }
.gdoc__attrs { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:5px; }
.gdoc__oem { font-size:10.5px; color:var(--dim); }
.gdoc__in--mini { width:120px; padding:3px 7px; font-size:11px; }
.gdoc__in--yr { width:62px; padding:3px 7px; font-size:11px; }
.gdoc__in--grade { padding:3px 6px; font-size:11px; }
.gdoc__in--vat { padding:4px 6px; font-size:11px; }
.gdoc__u { font-size:11px; color:var(--dim); }
.gdoc__del { width:34px; text-align:center; }
.gdoc__delbtn { width:28px; height:28px; display:grid; place-items:center; border:none; border-radius:7px; background:none; color:var(--dim); cursor:pointer; transition:.12s; }
.gdoc__delbtn:hover { color:var(--danger-ink,#b42318); background:#fdecec; }
.gdoc__empty { text-align:center; color:var(--dim); font-size:12px; padding:18px; }
.gdoc__exempt { font-size:11px; color:var(--dim); font-style:italic; }
.gdoc__tbl { width:100%; border-collapse:collapse; margin-top:8px; }
.gdoc__tbl th { font-size:11px; font-weight:800; color:var(--navy-700); text-align:left; padding:8px 7px; border-bottom:1.5px solid var(--line); background:#f7f9fc; }
.gdoc__tbl td { font-size:12px; color:var(--ink); padding:8px 7px; border-bottom:1px solid var(--line); vertical-align:middle; }
.gdoc__tbl .num { text-align:right; }
.gdoc__nm { font-weight:700; color:var(--navy-800); }
.gdoc__tbl td.num .gdoc__in { width:86px; text-align:right; }
.gdoc__in--qty { width:54px; text-align:right; }
.gdoc__sum { display:flex; flex-direction:column; align-items:flex-end; gap:4px; margin-top:12px; }
.gdoc__sumrow { display:flex; gap:26px; min-width:240px; justify-content:space-between; font-size:12.5px; color:var(--ink); }
.gdoc__grand { border-top:1.5px solid var(--navy-700); padding-top:7px; margin-top:3px; font-size:15px; font-weight:800; color:var(--navy-800); }
.gdoc__note { margin-top:14px; padding-top:11px; border-top:1px dashed var(--line); font-size:11px; color:var(--dim); line-height:1.5; }
.gdoc-modal__ft { display:flex; gap:9px; justify-content:flex-end; padding:13px 18px; border-top:1px solid var(--line); background:#fff; }
.gdoc-btn { display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:13px; font-weight:700; border-radius:10px; padding:9px 16px; cursor:pointer; border:1px solid; transition:.13s; }
.gdoc-btn--ghost { color:var(--navy-700); background:#fff; border-color:var(--line-2); }
.gdoc-btn--ghost:hover { border-color:var(--navy-400,#aebfdb); background:var(--surface-2); }
.gdoc-btn--primary { color:#fff; background:var(--navy-700); border-color:var(--navy-700); }
.gdoc-btn--primary:hover { background:var(--navy-800); }
/* print: show only the document */
@media print {
  body.gdoc-printing * { visibility:hidden !important; }
  body.gdoc-printing .gdoc, body.gdoc-printing .gdoc * { visibility:visible !important; }
  body.gdoc-printing .gdoc { position:fixed; inset:0; margin:0; box-shadow:none; border:none; border-radius:0; padding:30px; }
  body.gdoc-printing .gdoc__in, body.gdoc-printing .gdoc__party input { border:none !important; }
}
.gstockcard { display:flex; align-items:center; gap:11px; width:100%; text-align:left; background:#fff; border:1px solid var(--line); border-radius:11px; padding:10px 11px; cursor:pointer; font-family:var(--ff); transition:border-color .14s, box-shadow .14s, transform .14s; }
.gstockcard:hover { border-color:var(--gold-400); box-shadow:0 5px 16px rgba(20,40,90,.10); transform:translateY(-1px); }
.gstockcard__ic { flex:none; width:38px; height:38px; border-radius:10px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.gstockcard__bd { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.gstockcard__nm { font-size:13px; font-weight:800; color:var(--ink); line-height:1.25; }
.gstockcard__sub { font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gstockcard__tags { display:flex; flex-wrap:wrap; gap:5px; margin-top:1px; }
.gstockcard__grade { font-size:10.5px; font-weight:700; padding:1.5px 7px; border-radius:99px; }
.gstockcard__grade--oem { background:#e8f1ff; color:#1b4ea0; }
.gstockcard__grade--alt { background:#eef3ee; color:#3f7a4a; }
.gstockcard__right { flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.gstockcard__price { font-size:13px; font-weight:800; color:var(--navy-800); }
.gstockcard__stock { font-size:10.5px; font-weight:600; color:#3f7a4a; }
.gstockcard__stock.is-out { color:var(--danger-ink,#b42318); }
.gstockcard__bin { font-size:10px; color:var(--dim); font-variant-numeric:tabular-nums; }
.gstockcard__go { flex:none; color:var(--line-2); }
.gstockcard:hover .gstockcard__go { color:var(--gold-600); }

/* follow-up chips */
.gquick { display:flex; flex-wrap:wrap; align-items:center; gap:7px; padding:9px 10px; background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:12px; }
.gquick__lbl { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:800; letter-spacing:.02em; color:var(--gold-700,#9a7b2e); text-transform:uppercase; margin-right:1px; }
.gquick__chip { font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-800); background:#fff; border:1.5px solid var(--gold-300,#e3cf95); border-radius:var(--r-pill); padding:7px 14px; cursor:pointer; transition:.13s; }
.gquick__chip:hover { background:var(--gold-500); border-color:var(--gold-500); color:var(--navy-900); transform:translateY(-1px); box-shadow:0 4px 12px rgba(168,133,47,.22); }
.gfollow { display:flex; flex-wrap:wrap; gap:7px; }
.gfollow__chip { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-700); background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-pill); padding:7px 12px; cursor:pointer; transition:.14s; }
.gfollow__chip:hover { border-color:var(--gold-400); background:#fffdf6; color:var(--navy-800); }
.gfollow__chip svg { color:var(--gold-600); }

/* mic button in the bar */
.aimic { width:44px; height:44px; flex:none; border:1px solid var(--line-2); border-radius:var(--r-md); background:var(--surface); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; transition:.14s; }
.aimic:hover { border-color:var(--gold-400); color:var(--navy-800); }
.aimic.is-live { background:#fdeceb; border-color:#e7a39b; color:#c0392b; animation:gmic 1.1s ease-in-out infinite; }
@keyframes gmic { 0%,100%{ box-shadow:0 0 0 0 rgba(192,57,43,.32);} 50%{ box-shadow:0 0 0 6px rgba(192,57,43,0);} }

/* side rail */
.guru__side { display:flex; flex-direction:column; gap:13px; min-width:0; }
.gtool { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:13px 14px; }
.gtool__h { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:800; color:var(--navy-800); margin-bottom:10px; }
.gtool__chips { display:flex; flex-wrap:wrap; gap:7px; }
.gtool__chip { font-family:var(--ff); font-size:11.5px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-pill); padding:5px 11px; white-space:nowrap; flex:none; cursor:pointer; transition:.14s; }
.gtool__chip:hover { border-color:var(--gold-400); background:#fffdf6; color:var(--navy-800); }
.gtool__list { display:flex; flex-direction:column; gap:6px; }
.gtool__part { display:flex; flex-direction:column; gap:2px; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 11px; cursor:pointer; font-family:var(--ff); transition:.14s; }
.gtool__part:hover { border-color:var(--gold-400); background:#fffdf6; }
.gtool__partnm { font-size:12.5px; font-weight:700; color:var(--ink); line-height:1.25; }
.gtool__partsub { font-size:11px; color:var(--dim); }
.gtool--tip { display:flex; gap:9px; align-items:flex-start; font-size:11.5px; line-height:1.55; color:var(--dim); background:#fbfcff; }
.gtool--tip svg { flex:none; margin-top:1px; }
.gtool--tip b { color:var(--navy-700); }

/* ---------- draggable avatar window ---------- */
.gavatar { position:fixed; z-index:120; background:#fff; border:1px solid var(--line); border-radius:18px; box-shadow:0 18px 48px rgba(15,30,70,.22); overflow:hidden; user-select:none; }
.gavatar__bar { display:flex; align-items:center; gap:7px; padding:8px 9px 8px 11px; background:linear-gradient(120deg,#16294f,#0e1f3f); cursor:grab; }
.gavatar__bar:active { cursor:grabbing; }
.gavatar__grip { color:#7b8db0; display:grid; place-items:center; }
.gavatar__title { flex:1; font-size:12.5px; font-weight:800; color:#fff; letter-spacing:.01em; }
.gavatar__btn { width:25px; height:25px; flex:none; border:none; border-radius:7px; background:rgba(255,255,255,.10); color:#cdd8ef; display:grid; place-items:center; cursor:pointer; transition:.14s; }
.gavatar__btn:hover { background:rgba(255,255,255,.20); color:#fff; }
.gavatar__btn.is-on { background:var(--gold-500); color:var(--navy-900); }
.gavatar__stage { position:relative; height:148px; display:grid; place-items:center; background:radial-gradient(120% 90% at 50% 12%, #f3f6fd, #e7edf8); overflow:hidden; }
.gavatar__stage::after { content:""; position:absolute; left:50%; bottom:16px; transform:translateX(-50%); width:120px; height:14px; border-radius:50%; background:rgba(20,40,90,.13); filter:blur(3px); }
.gavatar__img { max-width:84%; max-height:80%; object-fit:contain; border-radius:12px; transition:transform .2s; position:relative; z-index:1; }
.gavatar__img.is-talk { animation:gbob .5s ease-in-out infinite; }
.gavatar__img.is-think { animation:gtilt 2.4s ease-in-out infinite; }
@keyframes gbob { 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-5px);} }
@keyframes gtilt { 0%,100%{ transform:rotate(-2deg);} 50%{ transform:rotate(2deg);} }
.gavatar__status { display:flex; align-items:center; gap:7px; padding:9px 13px; font-size:11.5px; font-weight:600; color:var(--navy-700); border-top:1px solid var(--line); }
.gavatar__pulse { width:8px; height:8px; border-radius:50%; background:var(--ok-ink,#1F8A5B); }
.gavatar__pulse--think { background:var(--gold-500); animation:gpulse 1s ease-in-out infinite; }
.gavatar__pulse--talk { background:#2D6CB5; animation:gpulse .6s ease-in-out infinite; }
.gavatar__pulse--happy { background:var(--ok-ink,#1F8A5B); }
@keyframes gpulse { 0%,100%{ opacity:1; } 50%{ opacity:.3; } }
.gavatar__tools { display:flex; gap:7px; padding:0 11px 12px; }
.gavatar__tool { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:7px 8px; cursor:pointer; transition:.14s; }
.gavatar__tool:hover { border-color:var(--gold-400); background:#fffdf6; }
.gavatar__tool--ghost { flex:0 0 auto; color:var(--dim); }
.gavatar-mini { position:fixed; z-index:120; width:72px; height:72px; border-radius:50%; border:2px solid #fff; background:radial-gradient(120% 100% at 50% 20%,#f3f6fd,#dde5f4); box-shadow:0 12px 30px rgba(15,30,70,.26); cursor:grab; display:grid; place-items:center; overflow:hidden; padding:0; }
.gavatar-mini:active { cursor:grabbing; }
.gavatar-mini .gmascot { transform:scale(.46); }
.gavatar-mini__img { width:100%; height:100%; object-fit:cover; }
.gavatar-mini__img.is-talk { animation:gbob .5s ease-in-out infinite; }
.gavatar-mini__dot { position:absolute; right:4px; bottom:4px; width:13px; height:13px; border-radius:50%; border:2px solid #fff; background:var(--ok-ink,#1F8A5B); }
.gavatar-mini__dot--think { background:var(--gold-500); }
.gavatar-mini__dot--talk { background:#2D6CB5; }

/* ---------- the CSS-drawn cat-mechanic mascot ---------- */
.gmascot { position:relative; width:118px; height:118px; transform-origin:50% 100%; animation:gmBreath 4s ease-in-out infinite; z-index:1; }
.gmascot--think { animation:gtilt 2.6s ease-in-out infinite; }
.gmascot--happy { animation:gmHop .5s ease-out; }
@keyframes gmBreath { 0%,100%{ transform:scaleY(1);} 50%{ transform:scaleY(1.025);} }
@keyframes gmHop { 0%{ transform:translateY(0);} 35%{ transform:translateY(-9px);} 100%{ transform:translateY(0);} }
.gm-head { position:absolute; left:9px; top:24px; width:100px; height:84px; background:linear-gradient(180deg,#f4f7fd,#cfd9ec); border-radius:48% 48% 44% 44% / 52% 52% 48% 48%; box-shadow:inset 0 -8px 14px rgba(20,40,90,.12); }
.gm-ear { position:absolute; top:14px; width:0; height:0; border-left:17px solid transparent; border-right:17px solid transparent; border-bottom:27px solid #e8edf7; z-index:0; }
.gm-ear::after { content:""; position:absolute; top:9px; left:-8px; width:0; height:0; border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:13px solid #e7a6a6; }
.gm-ear--l { left:14px; transform:rotate(-17deg); }
.gm-ear--r { right:14px; transform:rotate(17deg); }
/* mechanic cap */
.gm-cap { position:absolute; left:14px; top:6px; width:90px; height:30px; background:linear-gradient(180deg,#22386a,#16294f); border-radius:46px 46px 12px 12px / 40px 40px 12px 12px; z-index:2; box-shadow:inset 0 3px 5px rgba(255,255,255,.08); }
.gm-cap::after { content:""; position:absolute; left:-7px; bottom:-2px; width:54px; height:13px; background:#1a2e57; border-radius:0 0 10px 14px; transform:rotate(-3deg); }
.gm-cap-btn { position:absolute; left:55px; top:5px; width:9px; height:9px; border-radius:50%; background:var(--gold-500); z-index:3; box-shadow:0 0 0 2px rgba(217,164,65,.3); }
.gm-eye { position:absolute; top:30px; width:17px; height:19px; background:#fff; border-radius:50%; overflow:hidden; box-shadow:inset 0 1px 2px rgba(0,0,0,.12); }
.gm-eye--l { left:28px; } .gm-eye--r { right:28px; }
.gm-pupil { position:absolute; left:50%; top:52%; transform:translate(-50%,-50%); width:9px; height:9px; border-radius:50%; background:#16294f; transition:transform .25s; }
.gm-pupil::after { content:""; position:absolute; top:1px; right:1px; width:3px; height:3px; border-radius:50%; background:#fff; }
.gmascot--idle .gm-eye { animation:gmBlink 4.4s infinite; }
@keyframes gmBlink { 0%,94%,100%{ transform:scaleY(1);} 97%{ transform:scaleY(.12);} }
.gmascot--think .gm-pupil { transform:translate(-10%,-95%); }
.gmascot--happy .gm-eye { height:9px; border-radius:12px 12px 0 0; background:transparent; box-shadow:none; border-bottom:3px solid #16294f; }
.gmascot--happy .gm-pupil { display:none; }
.gm-nose { position:absolute; left:50%; top:54px; transform:translateX(-50%); width:11px; height:8px; background:#e08f93; border-radius:0 0 60% 60%; }
.gm-mouth { position:absolute; left:50%; top:62px; transform:translateX(-50%); width:18px; height:5px; background:#c75d62; border-radius:0 0 12px 12px; transition:height .05s linear; }
.gmascot--idle .gm-mouth, .gmascot--think .gm-mouth { height:0; width:22px; border:none; background:none; border-bottom:2.6px solid #b5565b; border-radius:0 0 20px 20px; }
.gmascot--happy .gm-mouth { height:9px; width:26px; background:#c75d62; }
.gm-cheek { position:absolute; top:56px; width:13px; height:8px; border-radius:50%; background:rgba(231,166,166,.55); opacity:0; transition:opacity .2s; }
.gm-cheek--l { left:20px; } .gm-cheek--r { right:20px; }
.gmascot--happy .gm-cheek, .gmascot--talk .gm-cheek { opacity:1; }
.gm-wk { position:absolute; top:58px; height:1.6px; width:22px; background:rgba(20,40,90,.32); border-radius:2px; }
.gm-wk--l1 { left:-12px; transform:rotate(7deg);} .gm-wk--l2 { left:-12px; top:64px; transform:rotate(-7deg);}
.gm-wk--r1 { right:-12px; transform:rotate(-7deg);} .gm-wk--r2 { right:-12px; top:64px; transform:rotate(7deg);}
.gm-think { position:absolute; right:-2px; top:-6px; display:flex; gap:3px; align-items:center; background:#fff; border:1px solid var(--line); border-radius:11px; padding:5px 7px; opacity:0; transform:scale(.7); transition:.2s; box-shadow:0 4px 10px rgba(20,40,90,.14); }
.gm-think i { width:5px; height:5px; border-radius:50%; background:var(--gold-500); animation:aiblink 1.2s infinite both; }
.gm-think i:nth-child(2){ animation-delay:.2s; } .gm-think i:nth-child(3){ animation-delay:.4s; }
.gmascot--think .gm-think { opacity:1; transform:scale(1); }
.gm-spark { position:absolute; left:-4px; top:2px; color:var(--gold-500); opacity:0; transform:scale(.5) rotate(-20deg); transition:.25s; }
.gmascot--happy .gm-spark { opacity:1; transform:scale(1) rotate(0); }

@media (prefers-reduced-motion: reduce){
  .gmascot, .gmascot--think, .gmascot--happy, .gm-eye, .gavatar__img, .gavatar-mini__img, .aimic.is-live { animation:none !important; }
}
@media (max-width: 1080px){
  .guru { grid-template-columns:1fr; }
  .guru__side { flex-direction:row; flex-wrap:wrap; }
  .guru__side .gtool { flex:1 1 220px; }
}

/* =========================================================================
   กล่องแชทรวม — omnichannel chat-commerce workspace
   ========================================================================= */
.cxwrap { display:flex; flex-direction:column; max-width:none; width:min(1600px, calc(100vw - 32px)); margin:0 auto; }
.cxtop { display:flex; gap:14px; align-items:stretch; margin-bottom:14px; flex-wrap:wrap; }
.cxkpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; flex:1 1 480px; }
.cxkpi { display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:11px 13px; }
.cxkpi > div { display:flex; flex-direction:column; justify-content:center; min-width:0; }
.cxkpi__ic { width:34px; height:34px; flex:none; border-radius:9px; display:grid; place-items:center; }
.cxkpi__v { font-size:19px; font-weight:800; color:var(--navy-900); line-height:1; }
.cxkpi__k { font-size:11px; color:var(--dim); margin-top:4px; line-height:1.25; min-height:2.5em; display:flex; align-items:center; }
.cxconnect { display:flex; flex-wrap:wrap; align-content:center; gap:7px; background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:10px 12px; flex:1 1 300px; }
.cxconn { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-pill); padding:5px 10px; }
.cxconn.is-on { color:var(--navy-700); }
.cxconn__dot { width:7px; height:7px; border-radius:50%; }
/* ช่องทางแชต → ปุ่มโลโก้ กดเพื่อกรองแพลตฟอร์ม (กดซ้ำ = ยกเลิก) */
.cxconnect { align-items:center; gap:7px; }
.cxchlogo { width:38px; height:38px; flex:none; display:grid; place-items:center; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; cursor:pointer; padding:0; transition:transform .14s, border-color .14s, box-shadow .14s, background .14s; }
.cxchlogo:hover { border-color:var(--line-2); transform:translateY(-1px); }
.cxchlogo.is-on { border-color:var(--gold-500); background:#fffdf6; box-shadow:0 0 0 1px var(--gold-500); }
.cxchlogo__img { width:22px; height:22px; object-fit:contain; border-radius:5px; }
.cxchlogo__dot { width:11px; height:11px; border-radius:50%; }
.cxchlogo--all.is-on { border-color:var(--navy-400,#aebfdb); background:var(--surface-3); box-shadow:0 0 0 1px var(--navy-400,#aebfdb); }

.cxgrid { display:grid; grid-template-columns:340px minmax(620px,1fr) 360px; gap:16px; align-items:stretch; height:calc(100vh - 196px); min-height:520px; }
/* 🔧 แชทรวม (inbox) split-pane reflow: thread minmax(620) บีบไม่ได้ → ล้น. กัน min-width + drop CRM + stack */
.pane-fluid--inbox .cxwrap{ min-width:0; max-width:100%; overflow-x:hidden; }
.pane-fluid--inbox .cxgrid > *{ min-width:0; }
.pane-fluid--inbox .cxgrid{ min-width:0; max-width:100%; }
.pane-fluid--inbox .cxthread, .pane-fluid--inbox .cxlist{ min-width:0; }
.pane-fluid--inbox .cxtools{ display:flex; flex-wrap:wrap; }
/* 🟦 ช่อง split: drill-in แบบ LINE — ชั้น 1 รายการแชท · ชั้น 2 ห้องแชท + การ์ดลูกค้า (thread | crm) */
.pane-fluid--inbox .cxgrid.cx-list{ grid-template-columns:minmax(0,1fr) !important; grid-template-rows:auto; }
.pane-fluid--inbox .cxgrid.cx-list > .cxthread,
.pane-fluid--inbox .cxgrid.cx-list > .cxcrm{ display:none; }
.pane-fluid--inbox .cxgrid.cx-chat{ grid-template-columns:minmax(0,1fr) 340px !important; grid-template-rows:auto; }
.pane-fluid--inbox .cxgrid.cx-chat > .cxlist{ display:none; }
@container pane (max-width: 860px){
  .pane-fluid--inbox .cxgrid.cx-chat{ grid-template-columns:minmax(0,1fr) !important; }
  .pane-fluid--inbox .cxgrid.cx-chat > .cxcrm{ display:none; }
}
.cxback{ display:none; flex:none; width:34px; height:34px; border-radius:9px; align-items:center; justify-content:center; background:var(--surface-2); border:1px solid var(--line); color:var(--navy-700); cursor:pointer; }
.cxback:hover{ background:var(--surface-3); border-color:var(--navy-400,#aebfdb); }
.pane-fluid--inbox .cxback{ display:inline-flex; }
/* กัน inner ของ thread/feed ดันช่องกว้างเกิน → no horizontal scroll ระดับ pane */
.pane-fluid--inbox .cxfeed{ min-width:0; }
.pane-fluid--inbox .cxmsg{ max-width:88%; min-width:0; }
.pane-fluid--inbox .cxmsg__bubble{ min-width:0; overflow-wrap:anywhere; }
.pane-fluid--inbox .cxprod{ width:auto; max-width:100%; min-width:0; }
.pane-fluid--inbox .cxprod__bd{ min-width:0; }
.pane-fluid--inbox .cxthread__hd{ flex-wrap:wrap; }
/* ปุ่มลัดล่าง (ตอบอัตโนมัติ/ส่งสินค้า/สร้างออเดอร์/ลิงก์ชำระเงิน) พับ 2 แถวได้ */
.pane-fluid--inbox .cxtools{ flex-wrap:wrap; }
.pane-fluid--inbox .cxtools > *{ min-width:0; }

/* ---- conversation list ---- */
.cxlist { background:var(--surface); border:1px solid var(--line); border-radius:16px; display:flex; flex-direction:column; overflow:hidden; }
.cxlist__search { display:flex; align-items:center; gap:8px; padding:11px 13px; border-bottom:1px solid var(--line); }
.cxlist__search input { flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); }
.cxlist__tabs { display:flex; gap:5px; padding:9px 11px 0; }
.cxtab { flex:1; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); background:none; border:none; border-bottom:2px solid transparent; padding:6px 2px 8px; cursor:pointer; white-space:nowrap; }
.cxtab.is-active { color:var(--navy-800); border-bottom-color:var(--gold-500); }
.cxchanrow { display:flex; gap:6px; padding:9px 11px; border-bottom:1px solid var(--line); }
/* ตัวกรองสถานะ → dropdown มีไอคอนทุกตัวเลือก */
.cxstatdd-wrap { position:relative; width:100%; }
.cxstatdd { width:100%; display:inline-flex; align-items:center; gap:8px; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--navy-800); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:8px 11px; cursor:pointer; transition:.14s; }
.cxstatdd:hover { border-color:var(--line-2); }
.cxstatdd__lb { flex:1; min-width:0; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxstatdd-scrim { position:fixed; inset:0; z-index:60; }
.cxstatdd-pop { position:absolute; top:calc(100% + 5px); left:0; right:0; z-index:61; background:var(--surface,#fff); border:1px solid var(--line); border-radius:11px; box-shadow:0 14px 40px -12px rgba(16,32,72,.32); padding:5px; animation:bpyPop .16s var(--ease-out,ease) both; }
.cxstatdd-opt { width:100%; display:flex; align-items:center; gap:9px; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--navy-800); background:none; border:none; border-radius:8px; padding:8px 9px; cursor:pointer; text-align:left; transition:background .12s; }
.cxstatdd-opt:hover { background:var(--surface-2); }
.cxstatdd-opt.is-on { background:#fffdf6; }
.cxstatdd-opt__nm { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxchansel { width:100%; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-800); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:7px 10px; cursor:pointer; outline:none; }
.cxchansel:focus { border-color:var(--gold-500); }
.cxchan { display:inline-flex; align-items:center; gap:5px; flex:none; font-family:var(--ff); font-size:11px; font-weight:600; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-pill); padding:5px 10px; cursor:pointer; }
.cxchan.is-active { color:var(--navy-800); background:#fffdf6; }
.cxchan__d { width:7px; height:7px; border-radius:50%; }
.cxlist__scroll { flex:1; min-height:0; overflow-y:auto; }
.cxconvo { display:flex; gap:11px; width:100%; text-align:left; border:none; border-bottom:1px solid var(--line); background:none; cursor:pointer; padding:12px 13px; font-family:var(--ff); }
.cxconvo:hover { background:var(--surface-2); }
.cxconvo.is-on { background:#fdf6e6; box-shadow:inset 3px 0 0 var(--gold-500); }
.cxconvo__av { position:relative; flex:none; }
.cxconvo__av--lg .cxconvo__ava { width:42px; height:42px; }
.cxconvo__ava { width:40px; height:40px; border-radius:12px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); font-weight:800; font-size:15px; }
.cxconvo__badge { position:absolute; right:-4px; bottom:-4px; min-width:17px; height:17px; padding:0 3px; border-radius:6px; border:2px solid var(--surface); display:grid; place-items:center; color:#fff; font-size:8.5px; font-weight:800; }
.cxconvo__bd { flex:1; min-width:0; }
.cxconvo__top { display:flex; justify-content:space-between; gap:8px; }
.cxconvo__nm { font-size:13px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxconvo__time { font-size:10.5px; color:var(--dim); flex:none; }
.cxconvo__bot { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-top:2px; }
.cxconvo__last { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
.cxconvo__last.is-unread { color:var(--ink); font-weight:600; }
.cxconvo__n { flex:none; min-width:18px; height:18px; border-radius:99px; background:var(--gold-500); color:var(--navy-900); font-size:10.5px; font-weight:800; display:grid; place-items:center; padding:0 5px; }
.cxconvo__meta { display:flex; align-items:center; gap:7px; margin-top:5px; }
.cxconvo__stat { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; }
.cxconvo__statdot { width:6px; height:6px; border-radius:50%; flex:none; }
.cxconvo__tag { font-size:10px; font-weight:600; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:1px 7px; }

/* ---- thread ---- */
.cxthread { background:var(--surface); border:1px solid var(--line); border-radius:16px; display:flex; flex-direction:column; overflow:hidden; min-width:0; }
.cxthread__hd { display:flex; align-items:center; gap:10px; padding:11px 13px; border-bottom:1px solid var(--line); flex-wrap:nowrap; }
/* กลุ่มปุ่มจัดการในหัวแชต — ชิดขวา จอกว้าง · พับเป็นแถวเต็มของตัวเองเมื่อช่องแคบ */
.cxhdacts { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-left:auto; }
.pane-fluid--inbox .cxhdacts { flex:1 1 100%; margin-left:0; margin-top:4px; }
.cxthread__nm { font-size:14px; font-weight:800; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxthread__sub { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxhdbtn-wrap { position:relative; flex:none; }
.cxhdbtn { display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:6px 9px; cursor:pointer; white-space:nowrap; }
.cxhdbtn:hover { border-color:var(--gold-400); }
.cxhdic { width:32px; height:32px; flex:none; border-radius:9px; border:1px solid var(--line); background:var(--surface-2); color:var(--dim); display:grid; place-items:center; cursor:pointer; }
.cxhdic.is-on { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); border-color:transparent; }
.cxhdic.is-todo { background:#fff3e0; color:#E08600; border-color:#f3d9a8; }
/* current admin switcher */
.cxme { display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-800); background:#fff; border:1px solid var(--line); border-radius:999px; padding:4px 11px 4px 4px; cursor:pointer; }
.cxme:hover { border-color:var(--gold-400); }
.cxme__ava { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:var(--navy-700); color:#fff; font-size:12px; font-weight:800; }
.cxme-wrap { position:relative; }
.cxpop__hd { font-size:10.5px; font-weight:800; letter-spacing:.02em; color:var(--dim); text-transform:uppercase; padding:9px 12px 5px; }
/* waiting-too-long alert + badge */
.cxwaitalert { display:flex; align-items:center; gap:8px; margin:9px 11px 4px; padding:8px 11px; font-size:11.5px; color:#9a3412; background:#fff4ed; border:1px solid #f6c9aa; border-radius:10px; }
.cxwaitalert b { font-weight:800; }
.cxwaitbadge { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700; color:#c2410c; background:#fff1e6; border:1px solid #f4cfae; border-radius:999px; padding:1px 7px; }
/* ส่งตำแหน่งร้านในแชท */
.cxloc { display:flex; gap:11px; align-items:center; background:#fff; border:1px solid var(--line); border-radius:13px; padding:10px; max-width:280px; cursor:pointer; transition:.13s; }
.cxloc:hover { border-color:var(--navy-400,#aebfdb); box-shadow:0 4px 12px rgba(15,30,70,.1); }
.cxloc__map { flex:none; width:46px; height:46px; border-radius:10px; display:grid; place-items:center; background:linear-gradient(135deg,#2D6CB5,#16294f); }
.cxloc__bd { min-width:0; display:flex; flex-direction:column; gap:2px; }
.cxloc__bd b { font-size:13px; font-weight:800; color:var(--navy-800); }
.cxloc__bd span { font-size:11px; color:var(--dim); line-height:1.45; }
.cxloc__go { display:inline-flex !important; align-items:center; gap:3px; color:var(--navy-600) !important; font-weight:700 !important; margin-top:2px; }
.cxfeed { flex:1; min-height:0; overflow-y:auto; padding:16px 18px; display:flex; flex-direction:column; gap:13px; background:linear-gradient(180deg,#fbfcfe,#f6f8fc); }
.cxsys { align-self:center; font-size:10.5px; font-weight:600; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:3px 12px; }
.cxmsg { display:flex; gap:9px; max-width:78%; }
.cxmsg--me { align-self:flex-end; flex-direction:row-reverse; }
.cxmsg__ava { width:28px; height:28px; flex:none; border-radius:8px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:12px; align-self:flex-end; }
.cxmsg__ava--bot { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.cxmsg__col { display:flex; flex-direction:column; gap:3px; min-width:0; }
.cxmsg--me .cxmsg__col { align-items:flex-end; }
.cxmsg__bubble { padding:9px 13px; border-radius:14px; font-size:13px; line-height:1.55; white-space:pre-wrap; word-break:break-word; background:var(--surface); border:1px solid var(--line); color:var(--ink); border-bottom-left-radius:4px; }
.cxmsg--me .cxmsg__bubble { background:linear-gradient(135deg,#16294f,#0e1f3f); color:#fff; border:none; border-bottom-left-radius:14px; border-bottom-right-radius:4px; }
.cxmsg__time { font-size:9.5px; color:var(--dim); padding:0 4px; }
.cxmsg__img { width:150px; height:110px; border-radius:12px; background:var(--surface-3); border:1px solid var(--line); display:grid; place-items:center; }

/* product / order / payment cards in feed */
.cxprod { display:flex; gap:10px; width:248px; background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:9px; }
.cxmsg--me .cxprod { background:#fff; }
.cxprod__img { width:52px; height:52px; flex:none; border-radius:9px; background:var(--surface-3); color:var(--navy-700); display:grid; place-items:center; }
.cxprod__bd { min-width:0; display:flex; flex-direction:column; justify-content:center; }
.cxprod__nm { font-size:12.5px; font-weight:800; color:var(--ink); line-height:1.25; }
.cxprod__sub { font-size:10.5px; color:var(--dim); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxprod__pr { font-size:13.5px; font-weight:800; color:var(--navy-800); margin-top:3px; }
.cxprod__pr span { font-size:10px; font-weight:600; color:var(--ok-ink,#1F8A5B); }
.cxprod__link { display:inline-flex; align-items:center; gap:5px; align-self:flex-start; margin-top:7px; font-family:var(--ff); font-size:11px; font-weight:700; padding:4px 9px; border:1px solid; border-radius:99px; background:#fff; cursor:pointer; text-decoration:none; line-height:1; }
.cxprod__link:hover { filter:brightness(.95); }
.cxlinkhint { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-2); background:var(--surface-2); border:1px solid; border-left-width:3px; border-radius:9px; padding:8px 11px; margin-bottom:11px; line-height:1.4; }
.cxordc { width:258px; background:#fff; border:1px solid var(--gold-200,#f0e0b8); border-radius:13px; overflow:hidden; }
.cxordc__hd { display:flex; align-items:center; gap:6px; padding:9px 11px; background:#fffdf6; border-bottom:1px solid var(--gold-200,#f0e0b8); font-size:12px; color:var(--navy-800); }
.cxordc__hd b { font-weight:800; }
.cxordc__st { margin-left:auto; font-size:10px; font-weight:700; color:var(--gold-700,#9a7b2e); background:#fbeec8; border-radius:99px; padding:2px 8px; }
.cxordc__items { padding:8px 11px; display:flex; flex-direction:column; gap:5px; }
.cxordc__it { display:flex; gap:6px; font-size:12px; color:var(--ink); }
.cxordc__it span:first-child { flex:1; min-width:0; }
.cxordc__q { color:var(--dim); }
.cxordc__p { font-weight:700; }
.cxordc__tot { display:flex; justify-content:space-between; padding:8px 11px; border-top:1px dashed var(--line-2); font-size:12.5px; }
.cxordc__tot b { font-weight:800; color:var(--navy-900); }
.cxpay { display:flex; align-items:center; gap:10px; width:220px; background:#fff; border:1px solid var(--line); border-radius:13px; padding:11px 13px; }
.cxpay.is-paid { border-color:#bfe6cf; background:#f3fbf6; }
.cxpay__ic { width:36px; height:36px; flex:none; border-radius:10px; display:grid; place-items:center; background:#eef3fb; color:#16294f; }
.cxpay.is-paid .cxpay__ic { background:#e4f5ea; color:#1F8A5B; }
.cxpay__t { font-size:11px; color:var(--dim); }
.cxpay__amt { font-size:16px; font-weight:800; color:var(--navy-900); }
.cxpay__go { margin-left:auto; display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:700; color:var(--navy-700); }

/* composer */
.cxcomp { border-top:1px solid var(--line); padding:10px 13px 13px; position:relative; }
.cxtools { display:flex; gap:7px; margin-bottom:9px; flex-wrap:wrap; }
.cxtool { display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:7px 11px; cursor:pointer; transition:.14s; }
.cxtool:hover { border-color:var(--gold-400); background:#fffdf6; }
.cxtool--ic { padding:7px 9px; }
.cxcomp__bar { display:flex; gap:10px; align-items:flex-end; }
.cxcomp__bar textarea { flex:1; resize:none; border:1px solid var(--line-2); border-radius:var(--r-md); padding:11px 14px; font-family:var(--ff); font-size:13.5px; line-height:1.5; color:var(--ink); outline:none; max-height:120px; }
.cxcomp__bar textarea:focus { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }

/* ---- CRM panel ---- */
.cxcrm { background:var(--surface); border:1px solid var(--line); border-radius:16px; display:flex; flex-direction:column; overflow:hidden; }
.cxcrm__head { display:flex; flex-direction:column; align-items:center; gap:6px; padding:18px 14px 14px; border-bottom:1px solid var(--line); }
.cxcrm__ava { width:56px; height:56px; border-radius:16px; display:grid; place-items:center; background:linear-gradient(150deg,#22386a,#16294f); color:#fff; font-weight:800; font-size:22px; }
.cxcrm__nm { font-size:14px; font-weight:800; color:var(--ink); text-align:center; }
.cxcrm__tier { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:var(--gold-700,#9a7b2e); background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:99px; padding:2px 10px; }
.cxcrm__stats { display:grid; grid-template-columns:repeat(3,1fr); border-bottom:1px solid var(--line); }
.cxcrm__stats > div { text-align:center; padding:11px 4px; border-right:1px solid var(--line); }
.cxcrm__stats > div:last-child { border-right:none; }
.cxcrm__stats b { display:block; font-size:14px; font-weight:800; color:var(--navy-900); }
.cxcrm__stats span { font-size:10px; color:var(--dim); }
.cxcrm__tabs { display:flex; padding:8px 10px 0; gap:3px; border-bottom:1px solid var(--line); }
.cxcrmtab { flex:1; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); background:none; border:none; border-bottom:2px solid transparent; padding:6px 2px 8px; cursor:pointer; }
.cxcrmtab.is-active { color:var(--navy-800); border-bottom-color:var(--gold-500); }
.cxcrm__body { flex:1; min-height:0; overflow-y:auto; padding:13px; display:flex; flex-direction:column; gap:9px; }
.cxinfo { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--ink); line-height:1.4; }
.cxtags { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.cxtag { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:3px 5px 3px 10px; }
.cxtag button { border:none; background:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; padding:0; }
.cxtag button:hover { color:var(--danger-ink,#b42318); }
.cxtag--add { padding:0; }
/* แท็กลัด (preset) — กดเพื่อเพิ่ม เช่น "+ มัดจำ" */
.cxtag--preset { cursor:pointer; color:var(--navy-600); background:none; border:1px dashed var(--line-2); font-family:var(--ff); transition:.12s; }
.cxtag--preset:hover { border-style:solid; border-color:var(--gold-400); background:#fffdf6; color:var(--navy-800); }
.cxtag--add input { border:1px dashed var(--line-2); background:none; border-radius:99px; padding:3px 11px; font-family:var(--ff); font-size:11px; width:92px; outline:none; }
.cxhist { display:flex; flex-direction:column; gap:8px; }
.cxhist__row { display:flex; align-items:center; gap:9px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 11px; }
.cxhist__ic { width:30px; height:30px; flex:none; border-radius:8px; background:var(--surface); border:1px solid var(--line); display:grid; place-items:center; color:var(--navy-700); }
.cxhist__no { font-size:12px; font-weight:700; color:var(--ink); }
.cxhist__dt { font-size:10.5px; color:var(--dim); }
.cxhist__row b { font-size:12.5px; font-weight:800; color:var(--navy-800); }
.cxcart__sum { display:flex; justify-content:space-between; padding:9px 4px 4px; font-size:13px; border-top:1px dashed var(--line-2); }
.cxcart__sum b { font-weight:800; color:var(--navy-900); }
.cxempty { display:flex; flex-direction:column; align-items:center; gap:9px; color:var(--dim); font-size:12px; text-align:center; padding:24px 10px; }
.cxnote-add { display:flex; gap:7px; }
.cxnote-add input { flex:1; border:1px solid var(--line-2); border-radius:9px; padding:8px 11px; font-family:var(--ff); font-size:12px; outline:none; }
.cxnote-add button { width:36px; flex:none; border:none; border-radius:9px; background:var(--navy-700); color:#fff; cursor:pointer; display:grid; place-items:center; }
.cxnote { background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:10px; padding:9px 11px; }
.cxnote__t { font-size:12px; color:var(--ink); line-height:1.45; }
.cxnote__by { font-size:10px; color:var(--dim); margin-top:4px; }
.cxnote__foot { display:flex; align-items:center; justify-content:space-between; margin-top:5px; }
.cxnote__foot>span { font-size:10px; color:var(--dim); }
.cxnote__del { border:none; background:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; padding:2px; border-radius:5px; }
.cxnote__del:hover { color:var(--danger-ink,#b42318); background:#fdecec; }
.cxnote-add button:disabled { opacity:.4; cursor:not-allowed; }
.cxlist__tabs .cxtab, .cxcrm__tabs .cxcrmtab { white-space:nowrap; }
/* channel logos in inbox */
.cxconn__logo { height:15px; width:auto; max-width:22px; object-fit:contain; margin-right:5px; vertical-align:middle; }
.cxchan__logo { height:15px; width:auto; max-width:22px; object-fit:contain; margin-right:5px; vertical-align:middle; }
.cxbadge__logo { width:100%; height:100%; object-fit:contain; border-radius:inherit; }
/* logo channel badge on convo/thread avatar — fixed small box, no overflow */
.cxconvo__badge:has(.cxbadge__logo) { width:18px; min-width:18px; height:18px; padding:1px; overflow:hidden; }
.cxbadge__logo { display:block; }
/* inline channel logo before customer name */
.cxconvo__nm { display:flex; align-items:center; gap:6px; min-width:0; }
.cxconvo__chlogo { flex:none; width:16px; height:16px; object-fit:contain; }
.cxconvo__chdot { flex:none; width:9px; height:9px; border-radius:3px; }
/* marketplace card logo — sizing handled by .mark--logo img (safe, no clip); keep border on tile */
.intg-card__mark.mark--logo { border:1px solid var(--line); }
.intg-card__logo { /* neutralized: .mark--logo img controls size */ }
/* genuine-parts brand chips with logo */
.gpbrand { display:inline-flex; align-items:center; gap:8px; }
.gpbrand__lw { flex:none; width:36px; height:22px; display:inline-flex; align-items:center; justify-content:center; }
.gpbrand__logo { max-height:22px; max-width:36px; width:auto; height:auto; object-fit:contain; }
/* ระเบียบแถวตัวกรอง เช็กอะไหล่แท้ */
.gpfilter { background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:14px; display:flex; flex-direction:column; gap:9px; }
.gpfilter__row { display:grid; grid-template-columns:64px 1fr; align-items:start; gap:12px; }
.gpfilter__row + .gpfilter__row { border-top:1px solid var(--line); padding-top:9px; }
.gpfilter__lbl { font-size:12px; font-weight:700; color:var(--dim); padding-top:7px; }
.gpfilter .dchips { display:flex; flex-wrap:wrap; gap:7px; margin:0; }
/* ชิปยี่ห้อรถ + ยี่ห้ออะไหล่ ขนาดเท่ากันทุกตัว */
.gpbrands .dchip, .gpfilter__row:nth-child(2) .dchip { width:172px; justify-content:center; }
.gpbrands .dchip .gpbrand__lw { margin-left:0; }

/* popovers */
.cxpop { position:absolute; top:calc(100% + 6px); right:0; z-index:60; min-width:200px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 36px rgba(15,30,70,.18); padding:6px; max-height:340px; overflow-y:auto; }
.cxpop__opt { display:flex; align-items:center; gap:9px; width:100%; text-align:left; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; color:var(--ink); padding:8px 9px; border-radius:8px; }
.cxpop__opt:hover { background:var(--surface-2); }
.cxpop__opt b { font-weight:700; display:block; font-size:12.5px; }
.cxpop__opt i { font-style:normal; font-size:10.5px; color:var(--dim); }
.cxpop__ava { width:26px; height:26px; flex:none; border-radius:8px; background:var(--surface-3); color:var(--navy-700); display:grid; place-items:center; font-weight:800; font-size:12px; }
.cxpop--quick { left:0; right:auto; width:340px; top:auto; bottom:calc(100% + 6px); max-height:340px; overflow-y:auto; }
/* sticker picker — เปิดขึ้นบน (เหนือ composer) ไม่ให้จม/ถูกบัง */
.cxpop--sticker { left:auto; right:0; top:auto; bottom:calc(100% + 8px); width:300px; padding:10px; z-index:80; }

/* 🟢 แผงสติกเกอร์แบบ LINE — ธีมสว่าง, เปิดขึ้นบนเหนือ composer */
/* 🟢 แผงสติกเกอร์แบบ LINE — ธีมสว่าง, ยึดกับกล่อง composer (อยู่ในแพเนลเสมอ แม้แบ่งจอ) */
.cxhdbtn-wrap--stk { position:static; }
.stkpanel { position:absolute; right:12px; left:auto; bottom:calc(100% + 6px); width:min(420px, 44vw); height:min(468px, 66vh); background:#fff; border:1px solid var(--line,#e6e9ef); border-radius:12px; box-shadow:0 18px 50px rgba(20,30,60,.22); z-index:90; display:flex; flex-direction:column; overflow:hidden; color:var(--ink,#20242b); }
.stkpanel__top { display:flex; align-items:center; gap:8px; padding:9px 12px; border-bottom:1px solid var(--line,#eef0f4); }
.stkpanel__shelf { width:30px; height:30px; border:none; background:none; color:var(--dim,#8a8f98); border-radius:7px; display:grid; place-items:center; cursor:pointer; }
.stkpanel__shelf:hover { background:var(--surface-2,#f2f4f7); color:var(--ink,#20242b); }
.stkpanel__tabs { flex:1; display:flex; justify-content:center; gap:22px; }
.stkpanel__tab { background:none; border:none; color:var(--dim,#8a8f98); font-family:inherit; font-size:14px; font-weight:700; padding:6px 2px; cursor:pointer; position:relative; }
.stkpanel__tab.is-on { color:var(--ink,#20242b); }
.stkpanel__tab.is-on::after { content:""; position:absolute; left:0; right:0; bottom:-9px; height:2px; background:#08c25a; border-radius:2px; }
.stkpanel__x { width:30px; height:30px; border:none; background:none; color:var(--dim,#8a8f98); border-radius:7px; display:grid; place-items:center; cursor:pointer; }
.stkpanel__x:hover { background:var(--surface-2,#f2f4f7); color:var(--ink,#20242b); }
.stkpanel__sets { display:flex; gap:5px; padding:8px 10px; overflow-x:auto; background:var(--surface-2,#f6f7f9); border-bottom:1px solid var(--line,#eef0f4); scrollbar-width:thin; }
.stkpanel__sets::-webkit-scrollbar { height:5px; } .stkpanel__sets::-webkit-scrollbar-thumb { background:#cfd4dc; border-radius:3px; }
.stkpanel__seticon { flex:none; width:42px; height:42px; border:none; border-radius:9px; background:#fff; color:var(--dim,#8a8f98); display:grid; place-items:center; cursor:pointer; overflow:hidden; padding:3px; box-shadow:0 1px 2px rgba(0,0,0,.05); }
.stkpanel__seticon img { width:100%; height:100%; object-fit:contain; }
.stkpanel__seticon.is-on { box-shadow:inset 0 0 0 2px #08c25a; }
.stkpanel__seticon--add { color:#08a24d; border:1.5px dashed #b9c0cc; background:transparent; box-shadow:none; }
.stkpanel__body { flex:1; overflow-y:auto; padding:14px; scrollbar-width:thin; }
.stkpanel__body::-webkit-scrollbar { width:8px; } .stkpanel__body::-webkit-scrollbar-thumb { background:#cfd4dc; border-radius:4px; }
.stkpanel__grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.stkpanel__cell { position:relative; aspect-ratio:1; }
.stkpanel__cellbtn { width:100%; height:100%; border:none; background:none; border-radius:10px; cursor:pointer; padding:4px; overflow:hidden; }
.stkpanel__cellbtn:hover { background:var(--surface-2,#f2f4f7); }
.stkpanel__cellbtn img { width:100%; height:100%; object-fit:contain; }
.stkpanel__gif { position:absolute; left:5px; bottom:5px; font-size:8px; font-weight:800; color:#fff; background:rgba(0,0,0,.55); border-radius:4px; padding:1px 4px; pointer-events:none; }
.stkpanel__del { position:absolute; top:-5px; right:-5px; width:19px; height:19px; border-radius:50%; border:none; background:#C2402A; color:#fff; font-size:12px; line-height:1; cursor:pointer; display:none; place-items:center; }
.stkpanel__cell:hover .stkpanel__del { display:grid; }
.stkpanel__emoji { border:none; background:none; font-size:30px; line-height:1; padding:5px 0; cursor:pointer; border-radius:8px; }
.stkpanel__emoji:hover { background:var(--surface-2,#f2f4f7); }
.stkpanel__empty, .stkpanel__upzone { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; height:100%; color:var(--dim,#8a8f98); text-align:center; }
.stkpanel__empty span:not(.stkpanel__emptysub) { font-size:14px; font-weight:700; color:var(--ink,#3a3f48); }
.stkpanel__emptysub { font-size:11.5px; color:var(--dim,#9aa0a8); }
.stkpanel__upzone { border:1.5px dashed #b9c0cc; border-radius:14px; background:var(--surface-2,#f6f7f9); cursor:pointer; padding:20px; font-family:inherit; }
.stkpanel__upic { width:52px; height:52px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.08); display:grid; place-items:center; color:#08a24d; }
.stkpanel__uptitle { font-size:14px; font-weight:800; color:var(--ink,#20242b); }
.stkpanel__upsub { font-size:11.5px; color:var(--dim,#8a8f98); line-height:1.5; max-width:240px; }
.stkpanel__foot { border-top:1px solid var(--line,#eef0f4); background:var(--surface-2,#f6f7f9); padding:7px 10px; display:flex; align-items:center; gap:9px; }
.stkpanel__footlb { font-size:11px; font-weight:700; color:var(--dim,#8a8f98); flex:none; }
.stkpanel__footrow { display:flex; gap:5px; overflow-x:auto; flex:1; scrollbar-width:none; }
.stkpanel__footrow::-webkit-scrollbar { display:none; }
.stkpanel__footcell { flex:none; width:40px; height:40px; border:none; background:#fff; border-radius:8px; display:grid; place-items:center; cursor:pointer; overflow:hidden; padding:3px; box-shadow:0 1px 2px rgba(0,0,0,.05); }
.stkpanel__footcell:hover { background:var(--surface-2,#eef1f5); }
.stkpanel__footcell img { width:100%; height:100%; object-fit:contain; }
.stkpanel__footempty { font-size:11px; color:var(--dim,#a2a7af); }
.stkpanel__seticon--mng { color:var(--dim,#8a8f98); border:1px solid var(--line,#e6e9ef); box-shadow:none; }
.stkpanel__seticon--mng.is-on { color:var(--navy-700); box-shadow:inset 0 0 0 2px var(--navy-500,#3a6bc4); }
.stkpanel__manage { display:flex; align-items:center; gap:6px; padding:8px 10px; background:#fbfcfe; border-bottom:1px solid var(--line,#eef0f4); }
.stkpanel__rename { flex:1; min-width:0; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink,#20242b); border:1px solid var(--line,#d9dee6); border-radius:8px; padding:5px 9px; background:#fff; }
.stkpanel__rename:focus { outline:none; border-color:#08a24d; }
.stkpanel__mbtn { flex:none; width:30px; height:30px; border:1px solid var(--line,#e6e9ef); border-radius:8px; background:#fff; color:var(--navy-700); display:grid; place-items:center; cursor:pointer; }
.stkpanel__mbtn:hover { background:var(--surface-2,#f2f4f7); }
.stkpanel__mbtn--del { color:#c0392b; }
.stkpanel__mbtn--del:hover { background:#fdecec; border-color:#f3c6c6; }
.stkpanel__mhint { flex:1; font-size:11.5px; color:var(--dim,#8a8f98); }
.stkpanel__newset { flex:none; display:inline-flex; align-items:center; gap:4px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:#08a24d; background:#eafaf0; border:1px solid #bfe6cd; border-radius:8px; padding:5px 10px; cursor:pointer; }
.stkpanel__newset:hover { background:#dcf4e6; }
.stkpanel__draghint { font-size:11px; color:var(--dim,#8a8f98); margin:0 0 8px; display:flex; align-items:center; gap:5px; }
.stkpanel__cell[draggable="true"] { cursor:grab; }
.stkpanel__cell[draggable="true"]:active { cursor:grabbing; }
.stkpanel__cover { position:absolute; top:-5px; left:-5px; width:19px; height:19px; border-radius:50%; border:none; background:#2A6FDB; color:#fff; display:none; place-items:center; cursor:pointer; }
.stkpanel__cell:hover .stkpanel__cover { display:grid; }
.cxquickgrp { padding:4px 2px; }
.cxquickgrp__h { font-size:10px; font-weight:800; letter-spacing:.04em; color:var(--dim); text-transform:uppercase; padding:5px 8px 3px; }
.cxquick__opt { display:block; width:100%; text-align:left; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12px; line-height:1.4; color:var(--ink); padding:7px 9px; border-radius:8px; }
.cxquick__opt:hover { background:#fffdf6; }

/* product/order modal */
.cxmodal-ov { position:fixed; inset:0; z-index:200; background:rgba(15,25,50,.4); display:grid; place-items:center; padding:20px; backdrop-filter:blur(2px); }
.cxmodal { width:min(640px,96vw); max-height:88vh; background:#fff; border-radius:18px; box-shadow:0 24px 64px rgba(15,30,70,.3); display:flex; flex-direction:column; overflow:hidden; }
.cxmodal__hd { display:flex; align-items:center; gap:11px; padding:15px 17px; border-bottom:1px solid var(--line); }
.cxmodal__ic { width:38px; height:38px; flex:none; border-radius:11px; display:grid; place-items:center; }
.cxmodal__hd h3 { font-size:15px; font-weight:800; color:var(--ink); margin:0; }
.cxmodal__sub { font-size:11.5px; color:var(--dim); margin-top:2px; }
.cxmodal__x { width:30px; height:30px; flex:none; border:none; background:var(--surface-2); border-radius:9px; cursor:pointer; color:var(--dim); display:grid; place-items:center; }
.cxmodal__bd { padding:14px 17px; overflow-y:auto; }
.pgpop .cxmodal__bd { scrollbar-width:none; -ms-overflow-style:none; }
.pgpop .cxmodal__bd::-webkit-scrollbar { width:0; height:0; }
.cxsearch { display:flex; align-items:center; gap:8px; border:1px solid var(--line-2); border-radius:11px; padding:9px 12px; margin-bottom:11px; }
.cxsearch input { flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; }
.cxpicklist { display:flex; flex-direction:column; gap:5px; max-height:300px; overflow-y:auto; }
.cxpickrow { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 11px; cursor:pointer; font-family:var(--ff); }
.cxpickrow:hover { border-color:var(--gold-400); background:#fffdf6; }
.cxpickrow.is-sel { border-color:var(--ok-ink,#1F8A5B); background:#f3fbf6; }
.cxpickrow__ic { width:32px; height:32px; flex:none; border-radius:8px; background:var(--surface); border:1px solid var(--line); display:grid; place-items:center; color:var(--navy-700); }
.cxpickrow__bd { flex:1; min-width:0; }
.cxpickrow__nm { font-size:12.5px; font-weight:700; color:var(--ink); }
.cxpickrow__sub { font-size:10.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxpickrow__pr { font-size:12.5px; font-weight:800; color:var(--navy-800); flex:none; }
.cxcart { border-top:1px solid var(--line); padding:11px 17px; display:flex; flex-direction:column; gap:8px; max-height:200px; overflow-y:auto; background:var(--surface-2); }
.cxcart__row { display:flex; align-items:center; gap:9px; }
.cxcart__nm { flex:1; min-width:0; font-size:12.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cxcart__grade { font-family:var(--ff); font-size:11px; border:1px solid var(--line); border-radius:7px; padding:3px 5px; background:#fff; }
.cxqty { display:inline-flex; align-items:center; gap:8px; }
.cxqty button { width:24px; height:24px; border:1px solid var(--line); background:#fff; border-radius:7px; cursor:pointer; font-size:15px; line-height:1; color:var(--navy-700); }
.cxqty b { min-width:18px; text-align:center; font-size:13px; }
.cxcart__lt { font-size:12.5px; font-weight:800; color:var(--navy-800); min-width:64px; text-align:right; }
.cxcart__rm { border:none; background:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; }
.cxmodal__ft { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 17px; border-top:1px solid var(--line); }
.cxmodal__total { font-size:13px; color:var(--ink); }
.cxmodal__total b { font-size:15px; font-weight:800; color:var(--navy-900); }

@media (max-width: 1320px){
  .cxgrid { grid-template-columns:320px minmax(0,1fr) 320px; }
}
@media (max-width: 1180px){
  .cxgrid { grid-template-columns:300px minmax(0,1fr); }
  .cxcrm { display:none; }
}
.specrow__v--void { text-decoration:line-through; text-decoration-color:var(--danger-ink,#b42318); text-decoration-thickness:2px; color:var(--dim); }
.voidbadge { display:inline-block; margin-left:8px; font-family:var(--ff); font-size:10px; font-weight:800; color:var(--danger-ink,#b42318); background:var(--danger-bg,#fdeceb); border:1px solid #f0c2bd; border-radius:99px; padding:1px 8px; vertical-align:1px; letter-spacing:0; text-decoration:none; }
.code-struck { text-decoration:line-through; text-decoration-color:var(--danger-ink,#b42318); }
.row-void td { color:var(--dim); text-decoration:line-through; text-decoration-color:var(--danger-ink,#b42318); text-decoration-thickness:1.5px; }
.codecell { position:relative; padding-left:26px !important; white-space:nowrap; }
/* คอลัมน์จัดกึ่งกลาง (ที่เก็บ · แบรนด์รถ · ยี่ห้อ · เกรด) — หัวตาราง + เซลล์ (จอเดี่ยว · การ์ด split มีกฎ nth-child เฉพาะที่ specificity สูงกว่าจึงไม่กระทบ) */
.docreg__tbl thead th.colcenter { text-align:center; justify-content:center; }
.docreg__tbl tbody td.colcenter-cell { text-align:center; }
.codecell .favstar { position:absolute; left:7px; top:50%; transform:translateY(-50%); display:inline-flex; line-height:0; }
.pgcol__bd { padding:9px 11px; flex:1; display:flex; flex-direction:column; }
.kvgrid--1 { grid-template-columns:1fr; gap:5px 0; }
.kvgrid--2 { grid-template-columns:1fr 1fr; gap:6px 14px; }
/* tight inline KV (spec-sheet rows) — label left, value right on one line */
.kvgrid--tight { gap:0 18px; }
.kvgrid--tight .kvf { flex-direction:row; align-items:baseline; justify-content:space-between; gap:8px; padding:2px 0; border-bottom:1px dotted var(--line); }
.kvgrid--tight .kvf__k { font-size:11px; white-space:nowrap; flex:none; }
.kvgrid--tight .kvf__v { font-size:12px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.costlist { display:flex; flex-direction:column; gap:4px; }
.costlist__row { display:flex; justify-content:space-between; align-items:baseline; padding:5px 10px; background:var(--surface-2); border-radius:var(--r-sm); font-size:12px; color:var(--ink-2); }
.costlist__row b { font-size:14px; color:var(--ink); }
.costlist__row--sum { background:#fdf6e6; }
.costlist__row--sum b { color:var(--navy-800); }
.costlist__row--buy { align-items:flex-start; }
.costlist__date { color:var(--navy-600); font-weight:700; margin-left:7px; }
.costlist__sup { display:block; color:var(--dim); font-size:11px; font-weight:400; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:150px; }
.pgactions { display:flex; gap:8px; margin-top:auto; padding-top:10px; }
.pgswitch { margin-bottom:8px; }

/* KACC9 spreadsheet detail form (column ①) */
.dsheet { display:grid; grid-template-columns:repeat(12,1fr); gap:1px; background:color-mix(in srgb, var(--navy-700) 24%, #fff); border:1px solid color-mix(in srgb, var(--navy-700) 24%, #fff); border-radius:var(--r-sm); overflow:hidden; }
.dsheet__lb, .dsheet__val { padding:3.5px 8px; display:flex; align-items:center; min-width:0; font-size:12px; line-height:1.3; }
.dsheet__lb { background:color-mix(in srgb, var(--navy-600) 13%, #fff); font-weight:700; color:var(--navy-800); font-size:11px; }
.dsheet__val { background:#fff; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dsheet__val.mono { font-family:"Noto Sans",sans-serif; }
.dsheet__val.accent { color:var(--navy-700); font-weight:800; }
.dsheet__val--name { font-weight:800; color:var(--navy-800); white-space:normal; }
.dsheet__hint { color:var(--dim); font-style:italic; font-size:11px; }
.dsheet__edit { color:var(--dim); font-size:10px; margin-left:auto; font-style:italic; white-space:nowrap; }
.dsheet__val--input { padding:2px 5px; }
.dsheet__sel { width:100%; border:1px solid var(--line-2); border-radius:5px; padding:3px 7px; font-family:var(--ff); font-size:12px; color:var(--ink); background:var(--surface-2); cursor:pointer; }
.dsheet__sel:focus { outline:none; border-color:var(--navy-600); background:#fff; }
.ynflag { display:inline-grid; place-items:center; min-width:22px; height:18px; border-radius:4px; font-size:11px; font-weight:800; font-family:"Noto Sans",sans-serif; }
.ynflag--y { background:var(--ok-bg); color:var(--ok-ink); }
.ynflag--n { background:var(--surface-3); color:var(--dim); }
.dsheet__val--hlo { padding:0; }
.hlo { flex:1; display:flex; align-items:center; justify-content:center; gap:4px; padding:3px 4px; font-size:11px; font-weight:700; color:var(--ink); font-family:"Noto Sans",sans-serif; min-width:0; }
.hlo + .hlo { border-left:1px solid color-mix(in srgb, var(--navy-700) 16%, #fff); }
.hlo i { font-style:normal; font-size:9px; font-weight:800; color:#fff; background:var(--navy-600); border-radius:3px; padding:1px 4px; flex:none; }

/* clean product spec layout (column ①) */
.pspec { display:flex; flex-direction:column; flex:1; }
.pspec__name { display:flex; flex-direction:column; gap:1px; line-height:1.3; padding-bottom:9px; margin-bottom:3px; border-bottom:2px solid var(--navy-700); }
.pspec__part { font-size:14px; font-weight:800; color:var(--navy-800); text-wrap:balance; }
.pspec__model { font-size:12px; font-weight:600; color:var(--ink-2); text-wrap:balance; }
.pspec__grid { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
.specrow { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:4.5px 0; border-bottom:1px dotted var(--line); min-width:0; }
.specrow--span { grid-column:1 / -1; }
.specrow__k { font-size:11px; color:var(--dim); font-weight:600; white-space:nowrap; flex:none; }
.specrow__v { font-size:12px; color:var(--ink); font-weight:600; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.specrow__v.mono { font-family:"Noto Sans",sans-serif; }
.specrow__v.accent { color:var(--navy-700); font-weight:800; }
.specrow__v--wrap { display:inline-flex; flex-wrap:wrap; align-items:center; gap:5px 6px; white-space:normal; overflow:visible; text-overflow:clip; justify-content:flex-end; }
.specrow__v--wrap > span { margin-left:0 !important; }
.specrow__hint { color:var(--dim); font-style:italic; font-weight:400; }
.specrow--input { align-items:center; }
.duospec { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; padding:4.5px 0; border-bottom:1px dotted var(--line); min-width:0; }
.duospec__pair { display:flex; align-items:baseline; justify-content:space-between; gap:8px; min-width:0; }
.duospec__pair .specrow__v { text-align:right; }
.specrow--input .specrow__k { flex:none; }
.specrow__sel { flex:1; margin-left:6px; border:1px solid var(--line-2); border-radius:6px; padding:4px 8px; font-family:var(--ff); font-size:12px; color:var(--ink); background:var(--surface-2); cursor:pointer; }
.specrow__sel:focus { outline:none; border-color:var(--navy-600); background:#fff; }
.oemrow { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; align-items:center; padding:4.5px 0; border-bottom:1px dotted var(--line); }
.oemrow__main { display:flex; align-items:center; gap:7px; min-width:0; }
.oemrow__old { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.oemrow__old .oemsel__old { font-family:"Noto Sans",sans-serif; font-weight:700; color:var(--ink); }
.oemsel__cur { font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:800; color:var(--navy-800); letter-spacing:.4px; white-space:nowrap; }
.oemrow__main .oemsel__tag { margin-left:auto; }
.oemsel__tag { flex:none; font-size:9.5px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border-radius:99px; padding:1px 7px; }
.oemsel__old { border:1px solid var(--line-2); border-radius:6px; padding:2px 6px; font-family:var(--ff); font-size:10.5px; font-weight:600; color:var(--ink-2); background:var(--surface-2); cursor:pointer; }
.oemsel__old:focus { outline:none; border-color:var(--navy-600); }

/* keyboard-shortcut help FAB + popover */
.sc-rowsel { outline:2px solid var(--gold-400); outline-offset:-2px; border-radius:6px; }
tr.sc-rowsel > td { background:rgba(245,164,0,.12) !important; }
.kbfab { position:fixed; right:22px; bottom:22px; z-index:120; width:48px; height:48px; border-radius:50%; border:none; cursor:pointer; background:var(--navy-700); color:#fff; box-shadow:0 6px 18px rgba(11,26,51,.32); display:grid; place-items:center; transition:transform .14s, background .14s; }
.kbfab:hover { background:var(--navy-800); transform:translateY(-2px); }
.kbfab.is-open { background:var(--navy-800); }
.kbfab__x { font-size:26px; font-weight:400; line-height:1; }
.kbpop { position:fixed; right:22px; bottom:80px; z-index:120; width:312px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-lg); padding:14px 15px; animation:fade .15s ease; }
.kbpop__hd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:800; color:var(--navy-800); margin-bottom:11px; }
.kbpop__row { display:flex; gap:11px; align-items:flex-start; padding:7px 0; border-top:1px solid var(--line); font-size:12px; color:var(--ink-2); line-height:1.45; }
.kbkeys { flex:none; display:flex; align-items:center; gap:3px; white-space:nowrap; }
.kbpop kbd { font-family:"Noto Sans",sans-serif; font-size:11px; font-weight:700; color:var(--navy-800); background:var(--surface-2); border:1px solid var(--line-2); border-bottom-width:2px; border-radius:5px; padding:2px 6px; }
.kbpop__note { font-size:10.5px; color:var(--dim); margin-top:9px; padding-top:9px; border-top:1px dashed var(--line-2); font-style:italic; }
.pspec__foot { margin-top:auto; display:grid; grid-template-columns:1fr 1fr; gap:8px; padding-top:11px; }
.spbox { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:7px 11px; }
.spbox__k { font-size:10.5px; color:var(--dim); font-weight:700; margin-bottom:1px; }
.spbox__v { font-size:17px; font-weight:800; color:var(--navy-800); line-height:1.1; }
.spbox__v small { font-size:11px; font-weight:600; color:var(--ink-2); }
.spbox__sub { font-size:9.5px; color:var(--dim); font-style:italic; margin-top:2px; }
.spbox__hlo { display:flex; gap:4px; margin-top:3px; }
.spbox__hlo .hlo { flex:1; padding:2px; background:#fff; border:1px solid var(--line); border-radius:5px; }
.spbox__hlo .hlo + .hlo { border-left:1px solid var(--line); }
.hloedit { width:100%; border:none; outline:none; background:none; font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:800; color:var(--navy-800); text-align:center; padding:0; -moz-appearance:textfield; }
.hloedit::-webkit-outer-spin-button, .hloedit::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.spbox__hlo .hlo:focus-within { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); }
.selltbl__price { width:78px; border:1.5px solid var(--gold-400); outline:none; background:#fffdf6; font-family:"Noto Sans",sans-serif; font-size:14px; font-weight:800; color:var(--navy-800); text-align:right; border-radius:7px; padding:4px 8px; -moz-appearance:textfield; }
.selltbl__price:focus { box-shadow:0 0 0 3px var(--gold-glow); }
.selltbl__price::-webkit-outer-spin-button, .selltbl__price::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

/* free-text note (column ② footer) */
.pnote { display:flex; flex-direction:column; flex:1; margin-top:11px; min-height:90px; }
.pnote__hd { display:flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; color:var(--dim); margin-bottom:5px; }
.pnote__ta { flex:1; width:100%; resize:none; border:1px solid var(--line); border-radius:var(--r-sm); background:#fffdf6; padding:8px 10px; font-family:var(--ff); font-size:12px; line-height:1.5; color:var(--ink); }
.pnote__ta::placeholder { color:var(--dim); }
.pnote__ta:focus { outline:none; border-color:var(--gold-400); box-shadow:0 0 0 3px var(--gold-glow); }
/* admin passcode (edit/delete) modal */
.authlock { display:flex; align-items:center; gap:11px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:11px 13px; margin-bottom:16px; }
.authlock div { display:flex; flex-direction:column; min-width:0; }
.authlock b { font-size:12.5px; color:var(--navy-800); }
.authlock span { font-size:11.5px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.authlbl { display:block; font-size:11.5px; font-weight:700; color:var(--ink-2); margin-bottom:6px; }
.authpin { width:100%; border:1.5px solid var(--line-2); border-radius:var(--r-sm); padding:11px 14px; font-family:"Noto Sans",sans-serif; font-size:20px; font-weight:700; letter-spacing:6px; text-align:center; color:var(--ink); }
.authpin:focus { outline:none; border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.authpin.is-err { border-color:var(--danger); box-shadow:0 0 0 3px var(--danger-bg); }
.autherr { display:flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--danger); margin-top:8px; }
.authhint { font-size:11px; color:var(--dim); margin-top:9px; }
/* slim variant bar above the 3 columns */
.pgvar { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.pgvar__lb { font-size:11px; font-weight:700; color:var(--dim); font-family:"Noto Sans",sans-serif; flex:none; }
.grandbox__inline { display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:5px; font-size:11.5px; color:var(--dim); }
.grandbox__inline span { display:inline-flex; align-items:center; gap:5px; }
/* compact variant segbar inside column ① header — รวมปุ่มกันราคาไว้ในกรอบเดียว */
.pgcol__hdseg { margin-left:auto; display:inline-flex; align-items:center; gap:3px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); padding:2px; }
.pgcol__hdseg .segbar { padding:0; border:none; background:none; border-radius:0; }
.pgcol__hdseg .segbar__b { padding:2px 12px; font-size:11.5px; }
.pgcol__hdbtn { display:inline-flex; align-items:center; justify-content:center; width:26px; height:24px; padding:0; border:none; background:none; border-left:1px solid var(--line-2); margin-left:1px; border-radius:calc(var(--r-md) - 4px); color:var(--ok-ink,#1F8A5B); cursor:pointer; transition:background .12s; }
.pgcol__hdbtn:hover { background:#d6efe1; }

/* cost table: per small-unit & per big-unit (KACC9 ราคาตั้ง/ส่วนลด/ทุนสุทธิ) */
.costtbl { border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.costtbl__hd, .costtbl__row { display:grid; grid-template-columns:minmax(0,1.2fr) 1fr 1fr; gap:8px; padding:4px 11px; align-items:center; }
.costtbl__hd { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10px; font-weight:700; color:var(--dim); letter-spacing:.2px; font-family:"Noto Sans",sans-serif; }
.costtbl__hd .num, .costtbl__row .num { text-align:right; }
.costtbl__row { font-size:12.5px; }
.costtbl__row span:first-child { font-weight:600; color:var(--ink-2); }
.costtbl__row + .costtbl__row { border-top:1px solid var(--line); }
.costtbl__row--net { background:#fdf6e6; }
.costtbl__row--net .thb { font-weight:800; color:var(--navy-800); }
.discpill { display:inline-block; background:#fdf6e6; color:var(--gold-600); border:1px solid var(--gold-300); border-radius:99px; padding:1px 9px; font-size:11.5px; font-weight:800; font-family:"Noto Sans",sans-serif; }
.costtbl__row--new { background:rgba(31,138,91,.07); }
.costtbl__row--new span:first-child { display:flex; align-items:center; gap:6px; }
.costtbl__row--new .thb { color:var(--ok-ink); font-weight:800; }
.newpill { font-family:var(--ff); font-size:9.5px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border:1px solid #bfe6d3; border-radius:99px; padding:0 6px; white-space:nowrap; }
.costtbl__row--net span:first-child { display:inline-flex; align-items:center; gap:6px; }
.vatpill { font-family:var(--ff); font-size:9.5px; font-weight:800; color:var(--navy-700); background:var(--surface-3,#eef1f6); border:1px solid var(--line-2); border-radius:99px; padding:0 6px; white-space:nowrap; }

/* product image carousel (column ③ ราคาขาย) */
.pgallery { margin-top:9px; flex:1; display:flex; flex-direction:column; min-height:0; }
.pgallery__stage { position:relative; flex:1; aspect-ratio:4 / 3; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); overflow:hidden; display:flex; align-items:center; justify-content:center; }
.pgallery__stage--sm { aspect-ratio:auto; min-height:150px; }
.pgallery__ph { display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--dim); }
.pgallery__phtxt { font-size:11.5px; font-weight:700; font-family:"Noto Sans",sans-serif; }
.pgallery__nav { position:absolute; top:50%; transform:translateY(-50%); width:30px; height:30px; border-radius:50%; border:1px solid var(--line); background:rgba(255,255,255,.92); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; box-shadow:var(--sh-sm); transition:background .12s, transform .12s; }
.pgallery__nav:hover { background:#fff; }
.pgallery__nav:active { transform:translateY(-50%) scale(.92); }
.pgallery__nav--prev { left:8px; }
.pgallery__nav--next { right:8px; }
.pgallery__count { position:absolute; right:8px; bottom:8px; background:rgba(22,41,79,.82); color:#fff; font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:99px; }
.pgallery__dots { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin-top:8px; margin-bottom:14px; }
.pgallery__dot { width:7px; height:7px; padding:0; border:none; border-radius:50%; background:var(--line-2); cursor:pointer; transition:background .12s, transform .12s; }
.pgallery__dot:hover { background:var(--dim); }
.pgallery__dot.is-active { background:var(--navy-700); transform:scale(1.25); }
.pgallery__zoom { position:absolute; left:8px; bottom:8px; width:28px; height:28px; border-radius:50%; border:1px solid var(--line); background:rgba(255,255,255,.92); color:var(--navy-700); display:grid; place-items:center; cursor:pointer; box-shadow:var(--sh-sm); transition:background .12s, transform .12s; }
.pgallery__zoom:hover { background:#fff; }
.pgallery__zoom:active { transform:scale(.9); }
/* image lightbox */
.imglb { position:fixed; inset:0; z-index:120; display:flex; align-items:center; justify-content:center; background:rgba(15,23,42,.62); backdrop-filter:blur(2px); padding:32px; }
.imglb__box { position:relative; width:min(720px,92vw); background:var(--surface); border-radius:var(--r-md); box-shadow:0 24px 70px rgba(0,0,0,.4); padding:18px; }
.imglb__x { position:absolute; top:12px; right:12px; width:32px; height:32px; border-radius:50%; border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2); display:grid; place-items:center; cursor:pointer; z-index:2; }
.imglb__x:hover { background:var(--surface-3,#eef1f6); }
.imglb__stage { position:relative; aspect-ratio:4 / 3; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); overflow:hidden; display:flex; align-items:center; justify-content:center; margin-bottom:12px; }
.imglb__stage .pgallery__nav { width:38px; height:38px; }
.imglb__stage .pgallery__count { right:12px; bottom:12px; }

/* sell quick-quote table: ส่วนลด | ราคาหน่วยย่อย | ราคาหน่วยใหญ่ (editable %) */
.selltbl { border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.selltbl__hd, .selltbl__row { display:grid; grid-template-columns:minmax(0,.92fr) 1fr 1fr; gap:8px; padding:4px 11px; align-items:center; }
.selltbl__hd { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10px; font-weight:700; color:var(--dim); font-family:"Noto Sans",sans-serif; }
.selltbl__hd .num, .selltbl__row .num { text-align:right; }
.selltbl__row { font-size:13px; }
.selltbl__row + .selltbl__row { border-top:1px solid var(--line); }
.selltbl__pct { display:flex; align-items:center; gap:3px; }
.selltbl__in { width:56px; border:1.5px solid var(--line-2); border-radius:6px; padding:3px 7px; font-family:"Noto Sans",sans-serif; font-size:12.5px; font-weight:700; text-align:right; color:var(--ink); background:var(--surface); cursor:text; }background:var(--surface); -moz-appearance:textfield; }
.selltbl__in::-webkit-outer-spin-button, .selltbl__in::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.selltbl__in:focus { outline:none; border-color:var(--gold-500); box-shadow:0 0 0 2px #fdf6e6; }
.selltbl__sign { font-size:11px; color:var(--dim); font-weight:700; }
.selltbl__row--base { background:#fdf6e6; }
.selltbl__row--base .selltbl__in { border-color:var(--gold-300); }
.selltbl__row--base .thb { font-weight:800; color:var(--navy-800); }
.selltbl__row--up { background:rgba(31,138,91,.07); }
.selltbl__row--up .selltbl__in { color:var(--ok-ink); border-color:rgba(31,138,91,.4); }
.selltbl__row--down .selltbl__in { color:var(--gold-600); }
.selltbl__hdlbl { display:inline-flex; align-items:center; gap:4px; }
.infohint { position:relative; display:inline-flex; align-items:center; color:var(--dim); cursor:help; outline:none; }
.infohint:hover, .infohint:focus { color:var(--navy-600); }
.infohint__pop { position:absolute; top:calc(100% + 8px); bottom:auto; left:-10px; transform:translateY(-3px); width:max-content; max-width:208px; background:var(--navy-800,#16294f); color:#fff; font-size:11px; font-weight:600; line-height:1.45; letter-spacing:0; text-transform:none; padding:7px 10px; border-radius:7px; box-shadow:0 6px 20px rgba(0,0,0,.22); opacity:0; visibility:hidden; transition:opacity .14s ease, transform .14s ease; z-index:20; pointer-events:none; }
.infohint__pop::after { content:""; position:absolute; bottom:100%; left:15px; transform:none; border:5px solid transparent; border-bottom-color:var(--navy-800,#16294f); }
.infohint:hover .infohint__pop, .infohint:focus .infohint__pop { opacity:1; visibility:visible; transform:translateY(0); }
/* online mode: wider first column + marketplace label */
.selltbl--online .selltbl__hd, .selltbl--online .selltbl__row { grid-template-columns:minmax(0,1.55fr) 1fr 1fr; }
.selltbl__mkt { flex:1; min-width:0; width:0; border:1px solid var(--line-2); border-radius:5px; padding:2px 7px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); background:var(--surface); }
.selltbl__mkt::placeholder { color:var(--dim); font-weight:400; }
.selltbl__mkt:focus { outline:none; border-color:var(--navy-600); }
.selltbl__tag { font-family:var(--ff); font-size:10.5px; font-weight:700; color:var(--navy-700); background:var(--info-bg); border-radius:99px; padding:1px 9px; white-space:nowrap; }
@media (max-width:1080px){ .pg3 { grid-template-columns:1fr 1fr; } }
@media (max-width:760px){ .pg3 { grid-template-columns:1fr; } .kvgrid--2 { grid-template-columns:1fr 1fr; } }

.kvgrid { display:grid; grid-template-columns:1fr 1fr; gap:11px 20px; }
.kvf { display:flex; flex-direction:column; gap:1px; min-width:0; }
.kvf--wide { grid-column:1 / -1; }
.kvf__k { font-size:10.5px; color:var(--dim); font-family:"Noto Sans",sans-serif; letter-spacing:.2px; }
.kvf__v { font-size:13px; font-weight:700; color:var(--ink); }

/* sourcing table */
.srctbl { border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; }
.srctbl__hd, .srctbl__row { display:grid; grid-template-columns:minmax(0,1.7fr) .9fr .8fr .9fr; gap:8px; padding:8px 12px; align-items:center; }
.srctbl__hd { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; font-family:"Noto Sans",sans-serif; }
.srctbl__hd .num, .srctbl__row .num { text-align:right; }
.srctbl__row + .srctbl__row { border-top:1px solid var(--line); }
.srctbl__row { font-size:12.5px; }
.srctbl__sup { display:flex; align-items:center; gap:7px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.srctbl__sup i { width:7px; height:7px; border-radius:50%; background:var(--gold-500); flex:none; }
.srctbl__sum { display:grid; grid-template-columns:minmax(0,1.7fr) .9fr .8fr .9fr; gap:8px; padding:10px 12px; align-items:center; background:#16294f; color:#fff; font-size:11.5px; }
.srctbl__sum .num { text-align:right; }
.srctbl__sum b { color:var(--gold-400); font-size:13px; }
.srctbl__sum .thb::before { color:var(--gold-300); }

/* barcode table (per grade+brand/source, each with its own stock) */
.bcoem { display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#fdf6e6; border:1px solid var(--gold-300); border-radius:var(--r-sm); padding:8px 13px; margin-bottom:11px; }
.bcoem__lb { font-size:10.5px; font-weight:700; color:var(--gold-600); text-transform:uppercase; letter-spacing:.3px; }
.bcoem__no { font-family:"Noto Sans",sans-serif; font-size:15px; font-weight:800; color:var(--navy-800); letter-spacing:.5px; }
.bcoem__note { font-size:11px; color:var(--ink-2); }
.bchint { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--dim); margin-bottom:9px; line-height:1.4; }
.bctbl { border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; }
.bctbl__hd, .bctbl__row { display:grid; grid-template-columns:minmax(0,1.6fr) 1fr .85fr .85fr .7fr .6fr 40px; gap:10px; padding:8px 12px; align-items:center; }
.bctbl__hd { background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; font-family:"Noto Sans",sans-serif; }
.bctbl__hd .num, .bctbl__row .num { text-align:right; }
.bctbl__row { font-size:12.5px; }
.bctbl__row + .bctbl__row { border-top:1px solid var(--line); }
.bctbl__row:hover { background:var(--surface-2); }
.bctbl__code { display:flex; align-items:center; gap:7px; min-width:0; }
.bctbl__code--link { border:none; background:none; padding:0; cursor:pointer; font-family:inherit; text-align:left; }
.bctbl__code--link b { transition:color .12s; }
.bctbl__code--link:hover b { color:var(--gold-600); text-decoration:underline; text-underline-offset:2px; }
.bctbl__code--link:active { transform:scale(.98); }
.bctbl__unit { font-size:12px; color:var(--dim); white-space:nowrap; }
.bctbl__code b { font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:700; color:var(--navy-800); letter-spacing:.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bctbl__brand { font-weight:800; color:var(--navy-700); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bctbl__sup { color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bctbl__qty b { font-weight:800; color:var(--navy-800); }
.bctbl__qty.is-low b { color:var(--danger); }
.bctbl__qty small { color:var(--dim); font-weight:400; font-size:10.5px; }
.bctbl__print { border:1px solid var(--line-2); background:var(--surface); border-radius:7px; width:30px; height:28px; display:grid; place-items:center; cursor:pointer; color:var(--navy-700); justify-self:end; }
.bctbl__print:hover { border-color:var(--gold-400); background:#fffdf6; }
.bctbl__sum { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; background:#16294f; color:#fff; font-size:11.5px; }
.bctbl__sum .num { text-align:right; }
.bctbl__sum b { color:var(--gold-400); font-size:14px; margin-left:4px; }

.grandbox { margin-top:8px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:7px 11px; }
.grandbox__row { display:flex; justify-content:space-between; align-items:baseline; font-size:12.5px; color:var(--ink-2); }
.grandbox__row b { font-size:15px; font-weight:800; color:var(--navy-800); }
.grandbox__sub { display:flex; justify-content:space-between; font-size:12px; color:var(--dim); padding:4px 0 0; }
.grandbox__sub span:first-child { display:inline-flex; align-items:center; gap:6px; }
.dotg { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dotg--real { background:var(--ok); }
.dotg--alt { background:var(--info); }

/* ledger tabs */
.ptab-scroll { overflow:auto; }
.histcap { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:7px 11px; margin-bottom:10px; }
.histcap b { color:var(--navy-800); letter-spacing:.3px; }
.ledger .row-back td { background:rgba(217,119,6,.07); }
.histlink { border:none; background:none; padding:0; cursor:pointer; font-family:inherit; font-size:inherit; font-weight:700; color:var(--navy-600); text-decoration:none; }
.histlink:hover { color:var(--gold-600); text-decoration:underline; text-underline-offset:2px; }
.histlink--alt { color:var(--ink-2); font-weight:600; }
.histlink--alt:hover { color:var(--gold-600); }
/* stock-card: distinguish buy (incoming) vs sell (outgoing) rows */
.cardrow td:first-child { border-left:3px solid transparent; }
.cardrow--buy td:first-child { border-left-color:var(--navy-500,#3a5a93); }
.cardrow--sell td:first-child { border-left-color:#d99000; }
.cardrow--buy td { background:rgba(42,90,160,.045); }
.cardrow--sell td { background:rgba(217,144,0,.05); }
.cellsub { display:block; font-size:10.5px; color:var(--dim); opacity:.85; margin-top:1px; }
/* inline edit fields — sit in the value slot, right-aligned, subtle (preserve layout) */
.specrow__edit { flex:1; min-width:0; width:auto; text-align:right; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink); background:rgba(217,164,65,.10); border:1px solid transparent; border-bottom:1px solid var(--gold-400,#d9a441); border-radius:5px; padding:3px 7px; outline:none; }
.specrow__edit:focus { background:#fff; border-color:var(--gold-500,#c89a3a); box-shadow:0 0 0 2px rgba(217,164,65,.2); }
.specrow__edit.mono { font-family:"Noto Sans",sans-serif; letter-spacing:.3px; }
select.specrow__edit { cursor:pointer; text-align:left; }
.duospec__pair .specrow__edit, .oemrow__main .specrow__edit { flex:1; }
.oemrow__main .specrow__edit { margin-left:4px; }
.bigunit-edit { flex:1; display:flex; align-items:center; justify-content:flex-end; gap:5px; }
.bigunit-edit .specrow__edit { flex:none; text-align:left; }
.bigunit-x { color:var(--dim); font-size:12px; }
.costedit { max-width:96px; }
.catsel { position:relative; flex:1; display:flex; justify-content:flex-end; min-width:0; }
.catsel__btn { display:flex; align-items:center; justify-content:space-between; gap:6px; cursor:pointer; max-width:120px; }
.catsel__code { font-weight:700; color:var(--navy-800); }
.catsel__pop { position:absolute; top:calc(100% + 4px); right:0; z-index:40; min-width:230px; max-height:280px; overflow-y:auto; background:#fff; border:1px solid var(--line); border-radius:var(--r-sm); box-shadow:var(--sh-lg,0 12px 32px rgba(8,16,34,.18)); padding:4px; }
.catsel__opt { display:block; width:100%; text-align:left; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12px; color:var(--ink); padding:7px 9px; border-radius:6px; white-space:nowrap; }
.catsel__opt:hover { background:var(--surface-2); }
.catsel__opt.is-sel { background:rgba(217,164,65,.14); color:var(--navy-800); font-weight:700; }
.ledger { min-width:680px; }
.ledger thead th { position:sticky; top:0; background:var(--surface-2); z-index:1; }

@media (max-width:1080px){
  .pg { grid-template-columns:1fr; }
  .kvgrid { grid-template-columns:1fr; }
}

/* ===== product action flows: add/edit form + barcode print modal ===== */
.pfmodal, .pbmodal { width:min(640px,94vw); display:flex; flex-direction:column; max-height:88vh; }
.pfmodal__bd, .pbmodal__bd { overflow:auto; padding:18px 22px; }
.pfgrid { display:grid; grid-template-columns:1fr 1fr; gap:13px 16px; }
.pfsep { font-size:11.5px; font-weight:700; color:var(--navy-700); text-transform:none; padding-top:6px; margin-top:2px; border-top:1px dashed var(--line-2); }
.pfseg { display:flex; gap:6px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:3px; }
.pfseg__b { flex:1; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--dim); padding:6px 0; border-radius:6px; }
.pfseg__b.is-on { background:var(--navy-700); color:#fff; }
.pfmodal__ft, .pbmodal .pfmodal__ft { display:flex; align-items:center; justify-content:flex-end; gap:9px; padding:13px 22px; border-top:1px solid var(--line); }
.pbtotal { margin-right:auto; font-size:12.5px; color:var(--ink-2); }
.pbtotal b { color:var(--navy-800); font-size:15px; }
.pbnote { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--dim); margin-bottom:12px; }
.pblist { display:flex; flex-direction:column; gap:14px; }
.pbcard { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:var(--r-md); padding:11px 13px; background:var(--surface); cursor:pointer; transition:border-color .12s, opacity .12s; }
.pbcard:hover { border-color:var(--navy-300,#9fb3d4); }
.pbcard.is-off { opacity:.5; }
.pbcard__ck { width:17px; height:17px; flex:none; accent-color:var(--navy-700); }
.pbcard > .pbcard__ck { position:absolute; top:16px; left:16px; z-index:2; }
.pblabel { flex:1; min-width:0; border:1px dashed var(--line-2); border-radius:7px; padding:8px 11px; background:#fff; }
.pblabel__top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:5px; }
.pblabel__top b { font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pbgrade { font-family:var(--ff); font-size:10px; font-weight:800; border-radius:99px; padding:1px 8px; white-space:nowrap; }
.pbgrade--real { color:var(--ok-ink); background:var(--ok-bg); }
.pbgrade--alt { color:var(--navy-700); background:var(--info-bg,#eaf0fb); }
.pblabel__bot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:5px; font-size:11.5px; color:var(--ink-2); }
.pblabel__bot .mono { font-weight:700; letter-spacing:.4px; color:var(--navy-800); }

/* ===== print-label modal: enlarged + designed sticker preview + job cards ===== */
.pbmodal { width:min(780px,95vw); }
.pbcard { padding:16px 18px 16px 44px; align-items:center; gap:18px; position:relative; }
.pblabelwrap { flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:8px; }
.pblabelwrap .stkprev { max-width:252px; }
.pblabel__cap { display:flex; align-items:center; gap:9px; font-size:11.5px; color:var(--ink-2); flex-wrap:wrap; justify-content:center; }
.pblabel__cap .mono { font-weight:800; letter-spacing:.4px; color:var(--navy-800); }
.pbqty { display:flex; flex-direction:column; align-items:flex-end; gap:6px; flex:none; }
.pbqty > span { font-size:10.5px; color:var(--dim); }
.pbprevb { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:var(--surface-2); border-radius:7px; padding:5px 9px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); cursor:pointer; white-space:nowrap; }
.pbprevb:hover { border-color:var(--navy-300,#9fb3d4); color:var(--navy-800); }
/* designed 5×3.5cm sticker render */
.stkprev { position:relative; aspect-ratio:5 / 3.5; background:#fff; border:1px solid var(--line-2); border-radius:5px; box-shadow:var(--sh-sm); overflow:hidden; font-family:"THSarabunNew","Noto Sans Thai",sans-serif; color:#10203f; flex:none; }
.stkprev__f { position:absolute; line-height:1.04; white-space:pre-wrap; overflow:hidden; }
.stkprev .bcbars { height:100%; }
/* job cards (รายการรอสั่งพิมพ์) */
.pbjobs { display:flex; flex-direction:column; gap:10px; }
.pbjob { display:flex; align-items:center; gap:13px; border:1px solid var(--line); border-left:4px solid var(--line-2); border-radius:var(--r-md); padding:13px 15px; background:var(--surface); cursor:pointer; transition:border-color .12s, background .12s; }
.pbjob:hover { border-color:var(--navy-300,#9fb3d4); }
.pbjob.is-sel { background:#fdf6e6; border-color:var(--gold-400); }
.pbjob--printed { border-left-color:#1F9D6B; }
.pbjob--queued { border-left-color:#C2871A; background:#fffaf2; }
.pbjob--canceled { border-left-color:#9aa3b2; opacity:.6; }
.pbjob__main { flex:1; min-width:0; }
.pbjob__top { display:flex; align-items:center; gap:9px; }
.pbjob__id { font-size:13.5px; font-weight:800; color:var(--navy-800); }
.pbjob--printed .pbjob__id { color:#178a5e; }
.pbjob--queued .pbjob__id { color:#a06f14; }
.pbjob__status { font-family:var(--ff); font-size:10px; font-weight:800; border-radius:99px; padding:2px 9px; }
.pbjob__prod { font-size:13px; font-weight:600; color:var(--ink); margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pbjob__meta { display:flex; gap:12px; font-size:11px; color:var(--dim); margin-top:3px; }
.pbjob__r { display:flex; flex-direction:column; align-items:flex-end; gap:7px; flex:none; }
.pbjob__qty b { font-size:19px; font-weight:800; color:var(--navy-800); }
.pbjob__qty span { font-size:10px; color:var(--dim); margin-left:3px; }
.pbjob__re { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:var(--surface-2); border-radius:7px; padding:5px 10px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); cursor:pointer; white-space:nowrap; }
.pbjob__re:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }
.pblegend { display:flex; align-items:center; gap:16px; margin-bottom:11px; font-size:11.5px; color:var(--ink-2); }
.pblegend span { display:inline-flex; align-items:center; gap:6px; }
.pblegend i { width:11px; height:11px; border-radius:3px; display:inline-block; }
.bcbars { display:flex; align-items:stretch; gap:0; width:100%; overflow:hidden; }
.bcbars i { display:block; flex:none; }
.pbqty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; flex:none; width:90px; }
.pbqty span { font-size:10.5px; color:var(--dim); }
.pbqty .sin { width:60px; text-align:center; }

/* ====================================================================
   LOGIN v4 — minimal/cartoon: blue hero + cartoon car + floating card
   + recent users.  Big brand lockup.
   ==================================================================== */
.loginwrap--v4 { position:fixed; inset:0; z-index:120; font-family:var(--ff); background:#EEF2F9;
  display:flex; align-items:center; justify-content:center; padding:26px; overflow:auto; }
.loginwrap--v4 * { box-sizing:border-box; }
.l4-stage { position:relative; width:100%; max-width:1080px; min-height:626px; }

/* hero band */
.l4-hero { position:absolute; top:0; left:0; right:0; height:394px; border-radius:30px; overflow:hidden;
  padding:42px 48px; color:#fff;
  background:linear-gradient(135deg,#1f54c4 0%,#163f9c 52%,#0f2f7a 100%); }
.l4-hero__glow { position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(440px 320px at 84% 16%, rgba(255,255,255,.18), transparent 70%),
            radial-gradient(380px 300px at 16% 116%, rgba(245,164,0,.14), transparent 64%); }

/* big brand lockup */
.l4-brand { position:relative; z-index:2; display:flex; align-items:center; gap:20px; }
.l4-brand__mk { flex:none; width:88px; height:88px; border-radius:22px; overflow:hidden; display:grid; place-items:center;
  background:#fff; box-shadow:0 14px 34px -10px rgba(0,0,0,.45), 0 0 0 4px rgba(255,255,255,.16); }
.l4-brand__mk img { width:100%; height:100%; object-fit:cover; }
.l4-brand__eyebrow { display:inline-block; font-size:12px; font-weight:700; letter-spacing:.4px; color:#bcd0ff; white-space:nowrap;
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.16); padding:4px 12px; border-radius:99px; }
.l4-brand__tx h1 { margin:11px 0 0; font-size:43px; line-height:1; font-weight:800; letter-spacing:-.5px; white-space:nowrap;
  font-family:"Sarabun","Noto Sans Thai",var(--ff); text-shadow:0 4px 18px rgba(0,0,0,.22); }
.l4-brand__sub { display:block; margin-top:8px; font-size:16px; font-weight:700; letter-spacing:2.5px; color:#e9eefc; }
.l4-brand__tag { display:inline-flex; align-items:center; gap:10px; margin-top:12px; font-size:13.5px; font-weight:600; color:#cdd9f6; }
.l4-brand__tag i { width:26px; height:3px; border-radius:2px; background:var(--gold-400); display:block; }

/* real-car framed photo (user-fillable) */
.l4-photo { position:absolute; left:48px; right:432px; bottom:24px; height:156px; z-index:1;
  padding:6px; background:#fff; border-radius:18px; box-shadow:0 24px 50px -18px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.3); }
.l4-photo image-slot { display:block; width:100%; height:100%; }

/* recent users */
.l4-recent { position:absolute; left:6px; top:426px; right:418px; }
.l4-recent__hd { font-size:14px; font-weight:800; color:var(--ink); margin-bottom:14px; letter-spacing:.2px; }
.l4-recent__row { display:flex; gap:10px; flex-wrap:wrap; }
.l4-recent__empty { font-size:13px; color:var(--dim); }
.l4-user { position:relative; width:131px; text-align:center; padding:16px 9px 13px; border-radius:18px; cursor:pointer;
  background:#fff; border:1px solid var(--line); box-shadow:0 6px 18px -12px rgba(20,33,61,.25);
  font-family:var(--ff); transition:transform .15s, box-shadow .15s, border-color .15s; }
.l4-user:hover { transform:translateY(-3px); border-color:var(--gold-400); box-shadow:0 14px 28px -14px rgba(20,33,61,.4); }
.l4-user__x { position:absolute; top:9px; right:9px; width:22px; height:22px; border-radius:50%; display:grid; place-items:center;
  font-size:11px; color:var(--dim); background:var(--surface-2); transition:.14s; }
.l4-user__x:hover { background:var(--danger-bg); color:var(--danger-ink); }
.l4-user__av { width:54px; height:54px; border-radius:50%; margin:0 auto 11px; display:grid; place-items:center;
  font-size:22px; font-weight:800; color:#fff; font-family:"Sarabun","Noto Sans Thai",var(--ff);
  box-shadow:0 6px 16px -6px rgba(20,33,61,.5); }
.l4-user b { display:block; font-size:14px; font-weight:700; color:var(--ink); line-height:1.2; }
.l4-user i { display:block; font-style:normal; font-size:11px; color:var(--dim); margin-top:3px; line-height:1.3; }
.l4-user__ago { display:inline-flex; align-items:center; gap:5px; margin-top:9px; font-size:10.5px; font-weight:600; color:var(--ok-ink,#1f7a4d); }
.l4-user__ago .dot { width:6px; height:6px; border-radius:50%; background:#34c759; }

/* floating sign-in card */
.l4-card { position:absolute; top:54px; right:16px; width:396px; padding:32px 32px 28px; border-radius:26px;
  background:#fff; box-shadow:0 36px 80px -28px rgba(20,40,90,.45), 0 2px 0 rgba(20,40,90,.04); }
.l4-card.shake, .l4-form.shake { animation:lgShake .34s cubic-bezier(.36,.07,.19,.97); }
.l4-gear.lgx-gear { top:18px; right:18px; }
.l4-form__hd { margin-bottom:24px; }
.l4-form__welcome { display:block; font-size:13px; font-weight:600; color:var(--dim); }
.l4-form__welcome b { color:var(--navy-700); font-weight:800; }
.l4-form__hd h2 { margin:6px 0 0; font-size:34px; font-weight:800; color:var(--ink); letter-spacing:-.6px;
  font-family:"Sarabun","Noto Sans Thai",var(--ff); }

/* long single inputs */
.l4-input { display:flex; align-items:center; gap:11px; height:54px; padding:0 12px 0 14px; border-radius:13px;
  background:var(--surface); border:1.5px solid var(--line-2); transition:border-color .14s, box-shadow .14s, background .14s; }
.l4-input:focus-within { border-color:var(--gold-500); background:#fffdf7; box-shadow:0 0 0 3px var(--gold-glow); }
.l4-input__ic { flex:none; display:grid; place-items:center; color:var(--dim); }
.l4-input:focus-within .l4-input__ic { color:var(--gold-600); }
.l4-input input { flex:1; min-width:0; border:none; outline:none; background:none; color:var(--ink);
  font-family:"Noto Sans",var(--ff); font-size:19px; font-weight:700; letter-spacing:4px; }
.l4-input input::placeholder { font-family:var(--ff); font-size:13.5px; font-weight:500; letter-spacing:0; color:var(--dim); }
.l4-eye { flex:none; width:34px; height:34px; border-radius:9px; background:none; border:none; cursor:pointer;
  color:var(--dim); display:grid; place-items:center; transition:.14s; }
.l4-eye:hover { color:var(--navy-700); background:var(--surface-2); }

/* ====================================================================
   LOGIN v5 — minimal, credible, auto-parts.  Keeps the .l4-card form.
   ==================================================================== */
.loginwrap--v5 { position:fixed; inset:0; z-index:120; font-family:var(--ff); overflow:auto;
  background:#F4F6FB; display:grid; grid-template-columns:minmax(380px,540px) minmax(412px,452px);
  justify-content:center; column-gap:72px; }
.loginwrap--v5 * { box-sizing:border-box; }
.l5-bg { position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
.l5-cog { position:absolute; left:-72px; bottom:-86px; width:340px; height:340px; color:#E4E9F3; }

.l5-left { position:relative; z-index:1; min-height:100dvh; display:flex; flex-direction:column; justify-content:center; gap:32px;
  padding:60px 6% 60px 7.5%; }
.l5-brand { display:flex; align-items:center; gap:14px; }
.l5-logo { height:100px; width:auto; display:block; margin-left:-4px; }
.l5-mk { width:58px; height:58px; border-radius:15px; overflow:hidden; flex:none; box-shadow:0 10px 24px -10px rgba(20,40,90,.45); }
.l5-mk img { width:100%; height:100%; object-fit:cover; display:block; }
.l5-wd b { display:block; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:19px; font-weight:800; color:var(--ink); line-height:1; }
.l5-wd span { display:block; margin-top:4px; font-size:10.5px; letter-spacing:2px; color:var(--dim); }

.l5-hero { max-width:540px; }
.l5-kicker { position:relative; display:inline-block; padding-left:36px; font-size:12px; font-weight:800; letter-spacing:.8px; color:var(--gold-600); white-space:nowrap; }
.l5-kicker::before { content:""; position:absolute; left:0; top:50%; width:28px; height:2px; background:var(--gold-500); }
.l5-hero h1 { margin:18px 0 0; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:47px; line-height:1.12; font-weight:800; letter-spacing:-.6px; color:var(--ink); }
.l5-hero p { margin:17px 0 0; font-size:15px; line-height:1.7; color:var(--ink-2); max-width:450px; }

.l5-stats { display:flex; align-items:center; gap:15px; margin-top:34px; flex-wrap:wrap; }
.l5-stat { white-space:nowrap; }
.l5-stat b { display:block; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:29px; font-weight:800; color:var(--navy-700); line-height:1; white-space:nowrap; }
.l5-stat b em { font-style:normal; color:var(--gold-500); }
.l5-stat span { display:block; margin-top:6px; font-size:12px; color:var(--dim); }
.l5-stat__d { width:1px; height:36px; background:var(--line-2); }
.l5-stat--txt b { font-size:17px; letter-spacing:-.2px; }

.l5-foot { display:flex; align-items:center; gap:7px; font-size:12px; color:var(--dim); }
.l5-foot svg { color:#2e9e5b; }

/* middle feature image — fills the gap, user-fillable */
.l5-mid { position:relative; z-index:1; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:48px 8px; }
.l5-feature { position:relative; width:100%; max-width:388px; height:min(66dvh,540px); border-radius:22px; background:#fff; padding:8px;
  box-shadow:0 34px 66px -30px rgba(20,40,90,.45), 0 0 0 1px rgba(20,40,90,.05); }
.l5-feature image-slot { display:block; width:100%; height:100%; }
.l5-feature__badge { position:absolute; left:18px; bottom:18px; pointer-events:none; display:inline-flex; align-items:center; gap:7px; white-space:nowrap;
  background:rgba(15,28,54,.9); color:#fff; font-size:12px; font-weight:700; padding:8px 13px; border-radius:99px;
  -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.l5-feature__badge svg { color:var(--gold-400); }

.l5-right { position:relative; z-index:1; min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px;
  padding:48px 7.5% 48px 5%; }

/* card position override for v5 (kept card, now static & centered) */
.l4-card--v5 { position:relative; top:auto; right:auto; left:auto; width:100%; max-width:414px; }

/* recent users — minimal chips */
.l5-recent { width:100%; max-width:414px; }
.l5-recent__t { display:block; font-size:12px; font-weight:700; color:var(--dim); margin-bottom:11px; padding-left:2px; }
.l5-recent__empty { font-size:12.5px; color:var(--dim); }
.l5-recent__row { display:flex; gap:9px; flex-wrap:wrap; }
.l5-chip { position:relative; display:inline-flex; align-items:center; gap:9px; padding:7px 30px 7px 8px; border-radius:99px; cursor:pointer;
  background:#fff; border:1px solid var(--line); box-shadow:0 4px 12px -9px rgba(20,33,61,.35); font-family:var(--ff); transition:transform .14s, box-shadow .14s, border-color .14s; }
.l5-chip:hover { border-color:var(--gold-400); box-shadow:0 9px 18px -10px rgba(20,33,61,.4); transform:translateY(-1px); }
.l5-chip__av { width:30px; height:30px; border-radius:50%; flex:none; display:grid; place-items:center; color:#fff; font-weight:800; font-size:14px;
  font-family:"Sarabun","Noto Sans Thai",var(--ff); }
.l5-chip__nm { font-size:13px; font-weight:600; color:var(--ink); white-space:nowrap; }
.l5-chip__x { position:absolute; right:7px; top:50%; transform:translateY(-50%); width:19px; height:19px; border-radius:50%; display:grid; place-items:center;
  font-size:10px; color:var(--line-2); transition:.14s; }
.l5-chip__x:hover { background:var(--danger-bg); color:var(--danger-ink); }

/* (middle column removed by request) */
@media (max-width:920px){
  .loginwrap--v5 { grid-template-columns:1fr; }
  .l5-left { min-height:0; padding:48px 28px 8px; justify-content:flex-start; gap:24px; }
  .l5-right { min-height:0; padding:24px 28px 48px; }
  .l5-hero h1 { font-size:36px; }
  .l5-cog { left:auto; right:-100px; top:-100px; bottom:auto; }
}
@media (max-width:560px){
  .l5-hero h1 { font-size:31px; }
  .l5-stats { gap:16px; }
  .l5-stat b { font-size:25px; }
}

/* light form internals inside the white card (reuse lg-* / segbox) */
.l4-card .lg-lbl { color:var(--ink-2); }
.l4-card .lg-lbl em { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.l4-card .segbox { background:var(--surface); border:1.5px solid var(--line-2); color:var(--ink); caret-color:var(--gold-500); }
.l4-card .segbox.on { border-color:var(--gold-500); background:#fffdf7; }
.l4-card .segrow--gold .segbox.on { color:var(--gold-600); }
.l4-card .segbox:focus { border-color:var(--gold-500); background:#fffdf7; box-shadow:0 0 0 3px var(--gold-glow), 0 6px 16px -10px rgba(245,164,0,.5); }
.l4-card .lg-err { color:var(--danger-ink,#9c2b2b); }
.l4-card .lg-links { margin-top:18px; }
.l4-card .lg-link { color:var(--navy-600); }
.l4-card .lg-link:hover { color:var(--gold-600); }
.l4-card .lg-links__dot { background:var(--line-2); }
.l4-card .lg-hint { color:var(--dim); }
.l4-card .lg-hint b { color:var(--navy-700); }
.l4-card .lg-hint i { background:var(--line-2); }
.l4-card .llock h2 { color:var(--ink); }
.l4-card .llock p { color:var(--dim); }
.l4-card .lunlock-tgt { background:var(--surface-2); border-color:var(--line); color:var(--ink-2); }
.l4-card .lunlock-tgt b { color:var(--ink); }
.l4-card .lbtn--ghost { background:var(--surface-2); border-color:var(--line-2); color:var(--ink); }
.l4-card .lbtn--ghost:hover { background:var(--surface-3); color:var(--navy-700); }
.l4-card .lg-card--locked, .l4-card .l4-form { text-align:center; }
.l4-card .lg-field, .l4-card .lg-go, .l4-card .lg-links, .l4-card .lg-hint { text-align:left; }
.l4-card .llock { text-align:center; }

/* responsive */
@media (max-width:840px){
  .l4-stage { display:flex; flex-direction:column; max-width:440px; min-height:0; }
  .l4-hero { order:1; position:relative; height:auto; border-radius:24px; padding:30px 28px 28px; }
  .l4-photo { position:relative; left:auto; right:auto; bottom:auto; width:100%; height:168px; margin-top:22px; }
  .l4-card { order:2; position:relative; top:auto; right:auto; margin:-86px auto 0; width:100%; }
  .l4-recent { order:3; position:relative; top:auto; left:auto; right:auto; margin:26px auto 0; width:100%; }
  .l4-recent__row { justify-content:center; }
}
@media (max-width:560px){
  .l4-brand { gap:16px; }
  .l4-brand__mk { width:72px; height:72px; border-radius:18px; }
  .l4-brand__tx h1 { font-size:38px; }
  .l4-brand__sub { font-size:13px; letter-spacing:1.5px; }
  .l4-card { padding:26px 22px 22px; }
  .l4-user { width:100%; }
}

/* ====================================================================
   LOGIN v6 — polished brand split (matches mockup)
   ==================================================================== */
.loginwrap--v6 { position:fixed; inset:0; z-index:120; font-family:var(--ff); color:var(--ink); overflow:auto;
  display:flex; flex-direction:column;
  background:radial-gradient(1100px 720px at 8% -4%, #ffffff 0%, transparent 56%), linear-gradient(160deg,#FBFCFE 0%,#E9EEF7 100%); }
.loginwrap--v6 * { box-sizing:border-box; }

.l6-gear { position:fixed; top:20px; right:22px; z-index:6; width:40px; height:40px; border-radius:11px; display:grid; place-items:center; cursor:pointer;
  color:var(--ink-2); background:rgba(255,255,255,.82); border:1px solid var(--line-2);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); transition:.16s; }
.l6-gear:hover { color:var(--navy-700); border-color:var(--gold-400); transform:rotate(45deg); }

.l6-main { flex:1; min-height:0; display:grid; grid-template-columns:1.12fr .88fr; align-items:center; gap:36px;
  width:100%; max-width:1320px; margin:0 auto; padding:40px 56px; }

/* LEFT · brand intro */
.l6-left { position:relative; align-self:stretch; display:flex; flex-direction:column; justify-content:center; gap:28px; padding:36px 40px 36px 6px; }
.l6-deco { position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
.l6-deco__grid { position:absolute; inset:0; opacity:.4;
  background-image:repeating-linear-gradient(0deg, rgba(11,61,145,.055) 0 1px, transparent 1px 46px),
                   repeating-linear-gradient(90deg, rgba(11,61,145,.04) 0 1px, transparent 1px 46px);
  mask-image:radial-gradient(120% 78% at 14% 22%, #000 14%, transparent 64%);
  -webkit-mask-image:radial-gradient(120% 78% at 14% 22%, #000 14%, transparent 64%); }
/* LAYER 02 · full-bleed warehouse/building/truck photo (already faded to white) */
.l6-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center bottom; z-index:0; pointer-events:none; }
.loginwrap--v6 .l6-main { position:relative; z-index:1; }
.loginwrap--v6 .l6-foot { position:relative; z-index:1; }

.l6-deco__shapes { position:absolute; left:-18px; bottom:-10px; width:min(52%,470px); height:auto; opacity:1; z-index:1;
  filter:drop-shadow(0 8px 18px rgba(11,61,145,.25)); }
.l6-left > *:not(.l6-deco) { position:relative; z-index:2; }

.l6-logo { height:80px; width:auto; display:block; align-self:flex-start; }
.l6-hl { margin:0; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:58px; line-height:1.1; font-weight:800; letter-spacing:-1.2px; color:var(--navy-800); }
.l6-accent { display:flex; align-items:center; gap:13px; margin-top:22px; font-size:16px; font-weight:700; color:var(--gold-600); }
.l6-accent__bar { width:34px; height:3px; border-radius:2px; background:var(--gold-500); flex:none; }
.l6-desc { margin:16px 0 0; font-size:14.5px; line-height:1.85; color:var(--ink-2); max-width:470px; }

.l6-feats { display:flex; gap:14px; margin-top:30px; flex-wrap:wrap; }
.l6-chip { display:flex; align-items:center; gap:12px; padding:13px 18px 13px 13px; border-radius:16px; background:rgba(255,255,255,.8);
  border:1px solid var(--line); box-shadow:0 12px 28px -20px rgba(20,40,90,.45); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.l6-chip__ic { flex:none; width:40px; height:40px; border-radius:12px; display:grid; place-items:center; color:var(--navy-700);
  background:linear-gradient(150deg,#EAF0FB,#DBE5F7); }
.l6-chip__ic svg { width:21px; height:21px; }
.l6-chip__tx b { display:block; font-size:14px; font-weight:700; color:var(--ink); line-height:1.2; white-space:nowrap; }
.l6-chip__tx i { display:block; font-style:normal; font-size:11.5px; color:var(--dim); margin-top:3px; white-space:nowrap; }

/* RIGHT · sign-in card */
.l6-right { align-self:center; display:flex; justify-content:center; }
.l6-card { position:relative; width:100%; max-width:432px; background:#fff; border-radius:26px; padding:38px 40px 30px;
  border:1px solid var(--line); box-shadow:0 44px 96px -36px rgba(13,38,95,.5), 0 2px 0 rgba(13,38,95,.03); text-align:center; }
.l6-card.shake { animation:lgShake .34s cubic-bezier(.36,.07,.19,.97); }
.l6-badge { width:80px; height:80px; margin:0 auto 18px; border-radius:21px; display:grid; place-items:center; background:#fff;
  border:1px solid var(--line); box-shadow:0 16px 32px -16px rgba(13,38,95,.4); overflow:hidden; }
.l6-badge img { width:66px; height:66px; object-fit:contain; }
.l6-title { margin:0; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:30px; font-weight:800; color:var(--ink); letter-spacing:-.4px; }
.l6-sub { margin:8px 0 0; font-size:13.5px; color:var(--dim); line-height:1.5; }
.l6-divider { display:block; width:54px; height:3px; border-radius:2px; margin:18px auto 26px; background:linear-gradient(90deg,var(--gold-400),var(--gold-600)); }

.l6-field { text-align:left; margin-bottom:16px; }
.l6-lbl { display:block; font-size:13px; font-weight:700; color:var(--ink-2); margin-bottom:8px; }
.l6-input { display:flex; align-items:center; gap:11px; height:52px; padding:0 12px 0 14px; border-radius:13px;
  background:var(--surface-2); border:1.5px solid var(--line-2); transition:border-color .14s, box-shadow .14s, background .14s; }
.l6-input:focus-within { border-color:var(--navy-600); background:#fff; box-shadow:0 0 0 3px rgba(17,73,168,.14); }
.l6-input__ic { flex:none; display:grid; place-items:center; color:var(--dim); }
.l6-input:focus-within .l6-input__ic { color:var(--navy-600); }
.l6-input input { flex:1; min-width:0; border:none; outline:none; background:none; color:var(--ink); font-family:var(--ff); font-size:15px; font-weight:600; }
.l6-input input::placeholder { color:#9aa6bd; font-weight:500; }
.l6-eye { flex:none; width:34px; height:34px; border-radius:9px; background:none; border:none; cursor:pointer; color:var(--dim); display:grid; place-items:center; transition:.14s; }
.l6-eye:hover { color:var(--navy-700); background:var(--surface-3); }
.l6-err { text-align:left; margin:-2px 0 14px; }

.l6-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:2px 0 20px; }
.l6-check { display:inline-flex; align-items:center; gap:9px; cursor:pointer; font-size:13px; color:var(--ink-2); user-select:none; position:relative; white-space:nowrap; }
.l6-check input { position:absolute; opacity:0; width:0; height:0; }
.l6-check__box { width:19px; height:19px; border-radius:6px; border:1.5px solid var(--line-2); background:#fff; display:grid; place-items:center; color:#fff; transition:.14s; flex:none; }
.l6-check__box svg { opacity:0; }
.l6-check input:checked + .l6-check__box { background:var(--navy-700); border-color:var(--navy-700); }
.l6-check input:checked + .l6-check__box svg { opacity:1; }
.l6-check input:focus-visible + .l6-check__box { box-shadow:0 0 0 3px rgba(17,73,168,.2); }
.l6-forgot { background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-600); white-space:nowrap; }
.l6-forgot:hover { color:var(--gold-600); text-decoration:underline; }

.l6-go { width:100%; height:54px; border:none; border-radius:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:10px;
  font-family:var(--ff); font-size:16px; font-weight:800; color:#fff; background:var(--navy-700); white-space:nowrap;
  box-shadow:0 16px 30px -12px rgba(11,61,145,.55); transition:transform .14s, box-shadow .14s, background .14s; }
.l6-go:hover { background:var(--navy-800); transform:translateY(-2px); box-shadow:0 22px 40px -14px rgba(11,61,145,.6); }
.l6-go:active { transform:translateY(0) scale(.99); }
.l6-go__arr { display:grid; place-items:center; transform:scaleX(-1); transition:transform .16s; }
.l6-go:hover .l6-go__arr { transform:scaleX(-1) translateX(-3px); }

.l6-help { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:18px; font-size:12.5px; color:var(--dim); }
.l6-help svg { color:var(--ok); }
.l6-demo { margin-top:9px; font-size:11px; color:#aab4c8; letter-spacing:.3px; }

/* locked panel (light) */
.l6-locked { text-align:center; display:flex; flex-direction:column; align-items:center; }
.l6-locked .llock__ic { margin:2px 0 16px; }
.l6-locked .lunlock-tgt { background:var(--surface-2); border-color:var(--line); color:var(--ink-2); margin:16px 0; }
.l6-locked .lunlock-tgt b { color:var(--ink); }
.l6-locked .lbtn { margin-top:10px; }
.l6-locked .lbtn--ghost { background:var(--surface-2); border:1px solid var(--line-2); color:var(--ink); }
.l6-locked .lbtn--ghost:hover { background:var(--surface-3); color:var(--navy-700); }

/* footer */
.l6-foot { flex:none; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 40px;
  border-top:1px solid var(--line); background:rgba(244,247,251,.92); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); font-size:12px; color:var(--dim); }
.l6-ssl { display:inline-flex; align-items:center; gap:7px; font-weight:600; }
.l6-ssl svg { color:var(--ok); }

@media (max-width:1080px){
  .l6-main { grid-template-columns:1fr; max-width:560px; gap:10px; padding:30px 28px; align-items:start; }
  .l6-left { padding:8px; gap:22px; justify-content:flex-start; }
  .l6-deco__shapes { display:none; }
  .l6-hl { font-size:40px; }
  .l6-logo { height:64px; }
  .l6-feats { margin-top:22px; }
}
@media (max-width:560px){
  .l6-hl { font-size:33px; }
  .l6-chip { width:100%; }
  .l6-card { padding:30px 24px 24px; }
  .l6-foot { flex-direction:column; gap:6px; padding:14px 20px; text-align:center; }
}

/* ====================================================================
   LOGIN v7 — exact image backdrop + functional overlay controls.
   Image fills a 16:9 "cover" stage; controls are positioned in % of
   that stage (= image coords) and scale with container-query units.
   ==================================================================== */
.loginwrap--v7 { position:fixed; inset:0; z-index:120; font-family:var(--ff); background:#e9eef6; overflow:hidden; }
.loginwrap--v7 * { box-sizing:border-box; }
.l7-stage { position:absolute; inset:0; overflow:hidden; container-type:size; }
.l7-fit { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:max(100vw, 177.78vh); height:max(56.25vw, 100vh); container-type:size; background:#ffffff; }
.l7-img { position:absolute; left:0; bottom:0; width:70%; height:auto; display:block; -webkit-user-drag:none; user-select:none; }

/* bottom-left geometric brand shapes (real) */
.l7-shapes { position:absolute; left:0; bottom:2.6cqw; width:23cqw; height:auto; z-index:1; }

/* real footer (© left · SSL right) */
.l7-foot { position:absolute; bottom:1.05cqw; font-size:1cqw; color:#7a8aa6; white-space:nowrap; z-index:3; }
.l7-foot--l { left:2.4cqw; }
.l7-foot--r { left:74.85%; transform:translateX(-50%); right:auto; display:flex; align-items:center; gap:0.5cqw; }
.l7-foot--r svg { width:1.2cqw; height:1.2cqw; }

/* corrected brand-logo overlay (covers the baked logo with the typo) */
.l7-logomask { position:absolute; left:5.2%; top:10.2%; width:31.8%; height:13.6%; background:#fff; }
.l7-brandlogo { position:absolute; left:6.5%; top:11%; width:30%; height:auto; display:block; -webkit-user-drag:none; user-select:none; }

/* feature chips with card frame, equal width */
.l7-chips { position:absolute; left:6.5%; top:65.2%; width:auto; max-width:54%; display:flex; flex-wrap:nowrap; gap:0.7cqw; }
.l7-chip { flex:0 0 auto; min-width:0; display:flex; align-items:center; justify-content:flex-start; gap:0.6cqw; padding:0.85cqw 1cqw; border-radius:1cqw;
  background:#fff; border:1px solid var(--line); box-shadow:0 1cqw 2.2cqw -1.4cqw rgba(20,40,90,.5); }
.l7-chip__ic { flex:none; width:2.9cqw; height:2.9cqw; border-radius:0.85cqw; display:grid; place-items:center; color:var(--navy-700);
  background:linear-gradient(150deg,#EAF0FB,#DBE5F7); }
.l7-chip__ic svg { width:1.6cqw; height:1.6cqw; }
.l7-chip__tx { min-width:0; }
.l7-chip__tx b { display:block; font-size:0.94cqw; font-weight:700; color:var(--ink); line-height:1.15; white-space:nowrap; }
.l7-chip__tx i { display:block; font-style:normal; font-size:0.76cqw; color:var(--dim); margin-top:0.2cqw; white-space:nowrap; }

/* crisp real left text overlay (covers the baked blurry text; bg there is pure white) */
.l7-textmask { position:absolute; left:5.5%; top:23.4%; width:38.2%; height:44.4%; background:#fff; }
.l7-lefttext { position:absolute; left:6.48%; top:24.7%; width:42%; }
.l7-hl { margin:0; font-family:"Sarabun","Noto Sans Thai",var(--ff); font-size:3.55cqw; font-weight:800; line-height:1.16; letter-spacing:-0.01em; color:#0c2a5e; }
.l7-accent { display:flex; align-items:center; gap:0.9cqw; margin-top:4.5cqw; font-size:1.18cqw; font-weight:700; color:#0c2a5e; white-space:nowrap; }
.l7-accent::before { content:""; flex:none; width:2.7cqw; height:0.28cqw; border-radius:1cqw; background:linear-gradient(90deg,#f5a400,#ffc24d); }
.l7-desc { margin:0.2cqw 0 0; font-size:1.12cqw; line-height:1.72; color:#5d6e88; }

/* real recreated card, overlaid exactly on the drawn card region (scales w/ stage) */
.l7-card { position:absolute; left:55.9%; top:8.2%; width:37.9%; height:84.4%;
  background:#fff; border-radius:1.7cqw; padding:2.4cqw 2.7cqw;
  box-shadow:0 2.4cqw 6cqw -1.6cqw rgba(18,40,90,.26), inset 0 0 0 1px rgba(18,40,90,.045);
  display:flex; flex-direction:column; align-items:center; }
.l7-card.shake { animation:lgShake .34s cubic-bezier(.36,.07,.19,.97); }

.l7-badge { width:6.6cqw; height:6.6cqw; border-radius:1.5cqw; background:#10307e; flex:none;
  box-shadow:0 .9cqw 2.2cqw -.7cqw rgba(11,61,145,.42), inset 0 0 0 1px rgba(18,40,90,.06);
  display:grid; place-items:center; overflow:hidden; margin-top:.3cqw; }
.l7-badge img { width:100%; height:100%; object-fit:cover; transform:scale(1.06); }

.l7-title { margin:1.3cqw 0 0; font-family:"Sarabun","Noto Sans Thai",var(--ff);
  font-size:2.45cqw; font-weight:800; color:#0c2a5e; letter-spacing:-.3px; line-height:1; white-space:nowrap; }
.l7-sub { margin:.85cqw 0 0; font-size:1.02cqw; color:#64748b; text-align:center; line-height:1.4; white-space:nowrap; }
.l7-divider { width:3.2cqw; height:.32cqw; border-radius:1cqw; flex:none;
  background:linear-gradient(90deg,#f5a400,#ffc24d); margin:1.1cqw 0 0; }

.l7-field { width:100%; margin-top:1.4cqw; }
.l7-lbl { display:block; font-size:1.05cqw; font-weight:700; color:#0c2a5e; margin-bottom:.55cqw; }
.l7-input { display:flex; align-items:center; gap:.8cqw; height:3.85cqw; padding:0 1cqw; border-radius:1cqw;
  background:#fbfcfe; border:1.5px solid #d9e1ec; transition:border-color .14s, box-shadow .14s, background .14s; }
.l7-input:focus-within { border-color:#0b3d91; background:#fff; box-shadow:0 0 0 .28cqw rgba(11,61,145,.13); }
.l7-input__ic { flex:none; display:grid; place-items:center; color:#94a3b8; }
.l7-input__ic svg { width:1.75cqw; height:1.75cqw; }
.l7-input:focus-within .l7-input__ic { color:#0b3d91; }
.l7-input input { flex:1; min-width:0; border:none; outline:none; background:none; color:#0c2a5e;
  font-family:var(--ff); font-size:1.12cqw; font-weight:600; }
.l7-input input::placeholder { color:#9aa7bd; font-weight:500; }
.l7-eye { flex:none; width:2.6cqw; height:2.6cqw; border:none; background:none; cursor:pointer; color:#94a3b8; display:grid; place-items:center; border-radius:.6cqw; }
.l7-eye svg { width:1.75cqw; height:1.75cqw; }
.l7-eye:hover { color:#0b3d91; background:#eef2f9; }

.l7-err { width:100%; display:flex; align-items:center; gap:.5cqw; margin-top:.8cqw; font-size:1cqw; font-weight:600; color:#c0392b; }
.l7-err svg { width:1.4cqw; height:1.4cqw; flex:none; }

.l7-row { width:100%; display:flex; align-items:center; justify-content:space-between; margin-top:1.4cqw; }
.l7-remember { display:inline-flex; align-items:center; gap:.7cqw; background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:1.05cqw; color:#475569; white-space:nowrap; }
.l7-remember__box { width:1.65cqw; height:1.65cqw; border-radius:.42cqw; border:1.6px solid #cbd5e1; display:grid; place-items:center; color:#fff; transition:.14s; }
.l7-remember__box svg { width:1.2cqw; height:1.2cqw; opacity:0; }
.l7-remember.on .l7-remember__box { background:#0b3d91; border-color:#0b3d91; }
.l7-remember.on .l7-remember__box svg { opacity:1; }
.l7-forgot2 { background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:1.05cqw; font-weight:700; color:#f5a400; white-space:nowrap; }
.l7-forgot2:hover { text-decoration:underline; }

.l7-go { width:100%; margin-top:1.5cqw; height:4.5cqw; border:none; border-radius:1.1cqw; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:.8cqw; position:relative; white-space:nowrap;
  font-family:var(--ff); font-size:1.38cqw; font-weight:800; color:#fff;
  background:linear-gradient(135deg,#103e93,#0a2a63); box-shadow:0 1.1cqw 2.4cqw -1cqw rgba(11,61,145,.6); transition:transform .14s, box-shadow .14s, filter .14s; }
.l7-go:hover { transform:translateY(-1px); filter:brightness(1.07); }
.l7-go:active { transform:translateY(0); }
.l7-go__arr { position:absolute; right:1.6cqw; display:grid; place-items:center; }
.l7-go__arr svg { width:1.8cqw; height:1.8cqw; transform:scaleX(-1); }

.l7-help { display:flex; align-items:center; gap:.5cqw; margin-top:1.3cqw; font-size:.98cqw; color:#94a3b8; white-space:nowrap; }
.l7-help svg { width:1.3cqw; height:1.3cqw; }

.l7-gear { position:absolute; right:1.3cqw; top:1.3cqw; width:clamp(34px,3cqw,52px); height:clamp(34px,3cqw,52px);
  border-radius:.8cqw; display:grid; place-items:center; color:#5b6b86; cursor:pointer;
  background:rgba(255,255,255,.72); border:1px solid rgba(11,40,90,.12); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); transition:.16s; }
.l7-gear:hover { color:#0b3d91; border-color:rgba(245,164,0,.5); transform:rotate(40deg); }

/* locked panel reuses the card box */
.l7-card--locked { justify-content:center; gap:1.1cqh; text-align:center; }
.l7-card--locked .l7-title { margin-top:1.2cqw; }
.l7-card--locked .l7-sub { max-width:86%; line-height:1.5; }
.l7-card--locked .lbtn { width:82%; }

.ltoast--err { background:linear-gradient(160deg,#7c2024,#4c1417); border-color:rgba(255,150,150,.32); }
.ltoast--err svg { color:#ffb4b4; }

/* v7 light modals — match the light login theme (override the dark .lmod*) */
.loginwrap--v7 .lmod { background:rgba(18,32,60,.36); -webkit-backdrop-filter:none; backdrop-filter:none; }
.loginwrap--v7 .lmod__panel { background:#fff; border:1px solid var(--line); box-shadow:0 40px 90px -24px rgba(18,40,90,.45); }
.loginwrap--v7 .lmod__close { background:var(--surface-2); border:1px solid var(--line); color:var(--dim); }
.loginwrap--v7 .lmod__close:hover { background:var(--surface-3); color:var(--ink); }
.loginwrap--v7 .lmod__ic { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.loginwrap--v7 .lmod__ic--ok { color:#1f8a5b; background:#e8f7ee; border-color:#b7e4c9; }
.loginwrap--v7 .lmod__ic--warn { color:#c0392b; background:#fdeceb; border-color:#f5c4bf; }
.loginwrap--v7 .lmod__head h3 { color:var(--ink); }
.loginwrap--v7 .lmod__head p { color:var(--dim); }
.loginwrap--v7 .lset-row { background:var(--surface); border-color:var(--line); }
.loginwrap--v7 .lset-ic { background:var(--surface-2); color:var(--navy-600); }
.loginwrap--v7 .lset-row__l b { color:var(--ink); }
.loginwrap--v7 .lset-row__l span { color:var(--dim); }
.loginwrap--v7 .lselect select { background:#fff; border:1px solid var(--line-2); color:var(--ink); }
.loginwrap--v7 .lselect::after { color:var(--dim); }
.loginwrap--v7 .lconn i { box-shadow:0 0 0 3px rgba(63,208,127,.16); }
.loginwrap--v7 .lseg { background:var(--surface-2); border:1px solid var(--line); }
.loginwrap--v7 .lseg button { color:var(--dim); }
.loginwrap--v7 .lset-foot { border-top:1px solid var(--line); color:var(--dim); }
.loginwrap--v7 .lmethod { background:var(--surface); border-color:var(--line-2); }
.loginwrap--v7 .lmethod:hover:not(:disabled) { border-color:var(--gold-400); background:#fffdf6; }
.loginwrap--v7 .lmethod__ic { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.loginwrap--v7 .lmethod b { color:var(--ink); }
.loginwrap--v7 .lmethod span { color:var(--dim); }
.loginwrap--v7 .lmethod__chev { color:var(--dim); }
.loginwrap--v7 .lg-lbl--dark { color:var(--ink-2); }
.loginwrap--v7 .lg-lbl--dark em { color:var(--gold-600); background:#fdf4e1; border-color:#f2d89e; }
.loginwrap--v7 .segbox { background:var(--surface); border:1.5px solid var(--line-2); color:var(--ink); caret-color:var(--gold-500); }
.loginwrap--v7 .segbox.on { border-color:var(--gold-500); background:#fffdf7; }
.loginwrap--v7 .segrow--gold .segbox.on { color:var(--gold-600); }
.loginwrap--v7 .segbox:focus { border-color:var(--gold-500); background:#fffdf7; box-shadow:0 0 0 3px var(--gold-glow); }
.loginwrap--v7 .lg-hint--dark { color:var(--dim); }
.loginwrap--v7 .lg-hint--dark b { color:var(--navy-700); }
.loginwrap--v7 .lunlock-tgt { background:var(--surface-2); border-color:var(--line); color:var(--ink-2); }
.loginwrap--v7 .lunlock-tgt b { color:var(--ink); }
.loginwrap--v7 .lunlock-tgt__ic { color:var(--gold-600); }
.loginwrap--v7 .lforgot-ok p { color:var(--ink-2); }
.loginwrap--v7 .lforgot-ok p b, .loginwrap--v7 .lforgot-ref b { color:var(--ink); }
.loginwrap--v7 .lforgot-ok__ic { color:#1f8a5b; background:#e8f7ee; border-color:#b7e4c9; }
.loginwrap--v7 .lforgot-ref { background:var(--surface-2); border:1px dashed var(--line-2); color:var(--dim); }
.loginwrap--v7 .lbtn--ghost { background:var(--surface-2); border:1px solid var(--line-2); color:var(--ink); }
.loginwrap--v7 .lbtn--ghost:hover { background:var(--surface-3); color:var(--navy-700); }
.loginwrap--v7 .lg-err { color:#c0392b; }

@media (max-width:760px){
  /* on narrow screens the 16:9 image gets very tall; keep controls usable */
  .l7-in { font-size:11px; }
}

/* ============================================================
   ราคา & กติกา (pricing-rules.jsx · PricingRulesD)
   ============================================================ */
.pr-legend { display:flex; flex-wrap:wrap; gap:18px; margin-bottom:14px; font-size:12.5px; color:var(--ink-2); }
.pr-legend span { display:inline-flex; align-items:center; gap:7px; }
.pr-legend i { width:11px; height:11px; border-radius:3px; flex:none; }
.pr-legend em { font-style:normal; color:var(--dim); font-size:11.5px; }

.pr-cell { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.pr-price { display:inline-flex; align-items:center; gap:2px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface); padding:3px 7px; transition:border-color .14s,box-shadow .14s; }
.pr-price:focus-within { border-color:var(--gold-500); box-shadow:0 0 0 2px var(--gold-glow); }
.pr-price span { font-size:11px; color:var(--dim); }
.pr-price input { width:54px; border:none; background:none; outline:none; text-align:right; font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:700; color:var(--ink); }
.pr-mar { font-family:"Noto Sans",sans-serif; font-size:10.5px; font-weight:700; }

.pr-note { display:flex; align-items:flex-start; gap:8px; margin-top:14px; padding:10px 13px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); font-size:12.5px; line-height:1.55; color:var(--ink-2); }
.pr-note svg { flex:none; margin-top:2px; }

.pr-whrow { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.pr-wh { background:var(--surface); border:1.5px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:16px 18px; }
.pr-wh__hd { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.pr-wh__ic { width:44px; height:44px; flex:none; border-radius:12px; display:grid; place-items:center; }
.pr-wh__hd b { font-size:15px; font-weight:800; color:var(--ink); }
.pr-wh p { font-size:12.5px; line-height:1.55; color:var(--ink-2); margin:0 0 10px; }
.pr-wh__k { font-size:12px; font-weight:700; color:var(--dim); border-top:1px dashed var(--line-2); padding-top:9px; }

.pr-rule { display:flex; align-items:flex-start; gap:12px; padding:13px 4px; border-bottom:1px solid var(--line); }
.pr-rule:last-child { border-bottom:none; }
.pr-rule__ic { width:26px; height:26px; flex:none; border-radius:8px; display:grid; place-items:center; margin-top:1px; }
.pr-rule b { display:block; font-size:13.5px; font-weight:700; color:var(--ink); margin-bottom:2px; }
.pr-rule span { font-size:12.5px; line-height:1.5; color:var(--dim); }

.tbl.pr-perm th, .tbl.pr-perm td { vertical-align:middle; }
.pr-perm__c { display:inline-block; min-width:64px; font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:var(--r-pill); }
.pr-perm__c--btn { border:1px solid transparent; cursor:pointer; font-family:var(--ff); transition:filter .12s, box-shadow .12s; }
.pr-perm__c--btn:hover { filter:brightness(.96); box-shadow:0 0 0 2px rgba(11,26,51,.08); }

/* sync / dirty badge */
.pr-syncbadge { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:4px 11px; border-radius:var(--r-pill); color:#1F8A5B; background:#e8f7ee; border:1px solid #b7e4c9; white-space:nowrap; }
.pr-syncbadge.is-dirty { color:var(--gold-600); background:#fdf4e1; border-color:#ecd9a6; }

/* edited price cell highlight */
.pr-price.is-dirty { border-color:var(--gold-500); background:#fffdf6; box-shadow:0 0 0 2px var(--gold-glow); }

/* link to settings */
.pr-permlink { display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-600); background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-pill); padding:5px 12px; cursor:pointer; transition:border-color .12s,color .12s,background .12s; }
.pr-permlink:hover { border-color:var(--gold-400); color:var(--gold-600); background:#fffdf6; }

/* permission action bar */
.pr-permbar { display:flex; align-items:center; gap:10px; padding:12px 16px 14px; flex-wrap:wrap; }

.btn:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.btn:disabled:active { transform:none; }

/* ============================================================
   แดชบอร์ดวิเคราะห์ (analytics.jsx · AnalyticsD)
   ============================================================ */
.an-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.an-kpi { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:0 1px 2px rgba(11,61,145,.04), 0 4px 14px -8px rgba(11,61,145,.10); padding:15px 17px; overflow:hidden; transition:transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .28s ease; animation:an-kpi-in .5s cubic-bezier(.22,1,.36,1) both; }
.an-kpi:nth-child(1){ animation-delay:.02s; } .an-kpi:nth-child(2){ animation-delay:.08s; } .an-kpi:nth-child(3){ animation-delay:.14s; } .an-kpi:nth-child(4){ animation-delay:.20s; }
.an-kpi:hover { transform:translateY(-3px); box-shadow:0 2px 4px rgba(11,61,145,.06), 0 16px 32px -14px rgba(11,61,145,.32); border-color:#c7d5ef; }
.an-kpi:hover .an-kpi__ic { background:linear-gradient(135deg,#0B3D91,#1657c2); color:#fff; transform:scale(1.06) rotate(-3deg); }
@keyframes an-kpi-in { from{ opacity:0; transform:translateY(14px) scale(.985); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce){ .an-kpi{ animation:none; } .an-kpi:hover{ transform:none; } }
.an-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--navy-600); }
.an-kpi--gold::before { background:linear-gradient(var(--gold-400),var(--gold-600)); }
.an-kpi--ok::before { background:#1F8A5B; }
.an-kpi--info::before { background:#3056a0; }
.an-kpi--navy::before { background:var(--navy-700); }
.an-kpi__top { display:flex; align-items:center; justify-content:space-between; }
.an-kpi__k { font-size:12.5px; font-weight:600; color:var(--dim); }
.an-kpi__ic { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); transition:background .28s ease, color .28s ease, transform .28s cubic-bezier(.22,1,.36,1); }
.an-kpi__v { font-size:26px; font-weight:800; color:var(--ink); margin-top:8px; letter-spacing:-.5px; line-height:1; font-variant-numeric:tabular-nums; }
.an-kpi__v small { font-size:11.5px; font-weight:600; color:var(--dim); margin-left:5px; letter-spacing:0; }
.an-kpi__d { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:700; font-family:"Noto Sans",sans-serif; }
.an-kpi__d.is-up { color:#1F8A5B; }
.an-kpi__d.is-down { color:var(--danger); }
.an-kpi__d span { color:var(--dim); font-weight:500; font-family:var(--ff); }
.an-kpi__foot { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; margin-top:10px; }
.an-kpi__spark { width:86px; height:30px; flex:none; }

/* ยอดขายเฉลี่ยตามวัน (weekday mini-bars under the trend chart) */
.an-wkd { margin-top:14px; border-top:1px solid var(--line); padding-top:13px; }
.an-wkd__h { font-size:12px; font-weight:700; color:var(--navy-700); margin-bottom:11px; }
.an-wkd__bars { display:flex; align-items:flex-end; gap:9px; height:88px; }
.an-wkd__bar { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:7px; height:100%; cursor:default; }
.an-wkd__col { width:100%; max-width:38px; min-height:5px; border-radius:6px 6px 0 0; background:linear-gradient(180deg,#3a5183,#16294f); transition:filter .15s; }
.an-wkd__bar:hover .an-wkd__col { filter:brightness(1.12); }
.an-wkd__bar.is-peak .an-wkd__col { background:linear-gradient(180deg,var(--gold-400),var(--gold-600)); }
.an-wkd__d { font-size:11px; color:var(--dim); }
.an-wkd__bar.is-peak .an-wkd__d { color:var(--gold-700,#9a7b2e); font-weight:800; }

.an-row { display:grid; gap:18px; margin-bottom:18px; align-items:start; }
.an-row--2a { grid-template-columns:1.55fr 1fr; }
.an-row--2 { grid-template-columns:1fr 1fr; }
.an-row--3 { grid-template-columns:repeat(3,1fr); align-items:stretch; }
/* การ์ดการเงิน 3 ช่อง (ลูกหนี้/เจ้าหนี้/เงินสด) สูงเท่ากัน แม้เนื้อหาไม่เท่า (ช่องลูกหนี้มีแถบอายุหนี้) */
.an-row--3 > .an-fin { height:100%; display:flex; flex-direction:column; }

.an-legend { display:flex; gap:16px; font-size:12px; color:var(--ink-2); }
/* breathing room: analytics panel bodies had zero horizontal padding (content touched edges) */
.an-main .panel__bd { padding:8px 18px 16px; }
.an-main .an-chwrap { padding-top:6px; }
.an-legend span { display:inline-flex; align-items:center; gap:6px; }
.an-legend i { width:14px; height:3px; border-radius:2px; display:inline-block; }
.an-legend i.an-dash { width:14px; height:0; border-top:2px dashed var(--gold-600); background:none !important; }
.an-svg { width:100%; height:210px; display:block; }
/* chart v2 — แกน Y (฿) ซ้าย + แกนวันที่ล่าง + ควบคุม gran/zoom */
.an-chart2 { display:grid; grid-template-columns:46px 1fr; grid-template-rows:210px auto; align-items:stretch; }
.an-yax { position:relative; grid-column:1; grid-row:1; }
.an-yax > span { position:absolute; right:7px; transform:translateY(-50%); font-family:"Noto Sans",sans-serif; font-size:10px; color:var(--dim); white-space:nowrap; }
.an-plot { position:relative; grid-column:2; grid-row:1; }
.an-plot .an-svg { cursor:crosshair; }
.an-xax { position:relative; grid-column:2; grid-row:2; height:18px; margin-top:4px; }
.an-xax > span { position:absolute; top:0; font-size:10px; color:var(--dim); white-space:nowrap; }
.an-ctrl { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:10px; padding-top:11px; border-top:1px solid var(--line); }
.an-ctrl__gran { display:inline-flex; gap:3px; padding:3px; background:var(--surface-3); border-radius:9px; }
.an-granb { border:none; background:none; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); padding:5px 12px; border-radius:7px; cursor:pointer; transition:.13s; }
.an-granb.is-on { background:var(--surface); color:var(--navy-700); box-shadow:var(--sh-sm); }
.an-ctrl__zoom { display:inline-flex; align-items:center; gap:7px; }
.an-zoomlbl { font-size:11.5px; color:var(--dim); font-weight:600; }
.an-zoomb { width:28px; height:28px; border:1px solid var(--line-2); background:var(--surface); border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; transition:.13s; }
.an-zoomb:hover:not(:disabled) { border-color:var(--navy-600); color:var(--navy-700); }
.an-zoomb:disabled { opacity:.4; cursor:default; }
.an-chart { position:relative; }
.an-chart .an-svg { cursor:crosshair; }
.an-tip { position:absolute; top:6px; transform:translateX(-50%); min-width:138px; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 32px -10px rgba(10,22,50,.34); padding:9px 11px; pointer-events:none; z-index:5; }
.an-tip--left { transform:translateX(-100%); margin-left:-10px; }
.an-tip__d { font-size:11px; font-weight:800; color:var(--ink); margin-bottom:6px; }
.an-tip__r { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2); margin-top:3px; }
.an-tip__r b { margin-left:auto; font-size:12.5px; font-weight:800; color:var(--ink); }
.an-tip__dot { width:8px; height:8px; border-radius:50%; flex:none; }
.an-tip__mar { margin-top:6px; padding-top:6px; border-top:1px solid var(--line); font-size:10.5px; font-weight:700; color:var(--navy-700); }
/* สต๊อกติดลบ / ตัดผิดเจ้า */
.negwrap { display:flex; flex-direction:column; gap:12px; padding:4px 0; }
.negnote { display:flex; align-items:flex-start; gap:7px; font-size:12px; line-height:1.5; color:var(--navy-700); background:var(--info-bg); border:1px solid #bcd6f0; border-radius:var(--r-md); padding:9px 12px; }
.negcard { border:1px solid var(--line); border-left:3px solid var(--danger,#D14343); border-radius:var(--r-lg); padding:13px 15px; background:var(--surface); box-shadow:var(--sh-sm); }
.negcard.is-fixed { border-left-color:var(--ok,#1F8A5B); opacity:.82; }
.negcard__top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:11px; }
.negcard__id b { display:block; font-size:14px; font-weight:800; color:var(--ink); }
.negcard__id span { font-size:11.5px; color:var(--dim); }
.negcard__badge { flex:none; display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800; border-radius:99px; padding:4px 11px; }
.negcard__badge.bad { color:var(--danger-ink,#C0392B); background:var(--danger-bg); }
.negcard__badge.ok { color:var(--ok-ink,#1F8A5B); background:var(--ok-bg,#e6f4ec); }
.negflow { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.negsup { border:1px solid var(--line); border-radius:var(--r-md); padding:9px 11px; background:var(--surface-2); }
.negsup--bad { border-color:#e6b4b4; background:#fdf1f0; }
.negsup--over { border-color:#ead9a6; background:#fdf8ec; }
.negsup__h { display:block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--dim); margin-bottom:3px; }
.negsup b { display:block; font-size:12.5px; font-weight:700; color:var(--ink); }
.negsup__m { font-size:11.5px; color:var(--ink-2); }
.negsup__m i { font-style:normal; font-weight:800; }
.negsup__m i.neg { color:var(--danger,#C0392B); }
.negsup__m i.over { color:var(--gold-700,#A8852F); }
.negcard__ft { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:11px; padding-top:10px; border-top:1px solid var(--line); }
.negcard__bill { font-size:11.5px; color:var(--ink-2); display:inline-flex; align-items:center; gap:6px; }
.negcard__acts { display:flex; gap:7px; }
@media (max-width:720px){ .negflow { grid-template-columns:1fr; } }

.an-chwrap { display:flex; align-items:center; gap:20px; }
.an-donut { width:148px; height:148px; border-radius:50%; flex:none; display:grid; place-items:center; }
.an-donut__hole { width:96px; height:96px; border-radius:50%; background:var(--surface); display:flex; flex-direction:column; align-items:center; justify-content:center; box-shadow:inset 0 0 0 1px var(--line); }
.an-donut__hole b { font-size:14.5px; font-weight:800; color:var(--ink); letter-spacing:-.4px; white-space:nowrap; }
.an-donut__hole span { font-size:10.5px; color:var(--dim); }
.an-chlist { flex:1; display:flex; flex-direction:column; gap:9px; min-width:0; }
.an-chrow { display:flex; align-items:center; gap:9px; font-size:13px; }
.an-chrow b { font-weight:600; color:var(--ink); flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.an-chpct { font-family:"Noto Sans",sans-serif; font-weight:700; color:var(--navy-700); }
.an-dot { width:11px; height:11px; border-radius:3px; flex:none; }
/* donut v2 — SVG, gapped rounded arcs + hover */
.an-donut2 { position:relative; width:164px; height:164px; flex:none; }
.an-donut2 svg { display:block; }
.an-donut2__hole { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; }
.an-donut2__hole b { font-size:15px; font-weight:800; color:var(--ink); letter-spacing:-.4px; white-space:nowrap; line-height:1.1; }
.an-donut2__hole span { font-size:11px; color:var(--dim); margin-top:1px; max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }
.an-chamt { font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:700; color:var(--ink); }
.an-chrow b { font-weight:600; }
.an-chrow .an-chpct { min-width:34px; text-align:right; }
/* period range picker */
.an-periods { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.an-range { position:relative; }
.an-range__btn { display:inline-flex; align-items:center; gap:6px; }
.an-rangepop { position:absolute; top:calc(100% + 7px); right:0; z-index:60; width:280px; background:var(--surface); border:1px solid var(--line); border-radius:13px; box-shadow:0 18px 50px -16px rgba(10,22,50,.36); padding:14px; }
.an-rangepop__hd { font-size:12.5px; font-weight:800; color:var(--ink); margin-bottom:11px; }
.an-rangef { display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }
.an-rangef span { font-size:11px; font-weight:700; color:var(--dim); }
.an-rangef input { font-family:var(--ff); font-size:13px; color:var(--ink); background:var(--surface); border:1.5px solid var(--line-2); border-radius:9px; padding:8px 11px; outline:none; }
.an-rangef input:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px var(--info-bg); }
.an-rangepop__quick { display:flex; gap:5px; flex-wrap:wrap; margin:4px 0 12px; }
.an-rangepop__quick button { flex:1; border:1px solid var(--line-2); background:var(--surface-2); color:var(--ink-2); font-family:var(--ff); font-size:11px; font-weight:700; border-radius:7px; padding:5px 4px; cursor:pointer; transition:.13s; }
.an-rangepop__quick button:hover { border-color:var(--navy-600); color:var(--navy-700); }
.an-rangepop__ft { display:flex; gap:8px; }
.an-rangepop__cancel { flex:1; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-family:var(--ff); font-size:12.5px; font-weight:700; border-radius:9px; padding:8px; cursor:pointer; }
.an-rangepop__ok { flex:1.4; border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; border-radius:9px; padding:8px; cursor:pointer; }
.an-rangepop__ok:hover { filter:brightness(1.08); }

.an-toplist { display:flex; flex-direction:column; }
.an-toprow { display:flex; align-items:center; gap:13px; padding:11px 0; border-bottom:1px solid var(--line); }
.an-toprow:last-child { border-bottom:none; }
.an-rank { width:24px; height:24px; flex:none; border-radius:7px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); font-family:"Noto Sans",sans-serif; font-weight:800; font-size:12px; }
.an-toprow:first-child .an-rank { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }
.an-topmid { flex:1; min-width:0; }
.an-topnm { font-size:13px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:7px; }
.an-topcat { font-size:10.5px; font-weight:600; color:var(--dim); background:var(--surface-3); padding:1px 7px; border-radius:99px; flex:none; }
.an-topbar { height:7px; border-radius:99px; background:var(--surface-3); margin-top:6px; overflow:hidden; }
.an-topbar i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--navy-600),var(--navy-700)); }
.an-toprow:first-child .an-topbar i { background:linear-gradient(90deg,var(--gold-500),var(--gold-600)); }
.an-rank--2 { background:linear-gradient(150deg,#d2d9e4,#9fadc2) !important; color:#33415c !important; }
.an-rank--3 { background:linear-gradient(150deg,#e8cba6,#c8995f) !important; color:#5b3f1e !important; }
.an-topmeta { display:flex; align-items:center; gap:8px; margin-top:7px; font-size:10.5px; color:var(--dim); }
.an-mar { font-weight:700; color:var(--navy-700); background:var(--surface-3); border-radius:99px; padding:1px 8px; }
.an-mar.is-hi { color:#1F8A5B; background:#e8f7ee; }
.an-topshare { display:block; font-size:10.5px; color:var(--dim); margin-top:2px; }
.an-topnum { text-align:right; flex:0 0 auto; min-width:132px; white-space:nowrap; }
.an-topnum b { font-size:13.5px; font-weight:800; color:var(--ink); }
.an-topnum span { display:block; font-size:10.5px; color:var(--dim); margin-top:1px; white-space:nowrap; }
.an-topnum span * { display:inline; white-space:nowrap; }

/* ตัวชี้วัดสินค้า — จัดกลุ่ม + ดูละเอียด (anrec) */
.anrec-stars { display:inline-flex; gap:1px; }
.anrec-toolbar { display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; padding:11px 16px; border-bottom:1px solid var(--line); background:var(--surface-2); }
.anrec-gtabs { display:inline-flex; gap:3px; padding:3px; background:var(--surface-3); border-radius:9px; }
.anrec-gtab { border:none; background:none; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); padding:5px 11px; border-radius:7px; cursor:pointer; transition:.13s; }
.anrec-gtab.is-on { background:var(--surface); color:var(--navy-700); box-shadow:var(--sh-sm); }
.anrec-vfilter { display:flex; flex-wrap:wrap; gap:5px; }
.anrec-vchip { display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-family:var(--ff); font-size:11px; font-weight:700; border-radius:99px; padding:4px 10px; cursor:pointer; transition:.13s; }
.anrec-vchip:hover { border-color:var(--navy-600); }
.anrec-vchip.is-on { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.anrec-group { border-bottom:1px solid var(--line); }
.anrec-group:last-child { border-bottom:none; }
.anrec-ghd { width:100%; display:flex; align-items:center; gap:10px; padding:11px 4px; border:none; background:none; cursor:pointer; font-family:var(--ff); text-align:left; }
.anrec-ghd > svg:first-child { transition:transform .16s; }
.anrec-ghd.is-open > svg:first-child { transform:rotate(180deg); }
.anrec-ghd b { font-size:13.5px; font-weight:800; color:var(--ink); }
.anrec-gcount { font-size:11px; color:var(--dim); }
.anrec-gstars { margin-left:auto; }
.anrec-grev { font-size:13px; font-weight:800; color:var(--navy-700); min-width:96px; text-align:right; }
.anrec-list { display:flex; flex-direction:column; padding-bottom:4px; }
.anrec-row { display:flex; align-items:center; gap:11px; padding:9px 6px; border-top:1px solid var(--line); cursor:pointer; transition:.12s; }
.anrec-row:hover { background:var(--surface-2); }
.anrec-row.is-open { background:var(--surface-2); }
.anrec-score { width:34px; height:34px; flex:none; border-radius:9px; display:grid; place-items:center; font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:800; }
.anrec-main { flex:1; min-width:0; }
.anrec-nm { font-size:13px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.anrec-sub { font-size:11px; color:var(--dim); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.anrec-verdict { flex:none; display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:800; border-radius:99px; padding:4px 10px; }
.anrec-detail { padding:4px 6px 13px 51px; border-top:1px dashed var(--line); background:var(--surface-2); }
.anrec-mtx { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; margin:10px 0; }
.anrec-mtx > div { background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:7px 9px; }
.anrec-mtx span { display:block; font-size:10px; color:var(--dim); margin-bottom:2px; }
.anrec-mtx b { font-size:13px; font-weight:700; color:var(--ink); }
.anrec-act { display:flex; align-items:flex-start; gap:7px; font-size:12px; line-height:1.5; color:var(--ink-2); background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--navy-600); border-radius:9px; padding:9px 12px; }
@media (max-width:920px){ .anrec-mtx { grid-template-columns:repeat(3,1fr); } }

.an-catlist { display:flex; flex-direction:column; gap:11px; }
.an-catrow { display:grid; grid-template-columns:96px 1fr auto; align-items:center; gap:12px; }
.an-catnm { font-size:12.5px; font-weight:700; color:var(--ink-2); white-space:nowrap; }
.an-catbar { height:9px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.an-catbar i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--gold-400),var(--gold-600)); }
.an-catv { font-size:12.5px; font-weight:800; color:var(--ink); white-space:nowrap; }

.an-fin { padding:16px 18px; }
.an-fin__hd { display:flex; align-items:center; gap:11px; margin-bottom:12px; }
.an-fin__ic { width:38px; height:38px; flex:none; border-radius:11px; display:grid; place-items:center; }
.an-fin__hd b { display:block; font-size:13.5px; font-weight:700; color:var(--ink); }
.an-fin__hd span { font-size:11.5px; color:var(--dim); }
.an-fin__v { font-size:25px; font-weight:800; color:var(--ink); letter-spacing:-.5px; }
.an-fin__note { font-size:11.5px; color:var(--dim); margin-top:6px; line-height:1.5; }
.an-aging { display:flex; gap:2px; height:9px; margin-top:13px; border-radius:99px; overflow:hidden; }
.an-aging i { display:block; border-radius:2px; }
.an-aginglg { display:flex; flex-wrap:wrap; gap:11px; margin-top:8px; font-size:10.5px; color:var(--dim); }
.an-aginglg span { display:inline-flex; align-items:center; gap:5px; }
.an-aginglg i { width:9px; height:9px; border-radius:3px; }
.an-fin__link { display:inline-flex; align-items:center; gap:5px; margin-top:14px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; padding:0; }
.an-fin__link:hover { color:var(--gold-600); }

@media (max-width:1100px){
  .an-kpis { grid-template-columns:1fr 1fr; }
  .an-row--2a, .an-row--2, .an-row--3 { grid-template-columns:1fr; }
}

/* เป้าหมาย vs จริง */
.an-target { display:grid; grid-template-columns:1.7fr 1fr; gap:24px; align-items:center; padding:18px 22px; margin-bottom:18px; }
.an-target__hd { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.an-target__k { font-size:13.5px; font-weight:700; color:var(--ink); }
.an-target__tag { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:3px 10px; border-radius:99px; }
.an-target__tag.is-ok { color:#1F8A5B; background:#e8f7ee; }
.an-target__tag.is-warn { color:var(--gold-600); background:#fdf4e1; }
.an-target__bar { position:relative; height:16px; border-radius:99px; background:var(--surface-3); overflow:visible; }
.an-target__fill { height:100%; border-radius:99px; background:linear-gradient(90deg,var(--navy-600),var(--gold-500)); }
.an-target__proj { position:absolute; top:-4px; bottom:-4px; width:3px; border-radius:2px; background:var(--ink); transform:translateX(-1.5px); }
.an-target__proj::after { content:"\000e04\000e32\000e14"; position:absolute; top:-16px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:700; color:var(--ink-2); font-family:var(--ff); white-space:nowrap; }
.an-target__scale { display:flex; justify-content:space-between; margin-top:8px; font-size:11px; color:var(--dim); }
.an-target__r { display:flex; gap:14px; border-left:1px solid var(--line); padding-left:24px; }
.an-tstat { flex:1; }
.an-tstat span { display:block; font-size:11.5px; color:var(--dim); }
.an-tstat b { display:block; font-size:21px; font-weight:800; color:var(--ink); letter-spacing:-.5px; margin:3px 0 2px; }
.an-tstat i { font-style:normal; font-size:11px; font-weight:600; color:var(--ink-2); }
@media (max-width:1100px){ .an-target { grid-template-columns:1fr; gap:18px; } .an-target__r { border-left:none; padding-left:0; border-top:1px solid var(--line); padding-top:14px; } }

/* dashboard layout: main column + sidebar */
.an-main { display:grid; grid-template-columns:1.62fr 1fr; gap:18px; margin-bottom:18px; align-items:start; }
.an-col { display:flex; flex-direction:column; gap:18px; min-width:0; }
.an-target--side { grid-template-columns:1fr; gap:15px; padding:16px 18px; margin-bottom:0; align-items:stretch; }
.an-target--side .an-target__r { border-left:none; padding-left:0; border-top:1px solid var(--line); padding-top:14px; }
@media (max-width:1100px){ .an-main { grid-template-columns:1fr; } }

/* เบิกใช้ — tab switcher (parts / reimburse) + reimburse action buttons */
.iu-tabs { display:flex; gap:4px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); padding:4px; margin-bottom:18px; width:max-content; }
.iu-wrap { max-width:1280px; margin-left:auto; margin-right:auto; }
/* เบิกเงินสำรองจ่าย — action column (กว้างพอ ปุ่มไม่อึดอัด + sticky ขวาเมื่อ scroll) */
.panel__bd:has(.rb-tbl){ overflow-x:auto; }
.rb-tbl{ min-width:1020px; }
.rb-tbl th:last-child, .rb-tbl td:last-child{ min-width:330px; }
.rb-tbl thead th:last-child{ text-align:right; position:sticky; right:0; background:var(--surface-2); z-index:2; }
.rb-tbl tbody td:last-child{ position:sticky; right:0; background:var(--surface); box-shadow:-9px 0 12px -11px rgba(16,32,72,.22); }
.rb-tbl tbody tr:hover td:last-child{ background:var(--surface-2); }
.rb-tbl tbody td:last-child > div{ display:flex; align-items:center; justify-content:flex-end; gap:8px; white-space:nowrap; }
.rb-tbl .rb-act{ height:30px; padding:0 12px; border-radius:8px; min-width:100px; justify-content:center; }
.iu-tabs button { display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--dim); background:none; border:none; border-radius:calc(var(--r-md) - 4px); padding:8px 18px; cursor:pointer; transition:.14s; }
.iu-tabs button.is-on { background:var(--surface); color:var(--navy-800); box-shadow:var(--sh-sm); }
.rb-act { display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11.5px; font-weight:700; border:1px solid; border-radius:8px; padding:5px 11px; cursor:pointer; transition:.14s; }
.rb-act--ok { color:var(--ok-ink,#1F7A4D); background:var(--ok-bg,#e8f7ee); border-color:#bfe6cf; }
.rb-act--ok:hover { background:#dcf2e5; }
.rb-act--pay { color:#fff; background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); border-color:transparent; }
.rb-act--pay:hover { filter:brightness(1.07); }
.rb-act--ghost { color:var(--navy-700); background:var(--surface); border-color:var(--line-2); }
.rb-act--no { color:var(--danger-ink,#b42318); background:var(--danger-bg,#fdeceb); border-color:#f0c2bd; }
.rb-act--no:hover { background:#fbddd9; }
.rb-act--ghost:hover { border-color:var(--navy-300,#aebfdb); background:var(--surface-2); }

/* ค้างจ่ายคืนพนักงาน summary banner (shown in เจ้าหนี้ screen) — themed callout */
.rb-summary { display:flex; align-items:center; gap:13px; width:100%; text-align:left; background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--gold-500); border-radius:var(--r-md); padding:13px 16px 13px 15px; margin-bottom:14px; cursor:pointer; font-family:var(--ff); transition:border-color .14s, box-shadow .14s; }
.rb-summary:hover { border-color:var(--line-2); border-left-color:var(--gold-500); box-shadow:var(--sh-sm); }
.rb-summary__ic { width:42px; height:42px; flex:none; border-radius:11px; display:grid; place-items:center; background:var(--surface-3); color:var(--navy-700); }
.rb-summary__bd { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.rb-summary__t { font-size:13.5px; font-weight:700; color:var(--navy-800); }
.rb-summary__sub { font-size:11.5px; color:var(--dim); }
.rb-summary__amt { font-size:20px; font-weight:800; color:var(--navy-800); flex:none; font-family:"Noto Sans",var(--ff); }
.rb-summary__go { flex:none; display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:12.5px; font-weight:700; color:#fff; background:var(--navy-700); border-radius:var(--r-sm); padding:8px 14px; transition:background .14s; }
.rb-summary:hover .rb-summary__go { background:var(--navy-800); }

/* slip viewer (employee receipt + company transfer-back proof) */
.slipgrid { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.slipcard { border:1px solid var(--line); border-radius:13px; overflow:hidden; background:var(--surface); }
.slipcard__hd { display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:800; padding:9px 12px; }
.slipcard__hd--receipt { background:#eef3fb; color:var(--navy-700); }
.slipcard__hd--pay { background:#fff7e8; color:var(--gold-700,#9a7b2e); }
.slipcard__img { height:158px; display:flex; align-items:center; justify-content:center; padding:14px; background:repeating-linear-gradient(135deg,#f6f8fc 0 10px,#f1f4fa 10px 20px); }
.slipcard__img--empty { flex-direction:column; gap:8px; color:var(--dim); font-size:11.5px; background:var(--surface-2); }
.slipcard__paper { width:118px; min-height:128px; background:#fff; border:1px solid var(--line); border-radius:7px; box-shadow:0 6px 16px rgba(20,40,90,.12); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:13px 9px; position:relative; }
.slipcard__amt { font-size:18px; font-weight:800; color:var(--navy-900); }
.slipcard__ref { font-size:10px; color:var(--dim); text-align:center; line-height:1.3; }
.slipcard__stamp { margin-top:4px; font-size:9.5px; font-weight:800; color:var(--ok-ink,#1F8A5B); border:1.5px solid #bfe6cf; border-radius:5px; padding:1px 7px; transform:rotate(-7deg); }
.slipcard__hd--pay ~ .slipcard__img .slipcard__stamp { color:var(--gold-700,#9a7b2e); border-color:#ecd9a6; }
.slipcard__meta { display:flex; border-top:1px solid var(--line); }
.slipcard__meta > div { flex:1; padding:8px 11px; }
.slipcard__meta > div:first-child { border-right:1px solid var(--line); }
.slipcard__meta span { display:block; font-size:10px; color:var(--dim); }
.slipcard__meta b { font-size:11.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.slipnote { display:flex; align-items:center; gap:7px; margin-top:13px; font-size:11.5px; color:var(--dim); background:#fffdf6; border:1px solid var(--gold-200,#f0e0b8); border-radius:9px; padding:8px 11px; }

/* payback proof upload drop */
.slipdrop { display:flex; align-items:center; gap:11px; width:100%; text-align:left; margin-top:4px; background:var(--surface-2); border:1.5px dashed var(--line-2); border-radius:11px; padding:12px 14px; cursor:pointer; font-family:var(--ff); transition:.14s; }
.slipdrop:hover { border-color:var(--gold-400); background:#fffdf6; }
.slipdrop.is-on { border-style:solid; border-color:#bfe6cf; background:#f3fbf6; }
.slipdrop span { display:flex; flex-direction:column; line-height:1.3; }
.slipdrop b { font-size:12.5px; font-weight:700; color:var(--ink); }
.slipdrop i { font-style:normal; font-size:11px; color:var(--dim); margin-top:1px; }
@media (max-width:560px){ .slipgrid { grid-template-columns:1fr; } }

/* Catalog เจ้าหนี้ — supplier search + catalog grid + price-list upload */
.cat2 { display:grid; grid-template-columns:288px minmax(0,1fr); gap:16px; align-items:start; }
.cat-side { background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; max-height:calc(100vh - 290px); }
.cat-search { display:flex; align-items:center; gap:8px; padding:11px 13px; border-bottom:1px solid var(--line); }
.cat-search input { flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); }
.cat-suplist { flex:1; min-height:0; overflow-y:auto; padding:8px; display:flex; flex-direction:column; gap:5px; }
.cat-sup { display:flex; align-items:center; gap:10px; text-align:left; background:none; border:1px solid transparent; border-radius:10px; padding:9px 10px; cursor:pointer; font-family:var(--ff); }
.cat-sup:hover { background:var(--surface-2); }
.cat-sup.is-on { background:#fffdf6; border-color:var(--gold-400); }
.cat-sup__av { width:32px; height:32px; flex:none; border-radius:9px; background:var(--surface-3); color:var(--navy-700); display:grid; place-items:center; font-weight:800; font-size:14px; }
.cat-sup__bd { flex:1; min-width:0; }
.cat-sup__nm { font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cat-sup__sub { font-size:10.5px; color:var(--dim); }
.cat-sup__n { flex:none; min-width:20px; height:20px; border-radius:99px; background:var(--surface-3); color:var(--navy-700); font-size:11px; font-weight:800; display:grid; place-items:center; padding:0 6px; }
.cat-sup.is-on .cat-sup__n { background:var(--gold-500); color:var(--navy-900); }

.cat-main { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:16px 18px; min-width:0; }
.cat-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-bottom:14px; border-bottom:1px solid var(--line); margin-bottom:15px; }
.cat-head__nm { font-size:16px; font-weight:800; color:var(--navy-900); }
.cat-head__sub { font-size:11.5px; color:var(--dim); margin-top:2px; }
.cat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(178px,1fr)); gap:12px; }
.cat-card { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--surface); display:flex; flex-direction:column; }
.cat-card__img { height:108px; border:none; border-bottom:1px solid var(--line); background:var(--surface-2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; cursor:pointer; color:var(--dim); font-size:11px; font-family:var(--ff); transition:.14s; padding:0; }
.cat-card__img:hover { background:#fffdf6; color:var(--gold-700,#9a7b2e); }
.cat-card__img.has { cursor:pointer; }
.cat-card__img img { width:100%; height:100%; object-fit:cover; }
.cat-card__bd { padding:9px 11px; display:flex; flex-direction:column; gap:3px; }
.cat-card__nm { font-size:12.5px; font-weight:700; color:var(--ink); line-height:1.3; }
.cat-card__oem { font-size:10.5px; color:var(--dim); }
.cat-card__foot { display:flex; align-items:baseline; gap:5px; margin-top:3px; }
.cat-card__foot b { font-size:14px; font-weight:800; color:var(--navy-800); }
.cat-card__foot span { font-size:10.5px; color:var(--dim); }

.cat-docs { margin-top:18px; padding-top:15px; border-top:1px solid var(--line); }
.cat-docs__hd { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:800; color:var(--navy-800); margin-bottom:11px; }
.cat-docs__hd span { margin-left:auto; font-size:11px; font-weight:600; color:var(--dim); }
.cat-docs__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:11px; }
.cat-drop { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; height:118px; border:1.5px dashed var(--line-2); border-radius:11px; background:var(--surface-2); color:var(--navy-700); cursor:pointer; font-family:var(--ff); transition:.14s; }
.cat-drop:hover { border-color:var(--gold-400); background:#fffdf6; }
.cat-drop b { font-size:12px; font-weight:700; }
.cat-drop i { font-style:normal; font-size:10px; color:var(--dim); }
.cat-doc { border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.cat-doc__img { width:100%; height:92px; object-fit:cover; display:block; }
.cat-doc__file { height:92px; display:grid; place-items:center; background:var(--surface-2); }
.cat-doc__nm { font-size:10.5px; color:var(--ink); padding:6px 9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-top:1px solid var(--line); }
@media (max-width:1000px){ .cat2 { grid-template-columns:1fr; } .cat-side { max-height:none; } }

/* =========================================================================
   ฟอร์มบิล + พรีวิวก่อนพิมพ์ (print-preview.jsx · ใช้ร่วมทุกระบบ)
   ========================================================================= */
.ppmodal-wrap { position:fixed; inset:0; z-index:250; display:flex; flex-direction:column; }
.ppmodal-scrim { position:absolute; inset:0; background:rgba(12,22,45,.55); backdrop-filter:blur(2px); }
.ppmodal { position:relative; z-index:1; margin:auto; width:min(880px,96vw); height:min(94vh,1180px); background:#eceff4; border-radius:14px; box-shadow:0 30px 80px rgba(10,20,50,.4); display:flex; flex-direction:column; overflow:hidden; }
.ppmodal__bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 15px; background:var(--surface); border-bottom:1px solid var(--line); }
.ppmodal__title { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:800; color:var(--navy-800); }
.ppmodal__actions { display:flex; align-items:center; gap:9px; }
.ppsize { position:relative; display:inline-flex; align-items:center; gap:7px; background:var(--surface); border:1px solid var(--line-2); border-radius:9px; padding:6px 11px; transition:border-color .12s, box-shadow .12s; }
.ppsize:hover { border-color:var(--navy-300,#9fb3d4); }
.ppsize.is-open { border-color:var(--gold-500); box-shadow:0 0 0 3px var(--gold-glow); }
.ppsize__lbl { font-size:11.5px; font-weight:700; color:var(--ink-2); white-space:nowrap; }
.ppsize__btn { display:inline-flex; align-items:center; gap:9px; border:none; background:none; outline:none; cursor:pointer; padding:0; font-family:var(--ff); }
.ppsize__val { font-size:12.5px; font-weight:700; color:var(--navy-800); white-space:nowrap; }
.ppsize__cv { width:7px; height:7px; border-right:2px solid var(--dim); border-bottom:2px solid var(--dim); transform:translateY(-2px) rotate(45deg); transition:transform .15s; flex:none; }
.ppsize.is-open .ppsize__cv { transform:translateY(1px) rotate(225deg); }
.ppsize__pop { position:absolute; top:calc(100% + 6px); right:0; min-width:200px; background:var(--surface); border:1px solid var(--line); border-radius:11px; box-shadow:0 12px 34px rgba(20,40,90,.20); padding:5px; z-index:60; display:flex; flex-direction:column; gap:1px; max-height:340px; overflow:auto; }
.ppsize__opt { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; text-align:left; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink); padding:9px 11px; border-radius:8px; white-space:nowrap; }
.ppsize__opt:hover { background:var(--surface-2); }
.ppsize__opt.is-on { background:#fdf6e6; color:var(--navy-800); font-weight:800; }
.ppmodal__x { width:32px; height:32px; border:none; border-radius:9px; background:var(--surface-2); color:var(--dim); display:grid; place-items:center; cursor:pointer; }
.ppmodal__x:hover { background:var(--surface-3); color:var(--ink); }
.ppmodal__scroll { flex:1; min-height:0; overflow-y:auto; padding:24px; display:flex; justify-content:center; }

/* A4 paper */
.printpaper { width:210mm; max-width:100%; min-height:297mm; background:#fff; color:#1a2231; padding:16mm 15mm; box-shadow:0 6px 24px rgba(20,40,90,.18); font-family:var(--ff); font-size:12px; line-height:1.5; align-self:flex-start; }
.pp-head { display:flex; justify-content:space-between; gap:20px; border-bottom:2px solid #16294f; padding-bottom:12px; }
.pp-head__l { display:flex; gap:12px; }
.pp-logo { width:50px; height:50px; flex:none; border-radius:10px; background:linear-gradient(150deg,#22386a,#16294f); color:#fff; font-family:"Noto Sans",sans-serif; font-weight:800; font-size:26px; display:grid; place-items:center; }
.pp-shop { font-size:17px; font-weight:800; color:#16294f; }
.pp-shopsub { font-size:10.5px; color:#5a6477; margin-top:1px; line-height:1.45; }
.pp-head__r { text-align:right; flex:none; }
.pp-dtitle { font-size:18px; font-weight:800; color:#16294f; white-space:nowrap; }
.pp-copy { font-size:10.5px; color:#9a7b2e; font-weight:700; margin-top:2px; }
.pp-docmeta { margin-top:10px; margin-left:auto; border-collapse:collapse; }
.pp-docmeta td { padding:2px 0 2px 12px; font-size:11px; text-align:right; white-space:nowrap; }
.pp-docmeta td:first-child { color:#5a6477; text-align:left; padding-left:0; }
.pp-docmeta td:last-child { font-weight:700; font-family:"Noto Sans",sans-serif; }

.pp-party { display:flex; gap:14px; margin-top:14px; }
.pp-party__box { flex:1; border:1px solid #d5dbe6; border-radius:8px; padding:10px 13px; }
.pp-party__lbl { font-size:10px; color:#5a6477; text-transform:uppercase; letter-spacing:.04em; }
.pp-party__nm { font-size:14px; font-weight:800; color:#16294f; margin-top:2px; }
.pp-party__sub { font-size:11px; color:#5a6477; margin-top:1px; }
.pp-meta { width:46%; flex:none; border:1px solid #d5dbe6; border-radius:8px; padding:8px 13px; align-self:flex-start; }
.pp-meta__row { display:flex; justify-content:space-between; gap:14px; font-size:11.5px; padding:2.5px 0; }
.pp-meta__row span { color:#5a6477; white-space:nowrap; }
.pp-meta__row b { font-weight:700; color:#1a2231; text-align:right; }

.pp-items { width:100%; border-collapse:collapse; margin-top:14px; }
.pp-items thead th { background:#16294f; color:#fff; font-size:11px; font-weight:700; padding:7px 9px; text-align:left; }
.pp-items thead th.num { text-align:right; }
.pp-items tbody td { border:1px solid #d5dbe6; border-top:none; padding:6px 9px; font-size:11.5px; vertical-align:top; }
.pp-items tbody td.num { text-align:right; font-family:"Noto Sans",sans-serif; }
.pp-items__empty td { height:24px; color:transparent; }

.pp-foot { display:flex; justify-content:space-between; align-items:flex-end; gap:18px; margin-top:14px; }
.pp-foot__words { flex:1; border:1px dashed #c3cbd9; border-radius:8px; padding:9px 12px; }
.pp-foot__words span { display:block; font-size:10px; color:#5a6477; }
.pp-foot__words b { font-size:13px; color:#16294f; font-weight:800; }
.pp-totals { border-collapse:collapse; min-width:240px; }
.pp-totals td { padding:4px 4px; font-size:12px; }
.pp-totals td:first-child { color:#5a6477; padding-right:24px; }
.pp-totals td.num { text-align:right; font-family:"Noto Sans",sans-serif; font-weight:700; }
.pp-totals tr.is-grand td { border-top:2px solid #16294f; padding-top:7px; font-size:14px; color:#16294f; font-weight:800; }

.pp-note { margin-top:12px; font-size:11px; color:#5a6477; background:#f7f9fc; border-left:3px solid #c9a347; padding:7px 11px; border-radius:0 6px 6px 0; }
.pp-logo { overflow:hidden; }
.pp-logoimg { width:100%; height:100%; object-fit:contain; background:#fff; }
.pp-stampwrap { display:flex; justify-content:flex-end; margin-top:6px; }
.pp-stampimg { width:96px; height:96px; object-fit:contain; opacity:.95; }
.pp-sign { display:flex; gap:24px; margin-top:34px; }
.pp-sign__box { flex:1; text-align:center; }
.pp-sign__line { border-bottom:1px dotted #8a94a6; height:34px; }
.pp-sign__lbl { font-size:11px; color:#1a2231; margin-top:5px; font-weight:600; }
.pp-sign__date { font-size:10px; color:#8a94a6; margin-top:2px; }
.pp-paperfoot { margin-top:20px; padding-top:9px; border-top:1px solid #e3e7ee; text-align:center; font-size:9.5px; color:#9aa3b2; }

/* PRINT: show only the paper */
@media print {
  html, body { background:#fff !important; }
  body * { visibility:hidden !important; }
  .printpaper, .printpaper * { visibility:visible !important; }
  .ppmodal-wrap { position:static !important; }
  .ppmodal-scrim, .ppmodal__bar { display:none !important; }
  .ppmodal { width:auto !important; height:auto !important; box-shadow:none !important; background:#fff !important; border-radius:0 !important; }
  .ppmodal__scroll { overflow:visible !important; padding:0 !important; display:block !important; }
  .printpaper { width:auto !important; min-height:auto !important; box-shadow:none !important; padding:0 !important; margin:0 !important; }
  @page { size:A4; margin:14mm; }
}
.bpy-printing .dtoast { display:none !important; }
@media (max-width:560px){ .printpaper { padding:10mm 8mm; } .pp-party { flex-direction:column; } .pp-meta { width:100%; } }

/* กระดาษเตี้ย/ครึ่งใบ (9×5.5 ฯลฯ) — layout กระชับ ลดช่องว่าง พอดีแผ่นเดียว */
.printpaper--compact { padding:7mm 9mm; min-height:auto; font-size:11px; }
.printpaper--compact .pp-head { padding-bottom:7px; gap:14px; }
.printpaper--compact .pp-head__l { gap:9px; }
.printpaper--compact .pp-logo { width:38px; height:38px; font-size:20px; border-radius:8px; }
.printpaper--compact .pp-shop { font-size:14.5px; }
.printpaper--compact .pp-shopsub { font-size:9.5px; margin-top:0; line-height:1.35; }
.printpaper--compact .pp-dtitle { font-size:17px; }
.printpaper--compact .pp-party { margin-top:9px; gap:10px; }
.printpaper--compact .pp-party__box { padding:7px 11px; }
.printpaper--compact .pp-items { margin-top:9px; }
.printpaper--compact .pp-items th, .printpaper--compact .pp-items td { padding-top:4px; padding-bottom:4px; }
.printpaper--compact .pp-items__empty td { height:16px; }
.printpaper--compact .pp-foot { margin-top:9px; }
.printpaper--compact .pp-foot__words { padding:6px 10px; }
.printpaper--compact .pp-note { margin-top:8px; padding:5px 10px; }
.printpaper--compact .pp-sign { margin-top:16px; gap:18px; }
.printpaper--compact .pp-sign__line { height:22px; }
.printpaper--compact .pp-paperfoot { margin-top:8px; }

/* =========================================================================
   งานส่ง — delivery workflow (flow guide · list · detail · items · evidence)
   ========================================================================= */
.dlv-guide { display:flex; align-items:center; gap:6px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:9px 12px; margin-bottom:14px; }
.dlv-guide__step { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:var(--dim); white-space:nowrap; }
.dlv-guide__step.is-on { color:var(--navy-800); font-weight:700; }
.dlv-guide__n { width:17px; height:17px; flex:none; border-radius:50%; display:grid; place-items:center; font-size:10px; font-weight:800; background:var(--surface-3); color:var(--dim); }
.dlv-guide__step.is-on .dlv-guide__n { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); }

.dlv2 { display:grid; grid-template-columns:340px minmax(0,1fr); gap:16px; align-items:start; }
@media (max-width:1000px){ .dlv2 { grid-template-columns:1fr; } }
.dlv-list { background:var(--surface); border:1px solid var(--line); border-radius:16px; overflow:hidden; display:flex; flex-direction:column; max-height:calc(100vh - 250px); }
.dlv-list__tabs { display:flex; gap:5px; padding:11px 12px; border-bottom:1px solid var(--line); }
.dlv-tab { flex:1; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:8px; cursor:pointer; }
.dlv-tab.is-active { color:var(--navy-800); background:#fffdf6; border-color:var(--gold-400); }
.dlv-list__scroll { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding:10px; display:flex; flex-direction:column; gap:9px; }
.dlv-job, .dlv-job__l1, .dlv-job__l2 { min-width:0; max-width:100%; }
.dlv-job__l2 .dlv-job__sub { flex:1 1 0; }
.dlv-job { display:flex; flex-direction:column; gap:3px; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:8px 12px; cursor:pointer; font-family:var(--ff); transition:.14s; }
.dlv-job:hover { border-color:var(--gold-400); }
.dlv-job.is-on { border-color:var(--gold-500); background:#fffdf6; box-shadow:inset 3px 0 0 var(--gold-500); }
.dlv-job__top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dlv-job__l1 { display:flex; align-items:center; gap:7px; min-width:0; }
.dlv-job__l1 .dlv-job__cust { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dlv-job__l2 { display:flex; align-items:center; gap:8px; min-width:0; }
.dlv-job__l2 .dlv-job__sub { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-wrap:nowrap; }
.dlv-job__l2 .dlv-job__val { margin-left:auto; flex:none; }
.dlv-job__no { font-family:"Noto Sans",sans-serif; font-size:13px; font-weight:800; color:var(--navy-800); }
.dlv-job__cust { font-size:13px; font-weight:700; color:var(--ink); }
.dlv-job__sub { display:flex; align-items:center; gap:4px; flex-wrap:wrap; font-size:11px; color:var(--dim); }
.dlv-job__foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:3px; padding-top:7px; border-top:1px dashed var(--line); }
.dlv-job__cust { font-size:13px; font-weight:700; color:var(--ink); }
.dlv-job__stage { font-size:11px; font-weight:700; color:var(--navy-600); }
.dlv-job__val { font-size:13px; font-weight:800; color:var(--ink); }
.dlv-job__val i { font-style:normal; font-size:10.5px; font-weight:700; color:var(--warn-ink,#C2871A); }

.dlv-detail { display:flex; flex-direction:column; gap:14px; min-width:0; }
.dlv-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; flex-wrap:wrap; }
.dlv-head__no { display:flex; align-items:center; gap:9px; font-family:"Noto Sans",sans-serif; font-size:17px; font-weight:800; color:var(--navy-900); }
.dlv-head__chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:8px; }
.dlv-chip { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:var(--dim); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:4px 11px; }
.dlv-chip b { color:var(--navy-800); font-weight:700; }
.dlv-smart { display:flex; align-items:center; gap:10px; background:linear-gradient(120deg,#16294f,#0e1f3f); color:#fff; border:none; border-radius:12px; padding:9px 13px; cursor:pointer; font-family:var(--ff); text-align:left; transition:filter .14s; }
.dlv-smart:hover { filter:brightness(1.12); }
.dlv-smart span { display:flex; flex-direction:column; line-height:1.3; }
.dlv-smart i { font-style:normal; font-size:10px; color:#9fb0cd; }
.dlv-smart b { font-size:12.5px; font-weight:700; font-family:"Noto Sans",sans-serif; }
.dlv-smart > svg:first-child { color:var(--gold-400); }

.dlv-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:1000px){ .dlv-grid2 { grid-template-columns:1fr; } }
.panel--pad { padding:15px 17px; }
.dlv-route { display:flex; gap:12px; }
.dlv-route__line { display:flex; flex-direction:column; align-items:center; padding-top:3px; }
.dlv-route__dot { width:11px; height:11px; border-radius:50%; border:3px solid var(--navy-600); }
.dlv-route__bar { width:2px; flex:1; min-height:24px; background:var(--line-2); margin:3px 0; }
.dlv-route__pts { flex:1; display:flex; flex-direction:column; gap:14px; }
.dlv-route__pts span { font-size:11px; color:var(--dim); font-weight:600; display:block; }
.dlv-route__pts b { font-size:13px; font-weight:700; color:var(--ink); }
.dlv-route__pts i { font-style:normal; font-size:11.5px; color:var(--dim); display:block; margin-top:2px; line-height:1.4; }
.dlv-pay { display:flex; gap:14px; margin-top:14px; padding-top:13px; border-top:1px solid var(--line); }
.dlv-pay > div { flex:1; }
.dlv-pay span { font-size:11px; color:var(--dim); font-weight:600; display:block; }
.dlv-pay b { font-size:14px; font-weight:800; color:var(--ink); }

.dlv-items td { padding:8px 6px; border-bottom:1px solid var(--line); vertical-align:top; }
.dlv-items tr:last-child td { border-bottom:none; }
.dlv-items__q { white-space:nowrap; font-family:"Noto Sans",sans-serif; font-size:12px; font-weight:700; color:var(--navy-700); width:64px; }
.dlv-items__n { font-size:12.5px; color:var(--ink); line-height:1.4; }
.dlv-items__tot { display:flex; align-items:center; justify-content:space-between; margin-top:6px; padding-top:11px; border-top:1px dashed var(--line-2); font-size:13px; }
.dlv-items__tot b { font-size:15px; font-weight:800; color:var(--navy-900); }

.dlv-flow { display:block; }
.dlv-step { display:grid; grid-template-columns:28px 1fr auto; align-items:start; gap:4px 11px; padding:8px 0; position:relative; width:auto; height:auto; background:none; border-radius:0; }
.dlv-step:not(:last-child)::before { content:""; position:absolute; left:13px; top:34px; bottom:-3px; width:2px; background:var(--line); }
.dlv-step.is-done:not(:last-child)::before { background:#bfe6cf; }
.dlv-step__ic { width:28px; height:28px; flex:none; border-radius:50%; display:grid; place-items:center; z-index:1; background:var(--surface-3); color:var(--dim); border:2px solid var(--line); }
.dlv-step.is-done .dlv-step__ic { background:#e4f5ea; color:var(--ok-ink,#1F8A5B); border-color:#bfe6cf; }
.dlv-step.is-now .dlv-step__ic { background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); border-color:transparent; box-shadow:0 0 0 4px var(--gold-glow); }
.dlv-step__bd { min-width:0; }
.dlv-step__bd b { display:block; font-size:13px; font-weight:700; color:var(--ink); white-space:nowrap; }
.dlv-step__bd b *, .dlv-step__bd span * { display:inline; white-space:nowrap; }
.dlv-step.is-todo .dlv-step__bd b { color:var(--dim); font-weight:600; }
.dlv-step__bd span { display:block; font-size:11px; color:var(--dim); white-space:nowrap; margin-top:1px; }
.dlv-step__tag { font-size:10.5px; font-weight:800; color:var(--gold-700,#9a7b2e); background:#fdf4e1; border:1px solid #ecd9a6; border-radius:99px; padding:2px 9px; }

.dlv-evgrp { margin-bottom:13px; }
.dlv-evgrp:last-child { margin-bottom:0; }
.dlv-evgrp__h { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--ink); margin-bottom:9px; }
.dlv-evgrp__h em { font-style:normal; font-size:11px; font-weight:600; color:var(--ok-ink,#1F8A5B); }
.dlv-evgrp__h em.is-now { color:var(--gold-700,#9a7b2e); }
.dlv-photos { display:flex; gap:10px; flex-wrap:wrap; }
.dlv-photo { flex:1; min-width:120px; height:92px; border-radius:11px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; border:1.5px dashed var(--line-2); background:var(--surface-2); color:var(--dim); font-size:11px; text-align:center; padding:6px; }
.dlv-photo.is-active { border-style:solid; border-color:var(--gold-400); background:#fffdf6; color:var(--gold-700,#9a7b2e); }
.dlv-photo.is-done { border-style:solid; border-color:#bfe6cf; background:#f3fbf6; color:var(--ok-ink,#1F8A5B); position:relative; overflow:hidden; }
.dlv-photo.is-done::before { content:""; position:absolute; inset:0; background:repeating-linear-gradient(135deg,rgba(31,138,91,.05) 0 8px,rgba(31,138,91,.10) 8px 16px); }
.dlv-photo__t { font-weight:700; position:relative; }
.dlv-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; padding-right:84px; }

@media (max-width:1100px){ .dlv2 { grid-template-columns:1fr; } .dlv-list { max-height:none; } .dlv-grid2 { grid-template-columns:1fr; } }

/* ===== โปรโมชั่นหน้าร้าน (cashier preview posters · read-only) ===== */
.promoview__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(258px,1fr)); gap:16px; }
.promoview__ro { font-size:11px; font-weight:700; color:var(--dim); background:var(--surface-2); border:1px solid var(--line-2); border-radius:99px; padding:3px 10px; display:inline-flex; align-items:center; gap:5px; }
.promoposter { display:flex; flex-direction:column; gap:9px; text-align:left; border:none; border-radius:18px; padding:20px; color:#fff; font-family:var(--ff); box-shadow:0 16px 34px -18px rgba(20,40,90,.6); overflow:hidden; position:relative; min-height:182px; width:100%; transition:transform .14s ease, box-shadow .14s ease; }
.promoview__grid .promoposter:hover { transform:translateY(-3px); box-shadow:0 22px 44px -18px rgba(20,40,90,.72); }
.promoposter__top { display:flex; align-items:flex-start; justify-content:space-between; }
.promoposter__kind { font-size:12px; font-weight:800; color:#16294f; border-radius:99px; padding:4px 12px; }
.promoposter__ic { opacity:.92; }
.promoposter__name { font-weight:800; line-height:1.2; letter-spacing:.2px; }
.promoposter__detail { color:rgba(255,255,255,.86); line-height:1.5; flex:1; }
.promoposter__foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding-top:9px; border-top:1px solid rgba(255,255,255,.16); }
.promoposter__period { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:rgba(255,255,255,.92); white-space:nowrap; }
.promoposter__brand { font-size:10px; letter-spacing:1px; color:rgba(255,255,255,.6); text-transform:uppercase; white-space:nowrap; }
.promoview__scrim { position:fixed; inset:0; z-index:200; background:rgba(8,16,32,.66); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); display:grid; place-items:center; padding:24px; }
.promoview__stage { width:min(560px,92vw); display:flex; flex-direction:column; gap:14px; animation:pop .2s ease; }
.promoview__stage .promoposter { min-height:344px; padding:34px; cursor:default; }
.promoview__close { align-self:center; display:inline-flex; align-items:center; gap:7px; border:none; background:#fff; color:var(--ink); font-family:var(--ff); font-weight:700; font-size:14px; border-radius:99px; padding:11px 22px; cursor:pointer; box-shadow:var(--sh-md); }

/* ===== หน้าจอล็อก / พักหน้าจอ (sleep mode) ===== */
.scrlock { position:fixed; inset:0; z-index:300; display:grid; place-items:center; overflow:hidden; font-family:var(--ff);
  background:linear-gradient(160deg,#16294f 0%,#0c1c3a 60%,#0a1730 100%); }
@keyframes scrIn { from{ opacity:0; } to{ opacity:1; } }
.scrlock__bg { position:absolute; inset:0; overflow:hidden; }
.scrlock__bg > span { position:absolute; border-radius:50%; filter:blur(80px); opacity:.5; }
.scrlock__bg span:nth-child(1){ width:40vmax; height:40vmax; right:-12vmax; top:-14vmax; background:radial-gradient(circle,rgba(245,164,0,.22),transparent 70%); }
.scrlock__bg span:nth-child(2){ width:36vmax; height:36vmax; left:-12vmax; bottom:-14vmax; background:radial-gradient(circle,rgba(45,108,181,.32),transparent 70%); }
.scrlock__clock { position:absolute; top:7vh; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.9); font-size:62px; font-weight:300; letter-spacing:2px; font-family:"Noto Sans",sans-serif; }
.scrlock__card { position:relative; width:min(382px,90vw); padding:34px 30px 26px; border-radius:24px; text-align:center;
  background:linear-gradient(165deg, rgba(40,66,118,.86), rgba(18,34,68,.93)); border:1px solid rgba(130,160,220,.26); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  box-shadow:0 40px 90px -28px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px rgba(255,255,255,.03); color:#fff; }
.scrlock__styleswap { position:absolute; top:14px; right:14px; z-index:5; }.scrlock__stylebtn { width:34px; height:34px; border-radius:10px; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.08); color:rgba(255,255,255,.85); display:grid; place-items:center; cursor:pointer; transition:all .15s; }
.scrlock__stylebtn:hover { background:rgba(255,255,255,.18); color:#fff; }
.scrlock__stylepop { position:absolute; top:40px; right:0; min-width:158px; background:#15264a; border:1px solid rgba(255,255,255,.16); border-radius:12px; box-shadow:0 18px 40px -12px rgba(0,0,0,.7); padding:6px; display:flex; flex-direction:column; gap:2px; }
.scrlock__styleopt { text-align:left; border:none; background:none; cursor:pointer; font-family:var(--ff); font-size:13px; font-weight:600; color:rgba(255,255,255,.82); padding:9px 11px; border-radius:8px; transition:all .12s; }
.scrlock__styleopt:hover { background:rgba(255,255,255,.1); color:#fff; }
.scrlock__styleopt.is-on { background:var(--gold-500); color:#15264a; font-weight:700; }
.logoutmodal { position:fixed; inset:0; z-index:400; display:grid; place-items:center; background:rgba(8,16,33,.55); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); animation:lmFade .18s ease; }
.logoutmodal__card { width:min(360px,90vw); background:linear-gradient(165deg,#ffffff,#f4f7fc); border-radius:20px; padding:26px 24px 22px; text-align:center; box-shadow:0 30px 70px -20px rgba(0,0,0,.5); animation:lmPop .2s ease; }
.logoutmodal__ic { width:56px; height:56px; margin:0 auto 14px; border-radius:50%; display:grid; place-items:center; background:#fdecec; color:#d14343; }
.logoutmodal__card h3 { font-size:18px; font-weight:800; color:var(--navy-800); margin-bottom:6px; }
.logoutmodal__card p { font-size:13px; color:var(--dim); line-height:1.55; margin-bottom:20px; }
.logoutmodal__btns { display:flex; gap:10px; }
.logoutmodal__cancel, .logoutmodal__yes { flex:1; height:44px; border-radius:12px; font-family:var(--ff); font-size:14px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; transition:all .15s; }
.logoutmodal__cancel { border:1px solid var(--line-2); background:#fff; color:var(--ink-2); }
.logoutmodal__cancel:hover { background:var(--surface-2); }
.logoutmodal__yes { border:none; background:linear-gradient(135deg,#e0533f,#c0392b); color:#fff; }
.logoutmodal__yes:hover { filter:brightness(1.07); }
@keyframes lmFade { from{ opacity:0; } to{ opacity:1; } }
@keyframes lmPop { from{ opacity:0; transform:translateY(8px) scale(.97); } to{ opacity:1; transform:none; } }
/* uniform hero box for every sleep style */
.scrlock__hero { height:182px; margin:6px 0 14px; display:flex; align-items:center; justify-content:center; overflow:visible; }
.scrlock__hero > * { margin:0 !important; }
.scrlock__hero .planetlock-wrap { height:182px; min-height:0; }
.scrlock__hero .planetlock { transform:scale(.56); }
.scrlock__hero .coffeem-wrap { height:168px; min-height:0; }
.scrlock__hero .coffeem { transform:scale(.66); }
.scrlock__hero .lockhamster { height:168px; }
.scrlock__hero .lockmoon { transform:scale(1.45); }
.scrlock__hero .locklogo { transform:scale(1.3); }
.scrlock__hero .catnap, .scrlock__hero .catwall2, .scrlock__hero .catback { transform:scale(1.1); }
.scrlock__logo { width:54px; height:54px; border-radius:15px; overflow:hidden; margin:0 auto; background:#fff; display:grid; place-items:center; }
.scrlock__logo img { width:100%; height:100%; object-fit:cover; }
.scrlock__lockico { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; margin:-22px auto 0; background:var(--gold-500); color:var(--navy-900); border:3px solid #15294e; }
.scrlock__title { font-size:18px; font-weight:800; margin-top:12px; }
.scrlock__user { display:inline-flex; align-items:center; gap:9px; margin:12px 0 4px; text-align:left; }
.scrlock__ava { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:linear-gradient(150deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); font-weight:800; }
.scrlock__user b { display:block; font-size:14px; } .scrlock__user i { display:block; font-style:normal; font-size:11.5px; color:#9fb0cd; }
.scrlock__hint { font-size:12.5px; color:#9fb0cd; margin:10px 0 12px; }
.scrlock__err { display:flex; align-items:center; justify-content:center; gap:6px; color:#ffb4a8; font-size:12.5px; margin-top:10px; }
.scrlock__btn { width:100%; margin-top:16px; border:none; border-radius:12px; padding:12px; font-family:var(--ff); font-size:14px; font-weight:700; cursor:pointer;
  background:linear-gradient(120deg,var(--gold-500),var(--gold-600)); color:var(--navy-900); display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.scrlock__div { display:flex; align-items:center; gap:10px; margin:16px 0 10px; color:#6f80a0; font-size:11px; }
.scrlock__div::before, .scrlock__div::after { content:""; flex:1; height:1px; background:rgba(255,255,255,.14); }
.scrlock__alt { width:100%; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.05); color:#cdd6e8; border-radius:12px; padding:11px; font-family:var(--ff); font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.scrlock__alt:hover { background:rgba(255,255,255,.1); }
.scrlock .shake { animation:scrShake .4s; }
@keyframes scrShake { 0%,100%{ transform:translateX(0); } 20%,60%{ transform:translateX(-7px); } 40%,80%{ transform:translateX(7px); } }
.scrlock .segrow { justify-content:center; }
/* 🐞 จุดรหัสมองไม่เห็นบนหน้าพักหน้าจอ (เจ้าของแจ้ง 2026-08-23)
   .segbox ตั้ง color:#fff ไว้สำหรับพื้นเข้มของหน้า Login
   แต่หน้าพักหน้าจอทับพื้นช่องเป็นสีขาว ⇒ ตัวอักษรขาวบนพื้นขาว = มองไม่เห็น
   ทับสีตัวอักษร + เคอร์เซอร์ให้เป็นน้ำเงินเข้มเฉพาะในหน้านี้ (ไม่แตะหน้า Login ที่ freeze ไว้) */
.scrlock .segbox { background:rgba(255,255,255,.95); color:var(--navy-700,#0b2447); caret-color:var(--navy-700,#0b2447); }
.scrlock .segbox.on, .scrlock .segbox:focus { color:var(--navy-700,#0b2447); }

/* ----- แมวหลับ (sleeping cat animation) ----- */
.catnap { position:relative; width:188px; height:118px; margin:2px auto 4px; }
.catnap__cat { position:absolute; left:50%; bottom:20px; transform:translateX(-50%); width:112px; height:66px; transform-origin:50% 100%; animation:catBreath 4s ease-in-out infinite; }
.catnap__body { position:absolute; inset:0; background:linear-gradient(180deg,#f1f4fb,#cdd6e8); border-radius:50% 50% 46% 46% / 66% 66% 40% 40%; box-shadow:inset 0 -7px 12px rgba(20,40,90,.14); }
.catnap__body::before { content:""; position:absolute; top:46%; left:30px; width:11px; height:11px; border:2.4px solid #16294f; border-top:none; border-left:none; border-right:none; border-radius:0 0 11px 11px; box-shadow:34px 0 0 #16294f; opacity:.55; }
.catnap__body::after { content:""; position:absolute; top:54%; left:50%; transform:translateX(-50%); width:8px; height:5px; background:#e7a6a6; border-radius:0 0 8px 8px; opacity:.8; }
.catnap__ear { position:absolute; top:-10px; width:0; height:0; border-left:12px solid transparent; border-right:12px solid transparent; border-bottom:19px solid #f1f4fb; z-index:2; }
.catnap__ear::after { content:""; position:absolute; top:7px; left:-5px; width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent; border-bottom:9px solid #e7a6a6; }
.catnap__ear--l { left:20px; transform:rotate(-15deg); }
.catnap__ear--r { right:24px; transform:rotate(15deg); }
.catnap__tail { position:absolute; left:6px; bottom:0; width:66px; height:20px; background:linear-gradient(180deg,#e3e9f5,#c3cde2); border-radius:99px; transform-origin:88% 50%; transform:rotate(6deg); animation:catTail 4s ease-in-out infinite; }
.catnap__paw { position:absolute; left:42px; bottom:-2px; width:26px; height:12px; background:#e3e9f5; border-radius:99px; }
.catnap__ledge { position:absolute; left:50%; bottom:12px; transform:translateX(-50%); width:158px; height:9px; border-radius:5px; background:rgba(255,255,255,.10); box-shadow:0 1px 0 rgba(255,255,255,.06), inset 0 1px 2px rgba(0,0,0,.2); }
.catnap__z { position:absolute; font-family:"Noto Sans",sans-serif; font-weight:800; color:var(--gold-400); opacity:0; text-shadow:0 1px 4px rgba(0,0,0,.3); }
.catnap__z--1 { left:62%; bottom:58px; font-size:21px; animation:catZ 3.2s ease-in-out infinite; }
.catnap__z--2 { left:71%; bottom:66px; font-size:15px; animation:catZ 3.2s ease-in-out .9s infinite; }
.catnap__z--3 { left:58%; bottom:70px; font-size:11px; animation:catZ 3.2s ease-in-out 1.8s infinite; }
@keyframes catBreath { 0%,100%{ transform:translateX(-50%) scaleY(1); } 50%{ transform:translateX(-50%) scaleY(1.055); } }
@keyframes catTail { 0%,100%{ transform:rotate(6deg); } 50%{ transform:rotate(-9deg); } }
@keyframes catZ { 0%{ opacity:0; transform:translateY(8px) scale(.7); } 25%{ opacity:1; } 100%{ opacity:0; transform:translateY(-26px) scale(1.15); } }
@media (prefers-reduced-motion: reduce){ .catnap__cat,.catnap__tail,.catnap__z { animation:none !important; } }

/* ----- sleep style: แมวบนกำแพง (cat on wall) ----- */
.catwall { position:relative; width:196px; height:120px; margin:2px auto 4px; }
.catwall__wall { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); width:180px; height:26px; border-radius:4px;
  background:repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 36px, rgba(255,255,255,.04) 36px 39px), repeating-linear-gradient(0deg, transparent 0 12px, rgba(0,0,0,.18) 12px 13px);
  box-shadow:inset 0 1px 2px rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.25); }
.catwall__cat { position:absolute; left:50%; bottom:38px; transform:translateX(-50%); width:84px; height:54px; transform-origin:50% 100%; animation:catBreath 4s ease-in-out infinite; }
.cw-body { position:absolute; inset:0; background:linear-gradient(180deg,#f1f4fb,#cdd6e8); border-radius:50% 50% 44% 44% / 68% 68% 36% 36%; box-shadow:inset 0 -6px 10px rgba(20,40,90,.14); }
.cw-body::before { content:""; position:absolute; top:44%; left:22px; width:8px; height:8px; border-bottom:2.2px solid #16294f; border-radius:0 0 8px 8px; box-shadow:24px 0 0 #16294f; opacity:.55; }
.cw-ear { position:absolute; top:-8px; width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-bottom:16px solid #f1f4fb; z-index:2; }
.cw-ear--l { left:13px; transform:rotate(-15deg); } .cw-ear--r { right:17px; transform:rotate(15deg); }
.cw-tail { position:absolute; right:-10px; bottom:2px; width:13px; height:40px; background:linear-gradient(180deg,#e3e9f5,#c3cde2); border-radius:99px; transform-origin:top center; animation:cwTail .6s ease-in-out infinite alternate-reverse; }
@keyframes cwTail { 0%{ transform:rotate(58deg); } 50%{ transform:rotate(6deg); } 100%{ transform:rotate(-22deg); } }
.catwall__zz { position:absolute; left:58%; bottom:58px; display:flex; flex-direction:column; align-items:flex-start; }
.catwall__z { font-family:"Noto Sans",sans-serif; font-weight:800; color:var(--gold-400); text-shadow:0 1px 4px rgba(0,0,0,.3); }
.catwall__z--b { font-size:24px; margin-left:9px; animation:cwZ 2.3s linear infinite; }
.catwall__z--s { font-size:15px; animation:cwZ 2s linear infinite; }
@keyframes cwZ { 0%{ opacity:0; transform:translateY(5px); } 50%{ opacity:1; } 100%{ opacity:0; transform:translateY(-12px); } }

/* ----- sleep style: cat on wall v2 (SVG) ----- */
.catwall2 { position:relative; width:236px; height:128px; margin:2px auto 4px; }
.catwall2 .cw2-stage { position:absolute; inset:0; }
.cw2-wall { position:absolute; left:50%; bottom:6px; transform:translateX(-50%); width:236px; height:46px; filter:drop-shadow(0 3px 6px rgba(0,0,0,.32)); }
.cw2-cat { position:absolute; left:50%; bottom:44px; width:130px; height:auto; transform:translateX(-54%); transform-origin:50% 100%; animation:cw2Breath 4s ease-in-out infinite; filter:drop-shadow(0 4px 5px rgba(0,0,0,.22)); }
@keyframes cw2Breath { 0%,100%{ transform:translateX(-54%) scaleY(1); } 50%{ transform:translateX(-54%) scaleY(1.045); } }
.cw2-tailp { transform-box:fill-box; transform-origin:30% 88%; animation:cw2Tail 1.1s ease-in-out infinite alternate; }
@keyframes cw2Tail { 0%{ transform:rotate(9deg); } 100%{ transform:rotate(-11deg); } }
.cw2-text { position:absolute; left:14%; top:2px; display:flex; gap:2px; align-items:flex-start; z-index:3; }
.cw2-z { font-family:"Noto Sans",sans-serif; font-weight:800; color:var(--gold-400); text-shadow:0 1px 4px rgba(0,0,0,.3); }
.cw2-z--big { font-size:26px; animation:cw2Z 2.3s linear infinite; }
.cw2-z--sm { font-size:16px; margin-top:-2px; animation:cw2Z 2s linear infinite; }
@keyframes cw2Z { 0%{ opacity:0; transform:translateY(6px); } 50%{ opacity:1; } 100%{ opacity:0; transform:translateY(-14px); } }

/* ----- sleep style: แมวหันหลัง (cat from behind · Uiverse by vinodjangid07) ----- */
.catback { position:relative; width:236px; height:140px; margin:2px auto 4px; }
.catback .cb-stage { position:absolute; inset:0; }
.cb-wall { position:absolute; left:50%; bottom:6px; transform:translateX(-50%); width:236px; height:44px; filter:drop-shadow(0 3px 6px rgba(0,0,0,.32)); }
.cb-cat { position:absolute; left:50%; bottom:42px; width:88px; height:auto; transform:translateX(-58%); transform-origin:50% 100%; animation:cbBreath 4s ease-in-out infinite; filter:drop-shadow(0 4px 5px rgba(0,0,0,.22)); }
@keyframes cbBreath { 0%,100%{ transform:translateX(-58%) scaleY(1); } 50%{ transform:translateX(-58%) scaleY(1.03); } }
.cb-tail { position:absolute; left:calc(50% + 30px); bottom:32px; width:18px; height:54px; transform-origin:top center; animation:cbTail .5s ease-in infinite alternate-reverse; z-index:2; }
@keyframes cbTail { 0%{ transform:rotate(60deg); } 50%{ transform:rotate(0deg); } 100%{ transform:rotate(-20deg); } }
.cb-text { position:absolute; left:62%; top:2px; display:flex; flex-direction:column; align-items:flex-start; z-index:3; }
.cb-z { font-family:"Noto Sans",sans-serif; font-weight:800; color:var(--gold-400); text-shadow:0 1px 4px rgba(0,0,0,.3); }
.cb-z--big { font-size:25px; margin-left:10px; animation:cw2Z 2.3s linear infinite; }
.cb-z--sm { font-size:15px; animation:cw2Z 2s linear infinite; }

/* ----- sleep style: เครื่องชงกาแฟ (coffee machine · Uiverse by 3bdel3ziz-T) ----- */
.coffeem-wrap { width:100%; min-height:194px; display:flex; align-items:center; justify-content:center; margin:2px 0 10px; }
.coffeem { position:relative; width:212px; display:flex; flex-direction:column; align-items:center; justify-content:center; transform:scale(.8); transform-origin:center; }
.coffeem .coffee-header { padding:9px; width:100%; height:58px; display:flex; justify-content:space-between; align-items:center; background-color:#ddcfcc; border-radius:10px; }
.coffeem .coffee-header__buttons { width:18px; height:18px; background-color:#282323; border-radius:50%; box-shadow:28px 0 0 0 #282323; }
.coffeem .coffee-header__buttons::before { content:""; width:6px; height:6px; display:block; transform:translate(100%,18px); background-color:#615e5e; box-shadow:28px 0 0 0 #615e5e; }
.coffeem .coffee-header__display { width:36px; height:36px; border-radius:50%; background-color:#9acfc5; border:4px solid #43beae; box-sizing:border-box; }
.coffeem .coffee-header__details { width:6px; margin-left:12px; height:14px; align-self:flex-start; background-color:#9b9091; box-shadow:-9px 0 0 #9b9091,-18px 0 0 #9b9091; }
.coffeem .coffee-medium { width:90%; height:116px; position:relative; background-color:#bcb0af; }
.coffeem .coffee-medium:before { content:""; width:90%; height:72px; background-color:#776f6e; position:absolute; bottom:0; left:5%; border-radius:16px 16px 0 0; }
.coffeem .coffe-medium__exit { width:44px; height:14px; position:absolute; top:0; left:calc(50% - 22px); background-color:#231f20; }
.coffeem .coffe-medium__exit::before { content:""; width:36px; height:14px; border-radius:0 0 50% 50%; position:absolute; bottom:-14px; left:calc(50% - 18px); background-color:#231f20; }
.coffeem .coffe-medium__exit::after { content:""; width:8px; height:8px; position:absolute; bottom:-22px; left:calc(50% - 4px); background-color:#231f20; }
.coffeem .coffee-medium__arm { width:52px; height:14px; position:absolute; top:11px; right:18px; background-color:#231f20; }
.coffeem .coffee-medium__arm::before { content:""; width:11px; height:4px; position:absolute; top:5px; left:-11px; background-color:#9e9495; }
.coffeem .coffee-medium__cup { width:60px; height:34px; position:absolute; bottom:0; left:calc(50% - 30px); background-color:#fff; border-radius:0 0 70px 70px/0 0 110px 110px; }
.coffeem .coffee-medium__cup::after { content:""; width:14px; height:14px; position:absolute; top:5px; right:-10px; border:4px solid #fff; border-radius:50%; }
.coffeem .coffee-medium__liquid { width:5px; height:46px; position:absolute; top:36px; left:calc(50% - 2px); background-color:transparent; overflow:hidden; }
.coffeem .coffee-medium__liquid::before { transform:translateY(-100%); content:""; width:100%; height:100%; display:block; background-color:#74372b; animation:cmLiquid 5000ms linear 3500ms infinite normal both; }
.coffeem .smoke { opacity:0; width:6px; height:16px; position:absolute; border-radius:5px; background-color:#b3aeae; }
.coffeem .smoke.one { bottom:22px; left:72px; animation:cmSmoke 3s 5s linear infinite; }
.coffeem .smoke.two { bottom:30px; left:84px; animation:cmSmoke 3s 4s linear infinite; }
.coffeem .smoke.three { bottom:30px; right:84px; animation:cmSmoke 3s 7s linear infinite; }
.coffeem .smoke.four { bottom:22px; right:72px; animation:cmSmoke 3s 6s linear infinite; }
.coffeem::after { content:""; width:95%; height:11px; background-color:#41bdad; box-shadow:0 11px 0 4px #0a1730; border-radius:10px; }
@keyframes cmSmoke { 0%{ transform:translateY(0); opacity:0; } 40%{ opacity:.5; } 50%{ transform:translateY(-8px); opacity:.3; } 80%{ opacity:.5; } 100%{ transform:translateY(-24px); opacity:0; } }
@keyframes cmLiquid { 10%{ transform:translateY(0); } 90%{ transform:translateY(0); } 100%{ transform:translateY(100%); } }

/* ----- sleep style: รูปโลก / จรวดโคจร (Uiverse by anand_4957) ----- */
.planetlock-wrap { width:100%; height:212px; display:flex; align-items:center; justify-content:center; overflow:hidden; margin:2px 0 8px; }
.planetlock { display:flex; height:370px; width:370px; justify-content:center; align-items:center; position:relative; flex-direction:column; transform:scale(.54); }
.planetlock .moon { background-color:#39beff; height:170px; width:170px; border-radius:50%; position:absolute; margin:auto; left:0; right:0; top:0; bottom:0; overflow:hidden; }
.planetlock .crater { background-color:#31b4ff; height:30px; width:30px; border-radius:50%; position:relative; }
.planetlock .crater:before { content:""; position:absolute; height:25px; width:25px; border-radius:50%; box-shadow:-5px 0 0 2px #1ca4f9; top:2px; left:7px; }
.planetlock .crater1 { top:27px; left:90px; transform:scale(.9); }
.planetlock .crater2 { bottom:15px; left:61px; transform:scale(.6); }
.planetlock .crater3 { left:15px; transform:scale(.75); }
.planetlock .crater4 { left:107px; top:32px; transform:scale(1.18); }
.planetlock .crater5 { left:33px; bottom:4px; transform:scale(.65); }
.planetlock .pl-shadow { position:absolute; height:190px; width:190px; border-radius:50%; top:-12px; left:-34px; box-shadow:21px 0 0 5px rgba(0,0,0,.15); }
.planetlock .eye { position:absolute; background-color:#161616; height:12px; width:12px; border-radius:50%; top:62px; }
.planetlock .eye-l { left:60px; }
.planetlock .eye-r { left:98px; }
.planetlock .mouth { position:absolute; height:5px; width:10px; border:3px solid #161616; border-top:none; border-radius:0 0 10px 10px; top:80px; left:78px; }
.planetlock .blush { position:absolute; background-color:#1ca4f9; height:7.5px; width:7.5px; border-radius:50%; top:78px; }
.planetlock .blush1 { left:46px; }
.planetlock .blush2 { left:112px; }
.planetlock .orbit { height:280px; width:280px; border-radius:50%; position:absolute; margin:auto; left:0; right:0; top:0; bottom:0; animation:plSpin 10s infinite linear; }
@keyframes plSpin { 100% { transform:rotate(360deg); } }
.planetlock .rocket { background-color:#fafcf7; height:50px; width:25px; border-radius:50% 50% 0 0; position:relative; left:-11px; top:112px; overflow:visible; }
.planetlock .rocket:before { content:""; position:absolute; background-color:#39beff; height:20px; width:55px; border-radius:50% 50% 0 0; z-index:-1; right:-15px; bottom:0; }
.planetlock .rocket:after { content:""; position:absolute; background-color:#39beff; height:4px; width:15px; border-radius:0 0 2px 2px; bottom:-4px; left:4.3px; }
.planetlock .rocket .fire { position:absolute; bottom:-20px; left:50%; transform:translateX(-50%); width:12px; height:30px; background:radial-gradient(ellipse at center,#ffec85 0%,#ffae34 40%,#ec760c 70%,#cd4606 90%,rgba(0,0,0,0) 100%); border-radius:50%; animation:plFlame .3s infinite alternate; z-index:-1; }
@keyframes plFlame { 0%{ transform:translateX(-50%) scaleY(1); opacity:.9; } 100%{ transform:translateX(-50%) scaleY(1.4); opacity:.5; } }
.planetlock .rocket .gas { position:absolute; bottom:-35px; left:50%; transform:translateX(-50%); width:10px; height:10px; background:rgba(200,200,200,.6); border-radius:50%; animation:plGas 1.5s infinite ease-out; }
.planetlock .rocket .gas:nth-child(3) { animation-delay:.3s; left:40%; }
.planetlock .rocket .gas:nth-child(4) { animation-delay:.6s; left:60%; }
@keyframes plGas { 0%{ transform:translateX(-50%) scale(.5); opacity:.8; } 100%{ transform:translateX(-50%) translateY(40px) scale(1.8); opacity:0; } }
.planetlock .window { background-color:#151845; height:10px; width:10px; border:2px solid #b8d2ec; border-radius:50%; position:relative; top:17px; left:5px; }
.planetlock .curve { width:100%; height:100%; position:absolute; animation:plRotate 10s linear infinite; fill:transparent; }
@keyframes plRotate { 0%{ transform:rotate(0deg); } 100%{ transform:rotate(360deg); } }
.planetlock .curve text { letter-spacing:13px; text-transform:uppercase; font:1.4em "Noto Sans",sans-serif; fill:#95d5ff; filter:drop-shadow(0 2px 8px rgb(21,117,207)); }

/* ----- sleep style: พระจันทร์ (moon + stars) ----- */
.lockmoon { position:relative; width:160px; height:104px; margin:2px auto 6px; }
.lockmoon__moon { position:absolute; left:50%; top:13px; transform:translateX(-50%); width:76px; height:76px; border-radius:50%; overflow:hidden;
  background:radial-gradient(circle at 36% 32%, #fffdf4 0%, #fbeecb 36%, #f1d790 66%, #d9b76a 100%);
  box-shadow:0 0 28px 0 rgba(245,210,140,.32), 0 0 54px 0 rgba(245,200,120,.13); animation:moonBob 5s ease-in-out infinite; }
.lockmoon__moon::before { content:""; position:absolute; inset:0; border-radius:50%;
  background:
    radial-gradient(circle at 31% 62%, rgba(176,146,86,.55) 0 7px, transparent 8px),
    radial-gradient(circle at 54% 30%, rgba(176,146,86,.45) 0 4.5px, transparent 5.5px),
    radial-gradient(circle at 45% 72%, rgba(176,146,86,.4) 0 3px, transparent 4px),
    radial-gradient(circle at 23% 38%, rgba(176,146,86,.34) 0 3px, transparent 4px),
    radial-gradient(circle at 64% 56%, rgba(176,146,86,.3) 0 2.5px, transparent 3.5px); }
.lockmoon__moon::after { content:""; position:absolute; inset:0; border-radius:50%; box-shadow:inset -15px -8px 18px 0 rgba(21,41,78,.5), inset -30px -16px 30px 2px rgba(21,41,78,.4); }
@keyframes moonBob { 0%,100%{ transform:translateX(-50%) translateY(0); } 50%{ transform:translateX(-50%) translateY(-5px); } }
.lockmoon__star { position:absolute; width:6px; height:6px; background:#fff; border-radius:50%; box-shadow:0 0 6px #fff; animation:lmTwk 2.4s ease-in-out infinite; }
.lockmoon__star--1 { left:26px; top:22px; } .lockmoon__star--2 { right:30px; top:14px; width:4px; height:4px; animation-delay:.7s; } .lockmoon__star--3 { right:46px; bottom:22px; width:5px; height:5px; animation-delay:1.4s; }
@keyframes lmTwk { 0%,100%{ opacity:.25; transform:scale(.8); } 50%{ opacity:1; transform:scale(1.2); } }

/* ----- sleep style: โลโก้แบรนด์ (logo pulse) ----- */
.locklogo { position:relative; width:120px; height:104px; margin:4px auto 8px; display:grid; place-items:center; }
.locklogo__ring { position:absolute; width:96px; height:96px; border-radius:50%; border:3px solid rgba(255,255,255,.12); border-top-color:var(--gold-400); border-right-color:var(--gold-400); animation:spin 2.4s linear infinite; }
.locklogo__badge { width:74px; height:74px; border-radius:20px; overflow:hidden; display:grid; place-items:center; background:#fff; box-shadow:0 0 0 6px rgba(255,255,255,.06), 0 14px 30px -10px rgba(0,0,0,.5); animation:logoPulse 2.6s ease-in-out infinite; }
.locklogo__badge img { width:100%; height:100%; object-fit:cover; }
@keyframes logoPulse { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.05); } }

/* ----- sleep style: premium 3D free-standing logo ----- */
.sleep-logo-stage { position:relative; width:170px; height:140px; margin:0 auto; display:flex; align-items:center; justify-content:center; perspective:1000px; }
.sleep-logo-glow { position:absolute; top:50%; left:50%; transform:translate(-50%,-52%); width:118px; height:118px; border-radius:50%; overflow:hidden; background:radial-gradient(circle at 50% 45%, rgba(14,62,145,.5), rgba(4,25,68,0) 70%); }
.sleep-logo-shine { position:absolute; inset:-40%; pointer-events:none; background:linear-gradient(115deg, transparent 38%, rgba(255,255,255,.16) 47%, rgba(245,164,0,.16) 52%, transparent 63%); transform:translateX(-70%) rotate(8deg); animation:sleepLogoShine 7s ease-in-out infinite; }
.sleep-logo-mark { position:relative; z-index:2; width:138px; animation:sleepLogoFloat 4.5s ease-in-out infinite; }
.sleep-logo-mark img, .sleep-logo-mark svg { width:100%; height:auto; display:block; }
.sleep-logo-shadow { position:absolute; left:50%; bottom:8px; width:96px; height:15px; border-radius:50%; background:rgba(0,0,0,.36); filter:blur(10px); transform:translateX(-50%); animation:sleepLogoShadow 4.5s ease-in-out infinite; }
@keyframes sleepLogoFloat { 0%,100%{ transform:translateY(4px); } 50%{ transform:translateY(-9px); } }
.sleep-logo-shadow { position:absolute; left:50%; bottom:8px; width:104px; height:16px; border-radius:999px; background:rgba(0,0,0,.32); filter:blur(11px); transform:translateX(-50%); animation:sleepLogoShadow 9s ease-in-out infinite; }
@keyframes sleepLogoTilt { 0%{ transform:rotateX(3deg) rotateY(-6deg) rotateZ(-1deg) scale(1); } 25%{ transform:rotateX(4deg) rotateY(-2deg) rotateZ(0deg) scale(1.008); } 50%{ transform:rotateX(1deg) rotateY(6deg) rotateZ(1deg) scale(1.015); } 75%{ transform:rotateX(-3deg) rotateY(2deg) rotateZ(0deg) scale(1.008); } 100%{ transform:rotateX(3deg) rotateY(-6deg) rotateZ(-1deg) scale(1); } }
@keyframes sleepLogoShine { 0%,28%{ transform:translateX(-70%) rotate(8deg); opacity:0; } 42%{ opacity:.8; } 58%{ transform:translateX(70%) rotate(8deg); opacity:0; } 100%{ transform:translateX(70%) rotate(8deg); opacity:0; } }
@keyframes sleepLogoShadow { 0%,100%{ transform:translateX(-50%) scale(.96); opacity:.24; } 50%{ transform:translateX(-50%) scale(1.06); opacity:.32; } }
@media (prefers-reduced-motion: reduce) { .sleep-logo-mark, .sleep-logo-shine, .sleep-logo-shadow { animation:none; } }

/* ----- settings: sleep-style picker ----- */
.lockstyles { display:grid; grid-template-columns:repeat(auto-fit,minmax(82px,1fr)); gap:8px; margin-bottom:6px; }
.lockstyle { display:flex; flex-direction:column; align-items:center; gap:6px; padding:8px 6px; border:1.5px solid var(--line-2); border-radius:12px; background:var(--surface); cursor:pointer; font-family:var(--ff); transition:.12s; }
.lockstyle:hover { border-color:var(--gold-400); }
.lockstyle.is-on { border-color:var(--gold-500); box-shadow:0 0 0 1px var(--gold-500); background:#fffdf6; }
.lockstyle__t { font-size:11.5px; font-weight:600; color:var(--ink-2); }
.lockstyle__prev { width:100%; height:42px; border-radius:8px; background:linear-gradient(160deg,#16294f,#0a1730); position:relative; overflow:hidden; }
.lockstyle__prev::before { content:""; position:absolute; }
.lockstyle__prev--catGlass::before { left:50%; bottom:8px; transform:translateX(-50%); width:26px; height:15px; background:#eef2fb; border-radius:50% 50% 44% 44% / 64% 64% 40% 40%; }
.lockstyle__prev--catWall::before { left:50%; bottom:6px; transform:translateX(-50%); width:34px; height:5px; background:rgba(255,255,255,.28); border-radius:2px; box-shadow:0 -9px 0 -3px #eef2fb; }
.lockstyle__prev--moon::before { left:50%; top:9px; transform:translateX(-50%); width:18px; height:18px; border-radius:50%; background:#f3d27a; box-shadow:inset -5px -2px 0 -1px #16294f; }
.lockstyle__prev--logo::before { left:50%; top:50%; transform:translate(-50%,-50%); width:20px; height:20px; border-radius:6px; background:#fff; }
.lockstyle__prev--coffee::before { left:50%; bottom:9px; transform:translateX(-50%); width:16px; height:11px; background:#fff; border-radius:0 0 8px 8px; box-shadow:0 -8px 0 -1px #43beae; }
.lockstyle__prev--catBack::before { left:50%; bottom:7px; transform:translateX(-50%); width:18px; height:14px; background:#eef2fb; border-radius:48% 48% 42% 42%; box-shadow:-6px -7px 0 -4px #eef2fb, 6px -7px 0 -4px #eef2fb; }
.lockstyle__prev--planet::before { left:50%; top:50%; transform:translate(-50%,-50%); width:20px; height:20px; border-radius:50%; background:#39beff; box-shadow:inset -4px -3px 0 -1px #31b4ff; }
.lockstyle__prev--hamster::before { left:50%; top:50%; transform:translate(-50%,-50%); width:24px; height:24px; border-radius:50%; border:2px solid rgba(255,255,255,.55); background:radial-gradient(circle at 50% 64%, hsl(30,90%,55%) 32%, transparent 34%); }

/* ----- sleep style: hamster wheel (From Uiverse.io by Nawsome) ----- */
.lockhamster { display:grid; place-items:center; height:152px; margin:2px auto 6px; }
.lockhamster .wheel-and-hamster { font-size:11px; }
.wheel-and-hamster {
  --dur: 1s;
  position: relative;
  width: 12em;
  height: 12em;
  font-size: 14px;
}
.wheel,
.hamster,
.hamster div,
.spoke {
  position: absolute;
}
.wheel,
.spoke {
  border-radius: 50%;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.wheel {
  background: radial-gradient(100% 100% at center,hsla(0,0%,60%,0) 47.8%,hsl(0,0%,60%) 48%);
  z-index: 2;
}
.hamster {
  animation: hamster var(--dur) ease-in-out infinite;
  top: 50%;
  left: calc(50% - 3.5em);
  width: 7em;
  height: 3.75em;
  transform: rotate(4deg) translate(-0.8em,1.85em);
  transform-origin: 50% 0;
  z-index: 1;
}
.hamster__head {
  animation: hamsterHead var(--dur) ease-in-out infinite;
  background: hsl(30,90%,55%);
  border-radius: 70% 30% 0 100% / 40% 25% 25% 60%;
  box-shadow: 0 -0.25em 0 hsl(30,90%,80%) inset,
		0.75em -1.55em 0 hsl(30,90%,90%) inset;
  top: 0;
  left: -2em;
  width: 2.75em;
  height: 2.5em;
  transform-origin: 100% 50%;
}
.hamster__ear {
  animation: hamsterEar var(--dur) ease-in-out infinite;
  background: hsl(0,90%,85%);
  border-radius: 50%;
  box-shadow: -0.25em 0 hsl(30,90%,55%) inset;
  top: -0.25em;
  right: -0.25em;
  width: 0.75em;
  height: 0.75em;
  transform-origin: 50% 75%;
}
.hamster__eye {
  animation: hamsterEye var(--dur) linear infinite;
  background-color: hsl(0,0%,0%);
  border-radius: 50%;
  top: 0.375em;
  left: 1.25em;
  width: 0.5em;
  height: 0.5em;
}
.hamster__nose {
  background: hsl(0,90%,75%);
  border-radius: 35% 65% 85% 15% / 70% 50% 50% 30%;
  top: 0.75em;
  left: 0;
  width: 0.2em;
  height: 0.25em;
}
.hamster__body {
  animation: hamsterBody var(--dur) ease-in-out infinite;
  background: hsl(30,90%,90%);
  border-radius: 50% 30% 50% 30% / 15% 60% 40% 40%;
  box-shadow: 0.1em 0.75em 0 hsl(30,90%,55%) inset,
		0.15em -0.5em 0 hsl(30,90%,80%) inset;
  top: 0.25em;
  left: 2em;
  width: 4.5em;
  height: 3em;
  transform-origin: 17% 50%;
  transform-style: preserve-3d;
}
.hamster__limb--fr,
.hamster__limb--fl {
  clip-path: polygon(0 0,100% 0,70% 80%,60% 100%,0% 100%,40% 80%);
  top: 2em;
  left: 0.5em;
  width: 1em;
  height: 1.5em;
  transform-origin: 50% 0;
}
.hamster__limb--fr {
  animation: hamsterFRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,80%) 80%,hsl(0,90%,75%) 80%);
  transform: rotate(15deg) translateZ(-1px);
}
.hamster__limb--fl {
  animation: hamsterFLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,90%) 80%,hsl(0,90%,85%) 80%);
  transform: rotate(15deg);
}
.hamster__limb--br,
.hamster__limb--bl {
  border-radius: 0.75em 0.75em 0 0;
  clip-path: polygon(0 0,100% 0,100% 30%,70% 90%,70% 100%,30% 100%,40% 90%,0% 30%);
  top: 1em;
  left: 2.8em;
  width: 1.5em;
  height: 2.5em;
  transform-origin: 50% 30%;
}
.hamster__limb--br {
  animation: hamsterBRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,80%) 90%,hsl(0,90%,75%) 90%);
  transform: rotate(-25deg) translateZ(-1px);
}
.hamster__limb--bl {
  animation: hamsterBLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,90%) 90%,hsl(0,90%,85%) 90%);
  transform: rotate(-25deg);
}
.hamster__tail {
  animation: hamsterTail var(--dur) linear infinite;
  background: hsl(0,90%,85%);
  border-radius: 0.25em 50% 50% 0.25em;
  box-shadow: 0 -0.2em 0 hsl(0,90%,75%) inset;
  top: 1.5em;
  right: -0.5em;
  width: 1em;
  height: 0.5em;
  transform: rotate(30deg) translateZ(-1px);
  transform-origin: 0.25em 0.25em;
}
.spoke {
  animation: spoke var(--dur) linear infinite;
  background: radial-gradient(100% 100% at center,hsl(0,0%,60%) 4.8%,hsla(0,0%,60%,0) 5%),
		linear-gradient(hsla(0,0%,55%,0) 46.9%,hsl(0,0%,65%) 47% 52.9%,hsla(0,0%,65%,0) 53%) 50% 50% / 99% 99% no-repeat;
}
@keyframes hamster {
  from, to { transform: rotate(4deg) translate(-0.8em,1.85em); }
  50% { transform: rotate(0) translate(-0.8em,1.85em); }
}
@keyframes hamsterHead {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(8deg); }
}
@keyframes hamsterEye {
  from, 90%, to { transform: scaleY(1); }
  95% { transform: scaleY(0); }
}
@keyframes hamsterEar {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(12deg); }
}
@keyframes hamsterBody {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-2deg); }
}
@keyframes hamsterFRLimb {
  from, 25%, 50%, 75%, to { transform: rotate(50deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-30deg) translateZ(-1px); }
}
@keyframes hamsterFLLimb {
  from, 25%, 50%, 75%, to { transform: rotate(-30deg); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(50deg); }
}
@keyframes hamsterBRLimb {
  from, 25%, 50%, 75%, to { transform: rotate(-60deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(20deg) translateZ(-1px); }
}
@keyframes hamsterBLLimb {
  from, 25%, 50%, 75%, to { transform: rotate(20deg); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-60deg); }
}
@keyframes hamsterTail {
  from, 25%, 50%, 75%, to { transform: rotate(30deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(10deg) translateZ(-1px); }
}
@keyframes spoke {
  from { transform: rotate(0); }
  to { transform: rotate(-1turn); }
}

/* ============================================================================
   วิเคราะห์ลูกค้า (CustomerInsightsD)
   ========================================================================== */
.ci { padding:2px 2px 26px; }
.ci-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; flex-wrap:wrap; }
.ci-tab { border:none; background:none; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--dim); padding:10px 15px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; }
.ci-tab.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.ci-pane { display:flex; flex-direction:column; gap:16px; }
.ci-cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
@media (max-width:1000px){ .ci-cols { grid-template-columns:1fr; } }
.ci-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:13px; }
@media (max-width:900px){ .ci-kpis { grid-template-columns:repeat(2,1fr); } }
.ci-kpi { border:1px solid var(--line); border-radius:14px; background:#fff; padding:16px 16px 14px; }
.ci-kpi__ic { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; margin-bottom:10px; }
.ci-kpi__v { font-family:"Sarabun",var(--ff); font-size:26px; font-weight:800; color:var(--ink); line-height:1.1; }
.ci-kpi__t { font-size:13px; font-weight:700; color:var(--ink); margin-top:4px; }
.ci-kpi__s { font-size:11.5px; color:var(--dim); margin-top:2px; }
.ci-card { border:1px solid var(--line); border-radius:14px; background:#fff; padding:16px 17px; }
.ci-card__hd { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.ci-card__hd b { font-size:15px; color:var(--ink); }
.ci-card__hd span { font-size:11.5px; color:var(--dim); }
.ci-note { display:flex; align-items:flex-start; gap:7px; font-size:11.5px; color:var(--dim); line-height:1.5; background:var(--bg-1,#f6f8fb); border-radius:9px; padding:9px 11px; margin-top:13px; }

/* seg list (overview) */
.ci-seglist { display:flex; flex-direction:column; gap:3px; }
.ci-segrow { display:grid; grid-template-columns:14px 92px 1fr 38px 74px; align-items:center; gap:10px; border:none; background:none; font-family:var(--ff); padding:8px 6px; border-radius:8px; cursor:pointer; text-align:left; }
.ci-segrow:hover { background:var(--bg-1,#f5f7fb); }
.ci-segrow__dot { width:11px; height:11px; border-radius:50%; }
.ci-segrow__nm { font-size:12.5px; font-weight:700; color:var(--ink); }
.ci-segrow__bar { height:8px; background:var(--bg-1,#eef1f6); border-radius:5px; overflow:hidden; }
.ci-segrow__bar i { display:block; height:100%; border-radius:5px; }
.ci-segrow__n { font-size:14px; font-weight:800; color:var(--ink); text-align:right; }
.ci-segrow__rev { font-size:11.5px; color:var(--dim); text-align:right; }
@media (max-width:560px){ .ci-segrow { grid-template-columns:14px 1fr 38px; } .ci-segrow__bar, .ci-segrow__rev { display:none; } }

/* seg cards (rfm tab) */
.ci-segcards { display:grid; grid-template-columns:repeat(7,1fr); gap:9px; }
@media (max-width:980px){ .ci-segcards { grid-template-columns:repeat(4,1fr); } }
@media (max-width:560px){ .ci-segcards { grid-template-columns:repeat(2,1fr); } }
.ci-segcard { border:1px solid var(--line); border-radius:12px; background:#fff; padding:13px 12px; cursor:pointer; font-family:var(--ff); text-align:left; transition:border-color .12s, box-shadow .12s; position:relative; display:flex; flex-direction:column; }
.ci-segcard:hover { border-color:var(--navy-600); }
.ci-segcard.on { border-color:var(--sc,var(--navy-700)); box-shadow:0 0 0 1px var(--sc,var(--navy-700)) inset; }
.ci-segcard__dot { width:10px; height:10px; border-radius:50%; display:block; margin-bottom:8px; }
.ci-segcard b { display:block; font-size:13px; color:var(--ink); line-height:1.25; min-height:2.5em; }
.ci-segcard span:not(.ci-segcard__dot) { font-size:11px; color:var(--dim); white-space:nowrap; }
.ci-segbanner { display:flex; align-items:center; gap:18px; border:1px solid var(--line); border-left-width:4px; border-radius:12px; background:#fff; padding:14px 18px; flex-wrap:wrap; }
.ci-segbanner b { font-size:15px; }
.ci-segbanner p { margin:3px 0 0; font-size:12.5px; color:var(--dim); }
.ci-segbanner__act { flex:1; min-width:200px; font-size:12.5px; color:var(--ink); line-height:1.5; }
.ci-segbanner__lbl { display:block; font-size:10.5px; font-weight:800; letter-spacing:.4px; color:var(--dim); text-transform:uppercase; margin-bottom:2px; }
.ci-segbanner__btn { border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px 15px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }

/* table */
.ci-table { border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.ci-trow { display:grid; grid-template-columns:1.6fr 1fr 1.1fr .8fr 1fr 1fr; gap:10px; align-items:center; padding:11px 15px; font-size:12.5px; border-top:1px solid var(--line); }
.ci-trow:first-child { border-top:none; }
.ci-trow--h { background:var(--bg-1,#f5f7fb); font-weight:700; color:var(--dim); font-size:11.5px; }
.ci-trow .r { text-align:right; }
.ci-trow__nm { display:flex; align-items:center; gap:9px; font-weight:700; color:var(--ink); }
.ci-trow__av { width:26px; height:26px; border-radius:50%; background:linear-gradient(140deg,#1b305c,#0b3d91); color:#fff; display:grid; place-items:center; font-size:12px; font-weight:800; flex-shrink:0; }
.ci-pill { font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap; }
.ci-trow__ch { display:flex; align-items:center; gap:6px; color:var(--ink); }
.ci-trow__ch i { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.ci-trow__rec { color:var(--dim); }
@media (max-width:760px){ .ci-trow { grid-template-columns:1.4fr .8fr 1fr; } .ci-trow span:nth-child(3), .ci-trow span:nth-child(6), .ci-trow b:nth-child(4) { display:none; } }

/* channel list */
.ci-chlist { display:flex; flex-direction:column; gap:11px; }
.ci-chrow { display:grid; grid-template-columns:130px 1fr 34px 38px; align-items:center; gap:10px; }
.ci-chrow__nm { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:var(--ink); }
.ci-chrow__nm i { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.ci-chrow__bar { height:9px; background:var(--bg-1,#eef1f6); border-radius:5px; overflow:hidden; }
.ci-chrow__bar i { display:block; height:100%; border-radius:5px; }
.ci-chrow b { font-size:13px; font-weight:800; text-align:right; }
.ci-chrow__pct { font-size:11.5px; color:var(--dim); text-align:right; }

/* geo KPI summary row */
.ci-geokpis { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:14px; }
@media (max-width:980px){ .ci-geokpis { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .ci-geokpis { grid-template-columns:1fr; } }
.ci-geokpi { display:flex; align-items:center; gap:11px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.ci-geokpi__ic { width:38px; height:38px; flex:none; border-radius:10px; display:grid; place-items:center; }
.ci-geokpi__bd { display:flex; flex-direction:column; min-width:0; }
.ci-geokpi__t { font-size:11px; color:var(--dim); font-weight:700; }
.ci-geokpi__v { font-size:16px; color:var(--ink); line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ci-geokpi__s { font-size:10.5px; color:var(--dim); }

/* region grouping (replaces flat province list) */
.ci-regiongrid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:760px){ .ci-regiongrid { grid-template-columns:1fr; } }
.ci-region { border:1px solid var(--line); border-radius:12px; padding:12px 14px; border-left:3px solid var(--rc,#0b3d91); background:#fff; }
.ci-region__hd { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:7px; }
.ci-region__nm { font-size:13px; font-weight:800; color:var(--ink); }
.ci-region__n { font-size:18px; font-weight:800; color:var(--rc,#0b3d91); }
.ci-region__n small { font-size:11px; font-weight:600; color:var(--dim); margin-left:3px; }
.ci-region__bar { height:6px; background:var(--bg-1,#eef1f6); border-radius:4px; overflow:hidden; margin-bottom:10px; }
.ci-region__bar i { display:block; height:100%; border-radius:4px; }
.ci-region__provs { display:flex; flex-direction:column; gap:5px; }
.ci-region__prov { display:grid; grid-template-columns:84px 1fr 28px; align-items:center; gap:8px; }
.ci-region__pnm { font-size:11.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ci-region__pbar { height:6px; background:var(--bg-1,#eef1f6); border-radius:4px; overflow:hidden; }
.ci-region__pbar i { display:block; height:100%; border-radius:4px; opacity:.75; }
.ci-region__pn { font-size:11.5px; font-weight:800; text-align:right; color:var(--ink); }

/* time heatmap — bigger cells, aligned hour labels, multi-hue ramp */
.ci-heat { margin-top:4px; }
.ci-heat__hours { display:grid; grid-template-columns:34px 1fr; align-items:center; margin-bottom:6px; }
.ci-heat__hgrid { display:grid; grid-template-columns:repeat(8,1fr); }
.ci-heat__hgrid .ci-heat__h { font-size:10px; color:var(--dim); text-align:left; }
.ci-heat__row { display:grid; grid-template-columns:34px 1fr; align-items:center; gap:0; margin-bottom:4px; }
.ci-heat__row--we .ci-heat__day { color:var(--navy-700); font-weight:800; }
.ci-heat__day { font-size:11.5px; font-weight:700; color:var(--dim); }
.ci-heat__cells { display:grid; grid-template-columns:repeat(24,1fr); gap:2px; }
.ci-heat__cell { height:22px; border-radius:4px; transition:transform .1s; }
.ci-heat__cell:hover { transform:scale(1.18); outline:2px solid #fff; box-shadow:0 1px 5px rgba(15,23,42,.25); position:relative; z-index:1; }
.ci-heat__legend { display:flex; align-items:center; gap:4px; margin-top:11px; font-size:11px; color:var(--dim); justify-content:flex-end; }
.ci-heat__legend i { width:18px; height:12px; border-radius:3px; }

/* age list */
.ci-agelist { display:flex; flex-direction:column; gap:11px; }
.ci-agerow { display:grid; grid-template-columns:64px 1fr 30px 38px; align-items:center; gap:10px; }
.ci-agerow__nm { font-size:12.5px; font-weight:600; color:var(--ink); }
.ci-agerow__bar { height:9px; background:var(--bg-1,#eef1f6); border-radius:5px; overflow:hidden; }
.ci-agerow__bar i { display:block; height:100%; border-radius:5px; background:linear-gradient(90deg,#c77f00,#e0a93a); }
.ci-agerow b { font-size:13px; font-weight:800; text-align:right; }
.ci-agerow__pct { font-size:11.5px; color:var(--dim); text-align:right; }

/* donut */
.ci-donut { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.ci-donut__svg { width:140px; height:140px; flex-shrink:0; }
.ci-donut__c { font-family:"Sarabun",var(--ff); font-size:22px; font-weight:800; fill:var(--ink); }
.ci-donut__s { font-size:10px; fill:var(--dim); }
.ci-donut__legend { display:flex; flex-direction:column; gap:8px; flex:1; min-width:150px; }
.ci-donut__lg { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink); }
.ci-donut__lg span { width:11px; height:11px; border-radius:3px; flex-shrink:0; }
.ci-donut__lg b { margin-left:auto; font-weight:800; }

/* ============================================================================
   หลังร้านเว็บ (SFBack dashboard) — redesigned
   ========================================================================== */
.sfb { display:flex; flex-direction:column; }
/* header */
.sfb-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; padding:16px 18px; margin-bottom:16px; border-radius:16px; background:linear-gradient(120deg,#16294f,#0b1d3e); color:#fff; box-shadow:0 12px 28px -18px rgba(11,29,62,.6); }
.sfb-head__l { display:flex; align-items:center; gap:13px; min-width:0; }
.sfb-head__badge { flex:none; width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:rgba(255,255,255,.12); }
.sfb-head__tx b { display:block; font-size:16px; font-weight:800; letter-spacing:.2px; }
.sfb-head__tx span { display:block; font-size:12px; color:rgba(255,255,255,.72); margin-top:2px; }
.sfb-head__r { display:flex; align-items:center; gap:10px; }
.sfb-head__live { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:#bfe6cf; background:rgba(31,138,91,.22); border:1px solid rgba(31,138,91,.4); padding:5px 11px; border-radius:999px; }
.sfb-head__dot { width:8px; height:8px; border-radius:50%; background:#3ddc84; box-shadow:0 0 0 0 rgba(61,220,132,.6); animation:sfbPulse 2s infinite; }
@keyframes sfbPulse { 0%{box-shadow:0 0 0 0 rgba(61,220,132,.55);} 70%{box-shadow:0 0 0 6px rgba(61,220,132,0);} 100%{box-shadow:0 0 0 0 rgba(61,220,132,0);} }
.sfb-head__view { display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:#16294f; background:var(--gold-400,#e9b949); border:none; border-radius:10px; padding:8px 14px; cursor:pointer; transition:filter .12s; }
.sfb-head__view:hover { filter:brightness(1.06); }
/* KPIs */
.sfb-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:13px; margin-bottom:16px; }
@media (max-width:900px){ .sfb-kpis { grid-template-columns:repeat(2,1fr); } }
.sfb-kpi { position:relative; border:1px solid var(--line); border-radius:14px; background:#fff; padding:15px 16px; overflow:hidden; transition:box-shadow .14s, transform .08s; }
.sfb-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--kc,#0B3D91); }
.sfb-kpi:hover { box-shadow:0 10px 24px -18px rgba(20,40,90,.5); transform:translateY(-2px); }
.sfb-kpi__ic { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; margin-bottom:9px; }
.sfb-kpi__v { font-family:"Sarabun",var(--ff); font-size:25px; font-weight:800; color:var(--ink); line-height:1.1; }
.sfb-kpi__k { font-size:13px; font-weight:700; color:var(--ink); margin-top:3px; }
.sfb-kpi__s { font-size:11.5px; color:var(--dim); margin-top:2px; }
/* unified order panel */
.sfb-orders { border:1px solid var(--line); border-radius:16px; background:#fff; padding:16px; margin-bottom:20px; box-shadow:0 2px 10px -6px rgba(20,40,90,.12); }
.sfb-orders__hd { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.sfb-orders__title { display:flex; align-items:center; gap:9px; }
.sfb-orders__bell { width:28px; height:28px; border-radius:8px; background:#fff3dc; display:grid; place-items:center; flex:none; }
.sfb-orders__title b { font-size:14.5px; font-weight:800; color:var(--ink); }
.sfb-orders__count { font-family:"Sarabun",var(--ff); font-size:13px; font-weight:800; color:#C77F00; background:#fff3dc; border-radius:999px; padding:2px 11px; }
.sfb-orders__cta { display:inline-flex; align-items:center; gap:4px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:none; border-radius:9px; padding:7px 12px; cursor:pointer; }
.sfb-orders__cta:hover { background:#e2ecfb; }
.sfb-orders__body { display:grid; grid-template-columns:minmax(0,0.9fr) minmax(0,1.3fr); gap:18px; }
@media (max-width:820px){ .sfb-orders__body { grid-template-columns:1fr; gap:16px; } }
.sfb-orders__col { display:flex; flex-direction:column; gap:9px; }
.sfb-orders__lbl { font-size:11px; font-weight:700; letter-spacing:.4px; color:var(--dim); text-transform:uppercase; }
.sfb-alert__chips { display:flex; flex-wrap:wrap; gap:9px; }
.sfb-mk { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink); padding:7px 13px; border-radius:999px; cursor:pointer; }
.sfb-mk:hover:not(:disabled) { border-color:var(--navy-600); }
.sfb-mk:disabled { opacity:.5; cursor:default; }
.sfb-mk__dot { width:9px; height:9px; border-radius:50%; }
.sfb-mk b { font-size:13px; font-weight:800; }
/* status pipeline */
.sfb-pipe { display:flex; align-items:stretch; gap:0; }
.sfb-pipe__cell { flex:1; min-width:0; border:1px solid var(--line); background:#fff; border-radius:11px; padding:11px 6px; cursor:pointer; font-family:var(--ff); display:flex; flex-direction:column; align-items:center; gap:2px; border-bottom:2.5px solid var(--pc,#0B3D91); transition:box-shadow .12s, transform .08s; }
.sfb-pipe__cell:hover { box-shadow:0 6px 16px -10px rgba(20,40,90,.4); transform:translateY(-1px); }
.sfb-pipe__cell b { font-family:"Sarabun",var(--ff); font-size:21px; font-weight:800; line-height:1; color:var(--pc,#0B3D91); }
.sfb-pipe__cell span { font-size:10.5px; color:var(--ink-2); white-space:nowrap; }
.sfb-pipe__arrow { display:flex; align-items:center; padding:0 1px; flex:none; }
@media (max-width:560px){ .sfb-pipe { flex-wrap:wrap; gap:7px; } .sfb-pipe__cell { flex:1 1 28%; } .sfb-pipe__arrow { display:none; } }
/* grouped tools */
.sfb-grp { margin-bottom:18px; }
.sfb-secttl { font-size:13.5px; font-weight:800; color:var(--ink); margin-bottom:11px; padding-left:10px; border-left:3px solid var(--gold-400,#e9b949); line-height:1.3; }

/* ---- SFProducts: ACTIVE/HIDDEN ---- */
.sfp-filt { display:flex; gap:8px; margin-bottom:14px; }
.sfp-filt__b { border:1px solid var(--line); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--dim); padding:6px 14px; border-radius:999px; cursor:pointer; }
.sfp-filt__b.on { border-color:var(--navy-700); background:rgba(11,61,145,.07); color:var(--navy-700); }
.sfp-card--hidden { opacity:.62; }
.sfp-card--hidden .sfp-card__img { filter:grayscale(.5); }
.sfp-hidtag { position:absolute; top:7px; left:7px; background:rgba(20,30,55,.78); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:999px; }
.sfp-card__img { position:relative; }
.sfp-vis { position:absolute; top:8px; right:8px; z-index:2; display:inline-flex; align-items:center; gap:6px; border:1px solid rgba(20,30,55,.1); background:rgba(255,255,255,.95); box-shadow:0 1px 4px rgba(20,33,61,.12); border-radius:999px; padding:4px 11px 4px 5px; cursor:pointer; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--dim); backdrop-filter:blur(2px); }
.sfp-vis__knob { width:13px; height:13px; border-radius:50%; background:#b4bdce; transition:background .15s; flex:none; }
.sfp-vis.on { background:rgba(31,138,91,.14); border-color:rgba(31,138,91,.4); color:#1F8A5B; }
.sfp-vis.on .sfp-vis__knob { background:#1F8A5B; }
.sfp-vis__lbl { line-height:1; }

/* ============================================================================
   ช่องทางรับเงิน (PaymentChannelsD)
   ========================================================================== */
.pay { padding:2px 2px 26px; }
.pay-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.pay-tab { position:relative; border:none; background:none; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--dim); padding:10px 16px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; display:inline-flex; align-items:center; gap:7px; }
.pay-tab.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.pay-tab__n { background:#C0392B; color:#fff; font-size:10px; font-weight:800; min-width:17px; height:17px; border-radius:999px; display:inline-grid; place-items:center; padding:0 4px; }
.pay-pane { display:flex; flex-direction:column; }
.pay-hd { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.pay-hd b { font-size:15px; color:var(--ink); }
.pay-hd > div span { display:block; font-size:11.5px; color:var(--dim); margin-top:2px; }
.pay-add { border:none; cursor:pointer; font-family:var(--ff); font-weight:600; font-size:15px; border-radius:var(--r-md); padding:14px 18px; display:inline-flex; align-items:center; justify-content:center; gap:9px; width:auto; transition:transform .12s ease, box-shadow .18s ease, background .18s ease; background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); box-shadow:var(--sh-gold); }
.pay-add:active { transform:scale(.978); }
.pay-acclist { display:flex; flex-direction:column; gap:10px; }
.pay-acc { display:flex; align-items:center; gap:13px; border:1px solid var(--line); border-radius:13px; background:#fff; padding:13px 15px; }
.pay-acc--off { opacity:.6; }
.pay-acc__logo { width:42px; height:42px; border-radius:11px; color:#fff; display:grid; place-items:center; font-size:18px; font-weight:800; flex-shrink:0; }
.pay-acc__info { flex:1; min-width:0; }
.pay-acc__top { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.pay-acc__top b { font-size:14px; color:var(--ink); }
.pay-acc__pri { font-size:10.5px; font-weight:800; color:#1F8A5B; background:rgba(31,138,91,.12); padding:2px 8px; border-radius:999px; }
.pay-acc__type { font-size:11.5px; color:var(--dim); }
.pay-acc__no { font-family:"Sarabun",var(--ff); font-size:13px; color:var(--ink-2,#42506a); margin-top:3px; letter-spacing:.3px; }
.pay-acc__acts { display:flex; align-items:center; gap:7px; }
.pay-mini { width:32px; height:32px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--navy-700); cursor:pointer; display:grid; place-items:center; }
.pay-mini:hover { border-color:var(--navy-600); }
.pay-mini--del { color:#C0392B; }
.pay-vis { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:#f1f3f7; border-radius:999px; padding:4px 11px 4px 5px; cursor:pointer; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); }
.pay-vis__k { width:13px; height:13px; border-radius:50%; background:#b4bdce; }
.pay-vis.on { background:rgba(31,138,91,.12); border-color:rgba(31,138,91,.4); color:#1F8A5B; }
.pay-vis.on .pay-vis__k { background:#1F8A5B; }
/* methods */
.pay-methods { display:flex; flex-direction:column; gap:10px; }
.pay-method { display:flex; align-items:center; gap:13px; border:1px solid var(--line); border-radius:13px; background:#fff; padding:13px 15px; }
.pay-method__ic { width:40px; height:40px; border-radius:11px; background:rgba(11,61,145,.07); display:grid; place-items:center; flex-shrink:0; }
.pay-method__tx { flex:1; min-width:0; }
.pay-method__tx b { font-size:14px; color:var(--ink); }
.pay-method__tx span { display:block; font-size:11.5px; color:var(--dim); margin-top:2px; }
.pay-tog { width:44px; height:25px; border:none; border-radius:999px; background:#cdd5e2; cursor:pointer; position:relative; flex-shrink:0; transition:background .15s; }
.pay-tog__k { position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%; background:#fff; transition:transform .15s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.pay-tog.on { background:#1F8A5B; }
.pay-tog.on .pay-tog__k { transform:translateX(19px); }
/* slip */
.pay-slipcfg { border:1px solid var(--line); border-radius:13px; background:#fff; overflow:hidden; }
.pay-slipcfg__row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; border-top:1px solid var(--line); }
.pay-slipcfg__row:first-child { border-top:none; }
.pay-slipcfg__row b { font-size:13.5px; color:var(--ink); }
.pay-slipcfg__row span { display:block; font-size:11.5px; color:var(--dim); margin-top:2px; max-width:520px; }
.pay-thr { width:110px; border:1px solid var(--line); border-radius:9px; padding:8px 11px; font-family:"Sarabun",var(--ff); font-size:14px; font-weight:700; color:var(--ink); text-align:right; }
.pay-thr:focus { outline:none; border-color:var(--navy-600); }
.pay-sliplist { display:flex; flex-direction:column; gap:9px; }
.pay-slip { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:12px; background:#fff; padding:11px 14px; }
.pay-slip__thumb { width:40px; height:40px; border-radius:9px; background:var(--bg-1,#f1f4f9); display:grid; place-items:center; flex-shrink:0; }
.pay-slip__info { flex:1; min-width:0; }
.pay-slip__top { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pay-slip__top b { font-family:"Sarabun",var(--ff); font-size:16px; font-weight:800; color:var(--ink); }
.pay-slip__bk { font-size:12px; font-weight:700; }
.pay-slip__t { font-size:11.5px; color:var(--dim); }
.pay-slip__sub { font-size:12px; color:var(--dim); margin-top:3px; }
.pay-slip__auto { font-size:10.5px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.08); padding:2px 7px; border-radius:999px; margin-left:5px; }
.pay-st { font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap; }
.pay-st--pending { background:#fff3dc; color:#C77F00; }
.pay-st--matched { background:#e7f6ee; color:#1F8A5B; }
.pay-st--flagged { background:#fdecea; color:#C0392B; }
.pay-st--approved { background:#e7f6ee; color:#1F8A5B; }
.pay-st--rejected { background:#f1f3f7; color:var(--dim); }
.pay-slip__acts { display:flex; gap:7px; }
.pay-slip__ok { border:none; background:#1F8A5B; color:#fff; font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 13px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.pay-slip__no { border:1px solid var(--line); background:#fff; color:#C0392B; font-family:var(--ff); font-size:12px; font-weight:700; padding:7px 13px; border-radius:8px; cursor:pointer; }
@media (max-width:680px){ .pay-slip { flex-wrap:wrap; } .pay-slip__acts { width:100%; } }

/* ============================================================================
   แคมเปญ & การตลาด+ (CampaignsD)
   ========================================================================== */
.cmp { padding:2px 2px 26px; }
.cmp-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; flex-wrap:wrap; }
.cmp-tab { border:none; background:none; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--dim); padding:10px 15px; cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; }
.cmp-tab.on { color:var(--navy-700); border-bottom-color:var(--navy-700); }
.cmp-pane { display:flex; flex-direction:column; }

/* ===== marketplace boost (โปรโมทสินค้า) ===== */
.bst-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.bst-card { position:relative; border:1px solid var(--line); border-top:3px solid var(--mc,#888); border-radius:14px; background:#fff; padding:15px 16px; display:flex; flex-direction:column; gap:12px; }
.bst-card.off { opacity:.62; }
.bst-card__hd { display:flex; align-items:center; gap:11px; }
.bst-logo { width:34px; height:34px; flex:none; border-radius:9px; color:#fff; font-weight:900; font-size:17px; display:grid; place-items:center; }
.bst-logo--sm { width:24px; height:24px; font-size:13px; border-radius:7px; vertical-align:-6px; margin-right:6px; }
.bst-card__t { flex:1; min-width:0; }
.bst-card__t b { font-size:15px; color:var(--ink); }
.bst-cond { display:flex; align-items:center; gap:4px; font-size:11.5px; color:var(--mc,#888); font-weight:700; margin-top:1px; }
.bst-cd { background:var(--surface-2); border-radius:10px; padding:9px 12px; }
.bst-cd__row { display:flex; align-items:baseline; justify-content:space-between; }
.bst-cd__row span { font-size:11.5px; color:var(--dim); }
.bst-cd__row b { font-size:19px; font-weight:800; color:var(--navy-800); letter-spacing:.5px; }
.bst-cd__bar { height:5px; border-radius:99px; background:#e6eaf1; overflow:hidden; margin-top:7px; }
.bst-cd__bar i { display:block; height:100%; background:var(--mc,#888); border-radius:99px; transition:width 1s linear; }
.bst-cd__sub { font-size:10.5px; color:var(--dim); margin-top:5px; }
.bst-mode { display:flex; gap:6px; background:var(--surface-2); border-radius:9px; padding:3px; }
.bst-mode button { flex:1; border:none; background:none; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); padding:7px 4px; border-radius:7px; cursor:pointer; }
.bst-mode button.on { background:#fff; color:var(--navy-800); box-shadow:var(--sh-sm); }
.bst-slots { display:flex; flex-direction:column; gap:5px; }
.bst-slot { display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:8px; padding:6px 9px; font-size:12px; }
.bst-slot.empty { border-style:dashed; }
.bst-slot__n { width:18px; height:18px; flex:none; border-radius:5px; background:var(--mc,#888); color:#fff; font-size:10px; font-weight:800; display:grid; place-items:center; }
.bst-slot.empty .bst-slot__n { background:var(--line-2); color:#fff; }
.bst-slot__nm { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ink); font-weight:600; }
.bst-slot__empty { flex:1; color:var(--dim); font-size:11px; }
.bst-poolinfo { font-size:11px; color:var(--ink-2); }
.bst-poolinfo b { color:var(--navy-800); }
.bst-acts { display:flex; gap:7px; }
.bst-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line-2); background:var(--surface-2); border-radius:8px; padding:8px 9px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); cursor:pointer; flex:1; }
.bst-btn:hover { border-color:var(--navy-300,#9fb3d4); }
.bst-btn--go { background:var(--mc,#16294f); border-color:transparent; color:#fff; }
.bst-btn--go:hover { filter:brightness(1.06); }
.bst-btn:disabled { opacity:.45; cursor:not-allowed; }
.bst-pickinfo { font-size:12px; color:var(--ink-2); }
.bst-pickinfo b { color:var(--navy-800); }
.bst-picklist { display:flex; flex-direction:column; gap:6px; }
.bst-pick { display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:9px; padding:9px 12px; cursor:pointer; }
.bst-pick.on { border-color:var(--gold-400); background:#fffdf6; }
.bst-pick input { width:16px; height:16px; accent-color:var(--navy-700); flex:none; }
.bst-pick__nm { flex:1; min-width:0; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bst-pick__pr { font-size:12px; font-weight:700; color:var(--navy-700); }
.bst-rulehl { display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:800; border-radius:10px; padding:11px 14px; margin-bottom:14px; }
.bst-rules { list-style:none; display:flex; flex-direction:column; gap:9px; margin:0; padding:0; }
.bst-rules li { display:flex; align-items:flex-start; gap:8px; font-size:12.5px; color:var(--ink-2); line-height:1.45; }
.bst-rules li svg { flex:none; margin-top:1px; }
.bst-rulenote { display:flex; align-items:flex-start; gap:7px; font-size:11px; color:var(--dim); margin-top:14px; padding-top:12px; border-top:1px dashed var(--line-2); line-height:1.5; }
.cmp-hd { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.cmp-hd b { font-size:15px; color:var(--ink); }
.cmp-hd > div span { display:block; font-size:11.5px; color:var(--dim); margin-top:2px; }
.cmp-add { border:none; cursor:pointer; font-family:var(--ff); font-weight:600; font-size:15px; border-radius:var(--r-md); padding:14px 18px; display:inline-flex; align-items:center; justify-content:center; gap:9px; width:auto; transition:transform .12s ease, box-shadow .18s ease, background .18s ease; background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); color:var(--navy-900); box-shadow:var(--sh-gold); }
.cmp-add:active { transform:scale(.978); }
.cmp-rate, .cmp-revscore { font-size:12px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.07); padding:6px 12px; border-radius:999px; }
.cmp-revscore b { color:#C77F00; }
/* flash */
.cmp-flashgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(248px,1fr)); gap:13px; }
.cmp-flash { position:relative; border:1px solid var(--line); border-radius:14px; background:#fff; padding:15px; }
.cmp-flash.on { border-color:#f0c2bc; background:linear-gradient(180deg,#fffaf9,#fff); }
.cmp-flash__top { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cmp-flash__disc { font-family:"Sarabun",var(--ff); font-size:22px; font-weight:800; color:#C0392B; }
.cmp-flash__nm { font-size:14.5px; color:var(--ink); display:block; line-height:1.35; }
.cmp-flash__meta { display:flex; flex-wrap:wrap; gap:5px 13px; margin-top:8px; font-size:11.5px; color:var(--dim); }
.cmp-flash__meta span { display:inline-flex; align-items:center; gap:4px; }
.cmp-flash__bar { height:8px; background:var(--bg-1,#eef1f6); border-radius:5px; overflow:hidden; margin-top:11px; }
.cmp-flash__bar i { display:block; height:100%; background:linear-gradient(90deg,#C0392B,#e0603a); border-radius:5px; }
.cmp-flash__sold { font-size:11px; color:var(--dim); margin-top:6px; }
.cmp-flash__rm { position:absolute; bottom:13px; right:13px; width:28px; height:28px; border:1px solid var(--line); border-radius:8px; background:#fff; color:#C0392B; cursor:pointer; display:grid; place-items:center; }
/* ladder */
.cmp-ladlist { display:flex; flex-direction:column; gap:12px; }
.cmp-lad { border:1px solid var(--line); border-radius:14px; background:#fff; padding:15px 16px; }
.cmp-lad--off { opacity:.6; }
.cmp-lad__hd { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.cmp-lad__hd b { font-size:14.5px; color:var(--ink); }
.cmp-lad__tiers { display:flex; flex-direction:column; gap:8px; }
.cmp-tier { display:flex; align-items:center; gap:12px; background:var(--bg-1,#f6f8fb); border-radius:10px; padding:10px 14px; }
.cmp-tier__step { font-size:11px; font-weight:800; color:#fff; background:var(--navy-700); padding:3px 9px; border-radius:999px; }
.cmp-tier__min { font-size:13px; color:var(--ink); }
.cmp-tier__arrow { color:var(--dim); margin-left:auto; }
.cmp-tier__disc { font-family:"Sarabun",var(--ff); font-size:16px; font-weight:800; color:#1F8A5B; }
/* freebie */
.cmp-gifts { display:flex; flex-direction:column; gap:10px; }
.cmp-gift { display:flex; align-items:center; gap:13px; border:1px solid var(--line); border-radius:13px; background:#fff; padding:13px 15px; }
.cmp-gift--off { opacity:.6; }
.cmp-gift__ic { width:40px; height:40px; border-radius:11px; background:rgba(199,127,0,.1); display:grid; place-items:center; flex-shrink:0; }
.cmp-gift__tx { flex:1; min-width:0; }
.cmp-gift__tx b { font-size:14px; color:var(--ink); }
.cmp-gift__tx span { display:block; font-size:12px; color:var(--dim); margin-top:2px; }
.cmp-gift__tx em { color:#C77F00; font-style:normal; font-weight:700; }
/* affiliate */
.cmp-affkpi { display:grid; grid-template-columns:repeat(4,1fr); gap:11px; margin-bottom:14px; }
@media (max-width:720px){ .cmp-affkpi { grid-template-columns:repeat(2,1fr); } }
.cmp-affk { border:1px solid var(--line); border-radius:12px; background:#fff; padding:13px 14px; }
.cmp-affk b { font-family:"Sarabun",var(--ff); font-size:21px; font-weight:800; color:var(--ink); display:block; }
.cmp-affk span { font-size:11.5px; color:var(--dim); }
.cmp-table { border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.cmp-trow { display:grid; grid-template-columns:1.6fr 1fr .8fr .8fr 1.1fr 1fr; gap:10px; align-items:center; padding:11px 15px; font-size:12.5px; border-top:1px solid var(--line); }
.cmp-trow:first-child { border-top:none; }
.cmp-trow--h { background:var(--bg-1,#f5f7fb); font-weight:700; color:var(--dim); font-size:11.5px; }
.cmp-trow .r { text-align:right; }
.cmp-trow__nm { font-weight:700; color:var(--ink); }
.cmp-code { font-family:"Sarabun",monospace; font-size:11.5px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.08); padding:2px 8px; border-radius:6px; }
.cmp-comm { color:#1F8A5B; }
@media (max-width:760px){ .cmp-trow { grid-template-columns:1.4fr .8fr 1fr; } .cmp-trow span:nth-child(3), .cmp-trow b:nth-child(4), .cmp-trow span:nth-child(2) { display:none; } }
/* reviews */
.cmp-revlist { display:flex; flex-direction:column; gap:11px; }
.cmp-rev { display:flex; gap:12px; border:1px solid var(--line); border-radius:13px; background:#fff; padding:14px 15px; }
.cmp-rev__av { width:38px; height:38px; border-radius:50%; background:linear-gradient(140deg,#1b305c,#0b3d91); color:#fff; display:grid; place-items:center; font-size:16px; font-weight:800; flex-shrink:0; }
.cmp-rev__bd { flex:1; min-width:0; }
.cmp-rev__top { display:flex; align-items:center; gap:10px; }
.cmp-rev__top b { font-size:13.5px; color:var(--ink); }
.cmp-rev__stars { font-size:13px; color:#C77F00; letter-spacing:1px; }
.cmp-rev__stars i { color:#dce0e8; font-style:normal; }
.cmp-rev__prod { font-size:11.5px; color:var(--navy-700); margin-top:2px; }
.cmp-rev__txt { margin:7px 0 0; font-size:13px; color:var(--ink-2,#42506a); line-height:1.5; }
.cmp-rev__reply { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:#1F8A5B; margin-top:8px; }
.cmp-rev__replybtn { border:1px solid var(--line); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:8px; cursor:pointer; margin-top:8px; }

/* ---- order tags + legend (online orders) ---- */
.oo-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.ootag { font-size:9.5px; font-weight:700; padding:2px 7px; border-radius:5px; white-space:nowrap; letter-spacing:.2px; }
.ootag--cod { background:#e7f6ee; color:#1F8A5B; }
.ootag--ct { background:#fff3dc; color:#C77F00; }
.ootag--tax { background:#eaf0fb; color:#0B3D91; }
.ootag--guest { background:#f1f3f7; color:#64748b; }
.ootag--flash { background:#fdecea; color:#C0392B; }
.ootag--multi { background:#f3eafe; color:#7c3aed; }
.ootag--aff { background:#e6f7f4; color:#0d9488; }
.oo-legend { display:flex; flex-wrap:wrap; gap:6px 16px; padding:11px 16px 0; }
.oo-legend__i { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:var(--dim); }



/* ===== Document Designer (Stage B · drag-drop) ===== */
.dd-wrap { display:grid; grid-template-columns:230px 1fr 230px; gap:14px; align-items:start; }
@media (max-width:1100px){ .dd-wrap { grid-template-columns:1fr; } }
.dd-side, .dd-props { background:#fff; border:1px solid var(--line); border-radius:13px; padding:13px; }
.dd-side__hd, .dd-props__hd { font-size:13px; font-weight:800; color:var(--ink); margin-bottom:4px; }
.dd-side__hint { font-size:11px; color:var(--dim); line-height:1.45; margin-bottom:10px; }
.dd-zone { margin-bottom:11px; }
.dd-zone__t { font-size:10.5px; font-weight:700; letter-spacing:.4px; color:var(--dim); text-transform:uppercase; margin-bottom:5px; }
.dd-fld { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; cursor:pointer; }
.dd-fld:hover { background:var(--surface-2); }
.dd-fld.sel { background:var(--info-bg,#eef4ff); }
.dd-fld.off .dd-fld__lbl { color:var(--dim); text-decoration:line-through; }
.dd-fld__lbl { font-size:12px; color:var(--ink); flex:1; min-width:0; }
.dd-fld__tg { flex:none; width:30px; height:18px; border-radius:99px; border:none; background:var(--line-2); position:relative; cursor:pointer; transition:background .14s; }
.dd-fld__tg.on { background:#1F8A5B; }
.dd-fld__tg > span { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; transition:left .14s; }
.dd-fld__tg.on span { left:14px; }
.dd-reset { width:100%; margin-top:6px; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); background:#fff; border-radius:9px; padding:8px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.dd-reset:hover { border-color:var(--navy-600); color:var(--navy-700); }
.dd-zone--assets { margin-top:12px; padding-top:11px; border-top:1px solid var(--line); }
.dd-assets { display:flex; gap:9px; }
.dd-asset { position:relative; flex:1; }
.dd-asset__box { width:100%; height:54px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; border:1.5px dashed var(--line-2); border-radius:9px; background:#fff; cursor:pointer; color:var(--dim); font-size:11px; font-weight:700; overflow:hidden; }
.dd-asset__box:hover { border-color:var(--navy-600); color:var(--navy-700); }
.dd-asset__box img { max-width:100%; max-height:100%; object-fit:contain; }
.dd-asset__x { position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--danger); cursor:pointer; display:grid; place-items:center; box-shadow:var(--sh-sm); }
/* canvas */
.dd-stage { display:flex; justify-content:center; }
.dd-paper { position:relative; width:100%; max-width:520px; background:#fff; border:1px solid var(--line); border-radius:4px; box-shadow:0 8px 30px -10px rgba(20,33,61,.28); overflow:hidden; font-family:"Noto Sans Thai","Sarabun",sans-serif; margin-inline:auto; }
.dd-paper__tag { position:absolute; bottom:5px; right:8px; font-size:9px; color:#c2c9d6; pointer-events:none; }
.dd-item { position:absolute; cursor:move; line-height:1.25; color:#1a2233; padding:2px 3px; border:1px solid transparent; border-radius:3px; user-select:none; box-sizing:border-box; white-space:pre-wrap; }
.dd-item:hover { border-color:rgba(20,40,90,.25); background:rgba(20,40,90,.03); }
.dd-item.sel { border-color:var(--navy-600); background:rgba(20,40,90,.06); box-shadow:0 0 0 2px rgba(20,40,90,.12); }
.dd-item--table { cursor:move; }
.dd-tbl { font-size:9px; width:100%; }
.dd-tbl__hd, .dd-tbl__row { display:grid; grid-template-columns:1.1fr 2.2fr .7fr .9fr .8fr .9fr; gap:4px; padding:3px 2px; }
.dd-tbl__hd { background:#16294f; color:#fff; border-radius:3px; font-weight:700; }
.dd-tbl__row { border-bottom:1px solid #e6e9f0; }
.dd-tbl__hd span:nth-child(n+3), .dd-tbl__row span:nth-child(n+3) { text-align:right; }
/* props */
.dd-prow { display:flex; align-items:center; gap:9px; padding:8px 0; border-bottom:1px solid var(--line); font-size:12px; color:var(--ink-2); }
.dd-prow > span:first-child { width:64px; flex:none; }
.dd-prow input[type=range] { flex:1; min-width:0; accent-color:var(--navy-700); }
.dd-prow b { font-size:11.5px; color:var(--navy-700); min-width:34px; text-align:right; }
.dd-seg { display:flex; flex:1; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.dd-seg button { flex:1; border:none; background:#fff; padding:6px 0; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.dd-seg button.on { background:var(--navy-700); color:#fff; }
.dd-pnudge { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-top:11px; }
.dd-pnudge button { border:1px solid var(--line); background:#fff; border-radius:8px; padding:8px 0; cursor:pointer; font-size:13px; color:var(--navy-700); }
.dd-pnudge button:hover { background:var(--surface-2); }
.dd-props__empty { display:flex; flex-direction:column; align-items:center; gap:9px; text-align:center; padding:30px 10px; color:var(--dim); font-size:12px; line-height:1.5; }


/* doc-designer barcode preview */
.dd-barcode { width:100%; height:38px; display:flex; align-items:center; justify-content:center; }
.dd-barcode__bars { width:100%; height:100%; background:repeating-linear-gradient(90deg,#1a2233 0,#1a2233 2px,#fff 2px,#fff 3px,#1a2233 3px,#1a2233 4px,#fff 4px,#fff 6px,#1a2233 6px,#1a2233 9px,#fff 9px,#fff 10px); }


.pspec__lbltag { display:inline-flex; align-items:center; gap:5px; margin-top:6px; font-size:10.5px; font-weight:700; color:var(--navy-700); background:var(--info-bg,#eef4ff); border:1px solid #cfe0fb; border-radius:99px; padding:2px 9px; width:fit-content; }


/* abbreviation table (settings) */
.abbr-tbl.sc-rowsel, .abbr-row.sc-rowsel, .abbr-tbl .sc-rowsel, .abbr-seg.sc-rowsel, .abbr-seg .sc-rowsel { outline:none !important; }
.abbr-tbl__hd span { white-space:nowrap; }
.abbr-save { display:inline-flex; align-items:center; gap:6px; border:none; background:var(--navy-700); color:#fff; border-radius:9px; padding:9px 18px; font-family:var(--ff); font-size:13px; font-weight:800; cursor:pointer; }
.abbr-save:hover { background:var(--navy-800,#16294f); }
.abbr-seg { display:flex; align-items:stretch; border:1px solid var(--line); border-radius:9px; overflow:hidden; margin-bottom:14px; }
.abbr-seg button { border:none; background:#fff; padding:8px 18px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.abbr-seg button.on { background:var(--navy-700); color:#fff; }
.abbr-tbl__hd { display:grid; grid-template-columns:1fr 28px 160px 36px; gap:8px; align-items:center; font-size:11px; font-weight:700; color:var(--dim); padding:0 2px 7px; }
.abbr-tbl__hd span:nth-child(2){ text-align:center; }
.abbr-row { display:grid; grid-template-columns:1fr 28px 160px 36px; gap:8px; align-items:center; margin-bottom:8px; }
.abbr-in { height:40px; border:1.5px solid var(--line-2); border-radius:9px; padding:0 12px; font-family:var(--ff); font-size:14px; outline:none; }
.abbr-in:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(20,40,80,.08); }
.abbr-in--short { font-weight:800; color:var(--navy-700); letter-spacing:.5px; }
.abbr-arrow { text-align:center; color:var(--dim); font-size:15px; }
.abbr-del { border:none; background:none; color:var(--line-2); cursor:pointer; display:grid; place-items:center; }
.abbr-del:hover { color:var(--danger,#d1453b); }
.abbr-add { display:inline-flex; align-items:center; gap:7px; border:none; background:var(--gold-500); color:#081B45; border-radius:10px; padding:11px 20px; font-family:var(--ff); font-size:13.5px; font-weight:800; cursor:pointer; margin-top:8px; box-shadow:0 3px 10px -3px rgba(216,160,40,.5); }
.abbr-add:hover { background:var(--gold-600,#c8901a); transform:translateY(-1px); }
.abbr-empty { color:var(--dim); font-size:13px; padding:14px 2px; }
.abbr-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; padding-top:13px; border-top:1px solid var(--line); flex-wrap:wrap; }
.abbr-note { font-size:12.5px; color:var(--ink-2); }
.abbr-note b { color:var(--navy-700); font-weight:800; letter-spacing:.5px; }
.abbr-reset { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:#fff; border-radius:9px; padding:8px 13px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.abbr-reset:hover { border-color:var(--navy-600); color:var(--navy-700); }

.abbr-sort { margin-left:auto; display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:#fff; border-radius:9px; padding:0 14px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.abbr-sort:hover { border-color:var(--navy-600); background:var(--info-bg,#eef4ff); }

.dd-numin { width:52px; flex:none; height:30px; border:1.5px solid var(--line-2); border-radius:7px; padding:0 6px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); text-align:center; outline:none; }
.dd-numin:focus { border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(20,40,80,.08); }
.dd-numpc { font-size:12px; color:var(--dim); margin-left:-4px; }

/* doc-designer grid + snap guides (Canva-style) */
.dd-paper--grid { background-image:linear-gradient(rgba(20,40,90,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(20,40,90,.07) 1px,transparent 1px); background-size:5% 5%; }
.dd-guide { position:absolute; z-index:50; pointer-events:none; }
.dd-guide--v { top:0; bottom:0; width:0; border-left:1px dashed #e0218a; }
.dd-guide--h { left:0; right:0; height:0; border-top:1px dashed #e0218a; }

.dd-item.active { border-color:var(--navy-600); background:rgba(20,40,90,.06); box-shadow:0 0 0 2px rgba(20,40,90,.16); }
.dd-item.sel:not(.active) { border-color:#7c9bd6; background:rgba(20,40,90,.04); box-shadow:0 0 0 1.5px rgba(20,40,90,.1); }
.dd-multitag { margin-left:7px; font-size:11px; font-weight:800; color:#fff; background:var(--navy-700); border-radius:99px; padding:1px 7px; }
.dd-keys { margin-top:13px; padding-top:11px; border-top:1px solid var(--line); font-size:10.5px; line-height:1.6; color:var(--dim); }

.dd-ktbl { display:flex; flex-direction:column; gap:2px; }
.dd-krow { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; color:var(--ink); }
.dd-krow:last-child { border-bottom:none; }
.dd-krow kbd { flex:none; min-width:108px; font-family:"Noto Sans Thai",var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; padding:4px 9px; text-align:center; }

/* doc-designer header toolbar — wraps cleanly */
.dd-sectitle { align-items:flex-start; }
.dd-toolbar { display:flex; flex-wrap:wrap; gap:9px; align-items:center; margin:0 0 16px; padding:12px 14px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; }
.dd-toolbar .sin { height:38px; }

/* doc-designer shortcuts popover — bottom-left (เหมือนหน้าแฟ้มสินค้า) */
.dd-keyspop { position:fixed; left:20px; bottom:20px; z-index:240; width:340px; max-width:calc(100vw - 40px); background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 18px 50px rgba(8,18,40,.26); padding:15px 16px 16px; animation:ddKeysIn .18s ease; }
@keyframes ddKeysIn { from{ transform:translateY(10px); opacity:0; } to{ transform:none; opacity:1; } }
.dd-keyspop__hd { margin-bottom:9px; }
.dd-keyspop__hd b { font-size:14px; color:var(--ink); }
.dd-keyspop__x { position:absolute; right:-9px; bottom:-9px; width:38px; height:38px; border-radius:50%; border:none; background:var(--navy-700); color:#fff; cursor:pointer; display:grid; place-items:center; box-shadow:0 4px 12px rgba(11,29,62,.32); }
.dd-keyspop__x:hover { background:var(--navy-600); }

.dd-keysfab { position:fixed; right:22px; bottom:22px; z-index:235; width:52px; height:52px; border-radius:50%; border:none; background:var(--navy-700); color:#fff; cursor:pointer; display:grid; place-items:center; box-shadow:0 8px 22px rgba(11,29,62,.34); transition:background .14s, transform .08s; }
.dd-keysfab:hover { background:var(--navy-600); transform:translateY(-2px); }
.dd-keyspop--br { left:auto; right:22px; bottom:22px; }
.dd-keyspop--br .dd-keyspop__x { right:auto; left:-9px; }

/* doc-designer true-to-design preview */
.dd-pvov { position:fixed; inset:0; z-index:210; background:rgba(12,20,42,.55); display:flex; align-items:center; justify-content:center; padding:24px; }
.dd-pvwin { width:min(900px,100%); max-height:92vh; background:var(--surface-2,#eef1f6); border-radius:16px; box-shadow:0 24px 70px rgba(8,16,40,.34); display:flex; flex-direction:column; overflow:hidden; }
.dd-pvwin__bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; background:#fff; border-bottom:1px solid var(--line); }
.dd-pvwin__bar b { font-size:13.5px; color:var(--ink); }
.dd-pvwin__acts { display:flex; align-items:center; gap:9px; }
.dd-pvprint { display:inline-flex; align-items:center; gap:7px; border:none; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:13px; font-weight:700; padding:8px 15px; border-radius:9px; cursor:pointer; }
.dd-pvprint:hover { background:var(--navy-600); }
.dd-pvx { width:34px; height:34px; border:none; background:var(--surface-2); border-radius:9px; cursor:pointer; display:grid; place-items:center; color:var(--ink-2); }
.dd-pvx:hover { background:var(--line); }
.dd-pvscroll { flex:1; min-height:0; overflow:auto; display:flex; justify-content:center; padding:26px; }
.dd-pvpaper { position:relative; background:#fff; box-shadow:0 4px 20px rgba(20,33,61,.18); font-family:"Noto Sans Thai","Sarabun",sans-serif; flex:none; align-self:flex-start; }
.dd-pvitem { position:absolute; line-height:1.25; color:#1a2233; padding:2px 3px; box-sizing:border-box; white-space:pre-wrap; }
.dd-pvwin__note { padding:10px 16px; background:#fff; border-top:1px solid var(--line); font-size:11px; color:var(--dim); text-align:center; }
@media print {
  body > #root { display:none !important; }
  .dd-pvov { position:static; background:none; padding:0; display:block; }
  .dd-pvwin { box-shadow:none; max-height:none; background:none; }
  .dd-pvwin__bar, .dd-pvwin__note { display:none !important; }
  .dd-pvscroll { overflow:visible; padding:0; }
  .dd-pvpaper { box-shadow:none; }
}

/* ============================ ใบมัดจำ (POS) ============================ */
.posdep{ padding-bottom:14px; }
.posdep__hd{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.posdep__sum{ display:flex; gap:10px; flex-wrap:wrap; }
.posdep__sumitem{ background:#fff; border:1px solid var(--line); border-radius:var(--r-lg,14px); padding:10px 18px; min-width:118px; }
.posdep__sumitem span{ display:block; font-size:11.5px; color:var(--dim); margin-bottom:3px; }
.posdep__sumitem b{ font-size:19px; font-weight:800; color:var(--navy-800); }
.posdep__sumitem--accent{ background:linear-gradient(135deg,#fff8e8,#fdf0cf); border-color:#f0d488; }
.posdep__sumitem--accent b{ color:#9a6b00; }
.posdep__bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.posdep__search{ max-width:330px; flex:1 1 240px; }
.posdep__grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(284px,1fr)); gap:13px; }
.depcard{ background:#fff; border:1px solid var(--line); border-radius:var(--r-lg,14px); padding:15px 17px; display:flex; flex-direction:column; gap:9px; box-shadow:0 6px 18px -14px rgba(20,40,90,.4); transition:border-color .15s, box-shadow .15s; }
.depcard:hover{ border-color:#9db4d8; box-shadow:0 12px 26px -16px rgba(20,40,90,.45); }
.depcard--done{ background:#fafbfd; }
.depcard__top{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.depcard__party{ font-size:15px; font-weight:800; color:var(--ink); line-height:1.3; }
.depcard__amt{ font-size:26px; font-weight:800; color:var(--navy-800); letter-spacing:-.5px; line-height:1; }
.depcard--done .depcard__amt{ color:var(--dim); }
.depcard__meta{ display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--dim); }
.depcard__meta .mono{ font-weight:700; color:var(--navy-600); }
.depcard__ref{ display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--navy-700); background:#eef3fb; border-radius:8px; padding:4px 9px; align-self:flex-start; }
.depcard__note{ font-size:12px; color:var(--ink-2); line-height:1.45; }
.depcard__acts{ display:flex; gap:8px; align-items:center; border-top:1px solid var(--line); padding-top:11px; margin-top:2px; }
.depcard__applied{ margin-left:auto; display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:700; color:var(--ok); }
.depf__list{ position:absolute; top:100%; left:0; right:0; z-index:30; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 14px 30px -12px rgba(20,40,90,.4); margin-top:4px; max-height:210px; overflow:auto; }
.depf__list button{ display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; text-align:left; padding:9px 13px; border:none; background:none; cursor:pointer; font-family:inherit; border-bottom:1px solid var(--line); }
.depf__list button:last-child{ border-bottom:none; }
.depf__list button:hover{ background:#eef3fb; }
.depf__list button b{ font-size:13px; color:var(--ink); font-weight:700; }
.depf__list button span{ font-size:11.5px; color:var(--dim); }

/* strip เลือกใบมัดจำ + รายละเอียด (DocWorkbench) */
.depstrip{ display:flex; gap:11px; overflow-x:auto; padding:2px 1px 8px; margin-bottom:6px; }
.depmini{ flex:0 0 auto; width:212px; text-align:left; background:#fff; border:1.5px solid var(--line); border-radius:var(--r-lg,14px); padding:12px 14px; cursor:pointer; font-family:inherit; display:flex; flex-direction:column; gap:6px; transition:border-color .14s, box-shadow .14s; }
.depmini:hover{ border-color:#9db4d8; }
.depmini.is-sel{ border-color:var(--navy-700); box-shadow:0 0 0 3px rgba(22,41,79,.1); }
.depmini__top{ display:flex; align-items:center; justify-content:space-between; gap:6px; }
.depmini__top .mono{ font-size:11.5px; font-weight:700; color:var(--navy-700); }
.depmini__party{ font-size:13.5px; font-weight:800; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.depmini__amt{ font-size:18px; font-weight:800; color:var(--navy-800); line-height:1; }
.depmini__meta{ font-size:11px; color:var(--dim); }
.depact{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; background:#fff; border:1px solid var(--line); border-radius:var(--r-md,11px); padding:9px 13px; margin-bottom:11px; }
.depact__lbl{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--navy-700); }
.depwb{ background:#fff; border:1px solid var(--line); border-radius:var(--r-lg,14px); overflow:hidden; }

/* create-modal — รายการสินค้าที่สั่ง builder */
.depmod__bd{ padding:16px 20px 8px; max-height:min(70vh,560px); overflow-y:auto; }
.depmod__ft{ display:flex; justify-content:flex-end; gap:10px; padding:13px 20px; border-top:1px solid var(--line); background:#fafbfd; }
.depmod__grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.deplines{ border:1px solid var(--line); border-radius:11px; padding:6px; margin:2px 0 14px; background:#fafbfd; }
.deplines__empty{ display:flex; align-items:center; gap:7px; justify-content:center; padding:14px; font-size:12.5px; color:var(--dim); }
.depline{ display:flex; align-items:center; gap:9px; padding:7px 6px; border-bottom:1px solid var(--line); }
.depline:last-of-type{ border-bottom:none; }
.depline__nm{ flex:1; min-width:0; display:flex; flex-direction:column; }
.depline__nm b{ font-size:13px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.depline__nm .mono{ font-size:11px; color:var(--dim); }
.depline__qty{ display:flex; align-items:center; gap:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; flex:none; background:#fff; }
.depline__qty button{ width:26px; height:28px; border:none; background:#fff; cursor:pointer; font-size:15px; font-weight:700; color:var(--navy-700); }
.depline__qty button:hover{ background:var(--surface-3,#eef3fb); }
.depline__qty span{ min-width:30px; text-align:center; font-size:13px; font-weight:700; }
.depline__price input{ width:78px; height:30px; border:1px solid var(--line); border-radius:8px; padding:0 8px; font-family:inherit; font-size:12.5px; text-align:right; }
.depline__amt{ width:84px; text-align:right; font-size:13px; font-weight:800; color:var(--navy-800); flex:none; }
.depline__x{ border:none; background:none; cursor:pointer; color:var(--danger); padding:4px; flex:none; }
.deplines__sum{ display:flex; align-items:center; justify-content:space-between; padding:9px 8px 5px; border-top:1.5px solid var(--line); margin-top:2px; }
.deplines__sum span{ font-size:12.5px; font-weight:700; color:var(--ink-2); }
.deplines__sum b{ font-size:16px; font-weight:800; color:var(--navy-800); }
.qtadd{ display:flex; align-items:center; gap:10px; padding:10px 12px 4px; }
.qtadd__search{ flex:1; min-width:0; }
.qtscan{ margin:8px 12px 0; border:1.5px solid var(--gold-400)!important; background:#fffdf5!important; }
.qtscan input{ font-weight:700; }
.qtedit2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; padding:0 22px 12px; margin-top:-2px; }
.qtedit2__f label{ display:block; font-size:11px; font-weight:700; color:var(--ink-2); margin-bottom:5px; }
.qtchips{ display:flex; gap:6px; flex-wrap:wrap; }
.qtchip{ border:1.5px solid var(--line); background:#fff; border-radius:99px; padding:6px 13px; font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; font-family:inherit; }
.qtchip.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.qtvat{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 22px 4px; flex-wrap:wrap; }
.qtvat>span{ font-size:12.5px; font-weight:700; color:var(--ink-2); }
.qttax{ display:flex; gap:0; border:1px solid var(--line); border-radius:9px; overflow:hidden; }
.qttax__b{ border:none; background:#fff; padding:8px 14px; font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; font-family:inherit; border-left:1px solid var(--line); }
.qttax__b:first-child{ border-left:none; }
.qttax__b.is-on{ background:var(--navy-700); color:#fff; }
.qt-vatsel{ display:block; margin-top:5px; max-width:170px; font-size:11px; }
.qt-vattag{ display:inline-block; margin-top:3px; font-size:10.5px; font-weight:600; color:var(--gold-700,#9a7b2e); background:#fff4d6; border:1px solid var(--gold-200,#f0e0b8); border-radius:6px; padding:1px 7px; }
.qttotbox{ padding:2px 22px 0; }
.qttotbox__r{ display:flex; align-items:center; justify-content:space-between; padding:4px 0; font-size:12.5px; color:var(--ink-2); }
.qttotbox__r .thb{ font-weight:700; color:var(--navy-800); }
.qttotbox .qttotal{ padding-left:0; padding-right:0; }
@media (max-width:560px){ .depmod__grid2,.qtedit2{ grid-template-columns:1fr; } }

/* ============================ คืน / เปลี่ยนสินค้า (refund/exchange) ============================ */
.rrwrap{ max-width:1300px; margin:0 auto; }
.rrgrid{ display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:22px; align-items:start; }
.rrsum{ position:sticky; top:16px; }
/* return item table = main working area */
.rr-items{ table-layout:fixed; }
.rr-items thead th{ padding:12px 16px; font-size:11.5px; }
.rr-items tbody td{ padding:10px 16px; height:56px; font-size:13.5px; vertical-align:middle; }
.rr-items tbody tr{ cursor:default; }
.rr-items tbody tr:hover td{ background:var(--surface-2); }
.rr-items .cell-main{ white-space:normal; line-height:1.3; text-wrap:pretty; }
.rr-items .cell-sub{ white-space:normal; }
@media (max-width:1180px){ .rrgrid{ grid-template-columns:1fr; } .rrsum{ position:static; } }
/* bill-picker: expandable line-items preview */
.rrprevtog{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:#fff; border-radius:99px; padding:4px 10px; font-size:11.5px; font-weight:700; color:var(--navy-700); cursor:pointer; font-family:inherit; }
.rrprevtog:hover{ border-color:var(--gold-400); background:#fffdf5; }
.rrprevtog.is-open{ border-color:var(--navy-700); background:var(--navy-700); color:#fff; }
.tbl tbody tr.rrprevrow td{ background:#fbfcfe; cursor:default; padding:0 14px 12px !important; }
.tbl tbody tr.rrprevrow:hover td{ background:#fbfcfe; }
.rrprev{ border:1px solid var(--line); border-radius:var(--r-md); background:#fff; overflow:hidden; }
.rrprev__l{ display:grid; grid-template-columns:1fr auto 90px; align-items:center; gap:14px; padding:9px 14px; border-bottom:1px solid var(--line); font-size:12.5px; }
.rrprev__l:last-of-type{ border-bottom:0; }
.rrprev__nm{ display:flex; flex-direction:column; gap:2px; font-weight:700; color:var(--ink); min-width:0; }
.rrprev__sub{ font-style:normal; font-size:10.5px; font-weight:500; color:var(--dim); }
.rrprev__q{ color:var(--ink-2); white-space:nowrap; }
.rrprev__amt{ font-weight:800; color:var(--navy-800); text-align:right; }
.rrprev__ft{ display:flex; align-items:center; justify-content:space-between; padding:9px 14px; background:var(--surface-2); font-size:12px; color:var(--dim); }
.rrprev__go{ display:inline-flex; align-items:center; gap:5px; border:none; background:none; color:var(--gold-600); font-weight:800; font-size:12px; cursor:pointer; font-family:inherit; }
.rrprev__go:hover{ text-decoration:underline; }
/* bill items preview — column table (รหัส / รายการ / จำนวน / ราคา / ส่วนลด / รวม) */
.billprev{ border:1px solid var(--line); border-radius:var(--r-md); background:#fff; overflow:hidden; }
.billprev__t{ width:100%; border-collapse:collapse; table-layout:fixed; }
.billprev__t thead th{ text-align:left; font-size:11px; font-weight:700; color:var(--dim); padding:9px 16px; border-bottom:1px solid var(--line); white-space:nowrap; letter-spacing:.2px; }
.billprev__t thead th.num{ text-align:right; }
.billprev__t tbody td{ padding:10px 16px; border-bottom:1px solid var(--line); font-size:12.5px; vertical-align:middle; }
.billprev__t tbody tr:last-child td{ border-bottom:0; }
.billprev__t .num{ text-align:right; white-space:nowrap; }
.billprev__code{ font-family:"Noto Sans",sans-serif; font-weight:700; color:var(--navy-600); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.billprev__nm{ font-weight:700; color:var(--ink); overflow:hidden; }
.billprev__nm i{ display:block; font-style:normal; font-size:10.5px; font-weight:500; color:var(--dim); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.billprev__disc{ color:var(--dim); }
.billprev__tot{ font-weight:800; color:var(--navy-800); }
.billprev__ft{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; background:var(--surface-2); font-size:12px; color:var(--dim); }
.billprev__go{ display:inline-flex; align-items:center; gap:5px; border:none; background:none; color:var(--gold-600); font-weight:800; font-size:12px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.billprev__go:hover{ text-decoration:underline; }
/* bill-picker card: wider, all columns contained */
.rrbillcard{ max-width:1120px; margin:0 auto; }
.rr-bills{ table-layout:fixed; }
.rr-bills thead th{ padding:11px 18px; font-size:11.5px; }
.rr-bills tbody td{ padding:12px 18px; height:54px; vertical-align:middle; }
.rr-bills tbody td:last-child{ padding-right:20px; }
.rr-bills tbody tr:not(.rrprevrow) > td:nth-child(1),
.rr-bills tbody tr:not(.rrprevrow) > td:nth-child(2),
.rr-bills tbody tr:not(.rrprevrow) > td:nth-child(5){ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rr-bills tbody tr:not(.rrprevrow) > td:nth-child(1) div{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ============================ ปิดกะ / สรุปยอดสิ้นวัน (close-shift) ============================ */
.shiftmain{ display:grid; grid-template-columns:minmax(0,1fr) 440px; gap:24px; align-items:start; }
.shift-pay thead th{ padding:12px 16px; font-size:11.5px; }
.shift-pay tbody td{ padding:11px 16px; height:48px; font-size:13.5px; vertical-align:middle; }
.shift-pay tfoot td{ border-top:2px solid var(--line-2); }
@media (max-width:1100px){ .shiftmain{ grid-template-columns:1fr; } }

/* ============================ โปรไฟล์ส่วนตัว (my profile) ============================ */
.prof-wrap{ max-width:1080px; }
.prof-hero{ display:flex; align-items:center; gap:20px; padding:24px 26px; border-radius:18px; background:linear-gradient(120deg,#16294f,#0e1f3f); color:#fff; box-shadow:0 14px 34px rgba(15,30,70,.22); }
.prof-hero__ava{ flex:none; width:78px; height:78px; border-radius:50%; display:grid; place-items:center; font-size:34px; font-weight:800; color:var(--navy-900,#0e1f3f); background:linear-gradient(135deg,#f4d98b,#d9b25a); box-shadow:0 6px 18px rgba(0,0,0,.25); }
.prof-hero__id{ flex:1; min-width:0; }
.prof-hero__name{ font-size:22px; font-weight:800; display:flex; align-items:baseline; gap:9px; }
.prof-hero__nick{ font-size:14px; font-weight:600; color:#aebbd6; }
.prof-hero__role{ display:flex; align-items:center; gap:10px; margin-top:7px; }
.prof-badge{ font-size:11.5px; font-weight:800; color:var(--navy-900,#0e1f3f); background:var(--gold-400,#e3cf95); border-radius:999px; padding:3px 12px; }
.prof-hero__emp{ font-size:12.5px; color:#aebbd6; }
.prof-hero__meta{ display:flex; align-items:center; gap:6px; margin-top:9px; font-size:12.5px; color:#cdd8ef; }
.prof-hero__since{ flex:none; text-align:right; border-left:1px solid rgba(255,255,255,.15); padding-left:20px; }
.prof-hero__since span{ display:block; font-size:11px; color:#8fa0bd; }
.prof-hero__since b{ font-size:15px; font-weight:700; }
.prof-grid{ display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:18px; margin-top:18px; align-items:start; }
.prof-col{ display:flex; flex-direction:column; gap:18px; }
.prof-card{ background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.prof-card__hd{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 17px; border-bottom:1px solid var(--line); }
.prof-card__hd>span{ display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:800; color:var(--navy-800); }
.prof-card__bd{ padding:8px 17px 16px; }
.prof-card__bd--center{ display:flex; flex-direction:column; align-items:center; gap:9px; padding:20px; }
.prof-acts{ display:flex; gap:8px; }
.prof-btn{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:700; border-radius:9px; padding:7px 14px; cursor:pointer; border:1px solid; transition:.13s; }
.prof-btn--ghost{ color:var(--navy-700); background:#fff; border-color:var(--line-2); }
.prof-btn--ghost:hover{ border-color:var(--navy-400,#aebfdb); background:var(--surface-2); }
.prof-btn--primary{ color:#fff; background:var(--navy-700); border-color:var(--navy-700); }
.prof-btn--primary:hover{ background:var(--navy-800); }
.prof-btn--danger{ color:var(--danger-ink,#b42318); background:#fdecec; border-color:#f6cccc; }
.prof-btn--danger:hover{ background:var(--danger-ink,#b42318); border-color:var(--danger-ink,#b42318); color:#fff; }
.prof-f{ display:flex; align-items:center; gap:14px; padding:9px 0; border-bottom:1px solid var(--line); }
.prof-f:last-child{ border-bottom:none; }
.prof-f__k{ flex:none; width:96px; font-size:12px; font-weight:700; color:var(--dim); }
.prof-f__v{ flex:1; font-size:13.5px; font-weight:600; color:var(--ink); }
.prof-f__in{ flex:1; border:1px solid var(--line-2); border-radius:8px; padding:7px 10px; font-family:var(--ff); font-size:13px; outline:none; }
.prof-f__in:focus{ border-color:var(--gold-500); }
.prof-row{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; background:none; border:none; border-bottom:1px solid var(--line); padding:11px 2px; cursor:pointer; font-family:var(--ff); }
.prof-row:hover{ background:var(--surface-2); }
.prof-row__ic{ flex:none; width:34px; height:34px; display:grid; place-items:center; border-radius:9px; background:#eef3ff; color:var(--navy-700); }
.prof-row__bd{ flex:1; display:flex; flex-direction:column; gap:1px; }
.prof-row__bd b{ font-size:13px; font-weight:700; color:var(--navy-800); }
.prof-row__bd i{ font-size:11px; font-style:normal; color:var(--dim); }
.prof-toggle{ display:flex; align-items:center; gap:12px; padding:11px 2px; cursor:pointer; }
.prof-toggle input{ display:none; }
.prof-sw{ flex:none; width:40px; height:22px; border-radius:999px; background:var(--line-2); position:relative; transition:.16s; }
.prof-sw::after{ content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; transition:.16s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.prof-toggle input:checked + .prof-sw{ background:var(--ok-ink,#1F8A5B); }
.prof-toggle input:checked + .prof-sw::after{ transform:translateX(18px); }
.prof-signhint{ font-size:11px; color:var(--dim); }
.prof-lockcard{ margin-top:18px; }
.prof-lockhint{ font-size:12px; color:var(--dim); line-height:1.5; margin-bottom:10px; }
.prof-row--flat{ cursor:default; }
.prof-row--flat .prof-row__bd{ flex:1; }
.prof-pin{ display:flex; flex-direction:column; gap:12px; }
.prof-pin__f{ display:flex; flex-direction:column; gap:5px; }
.prof-pin__f>span{ font-size:12px; font-weight:700; color:var(--navy-700); }
.prof-pin__f input{ border:1px solid var(--line-2); border-radius:9px; padding:9px 12px; font-family:var(--ff); font-size:16px; letter-spacing:4px; outline:none; }
.prof-pin__f input:focus{ border-color:var(--gold-500); }
.prof-pin__err{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--danger-ink,#b42318); }
@media (max-width:880px){ .prof-grid{ grid-template-columns:1fr; } .prof-hero{ flex-wrap:wrap; } .prof-hero__since{ border-left:none; padding-left:0; text-align:left; } }

/* ======================================================================
   Fidelity badges (FidBadge) — Live / Session demo / Mock / Placeholder
   ====================================================================== */
.fidbadge{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap; line-height:1; }
.fidbadge i{ width:6px; height:6px; border-radius:50%; display:block; }
.btn--primary{ background:var(--navy-700); color:#fff; box-shadow:var(--sh-md); }

/* ======================================================================
   เชื่อมสินค้า Marketplace (MarketplaceMapD) + กฎซิงก์สต๊อก
   ====================================================================== */
.mp-fid{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.mp-reset{ font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:1px solid var(--line-2); border-radius:8px; padding:6px 12px; cursor:pointer; }
.mp-reset:hover{ background:var(--surface-2); }
.mp-tabs{ display:flex; gap:8px; margin:0 0 14px; border-bottom:1px solid var(--line); }
.mp-tab{ display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--dim); background:none; border:none; border-bottom:2px solid transparent; padding:9px 14px; margin-bottom:-1px; cursor:pointer; }
.mp-tab.is-on{ color:var(--navy-700); border-bottom-color:var(--gold-500); }
.mp-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.rp-search{ display:inline-flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:7px 11px; min-width:260px; }
.rp-search:focus-within{ border-color:var(--gold-500); }
.rp-search input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); }
.rp-search__x{ display:inline-flex; border:none; background:var(--surface-2); border-radius:6px; padding:3px; color:var(--dim); cursor:pointer; }
.rp-search__x:hover{ color:var(--ink); }
.mp-chips{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.mp-chip{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--ink-2); background:var(--surface); border:1px solid var(--line-2); border-radius:999px; padding:6px 12px; cursor:pointer; transition:.12s; }
.mp-chip:hover{ border-color:var(--gold-400); }
.mp-chip.is-on{ background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.mp-chip span:not(.mp-chip__mark){ font-size:11px; opacity:.7; }
.mp-chip__mark{ width:17px; height:17px; border-radius:5px; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:800; }
.mp-focusbar{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-2); background:#eef3ff; border:1px solid #d6e2f7; border-radius:10px; padding:9px 13px; margin-bottom:12px; }
.mp-focusbar b{ color:var(--navy-800); }
.mp-focusbar button{ margin-left:auto; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; }
.mp-tablewrap{ overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.mp-tbl{ min-width:940px; }
.mp-tbl th{ white-space:nowrap; }
.mp-tbl td{ vertical-align:top; }
.mp-tbl td.mono{ white-space:nowrap; }
.mp-row--err{ background:#fdf3f2; }
.mp-ch{ display:inline-flex; align-items:center; gap:8px; }
.mp-ch__mark{ width:24px; height:24px; flex:none; border-radius:7px; display:grid; place-items:center; color:#fff; font-size:11px; font-weight:800; }
.mp-ch__tx{ display:flex; flex-direction:column; line-height:1.25; }
.mp-ch__tx b{ font-size:12.5px; color:var(--ink); }
.mp-ch__tx span{ font-size:10.5px; color:var(--dim); }

/* ⭐ โลโก้ช่องทาง (mark tile) — โครงปลอดภัย กันโลโก้โดนตัด (ใช้ร่วมทุกจอ marketplace/online)
   tile = flex center + bg ขาว + overflow visible · img = contain ขนาด auto, จำกัดด้วย % กันล้น
   แบรนด์ Shopee/TikTok (ไอคอนทรงสูง) ย่อ max ลงนิดให้สมดุลกับโลโก้สี่เหลี่ยมเต็มใบ */
.mark--logo{ background:#fff !important; display:flex !important; align-items:center; justify-content:center; overflow:visible !important; box-sizing:border-box; padding:0; color:transparent; }
.mark--logo img{ display:block; width:auto; height:auto; max-width:100%; max-height:100%; object-fit:contain; object-position:center; flex-shrink:0; }
.mp-title{ min-width:230px; max-width:400px; font-size:13px; line-height:1.45; font-weight:600; color:var(--ink); white-space:normal; text-wrap:pretty; }
.mp-warns{ display:flex; flex-direction:column; gap:3px; margin-top:5px; }
.mp-warn{ display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:600; padding:2px 7px; border-radius:6px; width:fit-content; }
.mp-warn--danger{ background:var(--danger-bg); color:var(--danger-ink); }
.mp-warn--warn{ background:var(--warn-bg); color:var(--warn-ink); }
.mp-opt{ font-size:11.5px; font-weight:600; color:var(--navy-700); background:#eef3ff; border-radius:6px; padding:2px 8px; white-space:nowrap; }
.mp-sku{ display:inline-flex; align-items:center; gap:6px; font-size:12px; }
.mp-lead{ font-size:10px; font-weight:700; color:var(--gold-600); background:#fff6e0; border-radius:5px; padding:1px 6px; }
.mp-lead--bad{ color:var(--danger-ink); background:var(--danger-bg); }
.mp-unmap{ font-size:11.5px; color:var(--danger-ink); font-weight:600; }
.mp-push{ display:inline-block; min-width:26px; text-align:center; font-weight:800; color:#fff; background:var(--ok-ink,#1F8A5B); border-radius:6px; padding:2px 7px; }
.mp-acts{ white-space:nowrap; }
.mp-acts button{ width:28px; height:28px; border-radius:7px; border:1px solid var(--line-2); background:var(--surface); color:var(--navy-700); cursor:pointer; margin-left:3px; vertical-align:middle; }
.mp-acts button:hover{ border-color:var(--gold-400); background:var(--surface-2); }
.mp-acts__del:hover{ color:var(--danger-ink); border-color:#f0bcbc; }
.mp-note{ font-size:11.5px; color:var(--dim); line-height:1.7; margin-top:12px; }
.mp-note b{ color:var(--ink-2); }

/* mapping modal */
.cxmodal.mpmod{ width:min(720px,96vw); }
.mpmod__grid{ display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.mpfld{ display:flex; flex-direction:column; gap:5px; }
.mpfld--wide{ grid-column:1 / -1; }
.mpfld>label{ font-size:11.5px; font-weight:700; color:var(--navy-700); }
.mpfld input, .mpfld select{ border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; font-family:var(--ff); font-size:13px; outline:none; background:#fff; }
.mpfld input:focus, .mpfld select:focus{ border-color:var(--gold-500); }
.mppick{ display:flex; align-items:center; gap:9px; border:1px solid var(--line-2); border-radius:10px; padding:9px 12px; background:var(--surface-2); }
.mppick__id{ font-size:12px; font-weight:800; color:var(--navy-700); }
.mppick__nm{ flex:1; font-size:12.5px; font-weight:600; color:var(--ink); }
.mppick__oem{ font-size:11px; color:var(--dim); }
.mppick__chg{ font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; }
.mppick__open{ display:inline-flex; align-items:center; gap:7px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); background:#fff; border:1px dashed var(--line-2); border-radius:10px; padding:11px 14px; cursor:pointer; }
.mppick__open:hover{ border-color:var(--gold-400); }
.mppicker{ border:1px solid var(--line-2); border-radius:11px; overflow:hidden; margin-top:8px; }
.mppicker__search{ display:flex; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line); }
.mppicker__search input{ flex:1; border:none; outline:none; font-family:var(--ff); font-size:13px; }
.mppicker__list{ max-height:230px; overflow:auto; }
.mppicker__row{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:none; border:none; border-bottom:1px solid var(--line); padding:9px 12px; cursor:pointer; font-family:var(--ff); }
.mppicker__row:hover{ background:var(--surface-2); }
.mppicker__row.is-on{ background:#eef3ff; }
.mppicker__id{ flex:none; width:78px; font-size:12px; font-weight:800; color:var(--navy-700); }
.mppicker__nm{ flex:1; font-size:12.5px; color:var(--ink); }
.mppicker__oem{ font-size:11px; color:var(--dim); }
.mppicker__empty{ padding:18px; text-align:center; font-size:12.5px; color:var(--dim); }
.mplead{ display:flex; align-items:flex-start; gap:9px; margin-top:13px; font-size:12.5px; color:var(--ink-2); cursor:pointer; }
.mplead input{ margin-top:2px; }
.mplead b{ color:var(--navy-800); }
.mpchild{ margin-top:10px; border:1px solid var(--line); border-radius:11px; padding:11px 13px; background:var(--surface-2); }
.mpchild__hd{ font-size:11.5px; font-weight:700; color:var(--navy-700); margin-bottom:8px; }
.mpchild__tags{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.mpchild__tag{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--gold-700,#A8852F); background:#fff6e0; border-radius:7px; padding:3px 8px; }
.mpchild__tag button{ border:none; background:none; cursor:pointer; color:inherit; display:grid; place-items:center; }
.mpchild__empty{ font-size:11.5px; color:var(--dim); }
.mpchild__add input{ width:100%; border:1px solid var(--line-2); border-radius:8px; padding:8px 11px; font-family:var(--ff); font-size:12.5px; outline:none; }

/* stock-sync rule cards */
.sr-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:13px; margin-bottom:18px; }
.sr-card{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px; box-shadow:var(--sh-sm); }
.sr-card.is-paused{ opacity:.78; }
.sr-card__hd{ display:flex; align-items:center; gap:10px; margin-bottom:11px; }
.sr-card__mark{ width:30px; height:30px; flex:none; border-radius:9px; display:grid; place-items:center; color:#fff; font-size:13px; font-weight:800; }
.sr-card__id{ flex:1; display:flex; flex-direction:column; line-height:1.25; }
.sr-card__id b{ font-size:13.5px; color:var(--ink); }
.sr-card__id span{ font-size:11px; color:var(--dim); }
.sr-row{ display:flex; align-items:center; gap:9px; margin-bottom:6px; }
.sr-row label{ flex:none; width:74px; font-size:11.5px; font-weight:700; color:var(--navy-700); }
.sr-row select{ flex:1; border:1px solid var(--line-2); border-radius:8px; padding:7px 9px; font-family:var(--ff); font-size:12.5px; outline:none; background:#fff; }
.sr-mdesc{ font-size:11px; color:var(--dim); line-height:1.5; margin-bottom:10px; }
.sr-fields{ display:flex; gap:9px; flex-wrap:wrap; margin-bottom:9px; }
.sr-f{ display:flex; flex-direction:column; gap:4px; }
.sr-f label{ font-size:11px; font-weight:700; color:var(--dim); }
.sr-f input{ width:90px; border:1px solid var(--line-2); border-radius:8px; padding:7px 9px; font-family:var(--ff); font-size:13px; outline:none; }
.sr-f input:focus{ border-color:var(--gold-500); }
.sr-safety{ display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--ink-2); cursor:pointer; margin-bottom:9px; }
.sr-flag{ display:flex; align-items:center; gap:6px; font-size:11px; font-weight:600; padding:5px 9px; border-radius:7px; margin-bottom:9px; }
.sr-flag--warn{ background:var(--warn-bg); color:var(--warn-ink); }
.sr-card__ft{ display:flex; gap:9px; border-top:1px solid var(--line); padding-top:10px; }
.sr-stat{ flex:1; display:flex; flex-direction:column; gap:2px; }
.sr-stat span{ font-size:10.5px; color:var(--dim); }
.sr-stat b{ font-size:19px; font-weight:800; color:var(--ink); }
.sr-stat--push b{ color:var(--ok-ink,#1F8A5B); }
.sr-card__sub{ font-size:10.5px; color:var(--dim); margin-top:8px; }
.sr-board .panel__hd{ display:flex; align-items:center; justify-content:space-between; }
.sr-chsel{ border:1px solid var(--line-2); border-radius:8px; padding:6px 10px; font-family:var(--ff); font-size:12.5px; outline:none; background:#fff; }
.sr-availtbl th{ white-space:nowrap; }
.sr-pname{ display:flex; flex-direction:column; line-height:1.3; }
.sr-pname .mono{ font-size:11px; color:var(--navy-700); font-weight:700; }
.sr-pname span:not(.mono){ font-size:12px; color:var(--ink); }
.sr-step{ display:inline-flex; align-items:center; gap:6px; }
.sr-step button{ width:22px; height:22px; border-radius:6px; border:1px solid var(--line-2); background:var(--surface); color:var(--navy-700); font-weight:800; cursor:pointer; line-height:1; }
.sr-step button:hover{ border-color:var(--gold-400); background:var(--surface-2); }
.sr-step b{ min-width:18px; text-align:center; }

/* ======================================================================
   AI Guru v0 — local answer extras (confidence / VIN warning / actions)
   ====================================================================== */
.ailocal{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:8px; }
.aiconf{ display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:999px; }
.aiconf--hi{ background:var(--ok-bg); color:var(--ok-ink); }
.aiconf--mid{ background:var(--warn-bg); color:var(--warn-ink); }
.aiconf--src{ background:#fff6e0; color:var(--gold-700,#A8852F); }
.aivin{ display:flex; align-items:flex-start; gap:8px; font-size:11.5px; color:var(--warn-ink); background:var(--warn-bg); border:1px solid #ecd9a8; border-radius:9px; padding:8px 11px; margin-top:8px; line-height:1.5; }
.aivin svg{ flex:none; margin-top:1px; }
.aiacts{ display:flex; flex-wrap:wrap; gap:7px; margin-top:9px; }
.aiact{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:6px 11px; cursor:pointer; transition:.12s; }
.aiact:hover{ border-color:var(--gold-400); background:var(--surface-2); }
@media (max-width:760px){ .mpmod__grid{ grid-template-columns:1fr; } }

/* ======================================================================
   P1-F · Price-floor guard card (PriceGuardCard)
   ====================================================================== */
.pgcard{ margin-top:14px; border:1px solid var(--line-2); border-radius:12px; padding:11px 12px; background:var(--surface-2); }
.pgcard--ok{ border-color:#bfe6cf; background:#f1faf4; }
.pgcard--warn{ border-color:#ecd9a8; background:#fdf8ec; }
.pgcard--danger{ border-color:#f0bcbc; background:#fdf2f2; }
.pgcard__hd{ display:flex; align-items:center; justify-content:space-between; margin-bottom:9px; }
.pgcard__t{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:800; color:var(--navy-700); }
.pgcard__ch{ border:1px solid var(--line-2); border-radius:7px; padding:4px 8px; font-family:var(--ff); font-size:11.5px; outline:none; background:#fff; }
.pgcard__ctrl{ display:flex; gap:9px; margin-bottom:9px; }
.pgcard__ctrl label{ flex:1; display:flex; flex-direction:column; gap:3px; font-size:10.5px; font-weight:700; color:var(--dim); }
.pgcard__ctrl input{ border:1px solid var(--line-2); border-radius:7px; padding:6px 8px; font-family:var(--ff); font-size:13px; outline:none; }
.pgcard__ctrl input:focus{ border-color:var(--gold-500); }
.pgcard__rows{ display:flex; flex-direction:column; gap:2px; }
.pgcard__row{ display:flex; justify-content:space-between; font-size:12px; color:var(--ink-2); padding:2px 0; }
.pgcard__row--net{ border-top:1px dashed var(--line-2); margin-top:3px; padding-top:5px; font-weight:700; color:var(--ink); }
.pgcard__row--sub{ font-size:11px; color:var(--dim); padding:1px 0; }
.pgcard__row--sub span{ padding-left:2px; }
.pgcard__row--tot{ border-top:1px solid var(--line-2); margin-top:2px; padding-top:4px; font-weight:700; color:var(--navy-700); }
.pgcard__row--reco{ font-weight:700; color:var(--gold-700,#A8852F); }
.pgcard__row--floor{ align-items:center; }
.pgfloor__wrap{ display:inline-flex; align-items:center; gap:3px; border:1px solid var(--line-2); border-radius:7px; padding:0 7px; background:#fff; }
.pgfloor__wrap:focus-within{ border-color:var(--gold-500); }
.pgfloor__in{ width:56px; border:none; outline:none; background:transparent; padding:4px 0; font-family:var(--ff); font-size:12.5px; font-weight:700; text-align:right; color:var(--ink); }
.pgfloor__rev{ border:none; background:none; padding:0 0 0 4px; font-family:var(--ff); font-size:10px; font-weight:700; color:var(--gold-700,#A8852F); cursor:pointer; }
/* ตัวคำนวณ % กำไร → % บวก */
.pgtgt{ margin-top:10px; border:1px solid #d6e3f3; background:#f4f8fd; border-radius:10px; padding:9px 11px; }
.pgtgt__hd{ display:flex; align-items:center; gap:5px; font-size:11px; font-weight:800; color:var(--navy-700); margin-bottom:7px; }
.pgtgt__row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.pgtgt__lb{ font-size:12px; font-weight:600; color:var(--ink-2); }
.pgtgt__inwrap{ display:inline-flex; align-items:center; gap:3px; border:1px solid var(--line-2); border-radius:7px; padding:0 8px; background:#fff; }
.pgtgt__inwrap:focus-within{ border-color:var(--navy-600); }
.pgtgt__in{ width:56px; border:none; outline:none; background:transparent; padding:6px 0; font-family:var(--ff); font-size:13px; text-align:right; }
.pgtgt__pct{ color:var(--dim); font-size:12px; }
.pgtgt__out{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:8px; font-size:12px; color:var(--ink); }
.pgtgt__mk{ color:var(--ok-ink,#1F8A5B); }
.pgtgt__out--warn{ color:var(--danger-ink); font-size:11px; }
.pgtgt__apply{ flex:none; border:1px solid transparent; border-radius:7px; background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:11px; font-weight:700; padding:5px 11px; cursor:pointer; }
.pgtgt__apply:hover{ filter:brightness(1.08); }
.pgtgt__cur{ margin-top:7px; padding-top:6px; border-top:1px dashed #cfe0f3; font-size:10.5px; color:var(--dim); }
.pgtgt__cur b{ color:var(--navy-700); }
/* edit ต้นทุนดำเนินการ */
.pgcard__opshd{ display:flex; align-items:center; justify-content:space-between; margin-top:5px; padding-top:5px; border-top:1px dotted var(--line-2); font-size:10.5px; font-weight:800; color:var(--dim); }
.pgcard__opsedit, .pgcard__opssave, .pgcard__opsx{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); border-radius:6px; padding:3px 8px; font-family:var(--ff); font-size:10.5px; font-weight:700; background:#fff; color:var(--navy-700); cursor:pointer; }
.pgcard__opsedit:hover, .pgcard__opsx:hover{ border-color:var(--gold-400); }
.pgcard__opsbtns{ display:inline-flex; gap:5px; }
.pgcard__opssave{ color:#fff; background:var(--ok-ink,#1F8A5B); border-color:var(--ok-ink,#1F8A5B); }
.pgcard__row--ed{ align-items:center; }
.pgedwrap{ display:inline-flex; align-items:center; gap:3px; border:1px solid var(--line-2); border-radius:6px; padding:0 6px; background:#fff; }
.pgedwrap:focus-within{ border-color:var(--gold-500); }
.pgedcur{ color:var(--dim); font-size:11px; }
.pged{ width:62px; border:none; outline:none; background:transparent; padding:3px 0; font-family:var(--ff); font-size:12px; text-align:right; }
.pgcard__edhint{ display:flex; align-items:center; gap:5px; font-size:10px; color:var(--dim); margin-top:2px; padding-left:2px; }
.pgbox__auto{ margin:-3px 0 9px; }
.pgbox__autotag{ display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:600; color:var(--ok-ink,#1F8A5B); }
.pgbox__autotag--man{ color:var(--navy-600); }
.pgbox__autorev{ border:none; background:none; padding:0; font-family:var(--ff); font-size:10.5px; font-weight:700; color:var(--gold-700,#A8852F); cursor:pointer; text-decoration:underline; }
.pgcard__box{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:9px; font-size:11px; font-weight:700; color:var(--dim); }
.pgcard__link{ display:flex; align-items:center; gap:5px; font-size:10.5px; color:var(--navy-600); background:#eef4fb; border:1px solid #d6e3f3; border-radius:7px; padding:5px 8px; margin-bottom:9px; line-height:1.4; }
.pgcard__box select{ border:1px solid var(--line-2); border-radius:7px; padding:4px 8px; font-family:var(--ff); font-size:11.5px; outline:none; background:#fff; }
.pgcard__box select:focus{ border-color:var(--gold-500); }
.pgbox{ position:relative; display:inline-flex; align-items:center; }
.pgbox__gear{ display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0; border:1px solid var(--line-2); border-radius:7px; background:#fff6e0; color:var(--gold-700,#A8852F); cursor:pointer; margin-left:6px; transition:border-color .12s, background .12s; }
.pgbox__gear:hover{ border-color:var(--gold-400); background:#ffedc4; }
.pgbox__cur{ display:inline-flex; align-items:center; gap:8px; min-width:118px; justify-content:space-between; border:1px solid var(--line-2); border-radius:7px; padding:5px 8px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink); background:#fff; cursor:pointer; }
.pgbox__cur:hover{ border-color:var(--gold-500); }
.pgbox__scrim{ position:fixed; inset:0; z-index:40; }
.pgbox__menu{ position:absolute; top:calc(100% + 4px); right:0; z-index:41; display:grid; grid-template-columns:1fr 1fr; gap:3px; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:5px; box-shadow:0 10px 28px rgba(20,33,61,.16); min-width:190px; }
.pgbox__opt{ display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid transparent; border-radius:6px; padding:5px 8px; font-family:var(--ff); font-size:11.5px; color:var(--ink-2); background:var(--surface-2); cursor:pointer; }
.pgbox__opt:hover{ border-color:var(--gold-400); background:#fff; }
.pgbox__opt.is-on{ background:#fff6e0; border-color:var(--gold-500); color:var(--navy-700); }
.pgbox__code{ font-weight:800; }
.pgbox__price{ font-weight:700; color:var(--navy-700); }
/* ตั้งค่ากล่องพัสดุ */
.boxset{ display:flex; flex-direction:column; gap:6px; }
.boxset__hd{ display:grid; grid-template-columns:1fr 130px 34px; gap:8px; font-size:10.5px; font-weight:700; color:var(--dim); padding:0 2px 2px; }
.boxset__hd span:nth-child(2){ text-align:right; }
.boxset__row, .boxset__add{ display:grid; grid-template-columns:1fr 130px 34px; gap:8px; align-items:center; }
.boxset--dim .boxset__hd{ grid-template-columns:56px 1fr 110px 32px; }
.boxset--dim .boxset__hd span:nth-child(2){ text-align:left; }
.boxset--dim .boxset__hd span:nth-child(3){ text-align:right; }
.boxset--dim .boxset__row, .boxset--dim .boxset__add{ grid-template-columns:56px 1fr 110px 32px; }
.boxset__dim{ display:inline-flex; align-items:center; gap:4px; }
.boxset__dimin{ width:100%; min-width:0; border:1px solid var(--line-2); border-radius:6px; padding:5px 4px; font-family:var(--ff); font-size:12px; text-align:center; outline:none; }
.boxset__dimin:focus{ border-color:var(--gold-500); }
.boxset__x{ color:var(--dim); font-size:11px; }
.boxset__code{ font-weight:800; color:var(--navy-700); font-size:13px; padding-left:4px; }
.boxset__pwrap{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); border-radius:7px; padding:0 8px; background:#fff; }
.boxset__pwrap:focus-within{ border-color:var(--gold-500); }
.boxset__cur{ color:var(--dim); font-size:12px; }
.boxset__price{ flex:1; width:100%; border:none; outline:none; padding:6px 0; font-family:var(--ff); font-size:13px; text-align:right; background:transparent; }
.boxset__del{ display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border:1px solid var(--line-2); border-radius:7px; background:#fff; color:var(--danger-ink); cursor:pointer; }
.boxset__del:hover{ border-color:var(--danger); background:#fdecec; }
.boxset__add{ margin-top:6px; padding-top:8px; border-top:1px dashed var(--line-2); }
.boxset__newcode{ border:1px solid var(--line-2); border-radius:7px; padding:6px 8px; font-family:var(--ff); font-size:13px; outline:none; }
.boxset__newcode:focus{ border-color:var(--gold-500); }
.boxset__addbtn{ display:inline-flex; align-items:center; justify-content:center; gap:4px; height:32px; border:1px solid transparent; border-radius:7px; background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); color:#fff; font-family:var(--ff); font-size:11.5px; font-weight:700; cursor:pointer; padding:0 4px; }
.boxset--dim .boxset__addbtn{ width:32px; padding:0; }
.boxset__reuse{ display:grid; grid-template-columns:56px 1fr 110px; gap:8px; align-items:center; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line-2); }
.boxset__reuselb{ font-size:11px; color:var(--dim); line-height:1.4; }
.recbox{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:var(--navy-700); background:rgba(11,61,145,.06); border-radius:7px; padding:3px 8px; white-space:nowrap; }
.recbox--reuse{ color:var(--gold-700,#A8852F); background:#fff6e0; }
.boxset__addbtn:hover{ filter:brightness(1.04); }
.pgcard__status{ display:flex; gap:6px; margin-top:9px; }
.pgcard__appr{ margin-top:10px; border-top:1px solid var(--line); padding-top:9px; }
.pgcard__appr input{ width:100%; border:1px solid var(--line-2); border-radius:7px; padding:7px 9px; font-family:var(--ff); font-size:12px; outline:none; margin-bottom:7px; }
.pgcard__btns{ display:flex; flex-wrap:wrap; gap:6px; }
.pgcard__b{ display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:7px; padding:5px 9px; cursor:pointer; }
.pgcard__b:hover{ border-color:var(--gold-400); }
.pgcard__b--req{ color:var(--violet); border-color:#d6cdf0; }
.pgcard__b--ok{ color:#fff; background:var(--ok-ink,#1F8A5B); border-color:var(--ok-ink,#1F8A5B); }
.pgcard__warn{ display:flex; align-items:flex-start; gap:7px; font-size:11px; color:var(--danger-ink); margin-top:9px; line-height:1.5; }
.pgcard__foot{ margin-top:9px; padding-top:8px; border-top:1px solid var(--line); font-size:10px; color:var(--dim); line-height:1.55; }

/* ======================================================================
   P1-A · Shipping label / AWB (OOPSShipping)
   ====================================================================== */
.awbtbl th{ white-space:nowrap; }
.awb-carsel{ border:1px solid var(--line-2); border-radius:7px; padding:6px 8px; font-family:var(--ff); font-size:12px; outline:none; background:#fff; max-width:170px; }
.awb-carsel:disabled{ background:var(--surface-2); color:var(--ink-2); }
.awb-manual{ display:block; margin-top:5px; border:1px solid var(--line-2); border-radius:7px; padding:5px 8px; font-family:var(--ff); font-size:12px; outline:none; max-width:170px; }
.awb-no{ display:inline-block; font-size:12px; font-weight:700; color:var(--navy-800); border:1px dashed var(--line-2); border-left-width:3px; border-radius:6px; padding:3px 9px; }
.awb-acts{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; white-space:nowrap; }
.awb-x{ width:28px; height:28px; border-radius:7px; border:1px solid var(--line-2); background:#fff; color:var(--danger-ink); cursor:pointer; display:grid; place-items:center; }
.awb-x:hover{ border-color:#f0bcbc; background:#fdf2f2; }
.awb-handed{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--ok-ink,#1F8A5B); }
.awbbc{ display:flex; align-items:stretch; gap:1px; width:100%; overflow:hidden; }
.awbbc span{ flex:none; }
.cxmodal.awblabelmod{ width:min(440px,96vw); }
.awblabel{ border:2px solid #111; border-radius:6px; padding:13px; background:#fff; }
.awblabel__top{ display:flex; justify-content:space-between; align-items:center; border-bottom:1.5px solid #111; padding-bottom:8px; margin-bottom:8px; }
.awblabel__carrier{ font-size:15px; font-weight:800; }
.awblabel__cod{ font-size:11px; font-weight:800; border:1.5px solid #111; border-radius:5px; padding:2px 8px; }
.awblabel__awb{ text-align:center; font-size:15px; font-weight:800; letter-spacing:2px; margin:4px 0 10px; }
.awblabel__grid{ display:grid; grid-template-columns:1fr 1fr; gap:7px 12px; border-top:1px dashed #999; padding-top:9px; }
.awblabel__grid>div{ display:flex; flex-direction:column; gap:1px; }
.awblabel__full{ grid-column:1 / -1; }
.awblabel__grid label{ font-size:9.5px; color:#777; text-transform:uppercase; letter-spacing:.4px; }
.awblabel__grid b{ font-size:12.5px; color:#111; }
.awblabel__items{ margin-top:9px; border-top:1.5px solid #111; padding-top:7px; font-size:11.5px; color:#333; text-align:center; }
.awblabel__note{ display:flex; align-items:flex-start; gap:7px; font-size:11px; color:var(--dim); margin-top:11px; line-height:1.5; }

/* ======================================================================
   P1-B · Payout reconciliation (MpReconcileD)
   ====================================================================== */
.porec-cards{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:9px; margin-bottom:14px; }
@media (max-width:1100px){ .porec-cards{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:680px){ .porec-cards{ grid-template-columns:repeat(2,1fr); } }
.porec-card{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px 12px; box-shadow:var(--sh-sm); }
.porec-card--diff{ border-color:#f0bcbc; background:#fdf6f6; }
.porec-card__k{ font-size:11px; color:var(--dim); margin-bottom:6px; line-height:1.3; }
.porec-card__v{ font-size:18px; font-weight:800; }
/* 🔧 แบ่งจอ: กระทบยอด (mpreconcile) — การ์ด .porec-cards ล็อกหลายคอลัมน์ด้วย @media viewport
   → ช่องแคบทำให้ตัวเลข 18px ล้นการ์ด · ยุบคอลัมน์ตามความกว้างช่องจริง (เฉพาะ fluid pane) */
.splitpane__scroll--fluid .porec-card, .splitpane__scroll--fluid .porec-card__v { min-width:0; }
@container pane (max-width:900px){ .splitpane__scroll--fluid .porec-cards{ grid-template-columns:repeat(2,1fr); } }
@container pane (max-width:520px){ .splitpane__scroll--fluid .porec-cards{ grid-template-columns:1fr; } }
.porec-tbl{ min-width:1180px; }
.cxmodal.porec-drawer{ width:min(720px,96vw); }
.porec-break{ border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.porec-break__hd{ background:var(--surface-2); padding:9px 13px; font-size:12px; font-weight:800; color:var(--navy-700); border-bottom:1px solid var(--line); }
.porec-break__row{ display:flex; justify-content:space-between; padding:7px 13px; font-size:12.5px; color:var(--ink-2); border-bottom:1px solid var(--surface-3); }
.porec-break__row--net{ background:#f1faf4; font-weight:800; color:var(--ink); }
.porec-break__row--diff{ font-weight:800; }
.porec-reason{ display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--warn-ink); background:var(--warn-bg); border-radius:9px; padding:9px 12px; margin-top:11px; line-height:1.5; }
.porec-gain{ margin-top:12px; border:1px solid #cfe9da; background:#f1faf4; border-radius:10px; overflow:hidden; }
.porec-gain__hd{ display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:800; color:var(--ok-ink,#1F8A5B); padding:8px 13px; border-bottom:1px solid #d8eee2; }
.porec-gain__row{ display:flex; justify-content:space-between; padding:6px 13px; font-size:12.5px; color:var(--ink-2); }
.porec-gain__row--net{ font-weight:800; border-top:1px dashed #cfe9da; }
.porec-gain__row--net.is-gain{ color:var(--ok-ink,#1F8A5B); background:#e7f4ed; }
.porec-gain__row--net.is-loss{ color:var(--danger); background:#fdecea; }
.porec-orders{ margin-top:13px; }
.porec-orders__hd{ font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:7px; }
.porec-notebox{ margin-top:13px; }
.porec-notebox label{ display:block; font-size:11.5px; font-weight:700; color:var(--navy-700); margin-bottom:5px; }
.porec-notebox textarea{ width:100%; border:1px solid var(--line-2); border-radius:9px; padding:8px 11px; font-family:var(--ff); font-size:12.5px; outline:none; resize:vertical; }
.porec-link{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; }

/* ======================================================================
   P1-C · Replenishment (ReplenishD)
   ====================================================================== */
.rp-tbl{ min-width:980px; }
.rp-slow{ font-size:9.5px; font-weight:700; color:var(--dim); background:var(--surface-3); border-radius:5px; padding:1px 6px; margin-left:6px; }
.rp-acts{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; white-space:nowrap; }
.rp-done{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--ok-ink,#1F8A5B); }
.rp-skip{ font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); background:none; border:1px solid var(--line-2); border-radius:7px; padding:5px 9px; cursor:pointer; }
.rp-skip:hover{ border-color:var(--gold-400); }
.rp-open{ width:28px; height:28px; border-radius:7px; border:1px solid var(--line-2); background:#fff; color:var(--navy-700); cursor:pointer; display:grid; place-items:center; }
.rp-open:hover{ border-color:var(--gold-400); background:var(--surface-2); }

/* ======================================================================
   P1-E · Bin master (BinMasterD)
   ====================================================================== */
.bin-tbl{ min-width:880px; }
.bin-row--off{ opacity:.62; }
.bin-warns{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.bin-warn{ display:flex; align-items:flex-start; gap:9px; font-size:12.5px; padding:10px 13px; border-radius:10px; line-height:1.5; }
.bin-warn--warn{ background:var(--warn-bg); color:var(--warn-ink); border:1px solid #ecd9a8; }
.bin-warn--danger{ background:var(--danger-bg); color:var(--danger-ink); border:1px solid #f0bcbc; }
.bin-warn b{ font-weight:800; }

/* ======================================================================
   P1-D · Delivery board + driver assignment (DeliveryBoardD)
   ====================================================================== */
.dlv-selbar{ display:flex; align-items:center; gap:12px; background:#eef3ff; border:1px solid #d6e2f7; border-radius:11px; padding:9px 14px; margin-bottom:14px; font-size:13px; color:var(--navy-800); }
.dlv-selbar__grp{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:#fff; background:var(--navy-700); border:none; border-radius:8px; padding:7px 13px; cursor:pointer; }
.dlv-selbar__clr{ font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; margin-left:auto; }
.dlv-job2{ display:flex; align-items:flex-start; gap:11px; padding:12px 16px; border-bottom:1px solid var(--line); }
.dlv-job2.is-sel{ background:#f4f8ff; }
.dlv-job2__chk{ padding-top:3px; }
.dlv-job2__bd{ flex:1; min-width:0; }
.dlv-job2__ev{ display:flex; gap:12px; margin-top:6px; }
.dlv-job2__ev span{ display:inline-flex; align-items:center; gap:4px; font-size:10.5px; color:var(--dim); }
.dlv-job2__ev span.is-on{ color:var(--ok-ink,#1F8A5B); font-weight:700; }
.dlv-job2__assign{ display:flex; flex-direction:column; gap:6px; align-items:flex-end; flex:none; }
.dlv-job2__assign select{ border:1px solid var(--line-2); border-radius:8px; padding:6px 9px; font-family:var(--ff); font-size:12px; outline:none; background:#fff; min-width:168px; }
.dlv-runtag{ font-size:9.5px; font-weight:700; color:var(--violet); background:var(--violet-bg); border-radius:5px; padding:1px 7px; cursor:pointer; }
.dlv-run{ display:flex; align-items:center; gap:11px; width:100%; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:10px 13px; cursor:pointer; font-family:var(--ff); transition:.12s; }
.dlv-run:hover{ border-color:var(--gold-400); box-shadow:var(--sh-sm); }
.dlv-run__ic{ width:36px; height:36px; flex:none; border-radius:10px; display:grid; place-items:center; }
.dlv-run__bd{ flex:1; display:flex; flex-direction:column; line-height:1.3; }
.dlv-run__bd b{ font-size:13px; color:var(--ink); }
.dlv-run__bd span{ font-size:11.5px; color:var(--dim); }
.cxmodal.run-drawer{ width:min(560px,96vw); }
.run-stops{ display:flex; flex-direction:column; gap:9px; }
.run-stop{ display:flex; align-items:flex-start; gap:11px; border:1px solid var(--line); border-radius:11px; padding:11px 13px; }
.run-stop.is-done{ background:#f1faf4; border-color:#bfe6cf; }
.run-stop__n{ width:24px; height:24px; flex:none; border-radius:50%; background:var(--navy-700); color:#fff; display:grid; place-items:center; font-size:12px; font-weight:800; }
.run-stop.is-done .run-stop__n{ background:var(--ok-ink,#1F8A5B); }
.run-stop__bd{ flex:1; min-width:0; }
.run-stop__top{ display:flex; align-items:center; gap:8px; }
.run-stop__top b{ font-size:13px; }
.run-stop__sub{ font-size:11.5px; color:var(--dim); margin-top:2px; }
.run-stop__ev{ display:flex; gap:12px; margin-top:6px; }
.run-stop__ev span{ display:inline-flex; align-items:center; gap:4px; font-size:10.5px; color:var(--dim); }
.run-stop__ev span.is-on{ color:var(--ok-ink,#1F8A5B); font-weight:700; }
.run-stop__done{ flex:none; font-family:var(--ff); font-size:12px; font-weight:700; color:#fff; background:var(--ok-ink,#1F8A5B); border:none; border-radius:8px; padding:7px 12px; cursor:pointer; }
.run-closed{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--ok-ink,#1F8A5B); }

/* ======================================================================
   Patch 1 · ownership labels / bridge / clarity copy
   ====================================================================== */
.mp-owner{ display:inline-flex; align-items:center; font-size:10.5px; font-weight:800; padding:4px 10px; border-radius:999px; background:var(--navy-700); color:#fff; letter-spacing:.3px; }
.mp-owner--ops{ background:var(--info-ink,#1C4C86); }
.mp-owner--conn{ background:#6B7280; }
.oops-ownerbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:var(--surface-2); border:1px solid var(--line); border-radius:11px; padding:9px 13px; margin-bottom:12px; }
.oops-ownerbar__t{ flex:1; min-width:200px; font-size:12px; color:var(--ink-2); line-height:1.5; }
.oops-gorules{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:6px 12px; cursor:pointer; white-space:nowrap; }
.oops-gorules:hover{ border-color:var(--gold-400); }
.oops-hdr{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin:0 0 12px; }
.oops-hdr b{ font-size:14px; font-weight:800; color:var(--ink); }
.oops-hdr span{ font-size:12px; color:var(--dim); }
.oops-retlink{ font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-600); background:none; border:none; cursor:pointer; padding:0; }
.dlv-srctag{ font-size:9.5px; font-weight:700; color:var(--info-ink,#1C4C86); background:var(--info-bg,#E4EFFA); border-radius:5px; padding:1px 7px; }

/* ======================================================================
   Storage location / Putaway (ตำแหน่งเก็บ)
   ====================================================================== */
.loc-label{ display:inline-block; font-size:13px; font-weight:800; color:var(--navy-800); background:var(--surface-3); border-radius:6px; padding:2px 9px; }
.loc-human{ font-size:11px; color:var(--dim); margin-top:3px; }
.loc-preview{ display:flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:9px 12px; margin:4px 0 2px; }
.loc-preview .mono{ font-size:14px; font-weight:800; color:var(--navy-700); }
/* ปุ่มไอคอนตำแหน่งเก็บหลัก — หลังช่อง ชั้น/ห้อง */
.shelfrow{ display:inline-flex; align-items:center; gap:8px; }
.shelf-locbtn{ display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0; border:1px solid var(--line-2); border-radius:7px; background:#fff6e0; color:var(--gold-700,#A8852F); cursor:pointer; transition:border-color .12s, background .12s; }
.shelf-locbtn:hover{ border-color:var(--gold-400); background:#ffedc4; }
/* storage card in Product Master */
.stcard{ margin-top:14px; border:1px solid var(--line-2); border-radius:12px; padding:11px 13px; background:#f1f6fc; }
.stcard--warn{ background:#fdf8ec; border-color:#ecd9a8; }
.stcard__hd{ display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:800; color:var(--navy-700); margin-bottom:8px; }
.stcard__label{ font-size:18px; font-weight:800; color:var(--navy-800); letter-spacing:.3px; }
.stcard__human{ font-size:12px; color:var(--ink-2); margin-top:2px; }
.stcard__missing{ display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:var(--warn-ink); margin-bottom:8px; }
.stcard__btns{ display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.stcard__b{ display:inline-flex; align-items:center; gap:5px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line-2); border-radius:8px; padding:6px 11px; cursor:pointer; }
.stcard__b:hover{ border-color:var(--gold-400); }
.stcard__b--gold{ color:#fff; background:linear-gradient(140deg,var(--gold-400),var(--gold-600)); border-color:transparent; }
.stcard__help{ font-size:11px; color:var(--dim); margin:6px 0 0; line-height:1.5; }
.loc-help{ display:flex; align-items:flex-start; gap:7px; font-size:11.5px; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:8px 11px; margin-top:8px; line-height:1.5; }
.putsug{ margin-top:12px; }
.putsug__hd{ font-size:11.5px; font-weight:700; color:var(--navy-700); margin-bottom:7px; }
.putsug__chips{ display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:stretch; }
.putsug__chip{ font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink); background:#fff; border:1px solid var(--line-2); border-radius:999px; padding:6px 13px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; justify-content:flex-start; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.putsug__chip span{ color:var(--dim); font-weight:400; font-size:11px; }
.putsug__chip:hover{ border-color:var(--gold-400); }
.putsug__chip.is-on{ background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.putsug__chip.is-on span{ color:#cdd9f0; }

/* ================= ศูนย์จัดการคำสั่งซื้อ (Shopee-style) · .oc-* ================= */
.oc{ display:flex; flex-direction:column; gap:16px; align-items:stretch; }
.oc-side{ display:flex; flex-direction:row; flex-wrap:wrap; gap:6px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:7px; }
.oc-side__item{ display:flex; align-items:center; gap:9px; text-align:left; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink-2,#41506b); background:none; border:none; border-radius:10px; padding:10px 15px; cursor:pointer; transition:.13s; }
.oc-side__item:hover{ background:var(--surface-2); color:var(--navy-700); }
.oc-side__item.is-active{ background:var(--navy-700); color:#fff; font-weight:700; }
.oc-side__item span{ min-width:0; line-height:1.25; white-space:nowrap; }
.oc-side__b{ flex:none; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:var(--gold-500); color:#081B45; font-size:11px; font-weight:800; display:grid; place-items:center; }
.oc-side__item.is-active .oc-side__b{ background:var(--gold-400,#f0c95a); }
.oc-side__b--red{ background:var(--danger,#d24b4b); color:#fff; }
/* 🔧 แบ่งจอ: นำทาง .oc-side (4 เมนู) ที่ปกติเรียงแถวเดียว เมื่อช่องแคบจะ wrap เป็น 2+2 ไม่เป็นระเบียบ
   → จัดเป็นกริด 2 คอลัมน์เท่ากัน (2×2) ในช่อง fluid · แคบมากเหลือคอลัมน์เดียว (เฉพาะ split ไม่กระทบจอเดี่ยว) */
@container pane (max-width: 760px){
  .splitpane__scroll--fluid .oc-side{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
  .splitpane__scroll--fluid .oc-side__item{ width:100%; overflow:hidden; }
  .splitpane__scroll--fluid .oc-side__item span{ overflow:hidden; text-overflow:ellipsis; }
}
@container pane (max-width: 380px){
  .splitpane__scroll--fluid .oc-side{ grid-template-columns:1fr; }
}

.oc-main{ min-width:0; }
.oc-chbar{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:15px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.oc-chbar__lbl{ font-size:12px; color:var(--dim); margin-right:3px; }
.oc-chbtn{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink-2,#41506b); background:#fff; border:1px solid var(--line-2); border-radius:999px; padding:7px 14px; cursor:pointer; transition:.12s; }
.oc-chbtn:hover{ border-color:var(--navy-400,#aebfdb); }
.oc-chbtn.is-active{ background:#fff; border-color:var(--navy-700); color:var(--navy-800); box-shadow:inset 0 0 0 1px var(--navy-700); }
.oc-chbtn b{ font-weight:800; margin-left:1px; }
.oc-chbtn .oc-chdot{ width:8px; height:8px; border-radius:3px; flex:none; }
.oc-chbtn--logo{ padding:5px 11px; gap:7px; }
.oc-chlogo{ width:18px; height:18px; object-fit:contain; border-radius:4px; flex:none; }
/* ไอคอนเปิดป๊อปอัป "การจัดการข้ามแพลตฟอร์ม" บนแถบช่องทาง */
.oc-capic{ margin-left:auto; width:32px; height:32px; flex:none; display:grid; place-items:center; border:1px solid var(--line-2); background:#fff; border-radius:9px; cursor:pointer; color:var(--navy-600); transition:.12s; }
.oc-capic:hover{ border-color:var(--navy-400,#aebfdb); color:var(--navy-800); background:var(--surface-2); }
/* ป๊อปอัป */
.oc-capmodal-ov{ position:fixed; inset:0; background:rgba(12,22,48,.42); display:grid; place-items:center; z-index:200; padding:22px; animation:ocCapOv .14s ease both; }
@keyframes ocCapOv{ from{ opacity:0; } to{ opacity:1; } }
.oc-capmodal{ background:#fff; border-radius:16px; width:min(540px,100%); max-height:86vh; overflow:auto; box-shadow:0 30px 70px -20px rgba(8,20,55,.5); animation:ocCapIn .18s var(--ease-out,ease) both; }
@keyframes ocCapIn{ from{ opacity:0; transform:translateY(10px) scale(.98); } to{ opacity:1; transform:none; } }
.oc-capmodal__hd{ display:flex; align-items:center; gap:9px; padding:15px 18px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; }
.oc-capmodal__hd h3{ margin:0; font-size:15px; font-weight:800; color:var(--navy-800); flex:1; }
.oc-capmodal__hd button{ background:none; border:none; cursor:pointer; color:var(--dim); display:flex; padding:2px; border-radius:6px; }
.oc-capmodal__hd button:hover{ color:var(--ink); background:var(--surface-2); }
.oc-capmodal__bd{ padding:15px 18px 20px; }
.oc-capmodal__intro{ font-size:12.5px; color:var(--dim); margin:0 0 14px; line-height:1.5; }
.oc-capmodal__plats{ margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.oc-capmodal__platshd{ font-size:11px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; margin-bottom:9px; }
.oc-capplat{ display:flex; align-items:center; gap:9px; padding:7px 0; }
.oc-capplat b{ font-size:13px; color:var(--ink); }
.oc-capbadge{ margin-left:auto; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; }
.oc-capbadge--full{ background:#e6f5ec; color:#1b7a45; }
.oc-capbadge--partial{ background:#fdf3e0; color:#a8741a; }
.oc-capbadge--limited{ background:#fdecec; color:#c0392b; }
.oc-page{ display:flex; flex-direction:column; }
.oc-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.oc-head h2{ font-size:19px; font-weight:800; color:var(--navy-800); margin:0; }
.oc-head__acts{ display:flex; gap:8px; }

.oc-banner{ display:flex; align-items:center; gap:9px; padding:11px 14px; border-radius:11px; font-size:12.5px; margin-bottom:14px; }
.oc-banner--warn{ background:#fdf6e3; border:1px solid #f0dca6; color:#7a5c12; }
.oc-banner__x{ margin-left:auto; background:none; border:none; cursor:pointer; color:inherit; display:flex; }

.oc-tabs{ display:flex; gap:4px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin-bottom:14px; }
.oc-tab{ font-family:var(--ff); font-size:13px; font-weight:600; color:var(--dim); background:none; border:none; border-bottom:2px solid transparent; padding:9px 13px; margin-bottom:-1px; cursor:pointer; transition:.12s; white-space:nowrap; }
.oc-tab:hover{ color:var(--navy-700); }
.oc-tab.is-active{ color:var(--gold-700,#a8741a); border-bottom-color:var(--gold-500); font-weight:800; }

.oc-subtabs{ display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.oc-subtab{ font-family:var(--ff); font-size:13.5px; font-weight:700; color:var(--dim); background:none; border:none; border-bottom:2.5px solid transparent; padding:10px 4px; margin-right:18px; margin-bottom:-1px; cursor:pointer; }
.oc-subtab.is-active{ color:var(--navy-800); border-bottom-color:var(--gold-500); }

.oc-filters{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.oc-filrow{ display:flex; align-items:center; gap:8px; }
.oc-filrow--wrap{ flex-wrap:wrap; }
.oc-fillbl{ font-size:12px; color:var(--dim); margin-right:4px; flex:none; }
.oc-chip{ font-family:var(--ff); font-size:12px; font-weight:600; color:var(--ink-2,#41506b); background:#fff; border:1px solid var(--line-2); border-radius:999px; padding:6px 13px; cursor:pointer; transition:.12s; white-space:nowrap; }
.oc-chip:hover{ border-color:var(--gold-400); }
.oc-chip.is-active{ background:#fff; border-color:var(--gold-500); color:var(--gold-700,#a8741a); font-weight:800; box-shadow:inset 0 0 0 1px var(--gold-500); }
.oc-search{ display:flex; align-items:center; gap:7px; flex:1; min-width:0; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:8px 11px; }
.oc-search input{ flex:1; min-width:0; border:none; outline:none; font-family:var(--ff); font-size:12.5px; background:none; color:var(--ink); }
.oc-sel{ display:flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:6px 11px; flex:none; }
.oc-sel>span{ font-size:12px; color:var(--dim); }
.oc-sel select{ border:none; outline:none; background:none; font-family:var(--ff); font-size:12.5px; font-weight:600; color:var(--navy-700); cursor:pointer; }

.oc-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.oc-count{ font-size:13px; color:var(--ink); }
.oc-count b{ font-size:15px; color:var(--navy-800); }
.oc-toolbar__r{ display:flex; align-items:center; gap:12px; }
.oc-sortby{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:var(--dim); }

.oc-colhd{ display:grid; grid-template-columns:minmax(0,2.3fr) 1fr 1.3fr 1.3fr 1.2fr; gap:12px; padding:9px 14px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px 10px 0 0; font-size:11px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; }
.oc-colhd--ret{ grid-template-columns:minmax(0,2.3fr) 1.5fr 1fr 1.4fr; }
.oc-colhd__a{ text-align:right; }

.oc-list{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.oc-order{ border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; }
.oc-order__hd{ display:flex; align-items:center; gap:10px; padding:9px 14px; background:var(--surface-2); border-bottom:1px solid var(--line); font-size:12px; }
.oc-chtag{ display:inline-flex; align-items:center; gap:6px; font-weight:700; white-space:nowrap; }
.oc-chdot{ width:8px; height:8px; border-radius:3px; flex:none; }
.oc-order__cust{ font-weight:600; color:var(--ink); }
.oc-order__tags{ display:flex; gap:4px; flex-wrap:wrap; }
.oc-order__no{ margin-left:auto; color:var(--dim); font-size:11.5px; }
.oc-order__bd{ display:grid; grid-template-columns:minmax(0,2.3fr) 1fr 1.3fr 1.3fr 1.2fr; gap:12px; align-items:center; padding:13px 14px; }
.oc-order__bd--ret{ grid-template-columns:minmax(0,2.3fr) 1.5fr 1fr 1.4fr; }

.oc-prodwrap{ display:flex; align-items:center; gap:11px; min-width:0; }
.oc-thumb{ flex:none; border-radius:9px; display:grid; place-items:center; }
.oc-prod{ min-width:0; }
.oc-prod__name{ font-size:12.5px; font-weight:600; color:var(--ink); line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.oc-prod__qty{ color:var(--dim); font-weight:500; }
.oc-prod__more{ font-size:11px; color:var(--dim); margin-top:2px; }

.oc-pay{ display:flex; flex-direction:column; gap:1px; }
.oc-pay b{ font-size:13.5px; color:var(--navy-800); }
.oc-pay span{ font-size:11px; color:var(--dim); }
.oc-stat{ display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.oc-cd{ font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:6px; }
.oc-cd--late{ background:#fdecec; color:#c0392b; }
.oc-cd--today{ background:#fdf3e0; color:#a8741a; }
.oc-cd--tomorrow{ background:var(--surface-3); color:var(--navy-700); }
.oc-track{ font-size:10.5px; color:var(--navy-600); }
.oc-ship__c{ font-size:12px; font-weight:600; color:var(--ink); }
.oc-ship__sub{ font-size:11px; color:var(--dim); margin-top:1px; }
.oc-acts{ display:flex; flex-direction:column; align-items:flex-end; gap:5px; }
.oc-link{ background:none; border:none; cursor:pointer; font-family:var(--ff); font-size:12px; font-weight:600; color:var(--navy-600); padding:0; text-align:right; }
.oc-link:hover{ color:var(--navy-800); text-decoration:underline; }
.oc-link--gold{ color:var(--gold-700,#a8741a); font-weight:800; }
/* ปุ่มดูรายละเอียด — มีลูกศรหมุนเมื่อเปิด dropdown */
.oc-link--detail{ display:inline-flex; align-items:center; gap:3px; }
.oc-link--detail svg{ transition:transform .18s var(--ease-smooth,ease); }
.oc-link--detail.is-open{ color:var(--navy-800); }
.oc-link--detail.is-open svg{ transform:rotate(180deg); }
/* dropdown รายละเอียดการจัดส่ง (อยู่ในการ์ดเดิม — ไม่เปิดอีกจอ) */
.oc-order.is-open{ border-color:var(--navy-300,#aebfdb); box-shadow:0 10px 26px -16px rgba(16,32,72,.3); }
.oc-detail{ border-top:1px dashed var(--line-2); background:var(--surface-2); overflow:hidden; animation:ocDetailIn .2s var(--ease-out,ease) both; }
@keyframes ocDetailIn{ from{ opacity:0; transform:translateY(-6px); } to{ opacity:1; transform:none; } }
.oc-detail__bd{ padding:15px 16px 4px; }
.oc-detail__cols{ display:grid; grid-template-columns:1fr 1.2fr; gap:14px; }
.oc-detail__ft{ display:flex; gap:9px; padding:12px 16px 14px; }
@media (max-width:760px){ .oc-detail__cols{ grid-template-columns:1fr; } }

.oc-empty{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; padding:40px 20px; color:var(--dim); font-size:13px; }
.oc-empty--lg{ padding:64px 20px; }
.oc-empty small{ font-size:11.5px; color:var(--line-2); }

.oc-pager{ display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:14px; font-size:12.5px; color:var(--dim); }
.oc-pager button{ width:30px; height:30px; border:1px solid var(--line-2); background:#fff; border-radius:8px; cursor:pointer; display:grid; place-items:center; color:var(--navy-700); }
.oc-pager button:disabled{ opacity:.4; cursor:default; }

/* batch page */
.oc-batch{ display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:18px; align-items:start; }
@media (max-width:1000px){ .oc-batch{ grid-template-columns:1fr; } }
/* 🔧 จัดส่งแบบชุด (OcBatch) — สแต็ก 1 คอลัมน์ในช่อง split แคบ + ตารางเลื่อนแนวนอนในกล่อง */
@container pane (max-width:1000px){ .splitpane__scroll--fluid .oc-batch{ grid-template-columns:1fr; } }
.splitpane__scroll--fluid .oc-batch > *{ min-width:0; }
.splitpane__scroll--fluid .oc-batch__main{ overflow-x:auto; }
.splitpane__scroll--fluid .oc-pickup{ position:static; }
/* 🔧 ระบบสมาชิก — ทะเบียนสมาชิก → การ์ดกระชับ 2 บรรทัดในช่อง split แคบ (เลิก scroll แนวนอน) */
.pane-fluid--members .panel__bd{ overflow-x:auto; }
@container pane (max-width: 900px){
  .pane-fluid--members .panel__bd{ overflow-x:visible; }
  .pane-fluid--members .panel__bd > .tbl{ display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--members .panel__bd > .tbl > thead{ display:none; }
  .pane-fluid--members .panel__bd > .tbl > tbody{ display:contents; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr{
    display:flex; flex-wrap:wrap; align-items:center; column-gap:9px; row-gap:3px;
    padding:8px 12px; border-bottom:1px solid var(--line); width:100%; box-sizing:border-box;
  }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td{ display:flex; align-items:center; gap:4px; border:none !important; padding:0; min-width:0; white-space:nowrap; }
  /* === บรรทัด 1: สมาชิก(avatar+รหัส+ชื่อ+ประเภท/เบอร์) · ระดับ · แต้ม === */
  /* รหัสสมาชิกแสดง inline หน้าชื่อ (ซ่อนเซลล์แยกซ้าย) */
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(1){ display:none; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(2) .cell-main::before{ content:attr(data-mno) "  "; color:var(--navy-600); font-weight:700; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(2){ order:2; flex:1 1 140px; min-width:110px; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(2) .cellflex{ min-width:0; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(2) .cell-main{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(3){ order:3; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(4){ order:4; font-weight:800; color:var(--navy-700); }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(4)::after{ content:"แต้ม"; font-size:9px; color:#64748B; font-weight:600; margin-left:2px; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(8){ display:none; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr::after{ content:""; flex-basis:100%; height:0; order:6; }
  /* === บรรทัด 2: ยอดสะสม · วันสมัคร · ล่าสุด === */
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(5){ order:9; margin-left:auto; font-weight:700; text-align:right; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(6){ order:7; color:var(--dim); font-size:11.5px; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(7){ order:8; color:var(--ink-2); font-size:11.5px; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(5)::before{ content:"ยอดสะสม"; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(6)::before{ content:"สมัคร"; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(7)::before{ content:"ล่าสุด"; }
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(5)::before,
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(6)::before,
  .pane-fluid--members .panel__bd > .tbl > tbody > tr > td:nth-child(7)::before{ font-size:9px; color:#64748B; font-weight:600; }
  /* tfoot สรุป */
  .pane-fluid--members .panel__bd > .tbl > tfoot{ display:block; }
  .pane-fluid--members .panel__bd > .tbl > tfoot > tr{ display:flex; flex-wrap:wrap; align-items:center; gap:5px 14px; padding:9px 12px; background:var(--surface-2); }
  .pane-fluid--members .panel__bd > .tbl > tfoot > tr > td{ border:none !important; padding:0 !important; }
}
/* 🟦 ศูนย์จัดการคำสั่งซื้อ (ordercenter) split-pane REFLOW — container queries
   scope ใต้ .pane-fluid--ordercenter เท่านั้น · ไม่แตะจอเดี่ยว/ช่องเมนูอื่น.
   "คำสั่งซื้อของฉัน": แถวออเดอร์ 5 คอลัมน์ (สินค้า·ยอด·สถานะ·ขนส่ง·ดำเนินการ)
   → การ์ดสแต็กในช่องแคบ (เลิกบีบจนปุ่มดำเนินการพันกัน) */
/* ตัวกรอง/ทูลบาร์/หัวหน้า พับบรรทัดเสมอในช่อง fluid */
.pane-fluid--ordercenter .oc-head{ flex-wrap:wrap; }
.pane-fluid--ordercenter .oc-filrow{ flex-wrap:wrap; }
.pane-fluid--ordercenter .oc-toolbar{ flex-wrap:wrap; }
.pane-fluid--ordercenter .oc-toolbar__r{ flex-wrap:wrap; }
/* MEDIUM/NARROW ช่อง (≤ 820px) — แถวออเดอร์ → การ์ดกระชับ 3 บรรทัด (flex, ไม่เปลืองพื้นที่)
   บรรทัด1: สินค้า (ซ้าย) + ราคา/การชำระ (ขวา) · บรรทัด2: สถานะ + ขนส่ง (ชิปแนวนอน)
   บรรทัด3: ปุ่มดำเนินการ */
@container pane (max-width: 820px){
  .pane-fluid--ordercenter .oc-colhd{ display:none; }
  .pane-fluid--ordercenter .oc-order__hd{ flex-wrap:wrap; }
  .pane-fluid--ordercenter .oc-order__bd,
  .pane-fluid--ordercenter .oc-order__bd--ret{
    display:flex; flex-wrap:wrap; align-items:center; column-gap:12px; row-gap:7px; padding:11px 13px;
  }
  .pane-fluid--ordercenter .oc-prodwrap{ flex:1 1 170px; min-width:0; }
  .pane-fluid--ordercenter .oc-pay{ flex:0 0 auto; margin-left:auto; align-items:flex-end; text-align:right; }
  /* สถานะ + ขนส่ง → ชิปแนวนอนบรรทัดเดียวกัน (เลิกสแต็กแนวตั้ง) */
  .pane-fluid--ordercenter .oc-stat{ flex:0 1 auto; flex-direction:row; flex-wrap:wrap; align-items:center; gap:5px 9px; }
  .pane-fluid--ordercenter .oc-ship{ flex:0 1 auto; display:flex; align-items:baseline; gap:6px; }
  .pane-fluid--ordercenter .oc-ship__sub{ margin-top:0; }
  .pane-fluid--ordercenter .oc-acts{
    flex:1 1 100%; flex-direction:row; flex-wrap:wrap; align-items:center;
    justify-content:flex-start; gap:8px 16px; padding-top:8px; border-top:1px dashed var(--line);
  }
  .pane-fluid--ordercenter .oc-link{ text-align:left; }
  .pane-fluid--ordercenter .oc-detail__cols{ grid-template-columns:1fr; }
  /* คืน/ยกเลิก: สินค้า (ซ้าย) + ยอดคืน (ขวา) · เหตุผลเต็มแถว · ปุ่มล่าง */
  .pane-fluid--ordercenter .oc-order__bd--ret .oc-reason{ flex:1 1 100%; order:1; }
  .pane-fluid--ordercenter .oc-order__bd--ret .oc-acts{ order:2; }
}
/* 🔧 รายงานเข้าบริษัท (coreports) — master-detail (.rc-split) สแต็ก 1 คอลัมน์ในช่อง split แคบ + ตารางเลื่อนแนวนอนในกล่อง */
.pane-fluid--coreports .rc-split{ min-width:0; }
.pane-fluid--coreports .rc-split > *{ min-width:0; }
.pane-fluid--coreports .rc-split .panel__bd, .pane-fluid--coreports .panel{ overflow-x:auto; }
@container pane (max-width: 1000px){
  .pane-fluid--coreports .rc-split{ grid-template-columns:1fr !important; }
}
/* 🔧 งานรอจัดเก็บ (Putaway, route replenish) — ตารางงานจัดเก็บ → การ์ดกระชับในช่อง split แคบ (ปุ่มไม่ล้น) */
@container pane (max-width: 900px){
  .pane-fluid--replenish .mp-tablewrap{ overflow-x:visible; }
  .pane-fluid--replenish .mp-tablewrap > .tbl{ display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > thead{ display:none; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody{ display:contents; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr{
    display:grid; grid-template-columns:minmax(0,1fr) auto auto;
    align-items:center; column-gap:8px; row-gap:1px;
    padding:9px 12px; border-bottom:1px solid var(--line); width:100%; box-sizing:border-box;
  }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td{ border:none !important; padding:0; min-width:0; font-size:11px; }
  /* === ซ้าย (col1, span 2 แถว): ชื่อ(บน) + SKU(ล่าง) === */
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(1){ grid-column:1; grid-row:1 / span 2; min-width:0; display:flex; flex-direction:column; justify-content:space-between; gap:2px; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(1) .cell-main{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(1) .cell-sub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  /* === บรรทัด 1 ขวา: สถานะ === */
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(4){ grid-column:2 / 4; grid-row:1; justify-self:end; white-space:nowrap; }
  /* === บรรทัด 2: ที่เก็บ(กลาง) · คงเหลือ(ขวา) — ตรงแนว SKU === */
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(3){ grid-column:2; grid-row:2; justify-self:end; min-width:0; max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(2){ grid-column:3; grid-row:2; justify-self:end; text-align:right; font-weight:700; white-space:nowrap; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(2)::before{ content:"คงเหลือ "; font-size:9px; color:#64748B; font-weight:600; }
  /* === ปุ่ม: แถวล่างสุด พับในแถวได้ ไม่ล้น === */
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(5){ display:none; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td:nth-child(6){ grid-column:1 / 4; grid-row:3; display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:5px; }
  .pane-fluid--replenish .mp-tablewrap > .tbl > tbody > tr > td.rp-acts > *{ min-width:0; }
}
/* 🔧 สต๊อกคงเหลือ (StockOnHand, route stockcount) — รายการสินค้าคงเหลือ → การ์ดกระชับ 2 บรรทัดในช่อง split แคบ */
/* default (จอเดี่ยว/ตารางเต็ม): ซ่อนหมวด inline ในชื่อ (โชว์คอลัมน์หมวดปกติ) */
.sccat{ display:none; }
@container pane (max-width: 920px){
  .pane-fluid--stockcount .panel__bd--pad > .tbl{ display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > thead{ display:none; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody{ display:contents; }
  /* fixed grid: ชื่อ+หมวด(ยืด) · ยี่ห้อ · คงเหลือ · หน่วย · สถานะ (หมวด inline ในเซลล์ชื่อ — ไม่แยกคอลัมน์) */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr{
    display:grid;
    grid-template-columns:minmax(0,1.5fr) minmax(68px,1fr) 46px 40px 58px;
    align-items:center; column-gap:8px; row-gap:2px;
    padding:8px 12px; border-bottom:1px solid var(--line); width:100%; box-sizing:border-box;
  }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td{ border:none !important; padding:0; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:11px; }
  /* แถวรายละเอียดที่กางออก (colSpan=10) เต็มแถว */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr:has(td[colspan]){ display:block; padding:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td[colspan]{ white-space:normal; overflow:visible; }
  /* === บรรทัด 1: ชื่อ+หมวด(ยืด,span2) · ยี่ห้อ · คงเหลือ · หน่วย · สถานะ === */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(1){ grid-column:1; grid-row:1 / span 2; align-self:center; min-width:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(1) .cell-main{ min-width:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(1) .scname{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(1) .sccat{ display:inline; flex:none; font-size:11px; color:var(--ink-2); white-space:nowrap; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(1) .cell-sub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  /* ซ่อนคอลัมน์หมวดแยก (ใช้ inline ในชื่อแทน) */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td[data-sccat]{ display:none; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(3){ grid-column:2; grid-row:1; font-size:11px; }
  /* ยี่ห้อ+ป้าย alias บรรทัดเดียว (override inline flex-wrap) */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(3) > span{ flex-wrap:nowrap !important; min-width:0; overflow:hidden; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(3) > span > b{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(5){ grid-column:3; grid-row:1; font-weight:700; text-align:right; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(6){ grid-column:4; grid-row:1; color:var(--ink-2); }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(10){ grid-column:5; grid-row:1; justify-self:end; }
  /* === บรรทัด 2 (grid-row 2) — ที่เก็บ(ยืด) · ทุน(ขวา) === */
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(4){ grid-column:2 / 4; grid-row:2; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(4)::before{ content:"ที่เก็บ "; font-size:9px; color:#64748B; font-weight:600; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(7){ display:none; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(8){ grid-column:4 / 6; grid-row:2; text-align:right; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(8)::before{ content:"ทุน "; font-size:9px; color:#64748B; font-weight:600; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(9){ display:none; }
  .pane-fluid--stockcount .panel__bd--pad > .tbl > tbody > tr > td:nth-child(5) > div{ display:none; }
}
@container pane (max-width: 900px){
  .pane-fluid--marketing2 .panel__bd > .tbl{ display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--marketing2 .panel__bd > .tbl > thead{ display:none; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody{ display:contents; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr{
    display:flex; flex-wrap:wrap; align-items:center; column-gap:9px; row-gap:4px;
    padding:9px 12px; border-bottom:1px solid var(--line); width:100%; box-sizing:border-box;
  }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td{ display:flex; align-items:center; gap:5px; border:none !important; padding:0; min-width:0; white-space:nowrap; }
  /* === บรรทัด 1: ชื่อ+รหัส(ยืด) · ประเภท · ระยะเวลา · สถานะ · จัดการ === */
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(1){ order:1; flex:1 1 150px; min-width:120px; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(1) .cell-main{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(2){ order:2; flex:none; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(2) .promoitem__kind{ white-space:nowrap; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(4){ order:3; font-size:11.5px; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(6){ order:4; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(7){ order:5; margin-left:auto; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr::after{ content:""; flex-basis:100%; height:0; order:6; }
  /* === บรรทัด 2: เงื่อนไข(ยืดเต็ม) · สินค้าร่วม === */
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(3){ order:7; flex:1 1 100%; max-width:100%; min-width:0; white-space:normal; overflow:hidden; text-overflow:ellipsis; display:block; font-size:11.5px; color:var(--ink-2); }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(5){ order:8; font-size:11.5px; font-weight:700; }
  .pane-fluid--marketing2 .panel__bd > .tbl > tbody > tr > td:nth-child(5)::before{ content:"สินค้าร่วม "; font-size:9px; color:#64748B; font-weight:600; }
}
@container pane (max-width: 900px){
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl){ display:flex; flex-direction:column; width:100%; min-width:0; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > thead{ display:none; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody{ display:contents; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr{
    display:flex; flex-wrap:wrap; align-items:center; column-gap:9px; row-gap:3px;
    padding:8px 12px; border-bottom:1px solid var(--line); width:100%; box-sizing:border-box;
  }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td{ display:flex; align-items:center; gap:4px; border:none !important; padding:0; min-width:0; white-space:nowrap; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(1):last-child{ flex-basis:100%; }
  /* === บรรทัด 1: เลขที่ · รายการ(ยืด) · จำนวน · มูลค่า · สถานะ === */
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(1){ order:1; font-size:12px; font-weight:700; color:var(--navy-600); align-self:flex-start; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(3){ order:2; flex:1 1 130px; min-width:100px; align-self:flex-start; font-size:12px; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(3) .cell-sub{ white-space:nowrap; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(4){ order:3; font-weight:700; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(7){ order:4; font-weight:700; color:var(--navy-700); }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(8){ order:5; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr::after{ content:""; flex-basis:100%; height:0; order:6; }
  /* === บรรทัด 2: วันที่ · เบิกให้รถ/ทรัพย์สิน(ยืด) · ผู้เบิก · ดำเนินการ === */
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(2){ order:7; color:var(--dim); font-size:11.5px; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(5){ order:8; flex:1 1 90px; min-width:0; overflow:hidden; text-overflow:ellipsis; color:var(--ink-2); font-size:11.5px; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(6){ order:9; color:var(--ink-2); font-size:11.5px; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(6)::before{ content:"โดย "; font-size:9px; color:#64748B; font-weight:600; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tbody > tr > td:nth-child(9){ order:10; margin-left:auto; }
  /* tfoot สรุป */
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tfoot{ display:block; }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tfoot > tr{ display:flex; flex-wrap:wrap; align-items:center; gap:5px 12px; padding:9px 12px; background:var(--surface-2); }
  .pane-fluid--internaluse .panel__bd > .tbl:not(.rb-tbl) > tfoot > tr > td{ border:none !important; padding:0 !important; }
}
.oc-batch__main{ min-width:0; }
.oc-batch__main .oc-filrow{ margin-bottom:13px; }
.oc-ptbl{ width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.oc-ptbl th{ text-align:left; font-size:11px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px; padding:10px 12px; background:var(--surface-2); border-bottom:1px solid var(--line); white-space:nowrap; }
.oc-ptbl td{ padding:11px 12px; border-bottom:1px solid var(--line); font-size:12.5px; vertical-align:middle; }
.oc-ptbl tbody tr{ cursor:pointer; transition:background .12s; }
.oc-ptbl tbody tr:hover td{ background:var(--surface-2); }
.oc-ptbl tbody tr.is-sel td{ background:#fdf6e6; }
.oc-ptbl tbody tr:last-child td{ border-bottom:none; }
.oc-ck{ width:30px; text-align:center; }
.oc-ck input,.oc-allck input,.oc-docrow input,.oc-hrow input{ width:16px; height:16px; accent-color:var(--gold-600,#b8860b); cursor:pointer; }
.oc-no{ font-weight:700; color:var(--navy-600); white-space:nowrap; }
.oc-dim{ color:var(--dim); font-size:11.5px; white-space:nowrap; }

.oc-pickup{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; position:sticky; top:8px; }
.oc-pickup h3{ font-size:15px; font-weight:800; color:var(--navy-800); margin:0 0 4px; }
.oc-pickup__n{ font-size:12px; color:var(--dim); margin-bottom:12px; }
.oc-pcard{ border:1px solid var(--line); border-radius:11px; padding:13px; margin-bottom:12px; }
.oc-pcard__hd{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:9px; font-size:13px; color:var(--navy-800); }
.oc-addr{ font-size:12px; color:var(--ink-2,#41506b); line-height:1.55; background:var(--surface-2); border-radius:8px; padding:10px; margin-bottom:11px; }
.oc-pin{ display:inline-block; font-size:10px; font-weight:700; color:#c0392b; background:#fdecec; border-radius:5px; padding:1px 6px; }

/* ----- order detail drawer ----- */
.oc-drawer-wrap{ position:fixed; inset:0; z-index:340; display:flex; justify-content:flex-end; background:rgba(18,32,60,.42); animation:lmodIn .16s ease; }
.oc-drawer{ width:100%; max-width:440px; height:100%; background:var(--surface,#fff); display:flex; flex-direction:column; box-shadow:-12px 0 50px rgba(8,16,40,.25); animation:ocDrawerIn .22s cubic-bezier(.22,.61,.36,1); }
@keyframes ocDrawerIn{ from{ transform:translateX(40px); opacity:.4; } to{ transform:none; opacity:1; } }
.oc-drawer__hd{ display:flex; align-items:center; gap:10px; padding:15px 16px; border-bottom:1px solid var(--line); }
.oc-drawer__no{ font-size:13.5px; font-weight:800; color:var(--navy-800); margin-top:2px; }
.oc-drawer__x{ background:var(--surface-2); border:none; width:30px; height:30px; border-radius:9px; cursor:pointer; display:grid; place-items:center; color:var(--navy-700); }
.oc-drawer__x:hover{ background:var(--surface-3); }
.oc-drawer__bd{ flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:14px; }
.oc-tl{ display:flex; justify-content:space-between; gap:4px; background:var(--surface-2); border-radius:11px; padding:13px 10px; }
.oc-tlstep{ display:flex; flex-direction:column; align-items:center; gap:5px; flex:1; text-align:center; position:relative; }
.oc-tlstep:not(:last-child)::after{ content:""; position:absolute; top:13px; left:50%; width:100%; height:2px; background:var(--line-2); z-index:0; }
.oc-tlstep.is-done:not(:last-child)::after{ background:var(--ok,#3aa76d); }
.oc-tlstep__ic{ width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:#fff; border:2px solid var(--line-2); color:var(--dim); z-index:1; }
.oc-tlstep.is-done .oc-tlstep__ic{ background:var(--ok,#3aa76d); border-color:var(--ok,#3aa76d); color:#fff; }
.oc-tlstep.is-active .oc-tlstep__ic{ border-color:var(--gold-500); color:var(--gold-700,#a8741a); box-shadow:0 0 0 3px #fdf3e0; }
.oc-tlstep__lb{ font-size:10px; color:var(--dim); line-height:1.25; }
.oc-tlstep.is-done .oc-tlstep__lb,.oc-tlstep.is-active .oc-tlstep__lb{ color:var(--navy-700); font-weight:700; }
.oc-dsec{ border:1px solid var(--line); border-radius:12px; padding:12px 13px; }
.oc-dsec__t{ font-size:12px; font-weight:800; color:var(--navy-800); margin-bottom:9px; }
.oc-drow{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; font-size:12.5px; padding:4px 0; }
.oc-drow>span{ color:var(--dim); flex:none; }
.oc-drow>b{ color:var(--ink); font-weight:600; }
.oc-drow--tot{ border-top:1px dashed var(--line-2); margin-top:6px; padding-top:9px; font-size:14px; }
.oc-drow--tot b{ color:var(--navy-800); font-weight:800; }
.oc-ditem{ display:flex; align-items:center; gap:10px; padding:7px 0; border-top:1px solid var(--line); }
.oc-ditem:first-of-type{ border-top:none; }
.oc-ditem__m{ flex:1; min-width:0; }
.oc-ditem__n{ font-size:12.5px; font-weight:600; color:var(--ink); line-height:1.3; }
.oc-ditem__s{ font-size:11px; color:var(--dim); margin-top:1px; }
.oc-ditem>b{ font-size:12.5px; font-weight:700; color:var(--navy-800); white-space:nowrap; }
.oc-cap{ border:1px solid var(--line); border-radius:12px; padding:12px 13px; }
.oc-cap--full{ border-color:#bfe3cf; background:#f4fbf7; }
.oc-cap--partial{ border-color:#f0d089; background:#fffdf6; }
.oc-cap--limited{ border-color:#f3c9c9; background:#fdf6f6; }
.oc-cap__hd{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--navy-800); }
.oc-cap__badge{ display:inline-block; font-size:11px; font-weight:700; margin:8px 0 10px; padding:4px 10px; border-radius:7px; background:#fff; border:1px solid var(--line); color:var(--ink-2,#41506b); }
.oc-caplists{ display:flex; flex-direction:column; gap:11px; }
.oc-caplist__h{ font-size:11.5px; font-weight:800; margin-bottom:4px; }
.oc-caplist__h--ok{ color:var(--ok-ink,#1f7a52); }
.oc-caplist__h--no{ color:#b9821b; }
.oc-capli{ font-size:11.5px; color:var(--ink-2,#41506b); padding:2px 0 2px 14px; position:relative; line-height:1.4; }
.oc-capli::before{ content:"·"; position:absolute; left:4px; color:var(--dim); }
.oc-drawer__ft{ display:flex; gap:9px; padding:13px 16px; border-top:1px solid var(--line); background:var(--surface-2); }
.oc-dbtn{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; font-family:var(--ff); font-size:13px; font-weight:700; border-radius:10px; padding:11px 12px; cursor:pointer; border:1px solid transparent; }
.oc-dbtn--ghost{ background:#fff; border-color:var(--line-2); color:var(--navy-700); flex:0 0 auto; }
.oc-dbtn--ghost:hover{ border-color:var(--navy-400,#aebfdb); }
.oc-dbtn--plat{ color:#fff; }
.oc-dbtn--plat:hover{ filter:brightness(1.06); }
@media (max-width:560px){ .oc-drawer{ max-width:100%; } }
.oc-field{ display:flex; flex-direction:column; gap:5px; margin-bottom:10px; }
.oc-field>span{ font-size:11.5px; color:var(--dim); }
.oc-field input{ font-family:var(--ff); font-size:12.5px; border:1px solid var(--line-2); border-radius:8px; padding:8px 10px; outline:none; color:var(--ink); }
.oc-note{ font-size:11px; color:var(--dim); line-height:1.5; margin:0 0 11px; }

/* docs subtab */
.oc-docs{ display:flex; flex-direction:column; }
.oc-docbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; background:var(--surface-2); border:1px solid var(--line); border-radius:11px; margin-bottom:10px; }
.oc-docbar__r{ display:flex; gap:8px; }
.oc-allck{ display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:600; color:var(--ink); cursor:pointer; }
.oc-allck--sm{ font-size:11.5px; font-weight:500; color:var(--dim); margin-left:auto; }
.oc-docrow,.oc-hrow{ display:flex; align-items:center; gap:11px; padding:10px 14px; border:1px solid var(--line); border-radius:11px; background:#fff; cursor:pointer; }
.oc-docrow.is-sel,.oc-hrow.is-sel{ border-color:var(--gold-500); background:#fffdf5; }
.oc-docrow__main,.oc-hrow__main{ display:flex; flex-direction:column; gap:1px; flex:1; min-width:0; }
.oc-docrow__main b,.oc-hrow__main b{ font-size:12.5px; color:var(--navy-700); }
.oc-docrow__main span,.oc-hrow__main span{ font-size:11px; color:var(--dim); }

/* handover */
.oc-hint{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--dim); margin:0 0 14px; }
.oc-hgroup{ border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:12px; background:#fff; }
.oc-hgroup__hd{ display:flex; align-items:center; gap:9px; padding:10px 14px; background:var(--surface-2); border-bottom:1px solid var(--line); font-size:13px; color:var(--navy-800); }
.oc-carrierdot{ width:10px; height:10px; border-radius:3px; flex:none; }
.oc-hlist{ display:flex; flex-direction:column; }
.oc-hrow{ border:none; border-bottom:1px solid var(--line); border-radius:0; }
.oc-hrow:last-child{ border-bottom:none; }
.oc-awb{ font-size:11.5px; color:var(--navy-600); font-weight:700; }

/* returns */
.oc-order--ret .oc-order__hd{ background:#fdf3f3; }
.oc-reason{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2,#41506b); }
.oc-done{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; color:var(--ok-ink,#1f7a52); }
.oc-done--no{ color:var(--dim); }

@media (max-width:1180px){
  .oc{ grid-template-columns:1fr; }
  .oc-side{ flex-direction:row; flex-wrap:wrap; position:static; }
  .oc-side__item{ width:auto; }
  .oc-batch{ grid-template-columns:1fr; }
  .oc-pickup{ position:static; }
}

/* ================= สินค้าเฝ้าระวัง (watch) · .watch-* ================= */
.pghdbtn--watch.is-on{ background:#fdf3e0; border-color:#f0d089; color:#b9821b; }
.pghdbtn--watch.is-on:hover{ background:#fbe9c8; }
.watchbadge{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:#9a6a12; background:#fdf3e0; border:1px solid #f0d089; border-radius:7px; padding:2px 8px; cursor:pointer; }
.watchbadge:hover{ background:#fbe9c8; }
.watchbadge b{ color:#b9821b; text-decoration:underline; font-weight:800; margin-left:2px; }

/* editor modal */
.watch-modal{ width:100%; max-width:520px; background:#fff; border-radius:18px; box-shadow:0 24px 70px rgba(8,16,40,.3); overflow:hidden; display:flex; flex-direction:column; max-height:90vh; }
.watch-modal__hd{ display:flex; align-items:center; gap:12px; padding:16px 18px; background:linear-gradient(120deg,#b9821b,#d99a2b); color:#fff; }
.watch-modal__ic{ width:38px; height:38px; border-radius:11px; flex:none; display:grid; place-items:center; background:rgba(255,255,255,.18); }
.watch-modal__hd h3{ margin:0; font-size:16px; font-weight:800; }
.watch-modal__sub{ font-size:12px; opacity:.92; margin-top:2px; }
.watch-modal__sub .mono{ font-weight:700; }
.watch-modal__x{ background:rgba(255,255,255,.16); border:none; color:#fff; width:30px; height:30px; border-radius:9px; cursor:pointer; display:grid; place-items:center; }
.watch-modal__x:hover{ background:rgba(255,255,255,.28); }
.watch-modal__bd{ padding:16px 18px; overflow-y:auto; display:flex; flex-direction:column; gap:13px; }
.watch-intro{ display:flex; align-items:flex-start; gap:7px; font-size:12px; color:var(--ink-2,#41506b); line-height:1.5; margin:0; background:var(--surface-2); border-radius:9px; padding:9px 11px; }
.watch-trig{ display:flex; gap:8px; flex-wrap:wrap; margin-top:-3px; }
.watch-trig__i{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--navy-700); background:#fff; border:1px solid var(--line); border-radius:8px; padding:6px 11px; }
.watch-sec{ border:1px solid var(--line); border-radius:12px; padding:11px 12px; transition:.13s; }
.watch-sec.is-on{ border-color:#f0d089; background:#fffdf6; }
.watch-sec__hd{ display:flex; align-items:center; gap:10px; cursor:pointer; color:var(--ink); margin-bottom:10px; }
.watch-sec__hd input{ width:18px; height:18px; accent-color:#d99a2b; cursor:pointer; flex:none; }
.watch-sec__ic{ width:34px; height:34px; border-radius:10px; flex:none; display:grid; place-items:center; background:#fdf3e0; }
.watch-sec__titles{ display:flex; flex-direction:column; gap:1px; flex:1; min-width:0; }
.watch-sec__titles b{ font-size:13.5px; color:var(--ink); }
.watch-sec__titles span{ font-size:11.5px; color:var(--dim); line-height:1.4; }
.watch-sec__tag{ font-size:10.5px; font-weight:700; color:#9a6a12; background:#fdf3e0; border-radius:6px; padding:2px 8px; }
.watch-ta{ width:100%; font-family:var(--ff); font-size:12.5px; line-height:1.55; color:var(--ink); border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; outline:none; resize:vertical; box-sizing:border-box; }
.watch-ta:focus{ border-color:#d99a2b; }
.watch-ta:disabled{ background:var(--surface-2); color:var(--dim); cursor:not-allowed; }
.watch-modal__ft{ display:flex; align-items:center; gap:9px; padding:13px 18px; border-top:1px solid var(--line); background:var(--surface-2); }
.watch-btn{ display:inline-flex; align-items:center; gap:6px; font-family:var(--ff); font-size:13px; font-weight:700; border-radius:10px; padding:9px 16px; cursor:pointer; border:1px solid transparent; }
.watch-btn--ghost{ background:#fff; border-color:var(--line-2); color:var(--navy-700); }
.watch-btn--ghost:hover{ border-color:var(--navy-400,#aebfdb); }
.watch-btn--save{ background:linear-gradient(120deg,#b9821b,#d99a2b); color:#fff; }
.watch-btn--save:hover{ filter:brightness(1.05); }
.watch-btn--rm{ background:#fdecec; border-color:#f3c9c9; color:#b42318; }
.watch-btn--rm:hover{ background:#fbdcdc; }

/* alert popup */
.watch-pop-wrap{ position:fixed; inset:0; z-index:360; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(18,32,60,.5); animation:lmodIn .16s ease; }
.watch-pop{ width:100%; max-width:480px; background:#fff; border-radius:18px; box-shadow:0 30px 80px rgba(8,16,40,.4); overflow:hidden; display:flex; flex-direction:column; max-height:88vh; border-top:5px solid #d99a2b; }
.watch-pop__hd{ display:flex; align-items:center; gap:12px; padding:16px 18px 12px; }
.watch-pop__ic{ width:40px; height:40px; border-radius:12px; flex:none; display:grid; place-items:center; background:linear-gradient(120deg,#b9821b,#d99a2b); color:#fff; }
.watch-pop__hd h3{ margin:0; font-size:16px; font-weight:800; color:var(--navy-800); }
.watch-pop__sub{ font-size:12px; color:var(--dim); margin-top:2px; line-height:1.4; }
.watch-pop__bd{ padding:4px 18px 8px; overflow-y:auto; display:flex; flex-direction:column; gap:9px; }
.watch-item{ border:1px solid #f0d089; background:#fffdf6; border-radius:11px; padding:11px 13px; }
.watch-item__name{ display:flex; align-items:center; gap:6px; font-size:13.5px; font-weight:700; color:var(--navy-800); margin-bottom:5px; }
.watch-item__note{ font-size:12.5px; color:var(--ink-2,#41506b); line-height:1.55; }
.watch-item__note--none{ color:var(--dim); font-style:italic; }
.watch-pop__ft{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 18px; border-top:1px solid var(--line); }
.watch-pop__cnt{ font-size:12px; color:var(--dim); }

/* ===== Dashboard entrance motion (เล่นตอนเข้าเมนูแดชบอร์ด) ===== */
@keyframes dviewUp{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }
@keyframes dviewFade{ from{ opacity:0; } to{ opacity:1; } }
@media (prefers-reduced-motion:no-preference){
  .dview-anim .dgrid-kpi>*, .dview-anim .an-kpis>*, .dview-anim .kpi,
  .dview-anim .panel, .dview-anim .dcards>*, .dview-anim .dcardrow>* {
    animation: dviewUp .52s cubic-bezier(.22,.61,.36,1) both;
  }
  /* KPI stagger */
  .dview-anim .dgrid-kpi>*:nth-child(1), .dview-anim .an-kpis>*:nth-child(1){ animation-delay:.03s; }
  .dview-anim .dgrid-kpi>*:nth-child(2), .dview-anim .an-kpis>*:nth-child(2){ animation-delay:.09s; }
  .dview-anim .dgrid-kpi>*:nth-child(3), .dview-anim .an-kpis>*:nth-child(3){ animation-delay:.15s; }
  .dview-anim .dgrid-kpi>*:nth-child(4), .dview-anim .an-kpis>*:nth-child(4){ animation-delay:.21s; }
  .dview-anim .dgrid-kpi>*:nth-child(5), .dview-anim .an-kpis>*:nth-child(5){ animation-delay:.27s; }
  .dview-anim .dgrid-kpi>*:nth-child(n+6), .dview-anim .an-kpis>*:nth-child(n+6){ animation-delay:.33s; }
  /* panels come in a touch later */
  .dview-anim .panel{ animation-delay:.26s; }
  .dview-anim .panel:nth-of-type(2){ animation-delay:.34s; }
  .dview-anim .panel:nth-of-type(n+3){ animation-delay:.4s; }
  /* bars / progress grow on entrance */
  .dview-anim .kpi__spark, .dview-anim .an-kpi__spark{ animation: dviewFade .8s ease .35s both; }
}
/* KPI hover-lift (ลูกเล่นเวลาเอาเมาส์ชี้) */
.dview-anim .kpi, .dview-anim .an-kpi{ transition: transform .16s ease, box-shadow .16s ease; }
.dview-anim .kpi:hover, .dview-anim .an-kpi:hover{ transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(16,32,72,.32); }
.mirrornote{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== Smooth <select> dropdown (ทั้งระบบ) ===== */
.bpysel-pop{ position:fixed; z-index:400; background:var(--surface,#fff); border:1px solid var(--line-2); border-radius:11px; box-shadow:0 18px 44px -14px rgba(8,16,40,.42); padding:5px; overflow-y:auto; font-family:var(--ff); transform-origin:top center;
  animation: bpyselIn .19s cubic-bezier(.22,.61,.36,1) both; }
.bpysel-pop.bpysel-pop--up{ transform-origin:bottom center; animation-name: bpyselInUp; }
@keyframes bpyselIn{ from{ transform:translateY(-9px) scale(.985); } to{ transform:none; } }
@keyframes bpyselInUp{ from{ transform:translateY(9px) scale(.985); } to{ transform:none; } }
.bpysel-pop--out{ animation: bpyselOut .12s ease both; }
@keyframes bpyselOut{ to{ opacity:0; transform:translateY(-5px); } }
.bpysel-opt{ display:block; width:100%; text-align:left; border:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); padding:8px 13px; border-radius:8px; cursor:pointer; white-space:nowrap; line-height:1.35; }
.bpysel-opt:hover{ background:var(--surface-2); }
.bpysel-opt.is-hi:not(.is-sel){ background:var(--surface-3,#e9eef7); }
.bpysel-opt.is-sel{ background:var(--navy-700); color:#fff; font-weight:700; }
.bpysel-opt.is-sel:hover{ background:var(--navy-800,#16294f); }
.bpysel-opt.is-dis{ color:var(--line-2); cursor:default; }
.bpysel-grp{ font-size:10.5px; font-weight:800; color:var(--dim); text-transform:uppercase; letter-spacing:.4px; padding:7px 13px 3px; }

/* 🏠 โหมดคลัง บจก.บูรพายนต์ (WH-02) — ซ่อนป้าย Y/N (taxside) ทั้งระบบ */
.wh-bjk .taxside{ display:none !important; }
/* ซ่อนแบนเนอร์เส้นทางสต๊อก (สต๊อกเข้า 2 คลัง — BPYB2 + บจก.) เมื่ออยู่โหมด บจก.บูรพายนต์ (🏠) */
.wh-bjk .grwh{ display:none !important; }
.wh-bjk .ynflag{ display:none !important; }
/* ซ่อนคอลัมน์ Y/N ในตารางรายการสินค้า (สมุดเอกสาร) */
.wh-bjk .itbl th:nth-child(3), .wh-bjk .itbl td:nth-child(3){ display:none !important; }
/* ซ่อนตัวกรอง/ป้าย Y·มีภาษี ในจอลูกหนี้/เจ้าหนี้/ใบสำคัญ/วางบิล */
.wh-bjk .taxtabs{ display:none !important; }
.wh-bjk .taxpill{ display:none !important; }
/* ซ่อนคอลัมน์ Y/N ในตารางที่ทำเครื่องหมาย ynhide-col (คืนของ ฯลฯ) */
.wh-bjk .ynhide-col th:nth-child(3), .wh-bjk .ynhide-col td:nth-child(3){ display:none !important; }
.bpysel-opt--ingrp{ padding-left:20px; }
@media (prefers-reduced-motion:reduce){ .bpysel-pop{ animation:none; } }

/* ===== Empty state / Skeleton (ใช้ทั้งระบบ) ===== */
.dempty{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; padding:48px 22px; text-align:center; }
.dempty--sm{ padding:28px 18px; }
.dempty__ic{ width:64px; height:64px; border-radius:18px; display:grid; place-items:center; background:var(--surface-2); }
.dempty--sm .dempty__ic{ width:50px; height:50px; border-radius:14px; }
.dempty__t{ font-size:14px; font-weight:700; color:var(--ink-2,#41506b); }
.dempty__h{ font-size:12px; color:var(--dim); max-width:340px; line-height:1.5; }
.dempty__a{ margin-top:6px; }
.dskel{ display:flex; flex-direction:column; gap:8px; padding:4px 0; }
.dskel__row{ border-radius:10px; background:linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3,#e9eef7) 50%, var(--surface-2) 70%); background-size:200% 100%; animation:bpyShimmer 1.3s ease-in-out infinite; }
@keyframes bpyShimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }
@media (prefers-reduced-motion:reduce){ .dskel__row{ animation:none; } }

/* ===== Connection status badge (จอออนไลน์) ===== */
.connstrip{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.connstrip__lb{ font-size:11.5px; color:var(--dim); margin-right:2px; }
.connbadge{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; border:1px solid transparent; white-space:nowrap; }
.connbadge b{ font-weight:800; margin-right:1px; }
.connbadge__dot{ width:7px; height:7px; border-radius:50%; flex:none; }
.connbadge--full{ background:#f0fbf5; border-color:#bfe3cf; color:#1f7a52; }
.connbadge--partial{ background:#fffaf0; border-color:#f0d089; color:#9a6a12; }
.connbadge--limited{ background:#fdf3f3; border-color:#f0c0c0; color:#b42318; }
.connbadge--sm{ font-size:10.5px; padding:2px 8px; }

/* ====================================================================
   Global motion layer — smooth "Apple-like" feel ทั้งระบบ
   (opacity-only view fade เพื่อไม่ทำลาย position:sticky/fixed)
   ==================================================================== */
:root{ --ease-smooth: cubic-bezier(.32,.72,.34,1); --ease-out: cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion:no-preference){
  /* เนื้อหาเฟดเข้านุ่ม ๆ ทุกครั้งที่เปลี่ยนเมนู (Screen remount ด้วย key=view) */
  .dcontent > *{ animation: bpyViewFade .34s var(--ease-smooth) both; }
  @keyframes bpyViewFade{ from{ opacity:0; } to{ opacity:1; } }
  /* โมดอล/ดรอปดาวน์เด้งเข้านุ่ม */
  .dmodal, .impmodal__panel, .pospromo-modal, .watch-modal, .watch-pop, .oc-drawer, .cxmodal,
  .notifpop, .cxpop, .gsearch__drop, .psearch__drop, .qdrop, .billpick__drop, .cutsel__dd, .svcp-supdd, .an-rangepop{
    animation: bpyPop .2s var(--ease-out) both;
  }
  @keyframes bpyPop{ from{ opacity:0; transform:translateY(8px) scale(.985); } to{ opacity:1; transform:none; } }
}
/* smooth scroll */
.dcontent{ scroll-behavior:smooth; }
/* micro-interactions — transition + กดแล้วยุบเล็กน้อย */
.btn, .dchip, .oc-chip, .oc-tab, .oc-chbtn, .oc-side__item, .cxtab, .pghdbtn,
.intg-btn, .intg-gear, .qcat, .scr-chip, .oc-link, .oc-dbtn, .watch-btn, .sf-btn,
.kpi, .an-kpi, .panel, .intg-card, .oc-order, .car-card, .cxconvo, .ci-segcard{
  transition: transform .16s var(--ease-smooth), background-color .16s ease, border-color .16s ease, box-shadow .18s ease, color .16s ease, opacity .16s ease;
}
.btn:active, .dchip:active, .oc-chip:active, .oc-chbtn:active, .oc-tab:active,
.pghdbtn:active, .intg-btn:active, .intg-gear:active, .oc-dbtn:active, .watch-btn:active, .oc-side__item:active{
  transform: scale(.955);
}
/* การ์ดยกตัวนุ่ม ๆ เวลาชี้ (เฉพาะการ์ดที่กดได้) */
.intg-card:hover, .oc-order:hover{ transform: translateY(-2px); box-shadow: 0 12px 28px -16px rgba(16,32,72,.28); }

/* ===== ย่อ/ขยาย รายการสินค้า (POS browse + แฟ้มสินค้า/สมุดเอกสาร) — สไลด์ 2 ทาง นุ่มทั้งย่อ-ขยาย ===== */
@media (prefers-reduced-motion:no-preference){
  .pw__main .search2box, .pw__main .posbrowse, .docreg .docreg__tbl{
    transition: opacity .28s var(--ease-smooth), transform .3s var(--ease-out);
    transform-origin:top center; will-change:opacity, transform;
  }
  /* ขยาย = เห็นเต็ม */
  .pw__main:not(.pw__main--collapsed) .search2box,
  .pw__main:not(.pw__main--collapsed) .posbrowse,
  .docreg:not(.docreg--collapsed) .docreg__tbl{ opacity:1; transform:none; max-height:none; }
  /* ย่อ (หุบ) = เฟดออก + ยุบความสูงจริง (กันเหลือกล่องว่าง) */
  .pw__main--collapsed .search2box,
  .pw__main--collapsed .posbrowse,
  .docreg--collapsed .docreg__tbl{ opacity:0; max-height:0; overflow:hidden; padding:0; border:0; transform:translateY(-8px); pointer-events:none; }
}
/* ย่อ "รายการสินค้า" (แฟ้มสินค้า) = ไม่หุบจนหาย — เก็บโชว์ ~4 รายการ + เลื่อนดูเพิ่มได้
   (เฉพาะ .docreg ของแฟ้มสินค้า · ไม่กระทบ POS browse .pw__main--collapsed) */
.docreg--collapsed .docreg__tbl{
  opacity:1 !important; max-height:180px !important; overflow:auto !important;
  padding:0 !important; border:0; transform:none !important; pointer-events:auto !important;
}
/* ลูกศร ▾ หมุนนุ่มตอนกดย่อ/ขยาย */
.browsebar__tg, .docreg__tg{ transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.browsebar__tg svg, .docreg__tg svg{ transition: transform .26s var(--ease-smooth); }
/* พื้นที่ panel ปรับขนาดนุ่มเวลาย่อ/ขยาย */
/* พื้นที่ panel — ไม่ transition flex (ทำให้กระตุก); ให้เนื้อหาสไลด์เข้าแทน */

/* ===== รายงานแชต — KPI การ์ดไม่ให้ตัวเลขล้น ===== */
.cxrep-kpi{ gap:12px; }
.cxrep-kpi .kpi{ padding:13px 14px 12px; }
.cxrep-kpi .kpi__k{ padding-right:0; white-space:nowrap; font-size:12px; }
.cxrep-kpi .kpi__v{ font-size:19px; padding-right:0; white-space:nowrap; margin-top:5px; overflow:hidden; text-overflow:ellipsis; }
.cxrep-kpi .kpi__v small{ font-size:11px; margin-left:3px; }
@media (max-width:560px){ .cxrep-kpi{ grid-template-columns:1fr 1fr; } }
/* แถวกรองแชตเป็น dropdown 2 ช่อง */
.cxchanrow{ display:flex; gap:8px; }
.cxchanrow .cxchansel{ flex:1; min-width:0; }

/* ===== ซ่อนแถบเลื่อนในป๊อปอัป/โมดอล/ดรอปดาวน์ทั้งหมด (ยังเลื่อนได้) ===== */
.impmodal, .impmodal *,
.dmodal, .dmodal *, .dmodal-wrap, .dmodal-wrap *,
.lmod, .lmod *,
.pospromo-modal, .pospromo-modal *,
.watch-modal, .watch-modal *, .watch-pop-wrap, .watch-pop-wrap *,
.oc-drawer-wrap, .oc-drawer-wrap *,
.cxmodal, .cxmodal *,
.sheet, .sheet *,
.notifpop, .notifpop *, .cxpop, .cxpop *,
.gsearch__drop, .psearch__drop, .qdrop, .billpick__drop, .cutsel__dd, .svcp-supdd, .svcp-matches, .srv-addlist, .scr-cand, .grpolist, .bnpicklist {
  scrollbar-width: none; -ms-overflow-style: none;
}
.impmodal::-webkit-scrollbar, .impmodal *::-webkit-scrollbar,
.dmodal::-webkit-scrollbar, .dmodal *::-webkit-scrollbar, .dmodal-wrap::-webkit-scrollbar, .dmodal-wrap *::-webkit-scrollbar,
.lmod::-webkit-scrollbar, .lmod *::-webkit-scrollbar,
.pospromo-modal::-webkit-scrollbar, .pospromo-modal *::-webkit-scrollbar,
.watch-modal::-webkit-scrollbar, .watch-modal *::-webkit-scrollbar, .watch-pop-wrap *::-webkit-scrollbar,
.oc-drawer-wrap::-webkit-scrollbar, .oc-drawer-wrap *::-webkit-scrollbar,
.cxmodal::-webkit-scrollbar, .cxmodal *::-webkit-scrollbar,
.sheet::-webkit-scrollbar, .sheet *::-webkit-scrollbar,
.notifpop::-webkit-scrollbar, .notifpop *::-webkit-scrollbar, .cxpop::-webkit-scrollbar, .cxpop *::-webkit-scrollbar,
.gsearch__drop::-webkit-scrollbar, .psearch__drop::-webkit-scrollbar, .qdrop::-webkit-scrollbar, .billpick__drop::-webkit-scrollbar, .cutsel__dd::-webkit-scrollbar, .svcp-supdd::-webkit-scrollbar, .svcp-matches::-webkit-scrollbar, .srv-addlist::-webkit-scrollbar, .scr-cand::-webkit-scrollbar, .grpolist::-webkit-scrollbar, .bnpicklist::-webkit-scrollbar {
  width:0; height:0; display:none;
}

/* Owner-approved 2026-09-25: visible scrollbar only in bill history. */
.dmodal.doc-history-modal .doc-history-scroll {
  overflow-y:scroll; scrollbar-gutter:stable; scrollbar-width:auto;
  scrollbar-color:var(--dim) var(--surface-2); -ms-overflow-style:auto;
}
.dmodal.doc-history-modal .doc-history-scroll::-webkit-scrollbar {
  width:12px; height:12px; display:block;
}
.dmodal.doc-history-modal .doc-history-scroll::-webkit-scrollbar-track {
  background:var(--surface-2);
}
.dmodal.doc-history-modal .doc-history-scroll::-webkit-scrollbar-thumb {
  background:var(--dim); border:3px solid var(--surface-2); border-radius:8px;
}
/* End owner-approved bill history scrollbar. */

/* ====================================================================
   ⭐ เว็บร้าน (storefront) — Motion: scroll-reveal + stagger + hover polish
   JS: SFFront useLayoutEffect ติด .sf-reveal แล้ว IntersectionObserver เติม .is-in
   ==================================================================== */
@media (prefers-reduced-motion:no-preference){
  .sfsite .sf-reveal{ opacity:0; transform:translateY(24px); transition:opacity .6s var(--ease-out), transform .72s var(--ease-out); will-change:opacity, transform; }
  .sfsite .sf-reveal.is-in{ opacity:1; transform:none; }

  /* hero — ข้อความไล่ขึ้นทีละชิ้น + ป้ายสถิติตามมา */
  .sf-hero.is-in .sf-hero__tx > *{ animation:sfRise .62s var(--ease-out) backwards; }
  .sf-hero.is-in .sf-hero__tx > *:nth-child(1){ animation-delay:.05s; }
  .sf-hero.is-in .sf-hero__tx > *:nth-child(2){ animation-delay:.12s; }
  .sf-hero.is-in .sf-hero__tx > *:nth-child(3){ animation-delay:.19s; }
  .sf-hero.is-in .sf-hero__tx > *:nth-child(4){ animation-delay:.26s; }
  .sf-hero.is-in .sf-hb{ animation:sfRise .6s var(--ease-out) backwards; }
  .sf-hero.is-in .sf-hb:nth-child(1){ animation-delay:.22s; }
  .sf-hero.is-in .sf-hb:nth-child(2){ animation-delay:.3s; }
  .sf-hero.is-in .sf-hb:nth-child(3){ animation-delay:.38s; }

  /* trust bar — ไอคอนความน่าเชื่อถือไล่เข้า */
  .sf-trustbar.is-in .sf-trust2{ animation:sfRise .55s var(--ease-out) backwards; }
  .sf-trustbar.is-in .sf-trust2:nth-child(1){ animation-delay:.04s; }
  .sf-trustbar.is-in .sf-trust2:nth-child(2){ animation-delay:.12s; }
  .sf-trustbar.is-in .sf-trust2:nth-child(3){ animation-delay:.2s; }
  .sf-trustbar.is-in .sf-trust2:nth-child(4){ animation-delay:.28s; }

  /* การ์ดสินค้า / โลโก้รถ / แบรนด์อะไหล่ — cascade เข้าทีละใบ */
  .sfsite .sf-reveal.is-in .sf-grid > *,
  .sfsite .sf-reveal.is-in .sf-cars > *,
  .sfsite .sf-reveal.is-in .sf-partners > *{ animation:sfPop .5s var(--ease-out) backwards; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(1),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(1),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(1){ animation-delay:.03s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(2),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(2),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(2){ animation-delay:.06s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(3),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(3),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(3){ animation-delay:.09s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(4),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(4),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(4){ animation-delay:.12s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(5),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(5),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(5){ animation-delay:.15s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(6),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(6),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(6){ animation-delay:.18s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(7),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(7),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(7){ animation-delay:.21s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(8),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(8),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(8){ animation-delay:.24s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(9),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(9),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(9){ animation-delay:.27s; }
  .sfsite .sf-reveal.is-in .sf-grid > *:nth-child(n+10),.sfsite .sf-reveal.is-in .sf-cars > *:nth-child(n+10),.sfsite .sf-reveal.is-in .sf-partners > *:nth-child(n+10){ animation-delay:.3s; }
}
@keyframes sfRise{ from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:none; } }
@keyframes sfPop{ from{ opacity:0; transform:translateY(13px) scale(.985); } to{ opacity:1; transform:none; } }

/* hover polish — โลโก้/ไอคอนตอบสนองนุ่ม ๆ */
.sf-carbrand__logo img, .sf-partner__logo img{ transition:transform .22s var(--ease-smooth); }
.sf-carbrand:hover .sf-carbrand__logo img, .sf-partner:hover .sf-partner__logo img{ transform:scale(1.07); }
.sf-trust2__ic{ transition:transform .22s var(--ease-smooth); }
.sf-trustbar .sf-trust2:hover .sf-trust2__ic{ transform:scale(1.1) rotate(-4deg); }
.sf-card__img img{ transition:transform .35s var(--ease-smooth); }
.sf-card:hover .sf-card__img img{ transform:scale(1.05); }
@media (prefers-reduced-motion:reduce){
  .sfsite .sf-reveal{ opacity:1 !important; transform:none !important; }
  .sf-card:hover .sf-card__img img, .sf-carbrand:hover .sf-carbrand__logo img, .sf-partner:hover .sf-partner__logo img{ transform:none; }
}

/* ====================================================================
   ⭐ เว็บร้าน หลังร้าน 3 หน้า (หลังร้าน/สินค้าบนเว็บ/ปรับแต่งเว็บ) — Motion
   StoreWebsiteD ครอบ <div.sfadmin-anim key={side}> → remount ทุกครั้งที่สลับแท็บ → animation วิ่งใหม่
   ==================================================================== */
@media (prefers-reduced-motion:no-preference){
  /* บล็อกหลัก — ไล่ขึ้นทีละก้อน */
  .sfadmin-anim .sfb-head,
  .sfadmin-anim .sfb-orders,
  .sfadmin-anim .sfp-hd,
  .sfadmin-anim .sfp-filt,
  .sfadmin-anim .sfe-note{ animation:sfRise .5s var(--ease-out) backwards; }
  .sfadmin-anim .sfb-head{ animation-delay:.02s; }
  .sfadmin-anim .sfb-orders{ animation-delay:.16s; }
  .sfadmin-anim .sfp-hd{ animation-delay:.02s; }
  .sfadmin-anim .sfp-filt{ animation-delay:.08s; }

  /* KPI หลังร้าน — pop ไล่ */
  .sfadmin-anim .sfb-kpi{ animation:sfPop .46s var(--ease-out) backwards; }
  .sfadmin-anim .sfb-kpi:nth-child(1){ animation-delay:.05s; }
  .sfadmin-anim .sfb-kpi:nth-child(2){ animation-delay:.11s; }
  .sfadmin-anim .sfb-kpi:nth-child(3){ animation-delay:.17s; }
  .sfadmin-anim .sfb-kpi:nth-child(4){ animation-delay:.23s; }
  .sfadmin-anim .sfb-kpi:nth-child(5){ animation-delay:.29s; }

  /* กลุ่มเครื่องมือ + การ์ดเครื่องมือ + ขนส่ง — ไล่เข้า */
  .sfadmin-anim .sfb-grp{ animation:sfRise .5s var(--ease-out) backwards; animation-delay:.22s; }
  .sfadmin-anim .sfb-grp:nth-of-type(2){ animation-delay:.3s; }
  .sfadmin-anim .sf-admincards > *,
  .sfadmin-anim .sfb-carriers > *{ animation:sfPop .44s var(--ease-out) backwards; }
  .sfadmin-anim .sf-admincards > *:nth-child(1),.sfadmin-anim .sfb-carriers > *:nth-child(1){ animation-delay:.26s; }
  .sfadmin-anim .sf-admincards > *:nth-child(2),.sfadmin-anim .sfb-carriers > *:nth-child(2){ animation-delay:.3s; }
  .sfadmin-anim .sf-admincards > *:nth-child(3),.sfadmin-anim .sfb-carriers > *:nth-child(3){ animation-delay:.34s; }
  .sfadmin-anim .sf-admincards > *:nth-child(4),.sfadmin-anim .sfb-carriers > *:nth-child(4){ animation-delay:.38s; }
  .sfadmin-anim .sf-admincards > *:nth-child(n+5),.sfadmin-anim .sfb-carriers > *:nth-child(n+5){ animation-delay:.42s; }

  /* การ์ดสินค้าบนเว็บ — cascade (cap) */
  .sfadmin-anim .sfp-grid > *{ animation:sfPop .46s var(--ease-out) backwards; }
  .sfadmin-anim .sfp-grid > *:nth-child(1){ animation-delay:.04s; }
  .sfadmin-anim .sfp-grid > *:nth-child(2){ animation-delay:.08s; }
  .sfadmin-anim .sfp-grid > *:nth-child(3){ animation-delay:.12s; }
  .sfadmin-anim .sfp-grid > *:nth-child(4){ animation-delay:.16s; }
  .sfadmin-anim .sfp-grid > *:nth-child(5){ animation-delay:.2s; }
  .sfadmin-anim .sfp-grid > *:nth-child(6){ animation-delay:.24s; }
  .sfadmin-anim .sfp-grid > *:nth-child(7){ animation-delay:.28s; }
  .sfadmin-anim .sfp-grid > *:nth-child(8){ animation-delay:.32s; }
  .sfadmin-anim .sfp-grid > *:nth-child(n+9){ animation-delay:.36s; }

  /* ปรับแต่งเว็บ — แผงควบคุมไล่เข้า + พรีวิวเลื่อนเข้าจากขวา */
  .sfadmin-anim .sfe-panel > .sfe-sec{ animation:sfRise .5s var(--ease-out) backwards; }
  .sfadmin-anim .sfe-panel > .sfe-sec:nth-of-type(1){ animation-delay:.08s; }
  .sfadmin-anim .sfe-panel > .sfe-sec:nth-of-type(2){ animation-delay:.14s; }
  .sfadmin-anim .sfe-panel > .sfe-sec:nth-of-type(3){ animation-delay:.2s; }
  .sfadmin-anim .sfe-panel > .sfe-sec:nth-of-type(n+4){ animation-delay:.26s; }
  .sfadmin-anim .sfe-preview{ animation:sfeSlideIn .55s var(--ease-out) .12s backwards; }
}
@keyframes sfeSlideIn{ from{ opacity:0; transform:translateX(20px); } to{ opacity:1; transform:none; } }

/* hover polish — หลังร้าน/สินค้าบนเว็บ */
.sfb-kpi__ic, .sfp-card__img img{ transition:transform .25s var(--ease-smooth); }
.sfb-kpi:hover .sfb-kpi__ic{ transform:scale(1.08) rotate(-3deg); }
.sfp-card{ transition:transform .16s var(--ease-smooth), box-shadow .2s ease, border-color .15s ease; }
.sfp-card:hover{ transform:translateY(-3px); box-shadow:0 12px 26px -14px rgba(20,40,90,.42); }
.sfp-card:hover .sfp-card__img img{ transform:scale(1.05); }
@media (prefers-reduced-motion:reduce){
  .sfadmin-anim *{ animation:none !important; }
  .sfp-card:hover{ transform:none; }
  .sfp-card:hover .sfp-card__img img, .sfb-kpi:hover .sfb-kpi__ic{ transform:none; }
}

/* ====================================================================
   ⭐ เว็บร้าน 3 หน้าเต็ม (แต้ม/บัญชีของฉัน/ตะกร้า) — Motion ตอนเปิดหน้า
   แต่ละหน้า mount ใหม่ตอนเปิด → CSS animation ยิงครั้งเดียว/หน้า (ไม่ต้องใช้ JS)
   ตะกร้า: <div key={cartStep}> remount เนื้อหา → re-animate ตอนสลับขั้นตอน
   ==================================================================== */
@media (prefers-reduced-motion:no-preference){
  /* แถบหัว (back + ชื่อหน้า) — เลื่อนลงเข้า */
  .sf-pageanim > .sf-acctpage__bar{ animation:sfBarDrop .42s var(--ease-out) backwards; }
  /* เนื้อหาแต่ละก้อน — ไล่ขึ้นทีละชั้น (points/account/cart ใช้ wrapper ต่างกัน) */
  .sf-pageanim .sf-loy__wrap > *,
  .sf-pageanim .sf-acctpage__wrap > *,
  .sf-pageanim .sf-cartpage > *{ animation:sfRise .5s var(--ease-out) backwards; }
  .sf-pageanim .sf-loy__wrap > *:nth-child(1),.sf-pageanim .sf-acctpage__wrap > *:nth-child(1),.sf-pageanim .sf-cartpage > *:nth-child(1){ animation-delay:.08s; }
  .sf-pageanim .sf-loy__wrap > *:nth-child(2),.sf-pageanim .sf-acctpage__wrap > *:nth-child(2),.sf-pageanim .sf-cartpage > *:nth-child(2){ animation-delay:.15s; }
  .sf-pageanim .sf-loy__wrap > *:nth-child(3),.sf-pageanim .sf-acctpage__wrap > *:nth-child(3),.sf-pageanim .sf-cartpage > *:nth-child(3){ animation-delay:.22s; }
  .sf-pageanim .sf-loy__wrap > *:nth-child(4),.sf-pageanim .sf-acctpage__wrap > *:nth-child(4),.sf-pageanim .sf-cartpage > *:nth-child(4){ animation-delay:.29s; }
  .sf-pageanim .sf-loy__wrap > *:nth-child(n+5),.sf-pageanim .sf-acctpage__wrap > *:nth-child(n+5),.sf-pageanim .sf-cartpage > *:nth-child(n+5){ animation-delay:.36s; }

  /* การ์ดสมาชิก (หน้าแต้ม) — ลอยเข้าเด่นกว่าเพื่อน */
  .sf-pageanim .sf-loy__hero{ animation:sfHeroIn .6s var(--ease-out) .06s backwards; }
  /* แต้มสะสมตัวใหญ่ — pop เด้ง */
  .sf-pageanim .sf-loysum__pts b{ display:inline-block; animation:sfPtsPop .6s var(--ease-out) .34s backwards; }
  /* แถบ progress เลื่อนเติม */
  .sf-pageanim .sf-loysum__bar span{ animation:sfBarFill .9s var(--ease-out) .42s backwards; }
  /* การ์ด way / ออเดอร์ / แถวในตะกร้า — ไล่เข้าทีละใบ */
  .sf-pageanim .sf-loy__ways > *,
  .sf-pageanim .sf-cartdrawer__bd > *{ animation:sfPop .44s var(--ease-out) backwards; }
  .sf-pageanim .sf-loy__ways > *:nth-child(1),.sf-pageanim .sf-cartdrawer__bd > *:nth-child(1){ animation-delay:.26s; }
  .sf-pageanim .sf-loy__ways > *:nth-child(2),.sf-pageanim .sf-cartdrawer__bd > *:nth-child(2){ animation-delay:.31s; }
  .sf-pageanim .sf-loy__ways > *:nth-child(3),.sf-pageanim .sf-cartdrawer__bd > *:nth-child(3){ animation-delay:.36s; }
  .sf-pageanim .sf-loy__ways > *:nth-child(4),.sf-pageanim .sf-cartdrawer__bd > *:nth-child(4){ animation-delay:.41s; }
  .sf-pageanim .sf-loy__ways > *:nth-child(n+5),.sf-pageanim .sf-cartdrawer__bd > *:nth-child(n+5){ animation-delay:.46s; }
}
@keyframes sfBarDrop{ from{ opacity:0; transform:translateY(-12px); } to{ opacity:1; transform:none; } }
@keyframes sfHeroIn{ from{ opacity:0; transform:translateY(22px) scale(.985); } to{ opacity:1; transform:none; } }
@keyframes sfPtsPop{ 0%{ opacity:0; transform:translateY(10px) scale(.8); } 60%{ transform:scale(1.06); } 100%{ opacity:1; transform:none; } }
@keyframes sfBarFill{ from{ transform:scaleX(0); transform-origin:left; } to{ transform:scaleX(1); transform-origin:left; } }

/* hover polish — การ์ด way / ออเดอร์ */
.sf-way, .sf-ordcard{ transition:transform .16s var(--ease-smooth), box-shadow .2s ease; }
.sf-way:hover, .sf-ordcard:hover{ transform:translateY(-2px); box-shadow:0 10px 22px -14px rgba(20,40,90,.4); }
@media (prefers-reduced-motion:reduce){
  .sf-pageanim *{ animation:none !important; }
  .sf-way:hover, .sf-ordcard:hover{ transform:none; }
}

/* ============================================================================
   แผนที่ในคลัง (Warehouse Map — warehouse-map.jsx)
   ========================================================================== */
.wm-root{ padding-bottom:30px; }
.wm-intro{ display:flex; gap:9px; align-items:flex-start; font-size:12.5px; line-height:1.55; color:var(--ink-2); background:var(--info-bg); border:1px solid #cfe0f3; border-radius:12px; padding:11px 14px; margin-bottom:14px; }
.wm-intro b{ color:var(--navy-700); }

/* toolbar */
.wm-bar{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-bottom:10px; }
.wm-seg{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line-2); border-radius:10px; padding:3px; gap:2px; }
.wm-seg__b{ display:inline-flex; align-items:center; gap:6px; border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--ink-2); padding:7px 14px; border-radius:8px; cursor:pointer; }
.wm-seg__b.is-on{ background:var(--navy-700); color:#fff; box-shadow:0 1px 4px rgba(11,61,145,.3); }
.wm-search{ display:inline-flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--line-2); border-radius:9px; padding:7px 11px; min-width:300px; flex:1 1 320px; max-width:440px; }
.wm-search:focus-within{ border-color:var(--gold-500); }
.wm-search input{ flex:1; border:none; outline:none; background:none; font-family:var(--ff); font-size:13px; color:var(--ink); min-width:0; }
.wm-search__x{ border:none; background:none; color:var(--dim); cursor:pointer; display:grid; place-items:center; }
.wm-tgl{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-2); background:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--ink-2); padding:8px 12px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.wm-tgl:hover{ border-color:var(--navy-300,#9db3d6); }
.wm-tgl.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.wm-tgl--danger:hover{ border-color:#e0a3a3; color:var(--danger-ink); background:#fff6f6; }
.wm-addrow{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.wm-add{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:#fff; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); padding:7px 10px; border-radius:8px; cursor:pointer; }
.wm-add:hover{ border-color:var(--gold-400); background:#fffdf6; color:var(--gold-600); }
.wm-add--block{ border-style:dashed; border-color:var(--navy-300,#9db3d6); color:var(--navy-700); }
.wm-zoom{ display:inline-flex; align-items:center; gap:2px; border:1px solid var(--line-2); border-radius:9px; background:#fff; overflow:hidden; }
.wm-zoom button{ border:none; background:none; padding:7px 9px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; }
.wm-zoom button:hover{ background:var(--surface-2); }
.wm-zoom span{ font-size:12px; font-weight:700; color:var(--ink); min-width:42px; text-align:center; }
.wm-hitbar{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-2); background:#fffdf2; border:1px solid #ecd9a6; border-radius:9px; padding:8px 13px; margin-bottom:10px; }
.wm-hitbar b{ color:var(--gold-600); }

/* layout: full-width canvas + floating HUD (minimap/layers/inspector overlay) */
.wm-main{ display:block; position:relative; min-width:0; }
.wm-canvaswrap{ border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--sh-sm); overflow:auto; max-height:calc(100vh - 290px); position:relative; }
.wm-canvas{ position:relative; }
.wm-stage{ position:relative; transform-origin:0 0; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
  #f8fafc; }
.wm-stage--blueprint{ background:
  linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px) 0 0 / 40px 40px,
  linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px) 0 0 / 40px 40px,
  #122a52; }
.wm-canvaswrap.is-edit .wm-stage{ cursor:default; }

/* elements */
.wm-el{ position:absolute; box-sizing:border-box; border-radius:8px; font-family:var(--ff); user-select:none; overflow:hidden; }
.wm-canvaswrap.is-edit .wm-el{ cursor:move; }
.wm-el.is-dim{ opacity:.32; }
.wm-el.is-sel{ outline:2.5px solid var(--gold-500); outline-offset:1px; box-shadow:0 6px 18px -6px rgba(0,0,0,.3); }
.wm-el.is-hit{ outline:3px solid var(--gold-500); box-shadow:0 0 0 4px rgba(245,164,0,.28); z-index:600 !important; animation:wmPulse 1.1s ease-in-out infinite; }
@keyframes wmPulse{ 0%,100%{ box-shadow:0 0 0 3px rgba(245,164,0,.30); } 50%{ box-shadow:0 0 0 8px rgba(245,164,0,.12); } }

/* areas (zone/aisle/inbound/hold) */
.wm-el--zone{ background:rgba(11,61,145,.045); border:1.5px dashed rgba(11,61,145,.45); }
.wm-el--aisle{ background:repeating-linear-gradient(45deg,#eef1f7,#eef1f7 7px,#e6eaf2 7px,#e6eaf2 14px); border:1px dashed var(--line-2); border-radius:5px; }
.wm-el--inbound{ background:rgba(194,135,26,.10); border:1.5px dashed var(--warn); }
.wm-el--hold{ background:rgba(209,67,67,.09); border:1.5px dashed var(--danger); }
.wm-stage--blueprint .wm-el--zone{ background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.4); }
.wm-stage--blueprint .wm-el--aisle{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.25); }
.wm-el__tag{ position:absolute; top:5px; left:6px; display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:800; color:var(--navy-700); background:rgba(255,255,255,.82); border:1px solid currentColor; border-radius:6px; padding:2px 7px; }
.wm-el--inbound .wm-el__tag{ color:var(--warn-ink); }
.wm-el--hold .wm-el__tag{ color:var(--danger-ink); }
.wm-el--aisle .wm-el__tag{ color:var(--dim); border-color:var(--line-2); }
.wm-area__stk{ position:absolute; left:7px; bottom:6px; font-size:11px; font-weight:700; color:var(--ink-2); background:rgba(255,255,255,.78); border-radius:5px; padding:1px 6px; }

/* rack */
.wm-el--rack{ background:#fff; border:1.5px solid var(--ink-2); }
.wm-el__rackhd{ display:block; background:var(--ink-2); color:#fff; font-size:11px; font-weight:800; padding:3px 9px; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* counter */
.wm-el--counter{ background:linear-gradient(180deg,#f6ead0,#ecdcba); border:1.5px solid var(--gold-600); display:grid; place-items:center; }
.wm-el__counter{ font-size:12px; font-weight:800; color:#6b4d12; }

/* door */
.wm-el--door{ background:transparent; border:none; border-bottom:4px solid var(--ok); display:grid; place-items:center; overflow:visible; }
.wm-el__door{ font-size:10.5px; font-weight:800; color:var(--ok-ink); background:#fff; border:1px solid var(--ok); border-radius:5px; padding:1px 6px; white-space:nowrap; }

/* bin */
.wm-el--bin{ background:#fff; border:1.5px solid var(--line-2); display:flex; flex-direction:column; justify-content:center; align-items:center; gap:1px; padding:2px 4px; transition:background .15s ease; }
.wm-el--bin.wm-el--3d{ box-shadow:inset 0 -3px 0 rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.08); }
.wm-bin__lbl{ font-size:11px; font-weight:800; line-height:1.05; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-bin__stk{ font-size:13px; font-weight:800; line-height:1; }
.wm-bin__stk--none{ color:var(--dim); font-weight:600; }
.wm-bin__nolink{ position:absolute; top:2px; right:4px; font-size:11px; color:var(--warn); }
.wm-bin__flag{ position:absolute; top:2px; left:3px; font-size:9px; font-weight:800; border-radius:4px; padding:0 4px; }
.wm-bin__flag--over{ background:var(--danger); color:#fff; }
.wm-bin__flag--empty{ background:var(--warn-bg); color:var(--warn-ink); left:auto; right:3px; }
.wm-el--bin.is-empty{ border-color:var(--warn); border-style:dashed; }
.wm-el--bin.is-over{ border-color:var(--danger); }

/* resize handle */
.wm-el__rs{ position:absolute; right:-1px; bottom:-1px; width:15px; height:15px; background:var(--gold-500); border:2px solid #fff; border-radius:4px 0 7px 0; cursor:nwse-resize; z-index:5; }

/* legend */
.wm-legend{ display:flex; align-items:center; gap:13px; flex-wrap:wrap; padding:9px 14px; border-top:1px solid var(--line); background:#fbfcfe; }
.wm-leg{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:var(--ink-2); }
.wm-leg__sw{ width:16px; height:12px; border-radius:3px; flex:none; }
.wm-leg__sw--zone{ background:rgba(11,61,145,.08); border:1.5px dashed rgba(11,61,145,.5); }
.wm-leg__sw--aisle{ background:repeating-linear-gradient(45deg,#eef1f7,#eef1f7 4px,#e0e5ef 4px,#e0e5ef 8px); }
.wm-leg__sw--inbound{ background:rgba(194,135,26,.18); border:1.5px dashed var(--warn); }
.wm-leg__sw--hold{ background:rgba(209,67,67,.16); border:1.5px dashed var(--danger); }
.wm-leg__sw--rack{ background:#fff; border:1.5px solid var(--ink-2); }
.wm-leg__sw--bin{ background:#fff; border:1.5px solid var(--line-2); box-shadow:inset 0 -2px 0 rgba(0,0,0,.1); }
.wm-leg__sw--door{ background:transparent; border-bottom:3px solid var(--ok); border-radius:0; }
.wm-leg__sw--counter{ background:linear-gradient(180deg,#f6ead0,#ecdcba); border:1.5px solid var(--gold-600); }
.wm-legend__heat{ display:flex; align-items:center; gap:9px; font-size:11.5px; color:var(--ink-2); font-weight:600; }
.wm-heatbar{ width:160px; height:11px; border-radius:6px; border:1px solid var(--line-2); }
.wm-legend__heat em{ color:var(--dim); font-style:normal; }

/* side panel */
.wm-side{ position:sticky; top:0; }
.wm-side__empty{ border:1px dashed var(--line-2); border-radius:14px; background:var(--surface); padding:34px 14px; display:flex; flex-direction:column; align-items:center; gap:7px; text-align:center; }
.wm-side__t{ font-size:13.5px; font-weight:700; color:var(--ink); }
.wm-side__h{ font-size:11.5px; color:var(--dim); line-height:1.5; }

.wm-insp, .wm-det{ border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:var(--sh-sm); padding:14px; }
.wm-insp__hd, .wm-det__hd{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.wm-insp__ic, .wm-det__ic{ width:34px; height:34px; border-radius:10px; display:grid; place-items:center; flex:none; }
.wm-insp__hd b, .wm-det__hd b{ display:block; font-size:14px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-insp__hd span, .wm-det__hd span{ display:block; font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-det__x{ border:none; background:var(--surface-2); border-radius:8px; width:30px; height:30px; display:grid; place-items:center; cursor:pointer; color:var(--ink-2); flex:none; }
.wm-f{ display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }
.wm-f>span{ font-size:11.5px; font-weight:700; color:var(--ink-2); }
.wm-f input, .wm-f select{ font-family:var(--ff); font-size:13px; color:var(--ink); border:1px solid var(--line-2); border-radius:8px; padding:8px 10px; background:#fff; outline:none; }
.wm-f input:focus, .wm-f select:focus{ border-color:var(--gold-500); }
.wm-f--n input{ width:100%; }
.wm-insp__loc{ font-size:11px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); border-radius:7px; padding:5px 9px; margin:-4px 0 10px; display:flex; align-items:center; gap:5px; }
.wm-insp__loc--free{ color:var(--warn-ink); background:var(--warn-bg); }
.wm-insp__stat, .wm-det__reg{ font-size:11.5px; color:var(--ink-2); background:var(--surface-2); border-radius:8px; padding:7px 10px; margin-bottom:10px; }
.wm-insp__stat b{ color:var(--navy-700); }
.wm-det__reg{ display:flex; align-items:center; gap:5px; font-weight:700; color:var(--ok-ink); background:var(--ok-bg); }
.wm-det__reg--free{ color:var(--warn-ink); background:var(--warn-bg); }
.wm-insp__sec{ font-size:11px; font-weight:800; color:var(--navy-700); text-transform:uppercase; letter-spacing:.4px; margin:6px 0 7px; }
.wm-swatches{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.wm-sw{ width:26px; height:26px; border-radius:7px; border:2px solid #fff; box-shadow:0 0 0 1px var(--line-2); cursor:pointer; padding:0; }
.wm-sw.is-on{ box-shadow:0 0 0 2px var(--gold-500); }
.wm-sw--auto{ width:auto; padding:0 9px; font-family:var(--ff); font-size:11px; font-weight:700; color:var(--ink-2); background:var(--surface-2); }
.wm-insp__grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.wm-insp__acts{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:12px; }
.wm-ib{ display:inline-flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line-2); background:#fff; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); padding:8px 6px; border-radius:8px; cursor:pointer; }
.wm-ib:hover{ border-color:var(--navy-300,#9db3d6); }
.wm-ib--danger{ color:var(--danger-ink); border-color:#e9c2c2; background:#fff7f7; }

/* bin detail */
.wm-det__stat{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:9px; }
.wm-det__stat>div{ background:var(--surface-2); border-radius:9px; padding:8px; text-align:center; }
.wm-det__stat span{ display:block; font-size:10.5px; color:var(--dim); }
.wm-det__stat b{ display:block; font-size:16px; font-weight:800; color:var(--navy-700); }
.wm-det__stat b.wm-over{ color:var(--danger); }
.wm-cap{ height:8px; border-radius:6px; background:var(--surface-3); overflow:hidden; margin-bottom:10px; }
.wm-cap i{ display:block; height:100%; border-radius:6px; }
.wm-det__list{ display:flex; flex-direction:column; gap:6px; max-height:330px; overflow-y:auto; margin-bottom:10px; }
.wm-prod{ display:flex; align-items:center; gap:9px; border:1px solid var(--line); border-radius:9px; padding:8px 10px; cursor:pointer; background:var(--surface); }
.wm-prod:hover{ border-color:var(--gold-400); background:#fffdf6; }
.wm-prod__l{ flex:1; min-width:0; }
.wm-prod__l b{ display:block; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-prod__l span{ font-size:10.5px; color:var(--dim); }
.wm-prod__q{ font-size:14px; font-weight:800; color:var(--navy-700); white-space:nowrap; }
.wm-prod__q em{ font-size:10px; font-weight:600; color:var(--dim); font-style:normal; margin-left:3px; }
.wm-prod__q--zero{ color:var(--danger); }
.wm-det__go{ width:100%; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--navy-700); background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px; border-radius:9px; cursor:pointer; }
.wm-det__go:hover{ background:var(--navy-800); }
.wm-det__acts2{ display:flex; gap:6px; }
.wm-det__acts2 .wm-det__go{ flex:1; margin:0; }
.wm-det__go2{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line-2); background:#fff; color:var(--navy-700); font-family:var(--ff); font-size:12px; font-weight:700; padding:9px 6px; border-radius:9px; cursor:pointer; }
.wm-det__go2:hover{ border-color:var(--gold-400); background:#fffdf6; }

/* print map */
@media print {
  body.wm-printing *{ visibility:hidden !important; }
  body.wm-printing .wm-canvaswrap, body.wm-printing .wm-canvaswrap *{ visibility:visible !important; }
  body.wm-printing .wm-canvaswrap{ position:fixed; inset:0; max-height:none; border:none; box-shadow:none; overflow:visible; }
  body.wm-printing .wm-stage{ transform:scale(.6) !important; }
  body.wm-printing .wm-el__rs{ display:none !important; }
  body.wm-printing .wm-legend{ display:none !important; }
  @page{ size:A4 landscape; margin:8mm; }
}
.wm-printing .dtoast{ display:none !important; }

/* ===== Warehouse Map v2 — floors / room / furniture / group / dims / drill-in / flow ===== */
/* floor switcher */
.wm-floors{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:9px 13px; margin-bottom:12px; box-shadow:var(--sh-sm); }
.wm-floors__lbl{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--navy-700); }
.wm-floors__row{ display:flex; gap:6px; flex-wrap:wrap; }
.wm-floor{ display:flex; flex-direction:column; align-items:center; gap:1px; min-width:62px; border:1px solid var(--line-2); background:#fff; border-radius:10px; padding:6px 12px; cursor:pointer; font-family:var(--ff); transition:all .14s ease; }
.wm-floor:hover{ border-color:var(--navy-300,#9db3d6); }
.wm-floor b{ font-size:13px; color:var(--ink); }
.wm-floor span{ font-size:10px; color:var(--dim); }
.wm-floor.is-on{ background:var(--navy-700); border-color:var(--navy-700); }
.wm-floor.is-on b{ color:#fff; } .wm-floor.is-on span{ color:#cdd9f0; }

/* scale bar */
.wm-scalebar{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:#fbfcfe; border:1px dashed var(--line-2); border-radius:10px; padding:8px 13px; margin-bottom:10px; font-size:12.5px; color:var(--ink-2); }
.wm-scalebar b{ color:var(--navy-700); }
.wm-scalebar input{ width:64px; font-family:var(--ff); font-size:13px; font-weight:700; text-align:center; border:1px solid var(--line-2); border-radius:7px; padding:5px 6px; outline:none; }
.wm-scalebar input:focus{ border-color:var(--gold-500); }
.wm-scalebar em{ color:var(--dim); font-style:normal; font-size:11.5px; }

/* hit floor chips */
.wm-hitfloor{ border:1px solid #ecd9a6; background:#fff; color:var(--gold-600); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:99px; cursor:pointer; margin:0 3px; }
.wm-hitfloor.is-on{ background:var(--gold-500); border-color:var(--gold-500); color:#3a2a00; }
.wm-hitbar em{ color:var(--dim); font-style:normal; }

/* furniture add buttons */
.wm-add--furn{ border-style:dashed; }

/* room (walls) */
.wm-el--room{ background:rgba(60,72,95,.04); border:2px solid #58657d; border-radius:6px; box-shadow:inset 0 0 0 2px #fff, inset 0 0 0 4px rgba(88,101,125,.16); }
.wm-stage--blueprint .wm-el--room{ background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.55); box-shadow:inset 0 0 0 2px rgba(255,255,255,.12); }
.wm-canvaswrap:not(.is-edit) .wm-el--cont{ cursor:zoom-in; }
.wm-el__zoom{ display:inline-grid; place-items:center; margin-left:5px; opacity:.6; }
.wm-el__rackhd{ display:flex; align-items:center; gap:5px; }
.wm-el__rackz{ margin-left:auto; font-size:9.5px; font-weight:700; opacity:0; background:rgba(255,255,255,.22); border-radius:5px; padding:1px 6px; transition:opacity .14s; }
.wm-canvaswrap:not(.is-edit) .wm-el--rack:hover .wm-el__rackz{ opacity:1; }
.wm-el__grp{ position:absolute; bottom:2px; left:3px; color:var(--navy-600); background:rgba(255,255,255,.85); border-radius:4px; padding:0 2px; display:grid; place-items:center; }
.wm-el__dim{ position:absolute; right:3px; bottom:2px; font-size:9px; font-weight:700; color:var(--ink-2); background:rgba(255,255,255,.82); border-radius:4px; padding:0 4px; pointer-events:none; }

/* furniture */
.wm-el--furn{ background:#fff; border-width:1.5px; border-style:solid; border-radius:8px; }
.wm-furn{ display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; width:100%; gap:1px; padding:1px; }
.wm-furn em{ font-style:normal; font-size:9px; font-weight:700; color:var(--ink-2); line-height:1.05; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }

/* flow arrow */
.wm-el--arrow{ background:transparent !important; border:none !important; overflow:visible; }
.wm-flow{ position:absolute; inset:0; display:flex; align-items:center; padding:0 2px; }
.wm-flow__shaft{ flex:1; height:0; border-top:3px dashed currentColor; border-radius:2px; }
.wm-flow__head{ width:0; height:0; border-top:8px solid transparent; border-bottom:8px solid transparent; border-left:13px solid currentColor; margin-left:-2px; }
.wm-flow__lbl{ position:absolute; left:0; right:0; top:-12px; text-align:center; font-size:10px; font-weight:800; color:currentColor; font-style:normal; white-space:nowrap; }
.wm-el--arrow.is-sel{ outline-offset:3px; }

/* empty floor */
.wm-emptyfloor{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; color:var(--dim); pointer-events:none; }
.wm-emptyfloor div{ font-size:15px; font-weight:700; color:var(--ink-2); }
.wm-emptyfloor span{ font-size:12px; }

/* legend room swatch */
.wm-leg__sw--room{ background:rgba(88,101,125,.10); border:2px solid #58657d; }
.wm-leg__sw--arrow{ background:transparent; border:none; border-top:3px solid var(--navy-600); position:relative; }

/* inspector additions */
.wm-insp__hint{ font-size:11px; color:var(--dim); margin:-2px 0 8px; }
.wm-insp__hint b{ color:var(--navy-700); }
.wm-dirpad{ display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-bottom:6px; }
.wm-dir{ border:1px solid var(--line-2); background:#fff; border-radius:8px; padding:7px 0; font-size:16px; line-height:1; color:var(--ink-2); cursor:pointer; }
.wm-dir:hover{ border-color:var(--navy-300,#9db3d6); }
.wm-dir.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.wm-dir__c{ display:grid; place-items:center; color:var(--line-2); }
.wm-rotrow{ display:grid; grid-template-columns:repeat(4,1fr); gap:5px; margin-bottom:6px; }
.wm-rotb{ border:1px solid var(--line-2); background:#fff; border-radius:8px; padding:6px 0; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.wm-rotb:hover{ border-color:var(--navy-300,#9db3d6); }
.wm-rotb.is-on{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.wm-insp__hd, .wm-det__hd{ min-width:0; }
.wm-insp__ic, .wm-det__ic{ flex:none; }
.wm-insp__hd>div, .wm-det__hd>div{ min-width:0; }
.wm-insp__hd b{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-root .wm-insp__hd, .wm-root .wm-det__hd{ display:flex !important; align-items:center; gap:10px; width:100%; }
.wm-root .wm-insp__ic, .wm-root .wm-det__ic{ flex:0 0 auto !important; display:grid !important; place-items:center !important; }
.wm-root .wm-det__sum{ flex:1 1 auto !important; min-width:0 !important; display:flex; flex-direction:column; gap:1px; }
.wm-root .wm-det__sum b{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; word-break:normal; overflow-wrap:normal; }
.wm-root .wm-det__meta{ display:block; white-space:nowrap !important; overflow:hidden; text-overflow:ellipsis; word-break:normal !important; overflow-wrap:normal !important; max-width:100%; font-size:11px; color:var(--dim); }
.wm-root .wm-det__x{ flex:0 0 auto !important; }
.wm-root .wm-det__meta, .wm-root .wm-det__meta *{ display:inline !important; white-space:nowrap !important; word-break:normal !important; overflow-wrap:normal !important; }
.wm-root .wm-det__meta{ display:block !important; overflow:hidden; text-overflow:ellipsis; }
.wm-det__hd b{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== UX polish — compact stacked bars · taller canvas · scrollable side ===== */
.wm-crumbbar, .wm-scnbar, .wm-bar, .wm-navbar, .wm-scalebar, .wm-setpanel, .wm-hitbar, .wm-front{ margin-bottom:7px; }
.wm-crumbbar{ padding:6px 11px; }
.wm-scnbar{ padding:6px 10px; }
.wm-bar{ gap:8px; }
.wm-viewport, .wm-canvaswrap{ height:calc(100vh - 318px); }
.wm-side{ position:sticky; top:0; max-height:calc(100vh - 150px); overflow-y:auto; padding-right:3px; }
.wm-side::-webkit-scrollbar{ width:7px; }
.wm-side::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:7px; }
.wm-tgl, .wm-add{ padding:7px 10px; }
.wm-mini, .wm-layers, .wm-front{ margin-bottom:10px; }
@media (max-width:1180px){ .wm-side{ position:static; max-height:none; overflow:visible; } }
.wm-more{ position:relative; }
.wm-more>.wm-tgl{ padding:7px 13px; }
.wm-morepop{ position:absolute; right:0; top:calc(100% + 6px); z-index:40; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 30px -10px rgba(20,40,80,.35); padding:6px; min-width:212px; display:flex; flex-direction:column; gap:2px; }
.wm-morepop button{ display:flex; align-items:center; gap:9px; border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:600; color:var(--ink-2); padding:9px 11px; border-radius:8px; cursor:pointer; text-align:left; }
.wm-morepop button:hover{ background:var(--surface-2); }
.wm-morepop__danger{ color:var(--danger-ink) !important; }
/* floating zoom + jumps over the map */
.wm-root .wm-navbar{ position:relative; z-index:6; width:auto; max-width:100%; margin:2px 0 8px 0 !important; background:rgba(255,255,255,.96); border:1px solid var(--line); border-radius:14px; padding:6px 10px; box-shadow:0 6px 18px -8px rgba(20,40,80,.32); }
.wm-root .wm-navbar .wm-navbar__hint{ display:none; }
.wm-canvasframe{ padding-top:2px; }

/* group panel */
.wm-grp__chips{ display:flex; flex-wrap:wrap; gap:5px; margin-bottom:9px; }
.wm-grp__chip{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); border-radius:7px; padding:3px 8px; }
.wm-grp__note{ display:flex; align-items:flex-start; gap:6px; font-size:11.5px; color:var(--ink-2); background:var(--info-bg); border:1px solid #cfe0f3; border-radius:9px; padding:8px 10px; margin-bottom:10px; }
.wm-grp__note b{ color:var(--navy-700); }
.wm-grp__b{ width:100%; display:inline-flex; align-items:center; justify-content:center; gap:6px; font-family:var(--ff); font-size:13px; font-weight:700; padding:10px; border-radius:9px; cursor:pointer; border:1px solid; }
.wm-grp__b--go{ background:var(--navy-700); border-color:var(--navy-700); color:#fff; }
.wm-grp__b--go:hover{ background:var(--navy-800); }
.wm-grp__b--out{ background:#fff; border-color:#e9c2c2; color:var(--danger-ink); }

/* ===== focus overlay (drill-in) ===== */
.wmf-ov{ position:fixed; inset:0; z-index:6000; background:rgba(16,26,46,.55); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; padding:24px; animation:wmFadeIn .16s ease; }
@keyframes wmFadeIn{ from{ opacity:0; } to{ opacity:1; } }
.wmf-modal{ background:var(--surface); border-radius:18px; box-shadow:0 30px 80px -20px rgba(0,0,0,.5); width:min(1240px,96vw); max-height:92vh; display:flex; flex-direction:column; overflow:hidden; }
.wmf-hd{ display:flex; align-items:center; gap:11px; padding:13px 16px; border-bottom:1px solid var(--line); }
.wmf-hd__ic{ width:34px; height:34px; border-radius:10px; display:grid; place-items:center; flex:none; }
.wmf-bc{ flex:1; min-width:0; display:flex; align-items:center; gap:5px; flex-wrap:wrap; font-size:13px; }
.wmf-bc button{ border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-600); cursor:pointer; padding:2px 4px; border-radius:6px; }
.wmf-bc button:hover{ background:var(--surface-2); }
.wmf-bc b{ color:var(--ink); font-size:14px; }
.wmf-x{ width:32px; height:32px; border:none; background:var(--surface-2); border-radius:9px; display:grid; place-items:center; cursor:pointer; color:var(--ink-2); flex:none; }
.wmf-body{ display:flex; gap:16px; padding:16px; overflow:auto; align-items:flex-start; }
@media (max-width:860px){ .wmf-body{ flex-direction:column; } }
.wmf-stage{ position:relative; flex:none; border:1px solid var(--line); border-radius:12px; background:linear-gradient(var(--line) 1px,transparent 1px) 0 0/32px 32px, linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0/32px 32px, #f8fafc; overflow:hidden; }
.wmf-empty{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; color:var(--dim); font-size:12.5px; }
.wmf-tile{ position:absolute; box-sizing:border-box; border:1.5px solid var(--line-2); border-radius:6px; background:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; overflow:hidden; font-size:11px; cursor:default; }
.wmf-tile__l{ font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; padding:0 4px; }
.wmf-tile__s{ font-weight:800; color:var(--navy-700); font-size:12px; }
.wmf-tile__go{ position:absolute; top:2px; right:3px; color:var(--navy-600); }
.wmf-tile--room,.wmf-tile--zone{ background:rgba(11,61,145,.05); border-style:dashed; border-color:rgba(11,61,145,.4); cursor:zoom-in; align-items:flex-start; justify-content:flex-start; padding:4px 6px; }
.wmf-tile--rack{ border-color:var(--ink-2); cursor:zoom-in; align-items:flex-start; justify-content:flex-start; padding:3px 6px; background:#f4f6fb; }
.wmf-tile--bin{ cursor:pointer; }
.wmf-tile--bin:hover{ border-color:var(--gold-400); background:#fffdf6; }
.wmf-tile--aisle{ background:repeating-linear-gradient(45deg,#eef1f7,#eef1f7 6px,#e3e8f1 6px,#e3e8f1 12px); }
.wmf-tile--inbound{ background:rgba(194,135,26,.12); border-color:var(--warn); }
.wmf-tile--hold{ background:rgba(209,67,67,.10); border-color:var(--danger); }
.wmf-tile--furn{ color:var(--ink-2); }
.wmf-tile.is-pick{ outline:2.5px solid var(--gold-500); outline-offset:1px; z-index:50; }
.wmf-info{ flex:1; min-width:280px; align-self:stretch; display:flex; flex-direction:column; }
.wmf-info__hd{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.wmf-info__hd b{ font-size:15px; color:var(--ink); }
.wmf-info__hd button{ border:none; background:var(--surface-2); border-radius:7px; padding:5px 9px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
.wmf-info__sub{ font-size:12px; color:var(--dim); margin:3px 0 9px; }
.wmf-info__stat{ display:flex; gap:14px; font-size:12.5px; color:var(--ink-2); margin-bottom:10px; }
.wmf-info__stat b{ color:var(--navy-700); }
.wmf-info__lbl{ font-size:11px; font-weight:800; color:var(--navy-700); text-transform:uppercase; letter-spacing:.3px; margin-bottom:7px; }
.wmf-sum{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.wmf-sum>div{ background:var(--surface-2); border-radius:10px; padding:10px; text-align:center; }
.wmf-sum span{ display:block; font-size:10.5px; color:var(--dim); }
.wmf-sum b{ display:block; font-size:18px; font-weight:800; color:var(--navy-700); }
.wmf-loclist{ display:flex; flex-direction:column; gap:6px; overflow-y:auto; max-height:340px; }
.wmf-locrow{ display:flex; align-items:center; gap:9px; border:1px solid var(--line); border-radius:9px; padding:9px 11px; background:#fff; cursor:pointer; font-family:var(--ff); text-align:left; }
.wmf-locrow:hover{ border-color:var(--gold-400); background:#fffdf6; }
.wmf-locrow--rack{ background:var(--surface-2); }
.wmf-locrow__c{ display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:700; color:var(--ink); flex:none; }
.wmf-locrow__loc{ flex:1; min-width:0; font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wmf-locrow__s{ font-size:13px; font-weight:800; color:var(--navy-700); white-space:nowrap; }
.wmf-plist{ display:flex; flex-direction:column; gap:6px; overflow-y:auto; max-height:360px; }
.wmf-prod{ display:flex; align-items:center; gap:9px; border:1px solid var(--line); border-radius:9px; padding:8px 11px; background:#fff; }
.wmf-prod div:first-child{ flex:1; min-width:0; }
.wmf-prod b{ display:block; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wmf-prod span{ font-size:10.5px; color:var(--dim); }
.wmf-prod__q{ font-size:14px; font-weight:800; color:var(--navy-700); white-space:nowrap; }
.wmf-prod__q em{ font-size:10px; font-weight:600; color:var(--dim); font-style:normal; margin-left:3px; }
.wmf-prod__q.is-zero{ color:var(--danger); }

/* ===== Warehouse Map v3 — drill-down navigation ===== */
.wm-canvaswrap{ position:relative; overflow:hidden; height:calc(100vh - 340px); min-height:470px; max-height:none; border:1px solid var(--line); border-radius:16px; box-shadow:var(--sh-sm);
  background:linear-gradient(var(--line) 1px,transparent 1px) 0 0/40px 40px, linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0/40px 40px, #f8fafc; }
.wm-framebg{ position:absolute; box-sizing:border-box; pointer-events:none; z-index:0; border-radius:8px; }
.wm-framebg.wm-el--room{ background:rgba(60,72,95,.05); }
.wm-framebg.wm-el--zone{ background:rgba(11,61,145,.05); }
.wm-framebg.wm-el--rack{ background:#f4f6fb; }
.wm-framebg__l{ position:absolute; top:6px; left:8px; display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:800; color:var(--navy-700); background:rgba(255,255,255,.88); border-radius:6px; padding:2px 9px; }

/* building overview */
.wm-bld{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
@media(max-width:980px){ .wm-bld{ grid-template-columns:repeat(2,1fr); } }
@media(max-width:600px){ .wm-bld{ grid-template-columns:1fr; } }
.wm-bcard{ background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:18px; box-shadow:var(--sh-sm); cursor:pointer; transition:transform .15s ease, box-shadow .2s ease, border-color .15s; display:flex; flex-direction:column; gap:11px; }
.wm-bcard:hover{ border-color:var(--gold-400); box-shadow:0 12px 28px -16px rgba(20,40,90,.42); transform:translateY(-2px); }
.wm-bcard.is-empty{ opacity:.72; }
.wm-bcard__top{ display:flex; align-items:center; gap:10px; }
.wm-bcard__fl{ width:44px; height:44px; border-radius:12px; background:var(--navy-700); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:15px; line-height:1; white-space:nowrap; flex:none; }
.wm-bcard__nm{ font-size:15px; font-weight:800; color:var(--ink); flex:1; }
.wm-bcard__tag{ font-size:11px; font-weight:700; color:var(--navy-700); background:var(--surface-2); border-radius:99px; padding:3px 10px; }
.wm-bcard__tag--e{ color:var(--dim); }
.wm-bcard__big{ font-size:30px; font-weight:800; color:var(--navy-700); line-height:1; display:flex; align-items:baseline; gap:7px; }
.wm-bcard__big em{ font-size:12px; font-weight:600; color:var(--dim); font-style:normal; }
.wm-bcard__row{ display:flex; gap:13px; flex-wrap:wrap; font-size:12px; color:var(--ink-2); }
.wm-bcard__row span{ display:inline-flex; align-items:center; gap:4px; }
.wm-bcard__warn{ color:var(--warn-ink); font-weight:700; }
.wm-bcard__go{ margin-top:auto; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--navy-700); background:var(--navy-700); color:#fff; font-family:var(--ff); font-size:12.5px; font-weight:700; padding:9px; border-radius:9px; cursor:pointer; }
.wm-bcard__go:hover{ background:var(--navy-800); }
.wm-bcard{ position:relative; }
.wm-bcard__del{ flex:none; width:30px; height:30px; display:grid; place-items:center; border:1px solid #e9c2c2; background:#fff7f7; color:var(--danger-ink); border-radius:8px; cursor:pointer; }
.wm-bcard__del:hover{ background:var(--danger-bg); }
.wm-bcard--add{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:160px; border:2px dashed var(--navy-300,#9db3d6); background:#fafcff; color:var(--navy-700); cursor:pointer; font-family:var(--ff); font-size:14px; font-weight:800; box-shadow:none; }
.wm-bcard--add:hover{ background:#f0f5fd; border-color:var(--navy-700); }
.sfd-loc{ display:inline-flex; align-items:center; gap:5px; font-size:12.5px; color:var(--ink-2); background:#fffdf2; border:1px solid #ecd9a6; border-radius:8px; padding:5px 10px; margin-top:6px; }
.sfd-loc b{ color:var(--gold-600); }
.sfd-meta--hide{ display:none !important; }
.sfd-meta--left{ margin-top:12px; border-top:1px solid var(--line); padding-top:10px; }
.sfd-desc--hide{ display:none !important; }
.sfd-desc--left{ margin-top:12px; }
.oc-pickloc{ display:inline-flex; align-items:center; gap:3px; margin-left:8px; font-weight:700; color:var(--gold-600); }
.oc-mapbtn{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--gold-400); background:#fffdf6; color:var(--gold-600); font-family:var(--ff); font-size:11px; font-weight:700; padding:5px 9px; border-radius:7px; cursor:pointer; white-space:nowrap; }
.oc-mapbtn:hover{ background:var(--gold-500); color:#3a2a00; }
.sf-like{ position:absolute; top:8px; right:8px; width:32px; height:32px; display:grid; place-items:center; border:none; border-radius:50%; background:rgba(255,255,255,.92); box-shadow:0 1px 4px rgba(0,0,0,.18); color:#9aa3b2; cursor:pointer; transition:transform .12s, color .15s; z-index:3; }
.sf-like:hover{ transform:scale(1.12); color:#e0556b; }
.sf-like.is-on{ color:#e23b54; }
.sf-like.is-on svg{ fill:#e23b54; }

/* breadcrumb bar */
.wm-crumbbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:8px 12px; margin-bottom:10px; box-shadow:var(--sh-sm); }
.wm-back{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line-2); background:#fff; border-radius:9px; padding:7px 11px; font-family:var(--ff); font-size:12.5px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.wm-back:hover{ background:var(--surface-2); }
.wm-crumbs{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; font-size:13px; min-width:0; }
.wm-crumbs button{ border:none; background:none; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-600); cursor:pointer; padding:2px 6px; border-radius:6px; display:inline-flex; align-items:center; gap:4px; }
.wm-crumbs button:hover{ background:var(--surface-2); }
.wm-crumbs b{ color:var(--ink); font-size:13.5px; padding:0 4px; }

/* minimap */
.wm-mini{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px; box-shadow:var(--sh-sm); margin-bottom:12px; }
.wm-mini__hd{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:8px; }
.wm-mini__stage{ position:relative; background:#eef2f8; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin:0 auto; }
.wm-mini__el{ position:absolute; box-sizing:border-box; border:1px solid; border-radius:2px; cursor:pointer; }
.wm-mini__el--cont{ background:rgba(11,61,145,.07); }
.wm-mini__el--bin{ background:#fff; }
.wm-mini__el--other{ background:rgba(150,160,180,.30); border-color:transparent; }
.wm-mini__el.is-hit{ background:var(--gold-400) !important; border-color:var(--gold-600) !important; }
.wm-mini__el.is-sel{ outline:1.5px solid var(--gold-500); outline-offset:1px; z-index:5; }
.wm-mini__focus{ position:absolute; box-sizing:border-box; border:2px solid var(--gold-500); border-radius:3px; pointer-events:none; }

/* layers */
.wm-layers{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px; box-shadow:var(--sh-sm); margin-bottom:12px; }
.wm-layers__hd{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:8px; }
.wm-layers__grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.wm-lyr{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-2); background:#fff; border-radius:8px; padding:7px 9px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--dim); cursor:pointer; }
.wm-lyr svg{ opacity:.45; }
.wm-lyr.is-on{ background:var(--navy-50,#eef3fb); border-color:var(--navy-300,#9db3d6); color:var(--navy-700); }
.wm-lyr.is-on svg{ opacity:1; }

/* summary */
.wm-sum{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px; box-shadow:var(--sh-sm); }
.wm-sum__hd{ display:flex; align-items:center; gap:7px; font-size:13.5px; font-weight:800; color:var(--ink); margin-bottom:11px; }
.wm-sum__kpi{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:6px; }
.wm-sum__kpi>div{ background:var(--surface-2); border-radius:10px; padding:9px; text-align:center; }
.wm-sum__kpi span{ display:block; font-size:10.5px; color:var(--dim); }
.wm-sum__kpi b{ display:block; font-size:18px; font-weight:800; color:var(--navy-700); }
.wm-sum__sec{ font-size:11px; font-weight:800; color:var(--navy-700); text-transform:uppercase; letter-spacing:.3px; margin:10px 0 7px; }
.wm-sum__list{ display:flex; flex-direction:column; gap:6px; max-height:340px; overflow-y:auto; }
.wm-gorow{ display:flex; align-items:center; gap:9px; border:1px solid var(--line); border-radius:9px; padding:8px 10px; background:#fff; }
.wm-gorow__l{ flex:1; min-width:0; }
.wm-gorow__l b{ display:block; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-gorow__l span{ font-size:10.5px; color:var(--dim); }
.wm-gorow__b{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--gold-400); background:#fffdf6; color:var(--gold-600); font-family:var(--ff); font-size:11.5px; font-weight:700; padding:6px 10px; border-radius:8px; cursor:pointer; white-space:nowrap; }
.wm-gorow__b:hover{ background:var(--gold-500); color:#3a2a00; }
.wm-warn{ color:var(--warn-ink); }
.wm-over{ color:var(--danger); }

/* edit hint when fitted */
.wm-canvaswrap.is-edit .wm-el{ cursor:move; }
.wm-canvaswrap:not(.is-edit) .wm-el--cont{ cursor:zoom-in; }

/* ===== Warehouse Map v4 — long building viewport / ruler / landmarks ===== */
.wm-navbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.wm-zoom2{ display:inline-flex; align-items:center; gap:2px; border:1px solid var(--line-2); border-radius:9px; background:#fff; overflow:hidden; }
.wm-zoom2 button{ border:none; background:none; padding:7px 9px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; font-family:var(--ff); }
.wm-zoom2 button:hover{ background:var(--surface-2); }
.wm-zoom2 span{ font-size:12px; font-weight:700; min-width:44px; text-align:center; }
.wm-zbtn{ font-size:11.5px !important; font-weight:700; color:var(--navy-700) !important; border-left:1px solid var(--line) !important; padding:7px 10px !important; }
.wm-navbar__hint{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:var(--dim); }
.wm-jumps{ display:flex; gap:6px; flex-wrap:wrap; }
.wm-jump{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); background:#fff; border-radius:99px; padding:6px 11px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.wm-jump:hover{ border-color:var(--gold-400); background:#fffdf6; color:var(--gold-600); }

.wm-setpanel{ background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--sh-sm); padding:13px; margin-bottom:10px; }
.wm-setpanel__row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.wm-setpanel__row b{ font-size:13.5px; color:var(--ink); }
.wm-setpanel__row button{ border:none; background:var(--surface-2); border-radius:8px; width:28px; height:28px; display:grid; place-items:center; cursor:pointer; color:var(--ink-2); }
.wm-setpanel__grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:10px; }
.wm-setpanel__grid label{ display:flex; flex-direction:column; gap:4px; font-size:11.5px; font-weight:700; color:var(--ink-2); }
.wm-setpanel__grid input{ font-family:var(--ff); font-size:14px; font-weight:700; text-align:center; border:1px solid var(--line-2); border-radius:8px; padding:8px; outline:none; }
.wm-setpanel__grid input:focus{ border-color:var(--gold-500); }
.wm-setpanel__toggles{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:9px; }
.wm-setpanel__note{ font-size:11.5px; color:var(--dim); }
.wm-setpanel__note b{ color:var(--navy-700); }

.wm-canvasframe{ position:relative; }
.wm-canvasframe.has-ruler{ padding:22px 0 0 26px; }
.wm-ruler{ position:absolute; background:#fbfcfe; color:var(--dim); overflow:hidden; z-index:3; }
.wm-ruler--top{ top:0; left:26px; right:0; height:22px; border-bottom:1px solid var(--line); }
.wm-ruler--left{ top:22px; left:0; bottom:0; width:26px; border-right:1px solid var(--line); }
.wm-ruler-corner{ position:absolute; top:0; left:0; width:26px; height:22px; background:#f1f4f9; border-right:1px solid var(--line); border-bottom:1px solid var(--line); z-index:4; display:grid; place-items:center; font-size:9px; font-weight:700; color:var(--dim); }
.wm-ruler--top .wm-rtick{ position:absolute; top:0; height:100%; border-left:1px solid var(--line-2); }
.wm-ruler--top .wm-rtick > span{ position:absolute; left:3px; top:3px; font-size:9.5px; font-weight:700; }
.wm-ruler--left .wm-rtick{ position:absolute; left:0; width:100%; border-top:1px solid var(--line-2); }
.wm-ruler--left .wm-rtick > span{ position:absolute; left:2px; top:1px; font-size:9px; font-weight:700; }

.wm-viewport{ position:relative; overflow:auto; height:calc(100vh - 340px); min-height:460px; border:1px solid var(--line); border-radius:0 14px 14px 0; background:#f5f7fb; }
.wm-canvasframe:not(.has-ruler) .wm-viewport{ border-radius:14px; }
.wm-viewport.is-panning{ cursor:grabbing; }
.wm-world{ position:relative; }
.wm-stage2{ position:absolute; top:0; left:0; transform-origin:0 0;
  background:linear-gradient(var(--line) 1px,transparent 1px) 0 0/40px 40px, linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0/40px 40px, #f8fafc; }
.wm-viewport:not(.is-edit) .wm-stage2{ cursor:grab; }
.wm-secline{ position:absolute; left:0; height:0; border-top:1px dashed #c7d0e0; z-index:1; pointer-events:none; }
.wm-seclbl{ position:absolute; top:3px; left:4px; font-size:10px; font-weight:700; color:#8a97b0; background:rgba(255,255,255,.7); border-radius:4px; padding:0 4px; }

.wm-mini__vp{ position:absolute; box-sizing:border-box; border:2px solid var(--navy-700); background:rgba(11,61,145,.10); cursor:grab; z-index:6; }
.wm-mini__vp:active{ cursor:grabbing; }

.wm-el--column{ background:repeating-linear-gradient(45deg,#e3e7ef,#e3e7ef 5px,#cdd5e3 5px,#cdd5e3 10px) !important; border:1.5px solid #6b7790 !important; border-radius:4px; }
.wm-el--column .wm-furn em{ color:#4a5366; }
.wm-el--fireext{ background:#fff4f4 !important; border:1.5px solid var(--danger) !important; border-radius:7px; }
.wm-el--stair{ background:#eefaf3 !important; border:1.5px solid #1f8a5b !important; }
.wm-el--elevator{ background:#eef4fe !important; border:1.5px solid #2a6fdb !important; }
.wm-win{ display:block; width:100%; height:100%; border-top:3px solid #5A9BD4; border-bottom:3px solid #5A9BD4; background:linear-gradient(#dcebf8,#eaf3fb); }
.wm-el--window{ background:transparent !important; border:none !important; }

/* grid min-width fix — let 1fr track shrink below content so the long world scrolls internally */
.wm-main{ min-width:0; }
.wm-main > *{ min-width:0; }
.wm-canvasframe{ min-width:0; }
.wm-canvaswrap{ min-width:0; }
.wm-viewport{ width:100%; }

/* ===== Warehouse map · floating game-style HUD (full-width canvas, 2026) ===== */
.wm-hud{ position:absolute; top:14px; right:14px; z-index:22; display:flex; gap:8px; transition:right .24s var(--ease-smooth,cubic-bezier(.4,0,.2,1)); }
.wm-hud__btn{ width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:rgba(255,255,255,.85); -webkit-backdrop-filter:blur(9px); backdrop-filter:blur(9px); box-shadow:0 4px 14px rgba(15,30,60,.14); color:var(--ink-2); display:grid; place-items:center; cursor:pointer; transition:background .15s, color .15s, transform .12s, box-shadow .15s; }
.wm-hud__btn:hover{ background:#fff; color:var(--navy-700); }
.wm-hud__btn:active{ transform:scale(.93); }
.wm-hud__btn.is-on{ background:var(--navy-700); color:#fff; border-color:var(--navy-700); box-shadow:0 4px 16px rgba(11,61,145,.34); }

.wm-hudstack{ position:absolute; top:60px; right:14px; z-index:20; display:flex; flex-direction:column; align-items:flex-end; gap:10px; transition:right .24s var(--ease-smooth,cubic-bezier(.4,0,.2,1)); pointer-events:none; }
.wm-hudstack > *{ pointer-events:auto; }
.wm-floatmini, .wm-floatlyr{ position:relative; border:1px solid rgba(255,255,255,.72); border-radius:15px; background:rgba(247,250,253,.86); -webkit-backdrop-filter:blur(14px) saturate(1.3); backdrop-filter:blur(14px) saturate(1.3); box-shadow:0 14px 38px rgba(15,30,60,.22), 0 0 0 1px rgba(15,30,60,.05); padding:11px 11px 9px; }
.wm-floatmini{ width:236px; animation:wmMiniIn .18s var(--ease-out,ease) both; }
.wm-floatlyr{ width:230px; animation:wmHudPop .18s var(--ease-out,ease) both; }
@keyframes wmHudPop{ from{ opacity:0; transform:translateY(-6px) scale(.97); } to{ opacity:1; transform:none; } }
/* mini entrance animates position only — opacity stays under slider control (no fill-mode clobber) */
@keyframes wmMiniIn{ from{ transform:translateY(-6px) scale(.97); } to{ transform:none; } }
.wm-floatmini .wm-mini, .wm-floatlyr .wm-layers{ background:transparent; border:0; box-shadow:none; padding:0; margin:0; }
.wm-floatmini .wm-mini__hd, .wm-floatlyr .wm-layers__hd{ padding-right:24px; margin-bottom:8px; }
.wm-floatx{ position:absolute; top:8px; right:8px; z-index:3; width:22px; height:22px; border-radius:7px; border:1px solid var(--line); background:#fff; color:var(--dim); display:grid; place-items:center; cursor:pointer; transition:.14s; }
.wm-floatx:hover{ color:var(--danger); border-color:var(--danger); background:#fff4f4; }
.wm-floatmini__op{ display:flex; align-items:center; gap:7px; margin-top:9px; padding-top:9px; border-top:1px solid var(--line); }
.wm-floatmini__op input[type=range]{ flex:1; min-width:0; height:4px; accent-color:var(--navy-700); cursor:pointer; }
.wm-floatmini__op em{ font-size:11px; font-weight:700; font-style:normal; color:var(--ink-2); min-width:32px; text-align:right; }

.wm-inspectdrawer{ position:absolute; top:14px; right:14px; bottom:14px; width:330px; z-index:16; overflow-y:auto; overflow-x:hidden; padding:1px; border-radius:16px; animation:wmDrawerIn .2s var(--ease-out,ease) both; }
@keyframes wmDrawerIn{ from{ opacity:0; transform:translateX(14px); } to{ opacity:1; transform:none; } }
.wm-inspectdrawer::-webkit-scrollbar{ width:7px; }
.wm-inspectdrawer::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:7px; }
.wm-inspectdrawer > *{ margin-bottom:0 !important; box-shadow:0 16px 44px rgba(15,30,60,.18) !important; }
.wm-main.has-inspect .wm-hud,
.wm-main.has-inspect .wm-hudstack{ right:352px; }

.wm-sumbtn--float{ position:absolute; right:14px; bottom:14px; z-index:15; width:auto; box-shadow:0 10px 30px rgba(15,30,60,.18); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); background:rgba(255,255,255,.92); }

@media (max-width:1180px){
  .wm-main.has-inspect .wm-hud,
  .wm-main.has-inspect .wm-hudstack{ right:14px; }
  .wm-inspectdrawer{ width:min(330px, calc(100% - 28px)); }
}
@media (prefers-reduced-motion: reduce){ .wm-floatmini, .wm-floatlyr, .wm-inspectdrawer{ animation:none; } }
.wm-el--box{ background:#fff !important; border:1.5px solid var(--navy-600) !important; border-radius:6px; }
.wm-el--staff{ background:#eafaf2 !important; border:1.5px solid #1f8a5b !important; border-radius:50% 50% 9px 9px; }
.wm-el--light{ background:#fff8e6 !important; border:1.5px solid #E0A92E !important; border-radius:50%; }
.wm-el--lswitch{ background:#fff !important; border:1.5px solid #6b7790 !important; border-radius:4px; }
.wm-el__lock{ position:absolute; top:2px; right:3px; font-size:10px; line-height:1; z-index:6; }
.wm-el.is-locked{ outline:1px dashed var(--dim); outline-offset:1px; }
.wm-el.is-locked.is-sel{ outline:2.5px solid var(--gold-500); }
.wm-viewport .wm-el.is-locked, .wm-canvaswrap .wm-el.is-locked{ cursor:default; }
.wm-catic{ position:absolute; top:2px; left:3px; opacity:.9; pointer-events:none; }
.wm-catic--area{ left:auto; right:6px; top:5px; background:rgba(255,255,255,.85); border-radius:6px; padding:1px 3px; }
.wm-front{ background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--sh-sm); padding:12px 14px; margin-bottom:12px; }
.wm-front__hd{ display:flex; align-items:center; gap:6px; font-size:13px; font-weight:800; color:var(--ink); margin-bottom:10px; flex-wrap:wrap; }
.wm-front__hd em{ font-style:normal; font-weight:600; font-size:11px; color:var(--dim); }
.wm-front__steps{ display:inline-flex; align-items:center; gap:2px; border:1px solid var(--line-2); border-radius:8px; overflow:hidden; }
.wm-front__steps button{ border:none; background:#fff; width:26px; height:24px; font-size:15px; font-weight:800; color:var(--navy-700); cursor:pointer; }
.wm-front__steps button:hover{ background:var(--surface-2); }
.wm-front__steps b{ min-width:54px; text-align:center; font-size:12px; color:var(--ink); }
.wm-front__lvin{ width:44px; border:none; text-align:center; font-family:var(--ff); font-size:13px; font-weight:800; color:var(--ink); outline:none; background:#fff; }
.wm-front__lvu{ font-size:11px; color:var(--dim); padding:0 4px; }
.wm-sumbtn{ width:100%; display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid var(--line); background:var(--surface); border-radius:12px; padding:14px; font-family:var(--ff); font-size:13px; font-weight:700; color:var(--navy-700); cursor:pointer; box-shadow:var(--sh-sm); }
.wm-sumbtn:hover{ border-color:var(--gold-400); background:#fffdf6; }
.wm-el__rackrng{ margin-left:8px; font-size:9.5px; font-weight:700; background:rgba(255,255,255,.22); border-radius:5px; padding:1px 6px; white-space:nowrap; }
.wmf-body .wm-sum{ box-shadow:none; border:none; }
.wm-front__rack{ display:flex; flex-direction:column; gap:6px; border:2px solid var(--ink-2); border-radius:8px; padding:6px; background:#f4f6fb; max-height:340px; overflow:auto; }
.wm-front__lv{ display:flex; align-items:stretch; gap:8px; border-bottom:2px solid var(--line-2); padding-bottom:6px; }
.wm-front__lv:last-child{ border-bottom:none; padding-bottom:0; }
.wm-front__lvn{ flex:0 0 52px; display:flex; align-items:center; font-size:11px; font-weight:800; color:var(--navy-700); }
.wm-front__cells{ flex:1; display:flex; gap:6px; flex-wrap:wrap; align-items:stretch; }
.wm-front__empty{ font-size:11px; color:var(--dim); align-self:center; }
.wm-front__box{ min-width:74px; flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:1px; border:1.5px solid; border-radius:6px; background:#fff; padding:5px 7px; box-shadow:inset 0 -3px 0 rgba(0,0,0,.07); cursor:pointer; transition:box-shadow .12s, transform .1s; }
.wm-front__box:hover{ transform:translateY(-1px); box-shadow:0 3px 9px -4px rgba(20,40,80,.4), inset 0 -3px 0 rgba(0,0,0,.07); }
.wm-front__box.is-sel{ outline:2.5px solid var(--gold-500); outline-offset:1px; }
.wm-front__box b{ font-size:11.5px; font-weight:800; color:var(--ink); white-space:nowrap; }
.wm-front__box span{ font-size:10.5px; font-weight:700; color:var(--navy-700); }
.wm-front__bar{ display:block; width:100%; height:5px; border-radius:4px; background:var(--surface-3); overflow:hidden; margin-top:1px; }
.wm-front__bar u{ display:block; height:100%; border-radius:4px; }
.wm-ok{ color:var(--ok-ink); }
.wm-add--cat{ font-weight:800; border-color:var(--navy-300,#9db3d6) !important; color:var(--navy-700) !important; }
.wm-add__chev{ opacity:.6; margin-left:1px; }
.wm-el--locker{ background:#eef1f7 !important; border:1.5px solid #3C485F !important; border-radius:4px; }
.wm-el--furn{ overflow:visible; }
.wm-el--furn .wm-furn em{ max-width:200%; }
.wm-audit{ background:var(--surface-2); border:1px solid var(--line); border-radius:11px; padding:11px; margin-top:10px; }
.wm-audit__hd{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:800; color:var(--navy-700); margin-bottom:6px; }
.wm-audit__sec2{ font-size:11px; font-weight:800; color:var(--navy-700); margin:7px 0 2px; border-top:1px solid var(--line); padding-top:6px; }
.wm-scnbar{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:7px 11px; margin-bottom:9px; box-shadow:var(--sh-sm); }
.wm-scnbar__lbl{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:800; color:var(--navy-700); }
.wm-scn{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-2); background:#fff; border-radius:99px; padding:5px 11px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.wm-scn em{ font-style:normal; font-size:9.5px; font-weight:800; border-radius:5px; padding:1px 5px; }
.wm-scn--current em{ background:var(--ok-bg); color:var(--ok-ink); }
.wm-scn--planning em{ background:var(--warn-bg); color:var(--warn-ink); }
.wm-scn--archived em{ background:var(--surface-3); color:var(--dim); }
.wm-scn.is-on{ border-color:var(--navy-700); box-shadow:0 0 0 1px var(--navy-700); color:var(--navy-700); }
.wm-scn__add{ display:inline-flex; align-items:center; gap:4px; border:1px dashed var(--navy-300,#9db3d6); background:#fff; border-radius:99px; padding:5px 11px; font-family:var(--ff); font-size:12px; font-weight:700; color:var(--navy-700); cursor:pointer; }
.wm-scn__b{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line-2); background:#fff; border-radius:8px; padding:5px 9px; font-family:var(--ff); font-size:11.5px; font-weight:700; color:var(--ink-2); cursor:pointer; }
.wm-scn__b--go{ border-color:#a7d7bd; color:var(--ok-ink); background:#f3fbf6; }
.wm-scn__b--del{ border-color:#e9c2c2; color:var(--danger-ink); }
.wm-audit__row{ display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--ink-2); padding:3px 0; }
.wm-audit__row b{ font-weight:800; }
.wm-audit__chips{ display:flex; flex-wrap:wrap; gap:5px; margin:2px 0 6px; }
.wm-audit__dup{ font-size:10.5px; font-weight:700; color:var(--danger-ink); background:var(--danger-bg); border-radius:6px; padding:2px 7px; }
.wm-audit__bar{ display:flex; align-items:center; gap:7px; margin:2px 0; }
.wm-audit__bar>span{ flex:0 0 92px; font-size:10.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-audit__bar i{ flex:1; height:7px; border-radius:5px; background:var(--surface-3); overflow:hidden; }
.wm-audit__bar i b{ display:block; height:100%; border-radius:5px; }
.wm-audit__bar em{ flex:0 0 34px; text-align:right; font-size:10.5px; font-weight:700; font-style:normal; color:var(--ink-2); }
.wm-audit__warn{ display:flex; align-items:flex-start; gap:5px; font-size:10.5px; color:var(--warn-ink); background:var(--warn-bg); border-radius:7px; padding:5px 8px; margin:4px 0; }

/* ── คำขออนุมัติ (ขั้น 5 · 3.5) ─────────────────────────────────────────── */
.aptabs{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.aptab{ border:1px solid var(--line); background:#fff; color:var(--ink-2); border-radius:999px;
  padding:7px 16px; font-size:12.5px; font-weight:700; cursor:pointer; }
.aptab.is-on{ background:var(--navy); border-color:var(--navy); color:#fff; }
.aptabs__hint{ font-size:11.5px; color:var(--ink-3); margin-left:4px; }
.apgrid{ display:flex; flex-direction:column; gap:10px; }
.apcard{ border:1px solid var(--line); border-radius:12px; background:#fff; padding:13px 15px; }
.apcard__hd{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.apcard__perm{ font-size:13.5px; font-weight:800; color:var(--navy); }
.apcard__who{ font-size:11.5px; color:var(--ink-3); margin-top:2px; }
.apcard__st{ flex:0 0 auto; font-size:11px; font-weight:800; border-radius:999px; padding:3px 10px; }
.apcard__why{ font-size:12px; color:var(--ink-2); margin-top:8px; font-style:italic; }
.apcard__pl{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:9px;
  background:var(--bg-2, #f8fafc); border-radius:8px; padding:8px 10px; }
.apcard__pl div{ font-size:11.5px; }
.apcard__pl span{ color:var(--ink-3); margin-right:5px; }
.apcard__pl b{ color:var(--ink-1); }
.apcard__ft{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:11px; }
.apcard__exp{ font-size:11px; color:var(--ink-3); }
.apcard__done{ font-size:11.5px; font-weight:700; color:#15803d; }
.apcard__acts{ display:flex; gap:8px; }
.apbtn{ border-radius:8px; padding:6px 15px; font-size:12px; font-weight:800; cursor:pointer; border:1px solid var(--line); background:#fff; color:var(--ink-2); }
.apbtn--ok{ background:var(--gold); border-color:var(--gold); color:#3b2f0b; }
.apbtn--no{ color:#b91c1c; }
.apbtn:disabled{ opacity:.55; cursor:default; }

/* กล่อง "งานนี้ต้องขออนุมัติ" — DOM ล้วน สร้างเมื่อเจอ 403 approval_required เท่านั้น */
.apask__ov{ position:fixed; inset:0; z-index:400; background:rgba(15,23,42,.45);
  display:flex; align-items:center; justify-content:center; padding:20px; }
.apask{ width:min(430px,100%); background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 18px 50px rgba(15,23,42,.28); font-family:inherit; }
.apask__hd{ background:var(--navy); color:#fff; font-size:14px; font-weight:800; padding:13px 18px; }
.apask__bd{ padding:15px 18px; font-size:12.5px; color:var(--ink-2); line-height:1.65; }
.apask__perm{ margin-top:9px; font-size:11.5px; color:var(--ink-3);
  background:var(--bg-2,#f8fafc); border-radius:7px; padding:5px 9px; display:inline-block; }
.apask__why{ width:100%; margin-top:11px; border:1px solid var(--line); border-radius:8px;
  padding:7px 9px; font-size:12px; font-family:inherit; resize:vertical; }
.apask__ft{ display:flex; justify-content:flex-end; gap:9px; padding:0 18px 16px; }
.apask__x, .apask__go{ border-radius:8px; padding:7px 17px; font-size:12.5px; font-weight:800; cursor:pointer; }
.apask__x{ border:1px solid var(--line); background:#fff; color:var(--ink-2); }
.apask__go{ border:1px solid var(--gold); background:var(--gold); color:#3b2f0b; }
.apask__go:disabled{ opacity:.6; cursor:default; }
.apcard__fact{ margin-top:7px; font-size:11.5px; color:var(--ink-2);
  background:#fffbeb; border:1px solid #fde68a; border-radius:7px; padding:5px 9px; display:inline-block; }
.apcard__fact b{ color:var(--navy); }

/* แชทรวม แบบที่ 3 (เจ้าของ 4 ต.ค. 2569 "ผ่าน เอาตามนั้นเลย" · ภาพ output/ภาพก่อน-หลัง-2569-10-04/3-แชทรวม-แบบที่3-*)
   หัวห้องแชทแคบ (≤620px · 1366/1440) = แถวบน ชื่อห้อง + ปุ่มหลัก · แถวล่าง ปุ่มรอง/ไอคอน — ชื่อห้องกับปุ่มเปิดบิลเห็นพร้อมกัน · กว้างกว่านั้นคงแถวเดียวเดิม */
.cxthread{container-type:inline-size}
@container (max-width:620px){
  .cxthread__hd{flex-wrap:wrap;row-gap:8px}
  .cxhdacts{display:contents}
  .cxhdacts>.btn{order:1}
  .cxthread__hd::after{content:"";order:2;flex-basis:100%;height:0}
  .cxhdacts>.cxhdbtn-wrap,.cxhdacts>.cxhdic{order:3}
}

/* เว็บร้าน: เหลือชิ้นเดียวในร้าน (เจ้าของ 4 ต.ค. 2569) — ไม่ใช่ "สินค้าหมด" · ชวนแชทถามร้านก่อนสั่ง */
.sf-card__ask{ color:#1f8a5b; }
.sf-ask{ flex-wrap:wrap; }
.sf-ask small{ flex-basis:100%; font-size:11px; font-weight:500; color:var(--dim); margin-top:2px; }

/* bpy-shop: Thai upper marks (น้ำ) clipped by line-clamp */
.sf-card__nm,.sfp-card__nm,.sf-cartrow__nm,.sf-chatprod__bd b{padding-top:2px;margin-top:-2px}
