/* Nắng Sài Gòn Operations — global interaction feedback R399.2 */
:root{--nsg-ux-ring:rgba(47,138,95,.22);--nsg-ux-hover:rgba(47,138,95,.055);--nsg-ux-active:rgba(47,138,95,.10)}
html{-webkit-tap-highlight-color:transparent}
.nsg-interactive{cursor:pointer;touch-action:manipulation;transition:transform 145ms ease,box-shadow 160ms ease,background-color 145ms ease,border-color 145ms ease,filter 145ms ease,opacity 145ms ease;will-change:transform}
.nsg-interactive:focus-visible{outline:3px solid var(--nsg-ux-ring)!important;outline-offset:2px}
@media (hover:hover) and (pointer:fine){
  .nsg-interactive:not(.nsg-ux-plain):not(:disabled):not([aria-disabled="true"]):hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(17,48,36,.10);filter:saturate(1.02)}
  .nsg-interactive.nsg-ux-plain:not(:disabled):not([aria-disabled="true"]):hover{filter:brightness(.96)}
}
.nsg-interactive.ns-pressed:not(:disabled):not([aria-disabled="true"]),
.nsg-interactive:active:not(:disabled):not([aria-disabled="true"]){transform:scale(.98)!important;box-shadow:0 2px 7px rgba(17,48,36,.10)!important;filter:brightness(.97)}
.nsg-interactive.ns-clicked{background-image:linear-gradient(var(--nsg-ux-active),var(--nsg-ux-active))!important}
.nsg-interactive.ns-busy{opacity:.72!important;cursor:progress!important;pointer-events:none!important;position:relative}
.nsg-interactive.ns-busy::after{content:"";display:inline-block;width:14px;height:14px;margin-left:8px;vertical-align:-2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:nsg-spin .7s linear infinite}
button.nsg-interactive:disabled,.nsg-interactive[aria-disabled="true"]{cursor:not-allowed;opacity:.58}
#nsg-global-progress{position:fixed;z-index:2147483647;left:0;top:0;height:3px;width:0;background:linear-gradient(90deg,#2f8a5f,#69c58d);opacity:0;pointer-events:none;transition:width 180ms ease,opacity 150ms ease;box-shadow:0 1px 5px rgba(47,138,95,.35)}
#nsg-global-progress.on{opacity:1;width:72%;animation:nsg-progress 1.1s ease-in-out infinite}
#nsg-global-progress.done{opacity:0;width:100%;animation:none}
@keyframes nsg-spin{to{transform:rotate(360deg)}}
@keyframes nsg-progress{0%{width:16%}50%{width:68%}100%{width:88%}}
@media (prefers-reduced-motion:reduce){.nsg-interactive,#nsg-global-progress{transition:none!important;animation:none!important}.nsg-interactive:hover{transform:none!important}}

/* R398.3 iPhone/iPad interaction + control balance */
@media (max-width: 820px){
  button,.btn,[role="button"],a.nsg-interactive,.nsg-interactive{min-height:44px}
  button,.btn{padding-left:12px;padding-right:12px}
  input,select,textarea{min-height:44px}
  .nsg-interactive.ns-pressed:not(:disabled):not([aria-disabled="true"]),
  .nsg-interactive:active:not(:disabled):not([aria-disabled="true"]){transform:scale(.98)!important;filter:brightness(.94)!important}
}
.nsg-action-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.nsg-action-row>*{min-width:0}
@media(max-width:560px){
  .nsg-action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .nsg-action-row>.nsg-primary-action{grid-column:1/-1}
}

/* R398.3 search clear affordance — global mobile/desktop */
.nsg-search-clear-wrap{position:relative;display:block;min-width:0;width:100%}
.nsg-search-clear-wrap>input{width:100%!important;padding-right:44px!important}
.nsg-search-clear{position:absolute!important;right:6px;top:50%;transform:translateY(-50%);z-index:4;width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(95,110,103,.12)!important;color:#52645c!important;font:600 24px/30px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;display:none;align-items:center;justify-content:center;box-shadow:none!important;cursor:pointer;touch-action:manipulation}
.nsg-search-clear.show{display:flex}
.nsg-search-clear:hover{background:rgba(47,138,95,.15)!important;color:#1e6d4a!important}
.nsg-search-clear:active{transform:translateY(-50%) scale(.92)!important}
@media(max-width:820px){.nsg-search-clear{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;right:4px}.nsg-search-clear-wrap>input{padding-right:46px!important}}


/* R399.2 dual-edge scroll-to-top: tiny, edge-safe, usable by either hand */
.nsg-scrolltop{position:fixed!important;z-index:2147483000;top:56vh;width:34px!important;height:44px!important;min-width:34px!important;min-height:44px!important;padding:0!important;margin:0!important;border:1px solid rgba(31,107,69,.18)!important;background:rgba(255,255,255,.88)!important;color:#176b45!important;border-radius:12px!important;box-shadow:0 4px 14px rgba(17,48,36,.16)!important;font:900 23px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;display:flex!important;align-items:center;justify-content:center;opacity:0;pointer-events:none;transform:translateY(8px) scale(.92)!important;transition:opacity 140ms ease,transform 140ms ease,background 140ms ease!important;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.nsg-scrolltop-left{left:3px}.nsg-scrolltop-right{right:3px}.nsg-scrolltop.show{opacity:.78;pointer-events:auto;transform:translateY(0) scale(1)!important}.nsg-scrolltop.show:active{opacity:1;transform:scale(.92)!important;background:rgba(227,246,236,.96)!important}
@media (hover:hover) and (pointer:fine){.nsg-scrolltop.show:hover{opacity:1;transform:translateY(-2px)!important}}
@media(max-width:820px){.nsg-scrolltop{width:32px!important;height:42px!important;min-width:32px!important;min-height:42px!important;border-radius:11px!important;font-size:22px!important}.nsg-scrolltop-left{left:2px}.nsg-scrolltop-right{right:2px}}


/* R399.2 global list readability — subtle alternating rows only inside list-like containers */
:where(.list,[id$="List"],[id$="list"],[id$="Results"],[id$="results"]) > :nth-child(even):not(.loading):not(.empty),
tbody > tr:nth-child(even),
.day:nth-of-type(even),.breakdown:nth-of-type(even),.order:nth-of-type(even),.item:nth-of-type(even),.customer:nth-of-type(even),.product:nth-of-type(even),.temp:nth-of-type(even),.farm-row:nth-of-type(even){background-color:rgba(31,107,69,.038)}
:where(.list,[id$="List"],[id$="list"],[id$="Results"],[id$="results"]) > :nth-child(odd):not(.loading):not(.empty),
tbody > tr:nth-child(odd){background-color:rgba(255,255,255,.86)}


/* R399.10 configurable mobile quick menu */
.nsg-qm-button,.nsg-qm-drawer,.nsg-qm-shade{display:none}
@media(max-width:900px){
  body.nsg-qm-enabled > header,body.nsg-qm-enabled > .top,body.nsg-qm-enabled .shell > .topbar,body.nsg-qm-enabled > .nsg-head{padding-left:56px!important}
  html.nsg-qm-open,html.nsg-qm-open body{overflow:hidden!important}
  .nsg-qm-button{display:flex!important;position:fixed!important;z-index:2147483550;left:6px;top:calc(8px + env(safe-area-inset-top));width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;padding:0!important;border:1px solid rgba(255,255,255,.62)!important;border-radius:12px!important;background:rgba(18,83,57,.92)!important;color:#fff!important;box-shadow:0 5px 16px rgba(0,0,0,.20)!important;align-items:center;justify-content:center;font:900 25px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
  .nsg-qm-button:active{transform:scale(.94)!important}
  .nsg-qm-shade{display:block;position:fixed;z-index:2147483555;inset:0;background:rgba(3,18,12,.36);opacity:0;pointer-events:none;transition:opacity 180ms ease;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px)}
  .nsg-qm-shade.open{opacity:1;pointer-events:auto}
  .nsg-qm-drawer{display:flex;position:fixed;z-index:2147483560;left:0;top:0;bottom:0;width:min(88vw,370px);background:#f6faf7;color:#17392d;box-shadow:14px 0 40px rgba(0,0,0,.23);transform:translateX(-104%);transition:transform 220ms cubic-bezier(.2,.8,.2,1);flex-direction:column;padding-top:env(safe-area-inset-top);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
  .nsg-qm-drawer.open{transform:translateX(0)}
  .nsg-qm-head{display:flex;align-items:center;gap:10px;padding:14px 12px 10px;background:linear-gradient(135deg,#155f3e,#237b52);color:#fff;min-height:72px}.nsg-qm-head>div{flex:1}.nsg-qm-head b{display:block;font-size:18px}.nsg-qm-head small{display:block;margin-top:3px;opacity:.85;font-size:12px}.nsg-qm-head button{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;padding:0!important;border:0;border-radius:13px;background:#ffffff20;color:#fff;font-size:28px}
  #nsg-qm-body{padding:10px 10px calc(14px + env(safe-area-inset-bottom));overflow:auto;-webkit-overflow-scrolling:touch;flex:1}
  .nsg-qm-list{display:grid;gap:7px}.nsg-qm-item{display:grid;grid-template-columns:38px 1fr 24px;align-items:center;gap:8px;text-decoration:none;color:#183e31;background:#fff;border:1px solid #dce9e1;border-radius:15px;padding:10px 11px;min-height:54px;font-weight:800;box-shadow:0 2px 8px rgba(22,70,48,.045)}.nsg-qm-item.current{background:#e5f5eb;border-color:#89c9a3;color:#11623c}.nsg-qm-icon{font-size:22px;text-align:center}.nsg-qm-go{font-size:27px;color:#769087;text-align:right}.nsg-qm-edit{width:100%;margin-top:10px;border:0;border-radius:14px;background:#e9efec;color:#24463a;font-weight:900;padding:11px}
  .nsg-qm-edit-title{padding:8px 4px 6px}.nsg-qm-edit-title b{display:block}.nsg-qm-edit-title small{display:block;color:#73837d;font-size:11px;margin-top:2px}.nsg-qm-manage{display:grid;gap:6px}.nsg-qm-manage-row{display:grid;grid-template-columns:32px 1fr 38px 38px 42px;align-items:center;gap:5px;background:#fff;border:1px solid #dde9e2;border-radius:13px;padding:7px}.nsg-qm-label{font-weight:800;font-size:14px;min-width:0}.nsg-qm-manage-row button{min-width:36px!important;min-height:38px!important;padding:0!important;border:0;border-radius:10px;background:#eef4f0;color:#1e6547;font-weight:900}.nsg-qm-manage-row button[data-act="hide"]{background:#fff0ef;color:#a83830}.nsg-qm-manage-row button:disabled{opacity:.28}
  .nsg-qm-add-list{display:grid;grid-template-columns:1fr 1fr;gap:7px}.nsg-qm-add{display:flex!important;align-items:center;justify-content:space-between;text-align:left;gap:6px;border:1px solid #dce8e1;border-radius:12px;background:#fff;color:#21473a;font-weight:800;padding:9px!important;min-height:46px}.nsg-qm-add b{font-size:20px;color:#187548}.nsg-qm-edit-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.nsg-qm-edit-actions button{border:0;border-radius:13px;padding:11px;font-weight:900;background:#e7ece9;color:#32493f}.nsg-qm-edit-actions button:last-child{background:#1e754e;color:#fff}
}
@media(max-width:430px){.nsg-qm-button{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;font-size:23px!important}.nsg-qm-add-list{grid-template-columns:1fr}}


/* R399.22 — MOBILE HEADER ULTRA COMPACT
   Goal: keep only one slim identity row on iPhone; navigation lives in the fixed quick-menu button.
   Scoped to top-level page headers so content cards/subtitles elsewhere are untouched. */
@media(max-width:900px){
  body.nsg-qm-enabled{padding-top:0!important}

  /* Top-level header shells */
  body.nsg-qm-enabled > header,
  body.nsg-qm-enabled > .top,
  body.nsg-qm-enabled > .nsg-head,
  body.nsg-qm-enabled .shell > .topbar{
    min-height:54px!important;
    max-height:62px!important;
    margin:0!important;
    padding:6px 8px 6px 54px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* Inner wrappers used by different modules */
  body.nsg-qm-enabled > header > .head,
  body.nsg-qm-enabled > header > .bar,
  body.nsg-qm-enabled > header > .topin,
  body.nsg-qm-enabled > .top > .head,
  body.nsg-qm-enabled > .top > .bar,
  body.nsg-qm-enabled > .top > .topin,
  body.nsg-qm-enabled > .nsg-head > .nsg-head-in{
    min-height:42px!important;
    height:42px!important;
    max-width:none!important;
    width:100%!important;
    margin:0!important;
    padding:0 4px!important;
    gap:8px!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    overflow:hidden!important;
  }

  /* Logo: one compact size everywhere */
  body.nsg-qm-enabled > header img.logo,
  body.nsg-qm-enabled > header .nsg-r391-logo,
  body.nsg-qm-enabled > header > .head > img,
  body.nsg-qm-enabled > .top img.logo,
  body.nsg-qm-enabled > .top .nsg-r391-logo,
  body.nsg-qm-enabled > .nsg-head img.logo,
  body.nsg-qm-enabled .shell > .topbar .nsg-r391-logo{
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
    border-radius:9px!important;flex:0 0 34px!important;margin:0!important
  }

  /* Brand/title text reduced to a single readable line */
  body.nsg-qm-enabled > header h1,
  body.nsg-qm-enabled > header h2,
  body.nsg-qm-enabled > header .title,
  body.nsg-qm-enabled > header b,
  body.nsg-qm-enabled > .top h1,
  body.nsg-qm-enabled > .top h2,
  body.nsg-qm-enabled > .top .title,
  body.nsg-qm-enabled > .top b,
  body.nsg-qm-enabled > .nsg-head .brand b,
  body.nsg-qm-enabled .shell > .topbar h1{
    font-size:16px!important;line-height:1.1!important;margin:0!important;letter-spacing:0!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important
  }

  body.nsg-qm-enabled > header .nsg-r391-kicker,
  body.nsg-qm-enabled > header small,
  body.nsg-qm-enabled > header .sub,
  body.nsg-qm-enabled > header .subtitle,
  body.nsg-qm-enabled > .top .nsg-r391-kicker,
  body.nsg-qm-enabled > .top small,
  body.nsg-qm-enabled > .top .sub,
  body.nsg-qm-enabled > .top .subtitle,
  body.nsg-qm-enabled > .nsg-head .brand span,
  body.nsg-qm-enabled .shell > .topbar .eyebrow,
  body.nsg-qm-enabled .shell > .topbar .subtitle,
  body.nsg-qm-enabled .shell > .topbar .avatar{
    display:none!important
  }

  /* Mobile quick menu replaces redundant header navigation/home buttons. */
  body.nsg-qm-enabled > header .home,
  body.nsg-qm-enabled > header a[href="/"],
  body.nsg-qm-enabled > header button[onclick*="location.href='/'"],
  body.nsg-qm-enabled > header button[onclick*='location.href="/"'],
  body.nsg-qm-enabled > .top .home,
  body.nsg-qm-enabled > .top a[href="/"],
  body.nsg-qm-enabled > .nsg-head .nav,
  body.nsg-qm-enabled .shell > .topbar .home{
    display:none!important
  }

  /* Home page uses its own shell; reclaim the top whitespace too. */
  body.nsg-qm-enabled .shell{padding-top:8px!important}
  body.nsg-qm-enabled .shell > .topbar{padding-left:54px!important;justify-content:flex-start!important}
  body.nsg-qm-enabled .shell > .topbar .nsg-r391-brandline{min-width:0!important;gap:8px!important}
  body.nsg-qm-enabled .shell > .topbar .nsg-r391-brandline>div{min-width:0!important}

  /* Hamburger itself: small but still >= 36px touch target. */
  .nsg-qm-button{top:calc(7px + env(safe-area-inset-top))!important;left:7px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:11px!important;font-size:22px!important}
}
@media(max-width:430px){
  body.nsg-qm-enabled > header,
  body.nsg-qm-enabled > .top,
  body.nsg-qm-enabled > .nsg-head,
  body.nsg-qm-enabled .shell > .topbar{min-height:50px!important;max-height:56px!important;padding-top:5px!important;padding-bottom:5px!important;padding-left:50px!important}
  body.nsg-qm-enabled > header > .head,
  body.nsg-qm-enabled > header > .bar,
  body.nsg-qm-enabled > header > .topin,
  body.nsg-qm-enabled > .top > .head,
  body.nsg-qm-enabled > .top > .bar,
  body.nsg-qm-enabled > .top > .topin,
  body.nsg-qm-enabled > .nsg-head > .nsg-head-in{height:40px!important;min-height:40px!important}
  body.nsg-qm-enabled > header h1,
  body.nsg-qm-enabled > header h2,
  body.nsg-qm-enabled > header .title,
  body.nsg-qm-enabled > header b,
  body.nsg-qm-enabled > .top h1,
  body.nsg-qm-enabled > .top h2,
  body.nsg-qm-enabled > .top .title,
  body.nsg-qm-enabled > .top b,
  body.nsg-qm-enabled > .nsg-head .brand b,
  body.nsg-qm-enabled .shell > .topbar h1{font-size:15px!important}
}

/* R399.22b — normalize the many legacy header DOM shapes to one compact row. */
@media(max-width:900px){
  body.nsg-qm-enabled > header{display:flex!important;align-items:center!important;gap:8px!important;justify-content:flex-start!important}
  body.nsg-qm-enabled > header > .nsg-r391-brandline{flex:0 0 34px!important;width:34px!important;min-width:34px!important;margin:0!important;gap:0!important;overflow:hidden!important}
  body.nsg-qm-enabled > header > .nsg-r391-brandline > div{display:none!important}
  body.nsg-qm-enabled > header > .head,
  body.nsg-qm-enabled > header > .row,
  body.nsg-qm-enabled > header > div:not(.nsg-r391-brandline){flex:1!important;min-width:0!important;margin:0!important}
  body.nsg-qm-enabled > header > div:not(.nsg-r391-brandline) > span{display:block!important;font-size:15px!important;font-weight:900!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  /* Header navigation duplicates the hamburger quick-menu on phones. */
  body.nsg-qm-enabled > header button,
  body.nsg-qm-enabled > header a.home,
  body.nsg-qm-enabled > header a.btn[href="/"],
  body.nsg-qm-enabled > header a[href="/"]{display:none!important}

  /* Order header: logo + one-line title only. */
  body.nsg-qm-enabled > header.order-header{display:flex!important}
  body.nsg-qm-enabled > header.order-header .order-brand{flex:0 0 30px!important;width:30px!important;min-width:30px!important}
  body.nsg-qm-enabled > header.order-header .order-brand>div{display:none!important}
  body.nsg-qm-enabled > header.order-header .order-title-row{flex:1!important;min-width:0!important}
  body.nsg-qm-enabled > header.order-header .order-title{font-size:14px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body.nsg-qm-enabled > header.order-header .order-home{display:none!important}

  /* Warehouse and other .top pages that use an anonymous wrapper. */
  body.nsg-qm-enabled > .top > div:first-child:not(.bar):not(.topin):not(.head):not(.nsg-r391-brandline){
    height:42px!important;min-height:42px!important;display:flex!important;align-items:center!important;gap:8px!important;margin:0!important;padding:0!important
  }
  body.nsg-qm-enabled > .top > div:first-child > div:first-child{min-width:0!important;flex:1!important}
  body.nsg-qm-enabled > .top .home-btn{display:none!important}
  body.nsg-qm-enabled > .top .bar > img{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;border-radius:9px!important}

  /* No top-level header may consume a second row just for branding. */
  body.nsg-qm-enabled > header .nsg-r391-brandline[style*="margin-bottom"]{margin-bottom:0!important}
}

/* R399.29 VERSION GUARD — live server version, visible across Operations pages. */
.nsg-version-badge{position:fixed;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:240;border:1px solid #cfd9d2;background:rgba(255,255,255,.94);color:#335448;border-radius:999px;padding:6px 10px;font:800 11px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;box-shadow:0 4px 14px #0002;backdrop-filter:blur(8px);opacity:.86}.nsg-version-badge.live{border-color:#a7d8b9;color:#176642}.nsg-version-badge.mismatch{border-color:#f3a39d;background:#fff1f0;color:#b42318;opacity:1}@media(max-width:620px){.nsg-version-badge{font-size:10px;padding:5px 8px;bottom:max(8px,env(safe-area-inset-bottom));right:max(8px,env(safe-area-inset-right))}}

.nsg-order-alert-toast{position:fixed;z-index:2147483645;right:16px;top:16px;width:min(390px,calc(100vw - 32px));background:#fff;border:2px solid #2b7a57;border-radius:18px;box-shadow:0 16px 45px rgba(0,0,0,.22);padding:14px;color:#173b2d}.nsg-order-alert-title{font-size:18px;font-weight:950}.nsg-order-alert-body{margin-top:5px;font-size:14px;line-height:1.45}.nsg-order-alert-toast button{margin-top:10px;width:100%;border:0;border-radius:11px;background:#21754e;color:#fff;padding:10px;font-weight:900}.notify-status-on{color:#176642;font-weight:900}.notify-status-off{color:#9a6410;font-weight:900}

/* R399.32.43 multilingual display guard */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body,input,button,select,textarea{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP","Yu Gothic UI","Meiryo",Arial,sans-serif}
img{image-orientation:from-image}
