
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root{
  --sidebar-w:244px;
  --top-h:64px;
  --nav:#111315;
  --nav2:#1a1d21;
  --nav3:#22262b;
  --nav-text:#c6cbd1;
  --nav-muted:#757c85;
  --bg:#f0f1f2;
  --surface:#fff;
  --soft:#f6f7f8;
  --line:#e4e6e9;
  --text:#17191c;
  --muted:#767d86;
  --shadow:0 1px 2px rgba(16,18,22,.03),0 10px 30px rgba(16,18,22,.045);
  --good:#2f7350;
  --good-bg:#e8f2ec;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
button,input,select{font:inherit}
button{cursor:pointer}

.nav{
  position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);
  display:flex;flex-direction:column;background:var(--nav);color:var(--nav-text);
  z-index:70;overflow:hidden
}
.brand-row{
  min-height:74px;
  flex:0 0 74px;
  padding:18px 17px 13px;
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid #24282d;
}
.xyz-logo{
  display:block;
  width:84px;
  height:auto;
  flex:0 0 84px;
  object-fit:contain;
}
.logo-on-light{display:none}
.logo-on-dark{display:block}
.brand-system{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:31px;
  padding-left:10px;
  letter-spacing:.08em;
}
.brand-system::before{
  content:"";
  position:absolute;
  left:0;
  top:2px;
  bottom:2px;
  width:1px;
  background:#444a51;
}
.brand-system strong{
  font-size:10px;
  line-height:1;
  color:#fff;
}
.brand-system span{
  margin-top:5px;
  font-size:7px;
  line-height:1;
  color:#777e87;
}
.nav-scroll{flex:1;overflow:auto;padding:8px 10px 18px}
.nav-cap{padding:12px 11px 7px;color:#737b84;font-size:9px;font-weight:800;letter-spacing:.18em}
.menu-group{margin-bottom:4px}
.menu-head,.menu-item{
  width:100%;border:0;text-align:left;display:flex;align-items:center;color:inherit;
  background:transparent
}
.menu-head{
  min-height:45px;padding:0 13px;border-radius:13px;gap:12px;font-weight:650;font-size:13px
}
.menu-head:hover,.menu-head.current{background:#20242a;color:#fff}
.menu-icon{width:18px;display:grid;place-items:center;color:#8e959e;font-size:15px}
.chev{margin-left:auto;color:#717983;transition:transform .15s}
.menu-group.open .chev{transform:rotate(90deg)}
.menu-items{display:none;padding:3px 0 5px 31px}
.menu-group.open .menu-items{display:block}
.menu-item{
  position:relative;min-height:34px;padding:0 12px;border-radius:10px;color:#9fa5ac;font-size:12px
}
.menu-item:hover{color:#fff;background:#191d21}
.menu-item.current{background:#2a2f35;color:#fff;font-weight:700}
.menu-item.future::after{
  content:"";width:5px;height:5px;border-radius:50%;background:#8a9098;margin-left:auto
}
.user-card{
  margin:10px;padding:12px;border-radius:14px;background:#1a1d21;display:flex;align-items:center;gap:10px
}
.avatar{width:35px;height:35px;border-radius:10px;background:#fff;color:#111;display:grid;place-items:center;font-weight:900;font-size:11px}
.user-copy{display:flex;flex-direction:column;min-width:0}
.user-copy strong{font-size:11px;color:#f3f4f5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-copy span{font-size:8px;color:#737b84;margin-top:3px;letter-spacing:.06em}

.topbar{
  position:fixed;left:var(--sidebar-w);right:0;top:0;height:var(--top-h);
  display:flex;align-items:center;gap:12px;padding:0 20px;border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.96);backdrop-filter:blur(12px);z-index:60
}
.hamburger{width:38px;height:38px;border:0;border-radius:12px;background:#f1f2f3;color:#656b73;font-size:15px}
.context{min-width:170px}
.context-path{font-size:9px;color:#899099;margin-bottom:1px}
.context-title{font-size:15px;font-weight:850;letter-spacing:-.02em}
.theme-switch{margin-left:auto;display:flex;border:1px solid #c8c8c8;background:#fff}
.theme-btn{height:26px;min-width:52px;border:0;background:transparent;color:#777;font-size:10px;font-weight:800}
.theme-btn.active{background:#111;color:#fff}
.top-user{font-size:10px;color:#777d84;white-space:nowrap}
.status-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2ab96b;margin-right:6px}
.role{border-left:1px solid #d9dce0;padding-left:12px;color:#747a81;font-size:9px}
.logout{height:30px;padding:0 14px;border:1px solid #d2d5d8;background:#fff;font-size:10px;font-weight:700}

.main{
  position:fixed;left:var(--sidebar-w);right:0;top:var(--top-h);bottom:0;
  background:var(--bg);overflow:hidden;display:flex;flex-direction:column
}
.tabs{
  min-height:55px;padding:10px 18px 4px;display:flex;gap:8px;overflow-x:auto;flex:0 0 auto
}
.tab{
  min-width:106px;height:38px;border:0;border-radius:0;background:#e3e5e8;color:#777f88;
  display:flex;align-items:center;justify-content:space-between;padding:0 10px;font-size:11px
}
.tab.active{background:#fff;color:#16191d;font-weight:750;box-shadow:var(--shadow)}
.tab-close{margin-left:8px;border:0;background:transparent;color:#9299a2;font-size:14px;padding:2px}
.toolbar{
  margin:0 18px;min-height:52px;padding:8px 10px;background:var(--surface);
  border-radius:18px;box-shadow:var(--shadow);display:flex;align-items:center;gap:8px;flex:0 0 auto
}
.toolbar button{
  height:36px;padding:0 14px;border:1px solid #d9dcdf;border-radius:12px;background:#fff;color:#17191c;
  font-size:11px;font-weight:750
}
.toolbar button:hover{background:#f2f3f4}
.toolbar button.primary{background:#111315;color:#fff;border-color:#111315}
.toolbar button.danger{border-color:#d86a62;color:#b23f37}
.work{flex:1;overflow:auto;padding:36px 18px 70px}
.bottom-status{
  position:absolute;left:18px;right:18px;bottom:0;height:34px;display:flex;justify-content:space-between;align-items:center;
  color:#7d848c;font-size:9px;background:linear-gradient(to top,var(--bg) 70%,transparent)
}
.page{background:var(--surface);border-radius:18px;box-shadow:var(--shadow);padding:18px}
.note{padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:#747b83;font-size:11px;line-height:1.6}
.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
.summary{min-height:104px;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.summary .k{font-size:10px;color:#777e86}.summary .v{font-size:25px;font-weight:850;margin-top:10px}.summary .s{font-size:9px;color:#8b929a;margin-top:4px}
.filter{margin-top:12px;padding:13px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface);display:grid;grid-template-columns:1fr 170px;gap:10px}
.field label{display:block;font-size:9px;color:#747b83;margin:0 0 6px 2px}
.field input,.field select{width:100%;height:38px;border:1px solid #d8dce0;border-radius:10px;background:var(--soft);padding:0 12px;color:var(--text)}
.table-card{margin-top:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:930px;font-size:10px}
th{height:36px;padding:0 10px;text-align:left;background:#f4f5f6;color:#656c74;border-bottom:1px solid #e3e6e9;font-weight:750}
td{height:42px;padding:0 10px;border-bottom:1px solid #edf0f2;color:#22272c}
tr:last-child td{border-bottom:0}
.badge{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;background:var(--good-bg);color:var(--good);font-weight:750;font-size:9px}
.link-btn{border:0;background:transparent;text-decoration:underline;color:#34393f;font-weight:700}
.home-hero{padding:26px}
.home-title{font-size:27px;font-weight:850;letter-spacing:-.04em}.home-sub{margin-top:8px;color:#7e858d;font-size:12px}
.home-panels{display:grid;grid-template-columns:1.4fr 1fr;gap:12px;margin-top:14px}
.panel{background:var(--surface);border-radius:18px;box-shadow:var(--shadow);padding:18px}
.panel-head{display:flex;justify-content:space-between;font-size:12px;font-weight:800;margin-bottom:14px}
.panel-head span{padding:3px 8px;border-radius:999px;background:#f0f2f4;color:#7b828a;font-size:9px;font-weight:600}
.quick-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}
.quick{padding:14px;border-radius:13px;background:#f6f7f8}
.quick strong{display:block;font-size:11px}.quick small{display:block;color:#888f97;margin-top:5px;font-size:9px}
.placeholder{padding:54px 20px;text-align:center;color:#8a9198}
.placeholder strong{display:block;color:var(--text);font-size:16px;margin-bottom:8px}
.mock-tag{display:inline-block;margin-bottom:14px;padding:5px 9px;border-radius:999px;background:#eceff2;color:#69717a;font-size:9px;font-weight:800}

html[data-erp-theme="dark"]{
  --bg:#111315;--surface:#1a1d21;--soft:#20242a;--line:#30353b;--text:#e7e9ec;--muted:#9299a2;
  --shadow:0 1px 2px rgba(0,0,0,.2),0 10px 30px rgba(0,0,0,.16);--good-bg:#20342b;--good:#91c7a7
}
html[data-erp-theme="dark"] .topbar{background:rgba(24,27,31,.97);border-bottom-color:#2d3136}
html[data-erp-theme="dark"] .hamburger{background:#24282d;color:#cbd0d6}
html[data-erp-theme="dark"] .context-path,html[data-erp-theme="dark"] .top-user,html[data-erp-theme="dark"] .role{color:#949aa2}
html[data-erp-theme="dark"] .role{border-left-color:#3b4046}
html[data-erp-theme="dark"] .theme-switch{border-color:#41464d;background:#20242a}
html[data-erp-theme="dark"] .theme-btn{color:#949aa2}
html[data-erp-theme="dark"] .theme-btn.active{background:#f3f4f5;color:#111315}
html[data-erp-theme="dark"] .logout{background:#20242a;color:#d9dde1;border-color:#41464d}
html[data-erp-theme="dark"] .tab{background:#20242a;color:#9299a2}
html[data-erp-theme="dark"] .tab.active{background:#1a1d21;color:#f0f1f3}
html[data-erp-theme="dark"] .toolbar button{background:#25292f;color:#d9dde1;border-color:#33383e}
html[data-erp-theme="dark"] .toolbar button:hover{background:#2d3238;color:#fff}
html[data-erp-theme="dark"] .toolbar button.primary{background:#f2f3f4;color:#111315}
html[data-erp-theme="dark"] .field input,
html[data-erp-theme="dark"] .field select{border-color:#41464d;background:#20242a;color:#eef0f2}
html[data-erp-theme="dark"] th{background:#24282d;color:#bfc5cc;border-color:#33383e}
html[data-erp-theme="dark"] td{border-color:#2d3238}
html[data-erp-theme="dark"] .quick{background:#22262b}
html[data-erp-theme="dark"] .mock-tag{background:#282d33;color:#9299a2}


/* Legacy theme behavior:
   LIGHT mode = dark sidebar / white logo
   DARK mode  = light sidebar / black logo */
html[data-erp-theme="dark"] .nav{
  background:#f1f2f3;
  color:#15171a;
  border-right:1px solid #d7dbe0;
}
html[data-erp-theme="dark"] .brand-row{
  border-bottom-color:#d9dde1;
}
html[data-erp-theme="dark"] .logo-on-dark{display:none}
html[data-erp-theme="dark"] .logo-on-light{display:block}
html[data-erp-theme="dark"] .brand-system::before{background:#c5c9ce}
html[data-erp-theme="dark"] .brand-system strong{color:#111315}
html[data-erp-theme="dark"] .brand-system span{color:#7a8189}
html[data-erp-theme="dark"] .nav-cap{color:#8b9198}
html[data-erp-theme="dark"] .menu-head{color:#535a62}
html[data-erp-theme="dark"] .menu-head:hover,
html[data-erp-theme="dark"] .menu-head.current{
  background:#dfe2e6;
  color:#111315;
}
html[data-erp-theme="dark"] .menu-icon{color:#7a8189}
html[data-erp-theme="dark"] .chev{color:#8b9198}
html[data-erp-theme="dark"] .menu-item{color:#6b727a}
html[data-erp-theme="dark"] .menu-item:hover{
  background:#e5e7ea;
  color:#111315;
}
html[data-erp-theme="dark"] .menu-item.current{
  background:#d6d9dd;
  color:#111315;
}
html[data-erp-theme="dark"] .menu-item.future::after{background:#8b9198}
html[data-erp-theme="dark"] .user-card{
  background:#e3e6e9;
}
html[data-erp-theme="dark"] .avatar{
  background:#111315;
  color:#ffffff;
}
html[data-erp-theme="dark"] .user-copy strong{color:#17191c}
html[data-erp-theme="dark"] .user-copy span{color:#777e87}

.mobile-backdrop{display:none}

@media(max-width:980px){
  .nav{transform:translateX(-100%);transition:transform .18s ease}
  body.mobile-nav-open .nav{transform:translateX(0)}
  .topbar,.main{left:0}
  .mobile-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:65}
  body.mobile-nav-open .mobile-backdrop{display:block}
  .top-user,.role{display:none}
}
@media(max-width:720px){
  .context{min-width:0;flex:1}.context-path{display:none}.context-title{font-size:13px}
  .logout{display:none}.theme-btn{min-width:44px}
  .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .filter{grid-template-columns:1fr}
  .home-panels{grid-template-columns:1fr}
}

/* ── STEP 6-1 기준정보 조회 화면 ── */
.ref-filter{margin-top:12px;padding:13px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface);display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}
.ref-filter .field{flex:1 1 190px;min-width:140px}
.ref-filter .field.grow{flex:3 1 320px}
.ref-status{margin-top:10px;font-size:10px;color:#8b929a;display:flex;justify-content:space-between;gap:12px}
.ref-source{font-size:9px;color:#8b929a}
.p6-pill{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:999px;background:#eceff2;color:#69717a;font-weight:750;font-size:9px}
.p6-pill.ok{background:var(--good-bg);color:var(--good)}
.p6-pill.bad{background:#f6e9e8;color:#b23f37}
td.num,th.num,td.center,th.center,td.money,th.money{text-align:right}
td.center,th.center{text-align:center}
td.code{font-variant-numeric:tabular-nums;font-weight:700;color:#20242a}
html[data-erp-theme="dark"] td.code{color:#e7e9ec}
html[data-erp-theme="dark"] .p6-pill{background:#282d33;color:#9299a2}
html[data-erp-theme="dark"] .p6-pill.bad{background:#3a2a2a;color:#e0a6a1}
/* fix: 다크모드 표 본문 가독성 */
html[data-erp-theme="dark"] td{color:#dfe3e7}


/* ═══════════════════════════════════════════════════════
   GATE H · Legacy R8.12.1 common UI shell parity
   ═══════════════════════════════════════════════════════ */
.nav,.topbar,.main{transition:left .18s ease,width .18s ease,transform .18s ease,opacity .16s ease}
body.p21-sidebar-hidden .nav{transform:translateX(-102%);opacity:0;visibility:hidden;pointer-events:none}
body.p21-sidebar-hidden .topbar,body.p21-sidebar-hidden .main{left:0}

.tab{position:relative;flex:0 0 auto;cursor:grab;user-select:none;transition:opacity .1s ease,background .1s ease,box-shadow .1s ease}
.tab:active{cursor:grabbing}.tab.dragging{opacity:.38}.tab.drag-before{box-shadow:inset 3px 0 0 #111315}.tab.drag-after{box-shadow:inset -3px 0 0 #111315}
.tab-main{min-width:0;flex:1;height:100%;border:0;background:transparent;color:inherit;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;cursor:grab}
.tab-main:active{cursor:grabbing}.tabs{scrollbar-width:thin}.tab-close:hover{background:rgba(0,0,0,.08);color:var(--text)}

.erp-activity-text{min-width:0;max-width:220px;display:none;color:#747b83;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.erp-activity-text.on{display:block}.toolbar button:disabled{opacity:.46;cursor:not-allowed;pointer-events:none}.toolbar button.is-working::after{content:" …"}
.table-wrap{max-height:calc(100vh - 310px);overflow:auto}.table-wrap th{position:sticky;top:0;z-index:4}

.erp-toast-host{position:fixed;right:22px;bottom:22px;z-index:20000;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.erp-toast{max-width:360px;padding:11px 14px;border-radius:12px;background:#17191c;color:#fff;font-size:11px;box-shadow:0 14px 34px rgba(0,0,0,.18);opacity:0;transform:translateY(8px);transition:.18s ease}.erp-toast.show{opacity:1;transform:translateY(0)}
.erp-modal-backdrop{position:fixed;inset:0;z-index:19900;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.42)}.erp-modal-backdrop.open{display:flex}
.erp-modal{width:min(460px,100%);border-radius:18px;background:var(--surface);color:var(--text);box-shadow:0 24px 70px rgba(0,0,0,.28);overflow:hidden}.erp-modal-head{padding:18px 20px 12px;border-bottom:1px solid var(--line)}.erp-modal-head span{display:block;font-size:9px;color:var(--muted);font-weight:800;letter-spacing:.08em}.erp-modal-head strong{display:block;margin-top:5px;font-size:16px}.erp-modal-message{padding:20px;white-space:pre-line;font-size:12px;line-height:1.65}.erp-modal-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--line)}.erp-modal-actions button{height:36px;padding:0 15px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font-weight:750}.erp-modal-actions button.primary{background:#111315;color:#fff;border-color:#111315}.erp-modal-actions button.danger{background:#b23f37;color:#fff;border-color:#b23f37}
html[data-erp-theme="dark"] .erp-activity-text{color:#949aa2}html[data-erp-theme="dark"] .erp-modal-actions button.primary{background:#f3f4f5;color:#111315}

@media(max-width:980px){
  body.p21-sidebar-hidden .topbar,body.p21-sidebar-hidden .main{left:0}
  body.p21-sidebar-hidden .nav{opacity:1;visibility:visible;pointer-events:auto;transform:translateX(-100%)}
  body.mobile-nav-open .nav,body.mobile-nav-open.p21-sidebar-hidden .nav{transform:translateX(0)}
  body.mobile-nav-open{overflow:hidden}
  .table-wrap th:first-child,.table-wrap td:first-child{position:sticky;left:0;z-index:3;background:var(--surface);box-shadow:1px 0 0 var(--line)}
  .table-wrap th:first-child{z-index:6;background:#f4f5f6}
  html[data-erp-theme="dark"] .table-wrap th:first-child{background:#24282d}
  html[data-erp-theme="dark"] .table-wrap td:first-child{background:#1a1d21}
}


/* ═══════════════════════════════════════════════════════
   GATE I · WRITE STAGING integration screens
   ═══════════════════════════════════════════════════════ */
.write-page{padding:18px}.write-banner{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:14px 16px;border:1px solid var(--line);background:var(--soft);border-radius:14px}.write-banner strong{font-size:14px}.write-banner span{font-size:9px;color:var(--muted)}
.write-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}.write-field{min-width:0}.write-field.span2{grid-column:span 2}.write-field.span3{grid-column:span 3}.write-field label{display:block;margin:0 0 6px 2px;font-size:9px;color:var(--muted);font-weight:750}.write-field input,.write-field select,.write-line-grid input,.write-option-row select{width:100%;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text);padding:0 10px}
.write-status{margin-top:12px;padding:10px 12px;border-radius:10px;background:#eef2f5;color:#66707a;font-size:10px}.write-status.ok{background:#e7f4ec;color:#297347}.write-status.bad{background:#f8e9e8;color:#a33b34}html[data-erp-theme="dark"] .write-status{background:#252a30;color:#b2b8c0}html[data-erp-theme="dark"] .write-status.ok{background:#20342b;color:#91c7a7}html[data-erp-theme="dark"] .write-status.bad{background:#3a2a2a;color:#e0a6a1}
.write-section{margin-top:15px}.write-section-title{display:flex;align-items:center;justify-content:space-between;font-size:11px;font-weight:850;margin-bottom:8px}.write-section-title button,.write-inline-actions button,.write-row button,.inline-input button{height:34px;padding:0 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font-size:10px;font-weight:750}.write-inline-actions{display:flex;gap:8px;margin-top:12px}.write-inline-actions button.primary,.write-row button.primary{background:#111315;color:#fff;border-color:#111315}.write-inline-actions button.danger,.write-row button.danger{color:#b23f37;border-color:#d86a62}
.write-option-host{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;width:100%}.write-option-group{border:1px solid var(--line);border-radius:14px;overflow:hidden}.write-option-head{display:flex;justify-content:space-between;gap:12px;padding:11px 12px;background:var(--soft)}.write-option-head strong{font-size:11px}.write-option-head span{font-size:9px;color:var(--muted)}.write-option-row{display:grid;grid-template-columns:120px 1fr 80px;gap:10px;align-items:center;padding:9px 11px;border-top:1px solid var(--line);font-size:10px}.write-option-row small{display:block;color:var(--muted);margin-top:3px}.write-option-row .code{font-weight:800}
.write-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:12px}.write-metrics>div{padding:11px;border:1px solid var(--line);border-radius:12px}.write-metrics small{display:block;color:var(--muted);font-size:8px}.write-metrics strong{display:block;margin-top:5px;font-size:12px}
.write-list{margin-top:12px;border:1px solid var(--line);border-radius:14px;overflow:hidden}.write-row{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}.write-row:last-child{border-bottom:0}.write-row.multi{grid-template-columns:1fr auto}.write-row strong{display:block;font-size:11px}.write-row span{display:block;margin-top:5px;font-size:9px;color:var(--muted)}.write-row .badge{display:inline-flex;margin-right:5px}.row-metric{font-size:10px;font-weight:800}.row-actions{display:flex;gap:6px}
.write-line-grid{display:grid;grid-template-columns:1.1fr 1.6fr 1.5fr .7fr 1fr auto;gap:7px;align-items:center;margin-bottom:7px}.write-line-grid.po{grid-template-columns:2.5fr .7fr .8fr 1fr}.write-line-grid span{font-size:10px}.inline-input{display:grid;grid-template-columns:1fr auto;gap:6px}.check{display:flex!important;align-items:center;gap:7px;height:38px}.check input{width:auto;height:auto}
html[data-erp-theme="dark"] .write-inline-actions button.primary,html[data-erp-theme="dark"] .write-row button.primary{background:#f3f4f5;color:#111315}
@media(max-width:980px){.write-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.write-option-host{grid-template-columns:1fr}.write-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.write-grid{grid-template-columns:1fr}.write-field.span2,.write-field.span3{grid-column:span 1}.write-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.write-option-row{grid-template-columns:90px 1fr 70px}.write-line-grid,.write-line-grid.po{grid-template-columns:1fr}.write-row,.write-row.multi{grid-template-columns:1fr}.row-actions{flex-wrap:wrap}}

/* Gate I PO parity hotfix */
.po-note{margin-top:14px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--soft);font-size:10px;line-height:1.6;color:var(--muted)}
.po-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
.po-summary-card{padding:14px 15px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.po-summary-card span{display:block;font-size:9px;color:var(--muted);font-weight:800}
.po-summary-card strong{display:block;margin-top:7px;font-size:18px;letter-spacing:-.02em}
.po-summary-card small{display:block;margin-top:4px;font-size:9px;color:var(--muted)}
.po-form-card{padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.po-form-card .write-grid{margin-top:10px}
.po-step{font-size:9px;color:var(--muted);font-weight:650}
.po-item-table{border:1px solid var(--line);border-radius:12px;overflow:hidden}
.po-item-head,.po-item-row{display:grid;grid-template-columns:minmax(260px,2fr) 110px 120px 140px 160px 130px;gap:8px;align-items:center}
.po-item-head{padding:9px 12px;background:var(--soft);font-size:9px;color:var(--muted);font-weight:850}
.po-item-row{padding:10px 12px;border-top:1px solid var(--line)}
.po-item-row:first-child{border-top:0}
.po-item-row input{width:100%;height:38px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--text);padding:0 10px}
.po-item-name strong{display:block;font-size:10px}
.po-item-name span{display:block;margin-top:4px;font-size:9px;color:var(--muted)}
.po-request-qty,.po-line-amount{font-size:10px;font-weight:750;text-align:right}
.po-actions{justify-content:flex-end}
@media(max-width:1100px){
  .po-item-table{overflow-x:auto}
  .po-item-head,.po-item-row{min-width:940px}
}
@media(max-width:760px){
  .po-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Gate J-A low-risk WRITE UI parity */
.ja-hint{font-size:9px;color:var(--muted);font-weight:650}.ja-table-wrap{border:1px solid var(--line);border-radius:12px;overflow:auto;max-height:420px}.ja-table{width:100%;border-collapse:separate;border-spacing:0;min-width:860px}.ja-table th{position:sticky;top:0;z-index:2;background:var(--soft);font-size:9px;color:var(--muted);text-align:left;padding:9px 10px;border-bottom:1px solid var(--line)}.ja-table td{padding:9px 10px;border-bottom:1px solid var(--line);font-size:9px;vertical-align:top}.ja-table tbody tr:last-child td{border-bottom:0}.ja-table td strong{display:block;font-size:10px}.ja-table td small{display:block;margin-top:3px;color:var(--muted)}.ja-table .mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ja-table .num{text-align:right;white-space:nowrap}.ja-table tr.ja-short td{background:rgba(184,68,58,.08)}
.ja-context{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}.ja-context>div{padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}.ja-context small{display:block;font-size:8px;color:var(--muted)}.ja-context strong{display:block;margin-top:4px;font-size:10px;line-height:1.4}.ja-block-note{border-color:#d86a62!important;background:rgba(216,106,98,.08)!important}
.pr-master-head,.pr-master-line{display:grid;grid-template-columns:1.25fr 1.45fr 1.35fr .55fr .65fr 1fr auto;gap:7px;align-items:center}.pr-master-head{padding:0 4px 7px;color:var(--muted);font-size:8px;font-weight:800}.pr-master-line{margin-bottom:7px}.pr-master-line input{width:100%;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text);padding:0 10px}.pr-master-line input[readonly]{opacity:.86}.pr-master-line button{height:38px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font-size:9px;font-weight:750}.write-row small{display:block;margin-top:4px;font-size:8px;color:var(--muted)}
@media(max-width:980px){.ja-context{grid-template-columns:repeat(2,minmax(0,1fr))}.pr-master-head{display:none}.pr-master-line{grid-template-columns:1fr 1fr}.pr-master-line .inline-input{grid-column:span 2}}
@media(max-width:640px){.ja-context{grid-template-columns:1fr}.pr-master-line{grid-template-columns:1fr}.pr-master-line .inline-input{grid-column:span 1}}


/* Gate J-A Claude finding hotfix: purchase-request dark mode */
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-page{
  background:#1a1d21;
  color:#e7e9ec;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-section,
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .ref-filter{
  background:#1a1d21;
  color:#e7e9ec;
  border-color:#30353b;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-field input,
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-field select,
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .pr-master-line input{
  background:#20242a;
  color:#e7e9ec;
  border-color:#30353b;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .pr-master-line input[readonly]{
  background:#24282d;
  color:#cfd4da;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .pr-master-line button,
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-section-title button,
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-inline-actions button{
  background:#20242a;
  color:#e7e9ec;
  border-color:#30353b;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-inline-actions button.primary{
  background:#f3f4f5;
  color:#111315;
  border-color:#f3f4f5;
}
html[data-erp-theme="dark"] body[data-erp-screen="purchase-request"] .write-banner{
  background:#20242a;
  border-color:#30353b;
}


/* Gate J-B · QC / Stocktake Legacy parity */
.jb-qc-card,.jb-stocktake .write-section{margin-top:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);overflow:hidden}
.jb-qc-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 14px;border-bottom:1px solid var(--line)}
.jb-qc-head strong{display:block;font-size:13px}.jb-qc-head span{display:block;margin-top:3px;font-size:9px;color:var(--muted)}
.jb-qc-form{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:14px}
.jb-qc-field{display:flex;flex-direction:column;gap:5px}.jb-qc-field.wide{grid-column:span 2}.jb-qc-field span{font-size:9px;font-weight:800;color:var(--muted)}
.jb-qc-field input,.jb-qc-field textarea{width:100%;min-height:38px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--text)}
.jb-qc-field textarea{min-height:60px;resize:vertical}
.jb-qc-summary,.jb-stock-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;padding:0 14px 14px}
.jb-qc-summary>div,.jb-stock-summary>div{padding:11px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.jb-qc-summary small,.jb-stock-summary small{display:block;font-size:8px;color:var(--muted)}.jb-qc-summary strong,.jb-stock-summary strong{display:block;margin-top:4px;font-size:14px}
.jb-qc-table-wrap,.jb-stock-table-wrap{overflow:auto;max-height:540px;border-top:1px solid var(--line)}
.jb-qc-table,.jb-stock-table{border-collapse:separate;border-spacing:0;width:100%;min-width:1500px;font-size:9px}
.jb-stock-table{min-width:2050px}
.jb-qc-table th,.jb-stock-table th{position:sticky;top:0;z-index:2;padding:8px;background:var(--soft);border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
.jb-qc-table td,.jb-stock-table td{padding:8px;border-bottom:1px solid var(--line);vertical-align:middle}
.jb-qc-table input,.jb-stock-table input,.jb-stock-table select{width:100%;height:34px;border:1px solid var(--line);border-radius:7px;padding:0 8px;background:var(--soft);color:var(--text)}
.jb-result-group{display:flex;gap:4px}.jb-result-group button,.jb-toggle,.jb-qc-judgement button{border:1px solid var(--line);border-radius:7px;background:var(--soft);color:var(--text);padding:6px 8px;font-size:9px}
.jb-result-group button.active[data-result="OK"]{font-weight:900;outline:2px solid #47a36f}.jb-result-group button.active[data-result="NG"]{font-weight:900;outline:2px solid #d75b5b}.jb-result-group button.active[data-result="NA"]{font-weight:900;outline:2px solid #c49135}
.jb-toggle.active{font-weight:900;outline:2px solid currentColor}.jb-photo-required{display:block;margin-top:4px;color:var(--bad);font-size:8px}
.jb-qc-judgement{display:flex;align-items:center;gap:7px;padding:12px 14px;border-top:1px solid var(--line)}.jb-qc-judgement strong{margin-right:6px}.jb-qc-judgement button.active{font-weight:900;outline:2px solid currentColor}.jb-qc-judgement span{margin-left:auto;color:var(--muted);font-size:9px}
.jb-static-value{min-height:38px;display:flex;align-items:center;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:var(--soft);font-size:10px}
.jb-stock-summary{padding:14px 0 0}
.jb-stock-table td.num,.jb-stock-table td.money{text-align:right;font-variant-numeric:tabular-nums}
html[data-erp-theme="dark"] .jb-qc-card,html[data-erp-theme="dark"] .jb-stocktake .write-section{background:#1a1d21;border-color:#30353b}
html[data-erp-theme="dark"] .jb-qc-table th,html[data-erp-theme="dark"] .jb-stock-table th,
html[data-erp-theme="dark"] .jb-qc-field input,html[data-erp-theme="dark"] .jb-qc-field textarea,
html[data-erp-theme="dark"] .jb-qc-table input,html[data-erp-theme="dark"] .jb-stock-table input,html[data-erp-theme="dark"] .jb-stock-table select,
html[data-erp-theme="dark"] .jb-static-value{background:#20242a;color:#e7e9ec;border-color:#30353b}
@media(max-width:1100px){.jb-qc-form{grid-template-columns:repeat(2,minmax(0,1fr))}.jb-qc-field.wide{grid-column:span 2}.jb-qc-summary,.jb-stock-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* V8 RC1 · disabled action clarity */
button:disabled,
button.primary:disabled,
button.danger:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: grayscale(1);
  box-shadow: none;
}


/* =========================================================
   FINAL UX PARITY · Legacy interaction rules
   Query: gray -> pressed/running black -> gray
   Write: disabled gray -> valid black
   ========================================================= */
button{transition:background .12s ease,color .12s ease,border-color .12s ease,transform .06s ease,box-shadow .12s ease}
button:active{transform:translateY(1px)}
input[type="checkbox"]{accent-color:#202225}

.toolbar button{background:#f1f2f3!important;color:#3c4249!important;border:0!important;box-shadow:inset 0 0 0 1px rgba(17,19,22,.045)!important}
.toolbar button:hover:not(:disabled){background:#e7e9eb!important}
.toolbar button.query:active,.toolbar button.query.is-working,.toolbar button.query.is-working:disabled{background:#15171a!important;color:#fff!important;opacity:1!important;box-shadow:none!important}
.toolbar button.write,.toolbar button.write-action{background:#15171a!important;color:#fff!important;box-shadow:none!important}
.toolbar button:disabled,.toolbar button.write:disabled,.toolbar button.write-action:disabled{background:#eceef0!important;color:#a1a7ae!important;opacity:1!important;cursor:not-allowed!important;pointer-events:none!important}
.toolbar button.neutral{background:#f1f2f3!important;color:#555c64!important}

.write-inline-actions button,.write-section-title button,.inline-input button,.pr-master-line button{background:#f1f2f3;color:#3c4249;border-color:#e0e3e6}
.write-inline-actions button:hover:not(:disabled),.write-section-title button:hover:not(:disabled),.inline-input button:hover:not(:disabled),.pr-master-line button:hover:not(:disabled){background:#e7e9eb}
.write-inline-actions button.query-action:active,.write-section-title button.query-action:active,.inline-input button.query-action:active{background:#15171a!important;color:#fff!important;border-color:#15171a!important}
.write-inline-actions button.write-action:not(:disabled),.write-row button.write-action:not(:disabled){background:#15171a!important;color:#fff!important;border-color:#15171a!important}
.write-inline-actions button.write-action:disabled,.write-row button.write-action:disabled,.write-section-title button:disabled,.inline-input button:disabled{background:#eceef0!important;color:#a1a7ae!important;border-color:#e4e6e9!important;opacity:1!important;cursor:not-allowed!important}
.write-inline-actions button.danger:not(:disabled),.write-row button.danger:not(:disabled){background:#f1f2f3!important;color:#3c4249!important;border-color:#d8dce0!important}
.write-inline-actions button.danger:hover:not(:disabled),.write-row button.danger:hover:not(:disabled){background:#e5e7e9!important;color:#111315!important}
.check input[type="checkbox"],.check-field input[type="checkbox"]{accent-color:#202225}

.home-dashboard{display:flex;flex-direction:column;gap:14px}
.home-hero-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.home-refresh{height:36px;padding:0 14px;border:0;border-radius:11px;background:#f1f2f3;color:#3c4249;font-size:10px;font-weight:800}
.home-refresh:hover{background:#e7e9eb}
.summary.summary-link{width:100%;text-align:left;cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--text)}
.summary.summary-link:hover{background:#fafafa;border-color:#d6d9dd;box-shadow:0 8px 24px rgba(17,19,22,.05)}
.summary.summary-link:active{background:#15171a;color:#fff}
.summary.summary-link:active .k,.summary.summary-link:active .s{color:#c8cdd2}
.home-work-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.home-work-list{display:flex;flex-direction:column;gap:8px}
.home-work-item{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:68px;padding:11px 12px;border-radius:16px;background:#f6f7f8}
.home-work-icon{width:42px;height:42px;border-radius:13px;background:#fff;display:grid;place-items:center;color:#394047;font-size:15px;font-weight:800;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.home-work-item strong{display:block;color:#272b30;font-size:12px;font-weight:850}
.home-work-item small{display:block;margin-top:4px;color:#7d838a;font-size:10px}
.home-work-item>button{min-height:32px;padding:0 11px;border:0;border-radius:10px;background:#f1f2f3;color:#3c4249;font-size:10px;font-weight:800}
.home-work-item>button:hover{background:#15171a;color:#fff}
.home-quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.home-quick-item{min-height:104px;padding:13px;display:flex;flex-direction:column;justify-content:space-between;border:0;border-radius:17px;background:#f5f6f7;color:#272b30;text-align:left}
.home-quick-item:hover{background:#eceef0}
.home-quick-item>span{width:36px;height:36px;border-radius:12px;background:#fff;display:grid;place-items:center;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.home-quick-item strong{display:block;margin-top:12px;font-size:11.5px;font-weight:850}
.home-quick-item small{display:block;margin-top:3px;color:#858b92;font-size:9.5px}
.home-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.home-status-card{min-height:90px;padding:14px 15px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.home-status-card small{display:block;color:#7a8087;font-size:9.5px}
.home-status-card strong{display:block;margin-top:8px;font-size:14px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-status-card span{display:block;margin-top:5px;color:#9aa0a6;font-size:9px}
.quick-grid .quick{border:0;text-align:left;color:var(--text);cursor:pointer}
.quick-grid .quick:hover{background:#eceef0}
.quick-grid .quick:active{background:#15171a;color:#fff}
.quick-grid .quick:active small{color:#c8cdd2}

.empty-state{margin-top:12px;padding:42px 20px;border:1px dashed #d7dbe0;border-radius:16px;text-align:center;color:#848b93;background:#fafbfb}
.empty-state strong{display:block;color:#262b30;font-size:13px}
.empty-state span{display:block;margin-top:7px;font-size:10px}
.closing-state-card{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.closing-state-card>div{min-height:72px;padding:12px;border-radius:12px;background:var(--surface)}
.closing-state-card small{display:block;color:var(--muted);font-size:9px}
.closing-state-card strong{display:block;margin-top:8px;font-size:11px;line-height:1.45}

.menu-item.future{opacity:.58}
.future-page{padding:0}
.future-shell{padding:70px 24px;text-align:center}
.future-shell>strong{display:block;font-size:18px}
.future-shell p{margin:9px 0 0;color:#7f868e;font-size:11px}
.future-guide{max-width:620px;margin:18px auto 0;padding:14px 16px;border-radius:13px;background:#f6f7f8;color:#737a82;font-size:10px;line-height:1.6}

html[data-erp-theme="dark"] input[type="checkbox"]{accent-color:#e7e9ec}
html[data-erp-theme="dark"] .toolbar button,html[data-erp-theme="dark"] .toolbar button.neutral{background:#25292f!important;color:#d9dde1!important;box-shadow:none!important}
html[data-erp-theme="dark"] .toolbar button:hover:not(:disabled){background:#2d3238!important;color:#fff!important}
html[data-erp-theme="dark"] .toolbar button.query:active,html[data-erp-theme="dark"] .toolbar button.query.is-working,html[data-erp-theme="dark"] .toolbar button.query.is-working:disabled{background:#f2f3f4!important;color:#111315!important}
html[data-erp-theme="dark"] .toolbar button.write,html[data-erp-theme="dark"] .toolbar button.write-action,html[data-erp-theme="dark"] .write-inline-actions button.write-action:not(:disabled),html[data-erp-theme="dark"] .write-row button.write-action:not(:disabled){background:#f2f3f4!important;color:#111315!important;border-color:#f2f3f4!important}
html[data-erp-theme="dark"] .toolbar button:disabled,html[data-erp-theme="dark"] .toolbar button.write:disabled,html[data-erp-theme="dark"] .toolbar button.write-action:disabled,html[data-erp-theme="dark"] .write-inline-actions button.write-action:disabled{background:#24282d!important;color:#666e77!important;border-color:#30353b!important}
html[data-erp-theme="dark"] .write-inline-actions button,html[data-erp-theme="dark"] .write-section-title button,html[data-erp-theme="dark"] .inline-input button,html[data-erp-theme="dark"] .pr-master-line button{background:#25292f;color:#d9dde1;border-color:#33383e}
html[data-erp-theme="dark"] .write-inline-actions button.query-action:active,html[data-erp-theme="dark"] .write-section-title button.query-action:active,html[data-erp-theme="dark"] .inline-input button.query-action:active{background:#f2f3f4!important;color:#111315!important}
html[data-erp-theme="dark"] .write-inline-actions button.danger:not(:disabled),html[data-erp-theme="dark"] .write-row button.danger:not(:disabled){background:#25292f!important;color:#d9dde1!important;border-color:#41464d!important}
html[data-erp-theme="dark"] .home-work-item,html[data-erp-theme="dark"] .home-quick-item,html[data-erp-theme="dark"] .future-guide{background:#22262b;color:#e5e8eb}
html[data-erp-theme="dark"] .home-work-icon,html[data-erp-theme="dark"] .home-quick-item>span{background:#2c3137;color:#d3d7dc}
html[data-erp-theme="dark"] .home-work-item strong{color:#e5e8eb}
html[data-erp-theme="dark"] .home-work-item small,html[data-erp-theme="dark"] .home-quick-item small{color:#8d949d}
html[data-erp-theme="dark"] .home-work-item>button{background:#2c3137;color:#d3d7dc}
html[data-erp-theme="dark"] .home-work-item>button:hover{background:#f2f3f4;color:#111315}
html[data-erp-theme="dark"] .summary.summary-link:hover{background:#20242a;border-color:#41464d}
html[data-erp-theme="dark"] .home-status-card{background:#1a1d21}
html[data-erp-theme="dark"] .empty-state{background:#1d2126;border-color:#3b4148}
html[data-erp-theme="dark"] .empty-state strong{color:#e7e9ec}
html[data-erp-theme="dark"] .closing-state-card{background:#20242a;border-color:#30353b}
html[data-erp-theme="dark"] .closing-state-card>div{background:#1a1d21}

@media(max-width:1050px){
  .home-work-grid{grid-template-columns:1fr}
  .home-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .closing-state-card{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .home-status-grid,.home-quick-grid{grid-template-columns:1fr}
  .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .closing-state-card{grid-template-columns:1fr}
}


/* HOME MENU CUSTOMIZER */
.home-hero-actions{display:flex;align-items:center;gap:8px}
.home-edit,.panel-edit-btn{border:0;border-radius:10px;background:#f1f2f3;color:#3c4249;font-weight:800;cursor:pointer}
.home-edit{height:36px;padding:0 14px;font-size:10px}
.panel-edit-btn{min-height:28px;padding:0 10px;font-size:9.5px}
.home-edit:hover,.panel-edit-btn:hover{background:#e4e7e9;color:#17191c}
.home-empty-mini{min-height:84px;display:grid;place-items:center;border:1px dashed #d9dde1;border-radius:14px;color:#949aa1;font-size:10px;background:#fafbfb}
.home-editor-backdrop{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:24px;background:rgba(10,12,14,.42);backdrop-filter:blur(4px)}
.home-editor-card{width:min(880px,96vw);max-height:min(820px,92vh);display:flex;flex-direction:column;border-radius:22px;background:#fff;box-shadow:0 28px 80px rgba(0,0,0,.28);overflow:hidden}
.home-editor-head{min-height:76px;padding:18px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eceef0}
.home-editor-head strong{display:block;font-size:17px;font-weight:900;color:#17191c}
.home-editor-head span{display:block;margin-top:5px;font-size:10px;color:#8a9199}
.home-editor-close{width:36px;height:36px;border:0;border-radius:11px;background:#f1f2f3;color:#5b626b;font-size:22px;line-height:1;cursor:pointer}
.home-editor-close:hover{background:#e5e7e9;color:#111315}
.home-editor-body{padding:18px 20px 20px;overflow:auto}
.home-editor-body section+section{margin-top:22px}
.home-editor-section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
.home-editor-section-title strong{font-size:12px;font-weight:900;color:#252a30}
.home-editor-section-title span{font-size:9px;color:#9399a0}
.home-editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.home-editor-slot{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:10px;min-height:48px;padding:7px 9px;border-radius:12px;background:#f6f7f8}
.home-editor-slot>span{font-size:9.5px;font-weight:800;color:#687079}
.home-editor-slot select{width:100%;height:34px;padding:0 9px;border:1px solid #dce0e4;border-radius:9px;background:#fff;color:#272c31;font-size:10px;outline:none}
.home-editor-slot select:focus{border-color:#8f969e;box-shadow:0 0 0 2px rgba(30,34,38,.06)}
.home-editor-note{margin-top:16px;padding:12px 13px;border-radius:11px;background:#f7f8f9;color:#858c94;font-size:9.5px;line-height:1.55}
.home-editor-actions{min-height:68px;padding:13px 18px;display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:8px;border-top:1px solid #eceef0}
.home-editor-actions button{height:36px;padding:0 14px;border:0;border-radius:10px;background:#f1f2f3;color:#3c4249;font-size:10px;font-weight:850;cursor:pointer}
.home-editor-actions button:hover{background:#e5e7e9}
.home-editor-actions .home-editor-save{background:#15171a;color:#fff}
.home-editor-actions .home-editor-save:hover{background:#26292d}
html[data-erp-theme="dark"] .home-edit,html[data-erp-theme="dark"] .panel-edit-btn{background:#25292f;color:#d9dde1}
html[data-erp-theme="dark"] .home-edit:hover,html[data-erp-theme="dark"] .panel-edit-btn:hover{background:#30353b;color:#fff}
html[data-erp-theme="dark"] .home-empty-mini{background:#20242a;border-color:#373d44;color:#7f8790}
html[data-erp-theme="dark"] .home-editor-card{background:#1a1d21;box-shadow:0 28px 80px rgba(0,0,0,.55)}
html[data-erp-theme="dark"] .home-editor-head,html[data-erp-theme="dark"] .home-editor-actions{border-color:#2c3137}
html[data-erp-theme="dark"] .home-editor-head strong,html[data-erp-theme="dark"] .home-editor-section-title strong{color:#edf0f2}
html[data-erp-theme="dark"] .home-editor-head span,html[data-erp-theme="dark"] .home-editor-section-title span{color:#858d96}
html[data-erp-theme="dark"] .home-editor-close,html[data-erp-theme="dark"] .home-editor-actions button{background:#272c32;color:#d8dde1}
html[data-erp-theme="dark"] .home-editor-close:hover,html[data-erp-theme="dark"] .home-editor-actions button:hover{background:#32383f;color:#fff}
html[data-erp-theme="dark"] .home-editor-slot{background:#22262b}
html[data-erp-theme="dark"] .home-editor-slot>span{color:#9299a2}
html[data-erp-theme="dark"] .home-editor-slot select{background:#1a1d21;border-color:#3a4047;color:#e4e8eb}
html[data-erp-theme="dark"] .home-editor-note{background:#22262b;color:#878f98}
html[data-erp-theme="dark"] .home-editor-actions .home-editor-save{background:#f2f3f4;color:#111315}
html[data-erp-theme="dark"] .home-editor-actions .home-editor-save:hover{background:#fff}
@media(max-width:720px){
  .home-hero-row{align-items:stretch;flex-direction:column}
  .home-hero-actions{justify-content:flex-end}
  .home-editor-grid{grid-template-columns:1fr}
  .home-editor-card{max-height:94vh}
}


/* =========================================================
   FINAL DESIGN PARITY · Legacy ERP_Index P1 / P1.1 / P2.1 / P2.2
   UI-only. Backend / route / D1 rules unchanged.
   ========================================================= */
:root{
  --sidebar-w:244px;
  --top-h:64px;
  --bg:#f0f1f2;
  --surface:#ffffff;
  --soft:#f6f7f8;
  --soft-2:#f8f9fa;
  --line:#e4e6e9;
  --text:#17191c;
  --muted:#767d86;
  --shadow:0 1px 2px rgba(16,18,22,.03),0 10px 30px rgba(16,18,22,.045);
  --shadow-lg:0 1px 2px rgba(17,19,22,.035),0 12px 34px rgba(17,19,22,.055);
  --r-xl:24px;
  --r-lg:20px;
  --r-md:16px;
  --r-sm:12px;
}

/* Sidebar */
.nav{width:244px!important;background:#111315!important;color:#c6cbd1!important;border-right:0!important;box-shadow:none!important}
.brand-row{min-height:74px!important;padding:18px 17px 13px!important;border-bottom:1px solid #24282d!important}
.xyz-logo{width:84px!important;flex-basis:84px!important}
.logo-on-dark{display:block!important}.logo-on-light{display:none!important}
.brand-system::before{background:#444a51!important}
.brand-system strong{color:#fff!important}.brand-system span{color:#777e87!important}
.nav-scroll{padding:8px 10px 18px!important}
.nav-cap{padding:12px 11px 7px!important;color:#626a73!important;font-size:9px!important;letter-spacing:.16em!important}
.menu-group{margin-bottom:4px!important}
.menu-head{
  min-height:42px!important;padding:0 12px!important;gap:11px!important;border-radius:13px!important;
  color:#c6cbd1!important;font-size:12.5px!important;font-weight:700!important
}
.menu-head:hover,.menu-head.current{background:#1a1d21!important;color:#fff!important}
.menu-icon{width:19px!important;height:19px!important;flex:0 0 19px!important;color:#8e959e!important;font-size:0!important}
.menu-icon svg,.home-work-icon svg,.home-quick-icon svg{
  width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round
}
.menu-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chev{color:#626a73!important;font-size:14px!important}
.menu-items{padding:4px 0 7px 30px!important}
.menu-item{min-height:34px!important;padding:0 12px!important;border-radius:10px!important;color:#858d96!important;font-size:11.5px!important}
.menu-item:hover{color:#fff!important;background:#181b1f!important}
.menu-item.current{color:#fff!important;background:#24282d!important;font-weight:800!important}
.menu-item.future{opacity:.72}
.menu-item.future::after{background:#4f5760!important}

/* Sidebar user footer / popover */
.user-area{position:relative;flex:0 0 auto;margin:0 10px 12px}
.user-card{
  margin:0!important;padding:11px!important;min-height:56px;width:100%;border-radius:15px!important;
  background:#181b1f!important;color:#fff;display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none
}
.user-card:hover{background:#20242a!important}
.avatar{width:34px!important;height:34px!important;flex:0 0 34px;border-radius:11px!important}
.user-copy strong{color:#e6e8eb!important;font-size:10.5px!important;font-weight:800!important}
.user-copy span{color:#707881!important;font-size:9px!important}
.user-chevron{margin-left:auto;color:#6e7680;font-size:11px}
.user-popover{
  position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:120;overflow:hidden;
  border:1px solid #343a41;border-radius:14px;background:#111315;box-shadow:0 14px 34px rgba(0,0,0,.28)
}
.user-popover[hidden]{display:none!important}
.user-popover-head{padding:10px 12px;border-bottom:1px solid #292e34}
.user-popover-head span{display:block;color:#6f7780;font-size:8.5px}
.user-popover-head strong{display:block;margin-top:4px;overflow:hidden;color:#a9b0b8;font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}
.user-popover button{width:100%;min-height:38px;padding:0 12px;border:0;background:transparent;color:#e6e8eb;font-size:10.5px;font-weight:700;text-align:left}
.user-popover button:hover{background:#20242a}

/* Topbar */
.topbar{left:244px!important;height:64px!important;padding:0 20px!important;gap:12px!important;border-bottom:1px solid #e5e7ea!important;background:rgba(255,255,255,.96)!important;box-shadow:none!important}
.hamburger{width:38px!important;height:38px!important;flex:0 0 38px;border:0!important;border-radius:12px!important;background:#f2f3f4!important;color:#3d434a!important;font-size:14px!important}
.hamburger:hover{background:#e9ebed!important}
.context{min-width:0!important;display:flex;flex-direction:column;justify-content:center}
.context-path{color:#8b9198!important;font-size:9.5px!important;font-weight:700!important}
.context-title{margin-top:2px!important;color:#17191c!important;font-size:15px!important;font-weight:850!important}
.theme-switch{border-radius:8px!important;overflow:hidden}
.theme-btn{height:28px!important;min-width:52px!important;font-size:9.5px!important}
.top-user{color:#777d84!important}
.role{border-left-color:#d9dce0!important;color:#747a81!important}
.logout{display:none!important}

/* Main / tabs / toolbar / workspace */
.main{left:244px!important;top:64px!important;background:var(--bg)!important}
.tabs{
  height:44px!important;min-height:44px!important;display:flex!important;align-items:flex-end!important;
  gap:8px!important;padding:7px 18px 0!important;background:var(--bg)!important;overflow-x:auto!important
}
.tab{
  min-width:112px!important;max-width:210px!important;height:36px!important;padding:0!important;border:0!important;
  border-radius:11px 11px 0 0!important;background:#e3e5e8!important;color:#646a72!important;overflow:hidden!important
}
.tab.active{background:#fff!important;color:#17191c!important;font-weight:750!important;box-shadow:0 -1px 0 rgba(17,19,22,.03),0 1px 8px rgba(17,19,22,.045)!important}
.tab-main{padding:0 9px 0 12px!important;font-size:10.5px!important;font-weight:750!important}
.tab-close{width:25px!important;margin:0!important;color:#8b9198!important;font-size:13px!important;border-radius:8px}
.tab-close:hover,.tab.active .tab-close:hover{background:rgba(17,19,22,.06)!important;color:#17191c!important}
.toolbar{
  margin:18px 18px 0!important;min-height:52px!important;padding:8px 10px!important;border:0!important;
  border-radius:18px!important;background:#fff!important;box-shadow:var(--shadow)!important
}
.toolbar:empty{display:none!important}
.toolbar button{min-height:36px!important;height:36px!important;padding:0 14px!important;border:0!important;border-radius:11px!important;font-size:10.5px!important}
.work{padding:18px!important;background:var(--bg)!important}
.bottom-status{
  position:static!important;left:auto!important;right:auto!important;bottom:auto!important;flex:0 0 28px!important;
  min-height:28px!important;height:28px!important;padding:5px 18px!important;border:0!important;background:var(--bg)!important
}
.page{border-radius:20px!important;background:#fff!important;box-shadow:var(--shadow)!important}

/* Keep final Legacy P2.1 full-hide behavior (not old icon rail) */
body.p21-sidebar-hidden .nav{transform:translateX(-102%)!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important}
body.p21-sidebar-hidden .topbar,body.p21-sidebar-hidden .main{left:0!important}

/* Home */
.home-dashboard{gap:18px!important;padding:2px}
.home-hero{
  display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:18px!important;
  padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important
}
.home-title{color:#17191c!important;font-size:26px!important;font-weight:900!important;letter-spacing:-.035em!important}
.home-sub{margin-top:6px!important;color:#767c83!important;font-size:11.5px!important}
.home-hero-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.home-edit,.home-refresh{
  min-height:36px!important;height:36px!important;padding:0 14px!important;border:0!important;border-radius:11px!important;
  background:#f1f2f3!important;color:#3c4249!important;font-size:10px!important;font-weight:800!important
}
.home-edit:hover,.home-refresh:hover{background:#e6e8ea!important}
.home-edit:active,.home-refresh:active{background:#15171a!important;color:#fff!important}
.home-work-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:18px!important}
.panel{padding:18px!important;border-radius:20px!important;background:#fff!important;box-shadow:var(--shadow)!important}
.panel-head{align-items:center!important;justify-content:flex-start!important;margin-bottom:14px!important;font-size:13.5px!important}
.panel-head>span{margin-left:7px}
.panel-edit-btn{margin-left:auto!important;min-height:30px!important;padding:0 10px!important;border:0!important;border-radius:10px!important;background:#f1f2f3!important;color:#555c64!important;font-size:9.5px!important}
.panel-edit-btn:hover{background:#e7e9eb!important}.panel-edit-btn:active{background:#15171a!important;color:#fff!important}
.home-work-list{gap:8px!important}
.home-work-item{min-height:68px!important;padding:11px 12px!important;border-radius:16px!important;background:#f6f7f8!important}
.home-work-icon{width:42px!important;height:42px!important;border-radius:13px!important;background:#fff!important;color:#394047!important;display:flex!important;align-items:center!important;justify-content:center!important}
.home-work-item strong{color:#272b30!important;font-size:12px!important;font-weight:850!important}
.home-work-item small{margin-top:4px!important;color:#7d838a!important;font-size:10px!important}
.home-work-item>button{min-height:32px!important;padding:0 11px!important;border:0!important;border-radius:10px!important;background:#f1f2f3!important;color:#3c4249!important;font-size:10.5px!important;font-weight:800!important}
.home-work-item>button:hover{background:#e7e9eb!important}.home-work-item>button:active{background:#15171a!important;color:#fff!important}
.home-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.home-quick-item{min-height:106px!important;padding:13px!important;border:0!important;border-radius:17px!important;background:#f5f6f7!important;color:#272b30!important}
.home-quick-item:hover{background:#eff1f2!important}.home-quick-item:active{background:#15171a!important;color:#fff!important}
.home-quick-icon{width:36px!important;height:36px!important;border-radius:12px!important;background:#fff!important;color:#394047!important;display:flex!important;align-items:center!important;justify-content:center!important;box-shadow:0 1px 3px rgba(0,0,0,.04)!important}
.home-quick-item strong{font-size:11.5px!important;font-weight:850!important}
.home-quick-item small{margin-top:3px!important;color:#858b92!important;font-size:9.5px!important}
.home-quick-item:active small{color:#c8cdd2!important}
.home-live-summary{margin-top:0!important;gap:12px!important}
.summary.summary-link{min-height:90px!important;padding:14px 15px!important;border:0!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--shadow)!important}
.summary.summary-link:hover{background:#f8f9fa!important;box-shadow:var(--shadow-lg)!important}
.summary.summary-link:active{background:#15171a!important;color:#fff!important}
.summary .k{font-size:9.5px!important}.summary .v{margin-top:8px!important;font-size:20px!important}.summary .s{margin-top:5px!important;font-size:9px!important}
.home-status-grid{gap:12px!important}
.home-status-card{min-height:90px!important;padding:14px 15px!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--shadow)!important}
.home-status-card strong{font-size:15px!important}
.home-panels{gap:18px!important;margin-top:0!important}

/* Read filters: final Legacy P2.1 - rounded workspace surfaces */
.ref-filter{
  gap:12px!important;margin:0 0 14px!important;padding:15px 16px!important;border:0!important;
  border-radius:24px!important;background:#fff!important;box-shadow:var(--shadow-lg)!important;overflow:visible!important
}
.ref-filter .field{min-height:64px!important;padding:7px 8px!important;border:0!important;border-radius:16px!important;background:transparent!important}
.ref-filter .field label{min-height:0!important;margin:0 0 7px!important;padding:0 2px!important;border:0!important;background:transparent!important;color:#767d86!important;font-size:10px!important;font-weight:750!important}
.ref-filter .field input,.ref-filter .field select{
  min-height:43px!important;height:43px!important;padding:0 13px!important;border:1px solid #dfe3e7!important;
  border-radius:13px!important;background:#f8f9fa!important;color:#17191c!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 1px 1px rgba(17,19,22,.02)!important
}
.ref-filter .field input:focus,.ref-filter .field select:focus,
.write-field input:focus,.write-field select:focus,.pr-master-line input:focus,.po-item-row input:focus{
  outline:none!important;background:#fff!important;border-color:#aab1b9!important;box-shadow:0 0 0 4px rgba(17,19,22,.045)!important
}
.ref-status{margin:0 2px 10px!important;padding:0 2px!important}
.table-card{margin-top:0!important;border:0!important;border-radius:20px!important;background:#fff!important;box-shadow:var(--shadow-lg)!important;overflow:hidden!important}
.table-wrap{border-radius:20px!important}
th{height:44px!important;border:0!important;border-bottom:1px solid #e8ebee!important;background:#f6f7f8!important;color:#656c74!important}
td{height:46px!important;border:0!important;border-bottom:1px solid #eef0f2!important;background:#fff}
tbody tr:nth-child(even) td{background:#fcfcfd}
tbody tr:hover td{background:#f6f7f8!important}

/* Write screens: same visual language as read screens */
.page.write-page{padding:18px!important}
.write-banner{
  padding:15px 16px!important;border:0!important;border-radius:18px!important;background:#f6f7f8!important;
  box-shadow:inset 0 0 0 1px rgba(17,19,22,.035)!important
}
.write-grid{gap:12px!important;margin-top:14px!important}
.write-field{min-height:64px!important;padding:7px 8px!important;border-radius:16px!important;background:transparent!important}
.write-field label{margin:0 0 7px!important;padding:0 2px!important;color:#767d86!important;font-size:10px!important;font-weight:750!important}
.write-field input,.write-field select,.write-line-grid input,.write-option-row select,.pr-master-line input,.po-item-row input{
  min-height:43px!important;height:43px!important;padding:0 13px!important;border:1px solid #dfe3e7!important;border-radius:13px!important;background:#f8f9fa!important;color:#17191c!important
}
.write-status{border-radius:12px!important}
.write-section{margin-top:16px!important}
.write-list,.write-option-group,.po-form-card,.po-item-table,.ja-table-wrap{border:0!important;border-radius:18px!important;box-shadow:var(--shadow)!important;background:#fff!important}
.write-option-head,.po-item-head,.ja-table th{background:#f6f7f8!important}
.write-row{min-height:54px!important}
.write-inline-actions{gap:8px!important}
.write-inline-actions button,.write-section-title button,.write-row button,.inline-input button,.pr-master-line button{
  min-height:36px!important;height:36px!important;padding:0 13px!important;border:0!important;border-radius:11px!important
}
.ja-table td{min-height:46px!important}
.ja-table tbody tr:nth-child(even) td{background:#fcfcfd}
.ja-table tbody tr:hover td{background:#f6f7f8!important}

/* Modal / toast */
.erp-modal{border:0!important;border-radius:20px!important;box-shadow:0 22px 60px rgba(20,18,16,.18)!important}
.erp-modal-head{padding:18px 20px 12px!important}.erp-modal-message{padding:20px!important}
.erp-modal-actions button{border-radius:12px!important}
.erp-toast{border-radius:16px!important;box-shadow:var(--shadow-lg)!important}

/* Legacy contrast rule: LIGHT = bright workspace + dark sidebar / DARK = dark workspace + light sidebar */
html[data-erp-theme="dark"]{
  --bg:#121417;--surface:#1a1d21;--soft:#22262b;--soft-2:#20242a;--line:#30353b;--text:#e7e9ec;--muted:#9299a2;
  --shadow:0 1px 2px rgba(0,0,0,.22),0 12px 34px rgba(0,0,0,.20);
  --shadow-lg:0 1px 2px rgba(0,0,0,.24),0 14px 36px rgba(0,0,0,.22)
}
html[data-erp-theme="dark"] .nav{background:#f1f2f3!important;color:#15171a!important;border-right:1px solid #d7dbe0!important}
html[data-erp-theme="dark"] .brand-row{border-bottom-color:#d9dde1!important}
html[data-erp-theme="dark"] .logo-on-dark{display:none!important}
html[data-erp-theme="dark"] .logo-on-light{display:block!important}
html[data-erp-theme="dark"] .brand-system::before{background:#c5c9ce!important}
html[data-erp-theme="dark"] .brand-system strong{color:#111315!important}
html[data-erp-theme="dark"] .brand-system span{color:#7a8189!important}
html[data-erp-theme="dark"] .nav-cap{color:#8b9198!important}
html[data-erp-theme="dark"] .menu-head{color:#535a62!important}
html[data-erp-theme="dark"] .menu-head:hover,html[data-erp-theme="dark"] .menu-head.current{background:#dfe2e6!important;color:#111315!important}
html[data-erp-theme="dark"] .menu-icon{color:#7a8189!important}
html[data-erp-theme="dark"] .chev{color:#8b9198!important}
html[data-erp-theme="dark"] .menu-item{color:#6b727a!important}
html[data-erp-theme="dark"] .menu-item:hover{background:#e5e7ea!important;color:#111315!important}
html[data-erp-theme="dark"] .menu-item.current{background:#d6d9dd!important;color:#111315!important}
html[data-erp-theme="dark"] .user-card{background:#e3e6e9!important;color:#17191c!important}
html[data-erp-theme="dark"] .topbar{background:rgba(24,27,31,.97)!important;border-bottom-color:#2d3136!important;color:#e7e9ec!important}
html[data-erp-theme="dark"] .context-title{color:#f0f1f3!important}
html[data-erp-theme="dark"] .tabs{background:#121417!important}
html[data-erp-theme="dark"] .tab{background:#20242a!important;color:#9299a2!important}
html[data-erp-theme="dark"] .tab.active{background:#1a1d21!important;color:#f0f1f3!important;box-shadow:0 -1px 0 rgba(255,255,255,.025),0 1px 10px rgba(0,0,0,.18)!important}
html[data-erp-theme="dark"] .toolbar,html[data-erp-theme="dark"] .panel,html[data-erp-theme="dark"] .home-status-card,html[data-erp-theme="dark"] .summary.summary-link,
html[data-erp-theme="dark"] .ref-filter,html[data-erp-theme="dark"] .table-card,html[data-erp-theme="dark"] .page{background:#1a1d21!important}
html[data-erp-theme="dark"] .home-title{color:#f0f1f3!important}
html[data-erp-theme="dark"] .home-sub{color:#8e959e!important}
html[data-erp-theme="dark"] .home-work-item,html[data-erp-theme="dark"] .home-quick-item{background:#22262b!important;color:#e5e8eb!important}
html[data-erp-theme="dark"] .home-work-icon,html[data-erp-theme="dark"] .home-quick-icon{background:#2c3137!important;color:#d3d7dc!important}
html[data-erp-theme="dark"] .home-work-item strong,html[data-erp-theme="dark"] .home-quick-item strong{color:#e5e8eb!important}
html[data-erp-theme="dark"] .home-work-item small,html[data-erp-theme="dark"] .home-quick-item small{color:#8d949d!important}
html[data-erp-theme="dark"] .ref-filter .field input,html[data-erp-theme="dark"] .ref-filter .field select,
html[data-erp-theme="dark"] .write-field input,html[data-erp-theme="dark"] .write-field select,
html[data-erp-theme="dark"] .pr-master-line input,html[data-erp-theme="dark"] .po-item-row input{
  border-color:#41464d!important;background:#20242a!important;color:#eef0f2!important;box-shadow:none!important
}
html[data-erp-theme="dark"] .ref-filter .field input:focus,html[data-erp-theme="dark"] .ref-filter .field select:focus,
html[data-erp-theme="dark"] .write-field input:focus,html[data-erp-theme="dark"] .write-field select:focus{
  background:#1a1d21!important;border-color:#5f6770!important;box-shadow:0 0 0 4px rgba(255,255,255,.04)!important
}
html[data-erp-theme="dark"] th,html[data-erp-theme="dark"] .ja-table th{background:#24282d!important;color:#bfc5cc!important;border-bottom-color:#30353b!important}
html[data-erp-theme="dark"] td,html[data-erp-theme="dark"] .ja-table td{background:#1a1d21!important;border-bottom-color:#2b3036!important;color:#dfe3e7!important}
html[data-erp-theme="dark"] tbody tr:nth-child(even) td,html[data-erp-theme="dark"] .ja-table tbody tr:nth-child(even) td{background:#1d2125!important}
html[data-erp-theme="dark"] tbody tr:hover td,html[data-erp-theme="dark"] .ja-table tbody tr:hover td{background:#272c32!important}
html[data-erp-theme="dark"] .write-banner,html[data-erp-theme="dark"] .write-option-head,html[data-erp-theme="dark"] .po-item-head{background:#22262b!important}
html[data-erp-theme="dark"] .bottom-status{background:#121417!important}

/* Responsive: desktop hide/restores, mobile drawer. */
@media(max-width:980px){
  .nav{transform:translateX(-100%)!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important}
  .topbar,.main{left:0!important}
  body.mobile-nav-open .nav,body.mobile-nav-open.p21-sidebar-hidden .nav{transform:translateX(0)!important}
  .home-work-grid{grid-template-columns:1fr!important}
  .home-status-grid,.home-live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tabs{padding-left:10px!important;padding-right:10px!important}
  .erp-activity-text{display:none!important}
}
@media(max-width:700px){
  .home-status-grid,.home-live-summary,.home-quick-grid{grid-template-columns:1fr!important}
  .home-hero{align-items:stretch!important;flex-direction:column!important}
  .home-hero-actions{justify-content:flex-end!important;margin-left:0!important}
  .work{padding:10px!important}
  .toolbar{margin:10px 10px 0!important}
}


/* RCM P0 · Purchase Receipt / Incoming Inspection */
.rcv-item-table{border:0;border-radius:18px;background:var(--surface);box-shadow:var(--shadow);overflow:hidden}
.rcv-item-head,.rcv-item-row{display:grid;grid-template-columns:minmax(260px,2fr) 90px 100px 100px 90px 120px 90px;gap:8px;align-items:center}
.rcv-item-head{padding:10px 12px;background:#f6f7f8;color:#656c74;font-size:9px;font-weight:850}
.rcv-item-row{padding:10px 12px;border-top:1px solid #eef0f2;font-size:10px}
.rcv-item-row input{width:100%;height:40px;padding:0 10px;border:1px solid #dfe3e7;border-radius:11px;background:#f8f9fa;color:var(--text)}
.rcv-item-row .num{text-align:right;font-variant-numeric:tabular-nums}
.rcv-inspection{text-align:center;color:var(--muted);font-size:9px;font-weight:800}
.rcv-required{display:inline-flex;align-items:center;min-height:25px;padding:0 8px;border-radius:9px;background:#eceef0;color:#24282d}
.rcv-inspection-row{display:grid;grid-template-columns:minmax(260px,2fr) 110px 110px 145px minmax(180px,1.2fr) 90px;gap:9px;align-items:end;padding:12px;border-bottom:1px solid var(--line)}
.rcv-inspection-row:last-child{border-bottom:0}
.rcv-inspection-main strong{display:block;font-size:10.5px}
.rcv-inspection-main span{display:block;margin-top:5px;color:var(--muted);font-size:9px}
.rcv-inspection-row label span{display:block;margin:0 0 5px 2px;color:var(--muted);font-size:8.5px;font-weight:800}
.rcv-inspection-row input{width:100%;height:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text)}
.rcv-inspection-row button{height:38px;border:0;border-radius:10px;font-size:9.5px;font-weight:800}
html[data-erp-theme="dark"] .rcv-item-head{background:#24282d;color:#bfc5cc}
html[data-erp-theme="dark"] .rcv-item-row{border-top-color:#2b3036}
html[data-erp-theme="dark"] .rcv-item-row input,html[data-erp-theme="dark"] .rcv-inspection-row input{background:#20242a;border-color:#41464d;color:#eef0f2}
html[data-erp-theme="dark"] .rcv-required{background:#2c3137;color:#e4e7ea}
@media(max-width:1100px){
  .rcv-item-table{overflow-x:auto}
  .rcv-item-head,.rcv-item-row{min-width:880px}
  .rcv-inspection-row{grid-template-columns:1fr 100px 100px 140px;align-items:end}
  .rcv-inspection-main{grid-column:span 4}
  .rcv-inspection-row .rcvInspectMemo{grid-column:span 3}
}
@media(max-width:640px){
  .rcv-inspection-row{grid-template-columns:1fr 1fr}
  .rcv-inspection-main{grid-column:span 2}
  .rcv-inspection-row .rcvInspectMemo{grid-column:span 2}
  .rcv-inspection-row .rcvInspectBtn{grid-column:span 2}
}


/* RCM P0 · Shipment Gate */
.shp-row{display:grid;grid-template-columns:minmax(380px,2.2fr) minmax(190px,.8fr) auto;gap:10px;align-items:center;padding:12px;border-bottom:1px solid var(--line)}
.shp-row:last-child{border-bottom:0}
.shp-row>div:first-child strong{display:block;font-size:10.5px}
.shp-row>div:first-child span{display:block;margin-top:4px;color:var(--muted);font-size:9px}
.shp-row>div:first-child small{display:block;margin-top:4px;color:var(--muted);font-size:8.5px}
.shp-row>input{width:100%;height:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text)}
.shp-actions{display:flex;gap:7px;align-items:center;justify-content:flex-end}
.shp-actions button{height:36px;padding:0 12px;border:0;border-radius:10px;font-size:9.5px;font-weight:800}
.shp-role{color:var(--muted);font-size:9px;font-weight:800;white-space:nowrap}
html[data-erp-theme="dark"] .shp-row>input{background:#20242a;border-color:#41464d;color:#eef0f2}
@media(max-width:980px){
  .shp-row{grid-template-columns:1fr minmax(170px,.55fr)}
  .shp-row>div:first-child{grid-column:span 2}
}
@media(max-width:640px){
  .shp-row{grid-template-columns:1fr}
  .shp-row>div:first-child{grid-column:auto}
  .shp-actions{justify-content:stretch}
  .shp-actions button{flex:1}
}


/* RCM P1 · Supplier Control */
.sup-request-row{display:grid;grid-template-columns:minmax(420px,2fr) minmax(200px,.8fr) auto;gap:10px;align-items:center;padding:12px;border-bottom:1px solid var(--line)}
.sup-request-row:last-child{border-bottom:0}
.sup-request-row>div:first-child strong{display:block;font-size:10.5px}
.sup-request-row>div:first-child span{display:block;margin-top:4px;color:var(--muted);font-size:9px}
.sup-request-row>div:first-child small{display:block;margin-top:4px;color:var(--muted);font-size:8.5px}
.sup-request-row>input{width:100%;height:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text)}
.sup-actions{display:flex;gap:7px;align-items:center;justify-content:flex-end}
.sup-actions button{height:36px;padding:0 12px;border:0;border-radius:10px;font-size:9.5px;font-weight:800}
.sup-role{color:var(--muted);font-size:9px;font-weight:800;white-space:nowrap}
.sup-master-list{border-radius:16px;overflow:auto;border:1px solid var(--line)}
.sup-master-row{display:grid;grid-template-columns:150px minmax(180px,1.4fr) 110px 110px 130px minmax(190px,1.2fr) 90px;gap:8px;align-items:center;min-width:980px;min-height:46px;padding:8px 12px;border-bottom:1px solid var(--line);font-size:9.5px}
.sup-master-row:last-child{border-bottom:0}
.sup-master-row strong{font-size:10px}
html[data-erp-theme="dark"] .sup-request-row>input{background:#20242a;border-color:#41464d;color:#eef0f2}
@media(max-width:980px){
  .sup-request-row{grid-template-columns:1fr minmax(180px,.6fr)}
  .sup-request-row>div:first-child{grid-column:span 2}
}
@media(max-width:640px){
  .sup-request-row{grid-template-columns:1fr}
  .sup-request-row>div:first-child{grid-column:auto}
  .sup-actions{justify-content:stretch}
  .sup-actions button{flex:1}
}


/* 2026-09-09 · split register/query views */
.erp-subnav{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 12px;
  padding:5px;
  width:max-content;
  max-width:100%;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--soft);
}
.erp-subnav button{
  min-height:34px;
  padding:0 13px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  font-size:9.5px;
  font-weight:850;
  white-space:nowrap;
}
.erp-subnav button.active{
  background:#15171a;
  color:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.10);
}
html[data-erp-theme="dark"] .erp-subnav button.active{
  background:#f4f5f6;
  color:#17191c;
}
[data-subview-panel][hidden]{display:none!important}
.subview-field{display:contents}
.subview-field[hidden]{display:none!important}
.sup-page [data-subview-panel="request"] .write-section,
.shp-page [data-subview-panel="process"] .write-section,
.inv-page [data-subview-panel="register"] .write-section{
  margin-top:0;
}
@media(max-width:640px){
  .erp-subnav{
    width:100%;
    overflow-x:auto;
    justify-content:flex-start;
  }
  .erp-subnav button{flex:0 0 auto}
}

/* =========================================================
   XYZ ERP · FINAL PRODUCT UX SYSTEM · 2026-09-11
   Canonical visual layer. This section is the only final override layer.
   Business rules / API / D1 behavior remain unchanged.
   ========================================================= */
:root{
  --sidebar-w:244px;
  --top-h:60px;
  --ui-content-max:1380px;
  --ui-page-pad:16px;
  --ui-gap:12px;
  --ui-field-h:40px;
  --ui-button-h:34px;
  --ui-row-h:44px;
  --ui-card-r:14px;
  --ui-control-r:9px;
  --ui-bg:#f3f4f5;
  --ui-surface:#ffffff;
  --ui-surface-2:#f7f8f9;
  --ui-surface-3:#eef0f2;
  --ui-line:#e2e5e8;
  --ui-line-strong:#d4d8dd;
  --ui-text:#1a1d21;
  --ui-muted:#747b84;
  --ui-muted-2:#969da5;
  --ui-shadow:0 1px 2px rgba(17,19,22,.035),0 6px 18px rgba(17,19,22,.035);
  --ui-shadow-float:0 12px 30px rgba(17,19,22,.09);
  --bg:var(--ui-bg);
  --surface:var(--ui-surface);
  --soft:var(--ui-surface-2);
  --line:var(--ui-line);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
}
html[data-erp-theme="dark"]{
  --ui-bg:#121417;
  --ui-surface:#1a1d21;
  --ui-surface-2:#22262b;
  --ui-surface-3:#292e34;
  --ui-line:#30353b;
  --ui-line-strong:#41474e;
  --ui-text:#e7eaed;
  --ui-muted:#949ba4;
  --ui-muted-2:#737b84;
  --ui-shadow:0 1px 2px rgba(0,0,0,.18);
  --ui-shadow-float:0 14px 34px rgba(0,0,0,.34);
  --bg:var(--ui-bg);
  --surface:var(--ui-surface);
  --soft:var(--ui-surface-2);
  --line:var(--ui-line);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
}

/* ---------- 1. Shell: quiet chrome, clear workspace ---------- */
html,body{background:var(--ui-bg)!important;color:var(--ui-text)!important}
.topbar{
  height:var(--top-h)!important;
  padding:0 18px!important;
  gap:11px!important;
  background:rgba(255,255,255,.96)!important;
  border-bottom:1px solid var(--ui-line)!important;
  box-shadow:none!important;
}
.hamburger{
  width:36px!important;height:36px!important;border-radius:10px!important;
  background:var(--ui-surface-3)!important;color:#555d66!important;
}
.topbar-brand{display:none;align-items:center;flex:0 0 auto;width:58px;height:28px}
.topbar-logo{display:block;width:58px;height:auto;object-fit:contain}
.topbar-logo-dark{display:none}
body.p21-sidebar-hidden .topbar-brand{display:flex}
.context{min-width:128px!important}
.context-path{margin-bottom:2px!important;font-size:8px!important;font-weight:800!important;letter-spacing:.08em;color:#8b929a!important}
.context-title{font-size:14px!important;font-weight:850!important;letter-spacing:-.02em!important;color:#20242a!important}
.erp-activity-text{font-size:9.5px!important;color:var(--ui-muted)!important}
.theme-switch{margin-left:auto!important;height:30px!important;border:1px solid var(--ui-line-strong)!important;border-radius:9px!important;overflow:hidden;background:var(--ui-surface)!important}
.theme-btn{height:28px!important;min-width:50px!important;font-size:9px!important}
.theme-btn.active{background:#17191c!important;color:#fff!important}
.top-user,.role{font-size:9px!important;color:#7d848c!important}
.role{padding-left:11px!important;border-left:1px solid var(--ui-line)!important}
.logout{height:32px!important;padding:0 12px!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;background:var(--ui-surface)!important;color:#4f565e!important;font-size:9.5px!important}
.main{top:var(--top-h)!important;background:var(--ui-bg)!important}
.tabs{
  min-height:46px!important;height:46px!important;padding:6px 18px 4px!important;gap:4px!important;
  overflow-x:auto!important;overflow-y:hidden!important;border-bottom:1px solid var(--ui-line)!important;
  background:var(--ui-bg)!important;scrollbar-width:thin;scrollbar-color:#aeb4bb transparent
}
.tabs::-webkit-scrollbar{height:4px}.tabs::-webkit-scrollbar-thumb{background:#aeb4bb;border-radius:999px}.tabs::-webkit-scrollbar-track{background:transparent}
.tab{
  flex:0 0 auto!important;min-width:104px!important;max-width:172px!important;height:35px!important;
  padding:0 7px 0 10px!important;border:1px solid transparent!important;border-radius:9px 9px 6px 6px!important;
  background:transparent!important;color:#737b84!important;box-shadow:none!important
}
.tab:hover{background:var(--ui-surface-3)!important;color:var(--ui-text)!important}
.tab.active{background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;font-weight:800!important;box-shadow:0 1px 2px rgba(17,19,22,.025)!important}
.tab-main{font-size:10px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.tab-close{width:22px!important;height:22px!important;margin-left:4px!important;border-radius:6px!important;opacity:.42!important;color:inherit!important;font-size:13px!important}
.tab:hover .tab-close,.tab.active .tab-close{opacity:.72!important}.tab-close:hover{opacity:1!important;background:rgba(0,0,0,.07)!important}
.toolbar{
  min-height:46px!important;margin:10px 18px 0!important;padding:5px 7px!important;gap:6px!important;
  border:1px solid var(--ui-line)!important;border-radius:12px!important;background:var(--ui-surface)!important;box-shadow:none!important
}
.toolbar:empty{display:none!important}
.toolbar button{
  height:var(--ui-button-h)!important;min-height:var(--ui-button-h)!important;padding:0 12px!important;
  border:0!important;border-radius:var(--ui-control-r)!important;background:var(--ui-surface-3)!important;color:#4c535b!important;
  box-shadow:none!important;font-size:10px!important;font-weight:800!important
}
.toolbar button:hover:not(:disabled){background:#e2e5e8!important;color:#17191c!important}
.toolbar button.query:active,.toolbar button.query.is-working,.toolbar button.query.is-working:disabled{background:#17191c!important;color:#fff!important;opacity:1!important}
.toolbar button.write,.toolbar button.write-action,.toolbar button.primary{background:#17191c!important;color:#fff!important}
.toolbar button:disabled,.toolbar button.write:disabled,.toolbar button.write-action:disabled{background:#eceef0!important;color:#a3a9b0!important;opacity:1!important;cursor:not-allowed!important;pointer-events:none!important}
.work{padding:14px 18px 54px!important;background:var(--ui-bg)!important}
.bottom-status{left:18px!important;right:18px!important;height:30px!important;color:#858c94!important;font-size:8.5px!important;background:linear-gradient(to top,var(--ui-bg) 76%,transparent)!important}
.page{padding:var(--ui-page-pad)!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-card-r)!important;background:var(--ui-surface)!important;box-shadow:none!important}
.note{padding:12px 14px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;font-size:10px!important;line-height:1.55!important}

/* Sidebar stays intentionally opposite to workspace theme: Legacy reference behavior. */
html:not([data-erp-theme="dark"]) .nav{background:#111315!important;color:#c6cbd1!important;border-right:0!important}
html:not([data-erp-theme="dark"]) .brand-row{border-bottom-color:#24282d!important}
html:not([data-erp-theme="dark"]) .logo-on-dark{display:block!important}
html:not([data-erp-theme="dark"]) .logo-on-light{display:none!important}
html:not([data-erp-theme="dark"]) .brand-system::before{background:#444a51!important}
html:not([data-erp-theme="dark"]) .brand-system strong{color:#fff!important}
html:not([data-erp-theme="dark"]) .brand-system span{color:#777e87!important}
html:not([data-erp-theme="dark"]) .nav-cap{color:#737b84!important}
html:not([data-erp-theme="dark"]) .menu-head{color:#c6cbd1!important}
html:not([data-erp-theme="dark"]) .menu-head:hover,html:not([data-erp-theme="dark"]) .menu-head.current{background:#20242a!important;color:#fff!important}
html:not([data-erp-theme="dark"]) .menu-icon{color:#8e959e!important}
html:not([data-erp-theme="dark"]) .chev{color:#717983!important}
html:not([data-erp-theme="dark"]) .menu-item{color:#858d96!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html:not([data-erp-theme="dark"]) .menu-item:hover{background:#181b1f!important;color:#fff!important}
html:not([data-erp-theme="dark"]) .menu-item.current{background:#24282d!important;color:#fff!important}
html:not([data-erp-theme="dark"]) .user-card{background:#181b1f!important;color:#fff!important}
html:not([data-erp-theme="dark"]) .user-card:hover{background:#20242a!important}
html:not([data-erp-theme="dark"]) .avatar{background:#eef0f2!important;color:#111315!important}
html:not([data-erp-theme="dark"]) .user-copy strong{color:#fff!important}
html:not([data-erp-theme="dark"]) .user-copy span,html:not([data-erp-theme="dark"]) .user-chevron{color:#777e87!important}
html:not([data-erp-theme="dark"]) .user-popover{background:#111315!important;border-color:#343a41!important;color:#e7e9ec!important}
html:not([data-erp-theme="dark"]) .user-popover-head{border-bottom-color:#343a41!important}
html:not([data-erp-theme="dark"]) .user-popover-head span{color:#858d96!important}
html:not([data-erp-theme="dark"]) .user-popover-head strong{color:#e7e9ec!important}
html:not([data-erp-theme="dark"]) .user-popover button{color:#d9dde1!important}
html:not([data-erp-theme="dark"]) .user-popover button:hover{background:#20242a!important}
html[data-erp-theme="dark"] .nav{background:#f1f2f3!important;color:#15171a!important;border-right:1px solid #d7dbe0!important}
html[data-erp-theme="dark"] .brand-row{border-bottom-color:#d9dde1!important}
html[data-erp-theme="dark"] .logo-on-dark{display:none!important}
html[data-erp-theme="dark"] .logo-on-light{display:block!important}
html[data-erp-theme="dark"] .brand-system::before{background:#c5c9ce!important}
html[data-erp-theme="dark"] .brand-system strong{color:#111315!important}
html[data-erp-theme="dark"] .brand-system span{color:#7a8189!important}
html[data-erp-theme="dark"] .nav-cap{color:#8b9198!important}
html[data-erp-theme="dark"] .menu-head{color:#535a62!important}
html[data-erp-theme="dark"] .menu-head:hover,html[data-erp-theme="dark"] .menu-head.current{background:#dfe2e6!important;color:#111315!important}
html[data-erp-theme="dark"] .menu-icon{color:#7a8189!important}
html[data-erp-theme="dark"] .chev{color:#8b9198!important}
html[data-erp-theme="dark"] .menu-item{color:#6b727a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html[data-erp-theme="dark"] .menu-item:hover{background:#e5e7ea!important;color:#111315!important}
html[data-erp-theme="dark"] .menu-item.current{background:#d6d9dd!important;color:#111315!important}
html[data-erp-theme="dark"] .user-card{background:#e3e6e9!important;color:#17191c!important}
html[data-erp-theme="dark"] .user-card:hover{background:#d9dde1!important}
html[data-erp-theme="dark"] .avatar{background:#111315!important;color:#fff!important}
html[data-erp-theme="dark"] .user-copy strong{color:#17191c!important}
html[data-erp-theme="dark"] .user-copy span,html[data-erp-theme="dark"] .user-chevron{color:#777e87!important}
html[data-erp-theme="dark"] .user-popover{background:#fff!important;border-color:#d7dce1!important;color:#20252a!important;box-shadow:var(--ui-shadow-float)!important}
html[data-erp-theme="dark"] .user-popover-head{border-bottom-color:#e1e4e7!important}
html[data-erp-theme="dark"] .user-popover-head span{color:#7d858e!important}
html[data-erp-theme="dark"] .user-popover-head strong{color:#4f5760!important}
html[data-erp-theme="dark"] .user-popover button{color:#20252a!important}
html[data-erp-theme="dark"] .user-popover button:hover{background:#f0f2f4!important}

/* ---------- 2. Home: first-screen complete, visually balanced ---------- */
body[data-erp-screen="home"] .work{padding-top:13px!important}
.home-dashboard{width:min(100%,var(--ui-content-max))!important;margin:0 auto!important;display:flex!important;flex-direction:column!important;gap:13px!important;padding:0!important}
.home-hero{display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:18px!important;padding:2px 1px 1px!important;background:transparent!important}
.home-heading{min-width:0}
.home-title{font-size:25px!important;font-weight:900!important;letter-spacing:-.04em!important;line-height:1.16!important;color:var(--ui-text)!important}
.home-sub{margin-top:6px!important;color:var(--ui-muted)!important;font-size:10.5px!important;line-height:1.4!important}
.home-hero-actions{display:flex!important;align-items:center!important;gap:6px!important;flex:0 0 auto!important}
.home-edit,.home-refresh,.panel-edit-btn{
  height:32px!important;padding:0 11px!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;
  background:var(--ui-surface)!important;color:#555d66!important;font-size:9.5px!important;font-weight:800!important;box-shadow:none!important
}
.home-edit:hover,.home-refresh:hover,.panel-edit-btn:hover{background:var(--ui-surface-3)!important;color:var(--ui-text)!important}
.home-work-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px!important;align-items:stretch!important}
.home-work-grid>.panel{min-width:0!important;width:100%!important;min-height:324px!important}
.panel{
  padding:14px!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-card-r)!important;
  background:var(--ui-surface)!important;box-shadow:none!important
}
.panel-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;min-height:34px!important;margin:0 0 10px!important;color:var(--ui-text)!important}
.panel-head>div{min-width:0}.panel-head strong{display:block!important;font-size:12.5px!important;font-weight:900!important;line-height:1.2!important}.panel-head small{display:block!important;margin-top:4px!important;color:var(--ui-muted)!important;font-size:8.8px!important;font-weight:600!important}
.home-work-list{display:flex!important;flex-direction:column!important;gap:7px!important}
.home-work-item{
  min-height:61px!important;padding:9px 10px!important;display:grid!important;grid-template-columns:38px minmax(0,1fr) auto!important;align-items:center!important;gap:10px!important;
  border:1px solid transparent!important;border-radius:11px!important;background:var(--ui-surface-2)!important;transition:background .12s ease,border-color .12s ease!important
}
.home-work-item:hover{background:var(--ui-surface-3)!important;border-color:var(--ui-line)!important}
.home-work-icon{width:38px!important;height:38px!important;border-radius:10px!important;background:var(--ui-surface)!important;color:#4f5861!important;display:flex!important;align-items:center!important;justify-content:center!important;box-shadow:none!important}
.home-work-item strong{display:block!important;color:var(--ui-text)!important;font-size:11px!important;font-weight:850!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.home-work-item small{display:block!important;margin-top:4px!important;color:var(--ui-muted)!important;font-size:8.8px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.home-work-item>button{
  height:29px!important;min-height:29px!important;padding:0 5px 0 8px!important;border:0!important;border-radius:7px!important;
  background:transparent!important;color:#707881!important;font-size:9.5px!important;font-weight:800!important;white-space:nowrap!important
}
.home-work-item>button::after{content:" ›";font-size:12px}.home-work-item>button:hover{background:rgba(127,135,145,.10)!important;color:var(--ui-text)!important}
.home-quick-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
.home-quick-item{
  min-height:82px!important;padding:10px!important;display:grid!important;grid-template-columns:32px minmax(0,1fr)!important;grid-template-rows:auto auto!important;
  column-gap:9px!important;row-gap:2px!important;align-content:center!important;border:1px solid transparent!important;border-radius:11px!important;
  background:var(--ui-surface-2)!important;color:var(--ui-text)!important;text-align:left!important;box-shadow:none!important
}
.home-quick-item:hover{background:var(--ui-surface-3)!important;border-color:var(--ui-line)!important}
.home-quick-icon{grid-row:1/3!important;width:32px!important;height:32px!important;border-radius:9px!important;background:var(--ui-surface)!important;color:#4f5861!important;display:flex!important;align-items:center!important;justify-content:center!important;box-shadow:none!important}
.home-quick-item strong{display:block!important;align-self:end!important;margin:0!important;font-size:10.5px!important;font-weight:850!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.home-quick-item small{display:block!important;align-self:start!important;margin:2px 0 0!important;color:var(--ui-muted)!important;font-size:8.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.home-kpi-section{padding:0!important}
.home-section-title{display:flex!important;align-items:center!important;justify-content:space-between!important;margin:0 2px 7px!important}.home-section-title strong{font-size:10.5px!important;font-weight:850!important;color:var(--ui-text)!important}.home-section-title span{font-size:8.5px!important;color:var(--ui-muted)!important}
.home-live-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:0!important}
.summary.summary-link{
  min-height:72px!important;padding:10px 12px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;
  background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:none!important;text-align:left!important
}
.summary.summary-link:hover{background:var(--ui-surface-2)!important;border-color:var(--ui-line-strong)!important;box-shadow:none!important}
.summary .k{font-size:8.8px!important;color:var(--ui-muted)!important}.summary .v{margin-top:5px!important;font-size:19px!important;font-weight:900!important;line-height:1.05!important}.summary .s{margin-top:4px!important;font-size:8.2px!important;color:var(--ui-muted-2)!important}
.home-status-grid,.home-panels{display:none!important}
.home-empty-mini{min-height:96px!important;display:grid!important;place-items:center!important;border:1px dashed var(--ui-line-strong)!important;border-radius:11px!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;font-size:9px!important}

/* ---------- 3. Read screens: one-line data, explicit horizontal scroll ---------- */
.ref-filter{
  display:flex!important;flex-wrap:wrap!important;align-items:flex-end!important;gap:8px!important;
  margin:0 0 9px!important;padding:10px!important;border:1px solid var(--ui-line)!important;border-radius:12px!important;
  background:var(--ui-surface)!important;box-shadow:none!important;overflow:visible!important
}
.ref-filter .field{flex:1 1 170px!important;min-width:150px!important;min-height:57px!important;padding:2px!important;background:transparent!important;border:0!important}
.ref-filter .field.grow{flex:3 1 320px!important;min-width:250px!important}
.ref-filter .field label{display:block!important;min-height:13px!important;margin:0 0 5px 1px!important;padding:0!important;color:var(--ui-muted)!important;font-size:9px!important;font-weight:750!important;line-height:13px!important}
.ref-filter .field input,.ref-filter .field select{
  width:100%!important;height:var(--ui-field-h)!important;min-height:var(--ui-field-h)!important;padding:0 11px!important;
  border:1px solid var(--ui-line-strong)!important;border-radius:var(--ui-control-r)!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;
  box-shadow:none!important;outline:none!important;font-size:10.5px!important
}
.ref-filter .field input:focus,.ref-filter .field select:focus,.write-field input:focus,.write-field select:focus,.write-field textarea:focus,.pr-master-line input:focus,.po-item-row input:focus{
  background:var(--ui-surface)!important;border-color:#9da5ae!important;box-shadow:0 0 0 3px rgba(72,80,88,.08)!important;outline:none!important
}
.ref-filter .check-field{flex:0 0 auto!important;min-width:max-content!important;width:auto!important;align-self:flex-end!important;padding:2px!important}
.ref-filter .check-field>label{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;
  width:auto!important;height:var(--ui-field-h)!important;min-height:var(--ui-field-h)!important;margin:18px 0 0!important;padding:0 7px!important;
  border:1px solid transparent!important;border-radius:var(--ui-control-r)!important;color:var(--ui-text)!important;font-size:10px!important;font-weight:750!important;line-height:1!important;white-space:nowrap!important;cursor:pointer!important
}
.ref-filter .check-field>label:hover{background:var(--ui-surface-2)!important;border-color:var(--ui-line)!important}
.ref-filter .check-field input[type="checkbox"],body[data-erp-screen="purchase-need"] #pur_only_short{
  -webkit-appearance:checkbox!important;appearance:auto!important;display:inline-block!important;flex:0 0 16px!important;
  width:16px!important;min-width:16px!important;max-width:16px!important;height:16px!important;min-height:16px!important;max-height:16px!important;
  margin:0!important;padding:0!important;box-shadow:none!important;accent-color:#202225!important;cursor:pointer!important
}
.ref-status{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0 2px 8px!important;color:var(--ui-muted)!important;font-size:9.5px!important;white-space:nowrap!important}
.ref-source{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:var(--ui-muted-2)!important;font-size:8.7px!important}
.table-card{margin-top:0!important;border:1px solid var(--ui-line)!important;border-radius:12px!important;background:var(--ui-surface)!important;box-shadow:none!important;overflow:hidden!important}
.table-wrap,.ja-table-wrap,.jb-qc-table-wrap,.jb-stock-table-wrap,.sup-master-list,.rcv-item-table{max-width:100%!important;overflow-x:auto!important;overscroll-behavior-x:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important;scrollbar-color:#aeb4bb transparent!important}
.table-wrap{max-height:calc(100vh - 244px)!important;overflow-y:auto!important}
.table-wrap::-webkit-scrollbar,.ja-table-wrap::-webkit-scrollbar,.jb-qc-table-wrap::-webkit-scrollbar,.jb-stock-table-wrap::-webkit-scrollbar{height:8px;width:8px}
.table-wrap::-webkit-scrollbar-thumb,.ja-table-wrap::-webkit-scrollbar-thumb,.jb-qc-table-wrap::-webkit-scrollbar-thumb,.jb-stock-table-wrap::-webkit-scrollbar-thumb{background:#aeb4bb;border-radius:999px;border:2px solid transparent;background-clip:content-box}
.table-wrap>table{width:max-content!important;min-width:100%!important;table-layout:auto!important;border-collapse:collapse!important;font-size:9.8px!important}
.table-wrap th,.table-wrap td{
  white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important;hyphens:none!important;vertical-align:middle!important
}
.table-wrap th{position:sticky!important;top:0!important;z-index:4!important;height:40px!important;padding:0 10px!important;border:0!important;border-bottom:1px solid var(--ui-line)!important;background:var(--ui-surface-2)!important;color:#636b74!important;font-weight:800!important}
.table-wrap td{height:var(--ui-row-h)!important;padding:0 10px!important;border:0!important;border-bottom:1px solid var(--ui-line)!important;background:var(--ui-surface)!important;color:var(--ui-text)!important}
.table-wrap tbody tr:nth-child(even) td{background:rgba(127,135,145,.018)!important}.table-wrap tbody tr:hover td{background:var(--ui-surface-2)!important}
.table-wrap td:not(.code):not(.num):not(.money):not(.center){max-width:340px!important;overflow:hidden!important;text-overflow:ellipsis!important}
.table-wrap td.code,.table-wrap td.mono{min-width:max-content!important;max-width:none!important;overflow:visible!important;text-overflow:clip!important}
.code,.mono,td.code,th.code,.ja-table .mono,[data-document-no],[data-trace-no],[data-request-no]{white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important;hyphens:none!important;font-variant-numeric:tabular-nums!important}
td.num,td.money,td.center,th.num,th.money,th.center{white-space:nowrap!important}
.ja-table th,.ja-table td,.jb-qc-table th,.jb-qc-table td,.jb-stock-table th,.jb-stock-table td,.rcv-item-head,.rcv-item-row,.po-item-head,.po-item-row,.pr-master-head,.pr-master-line{white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important}

/* ---------- 4. Write / process screens: form hierarchy, full-width work surfaces ---------- */
.page.write-page{padding:var(--ui-page-pad)!important}
.write-banner{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:11px 13px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;background:var(--ui-surface-2)!important;box-shadow:none!important}
.write-banner strong{font-size:12px!important;font-weight:900!important;color:var(--ui-text)!important}.write-banner span{font-size:8.8px!important;color:var(--ui-muted)!important;white-space:nowrap!important}
.write-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important;margin-top:11px!important}
.write-field{min-width:0!important;min-height:58px!important;padding:3px 2px!important;background:transparent!important}.write-field.span2{grid-column:span 2!important}.write-field.span3{grid-column:span 3!important}
.write-field label{display:block!important;margin:0 0 5px 1px!important;color:var(--ui-muted)!important;font-size:9px!important;font-weight:750!important}
.write-field input,.write-field select,.write-field textarea,.write-line-grid input,.write-option-row select,.pr-master-line input,.po-item-row input,.rcv-item-row input,.rcv-inspection-row input,.shp-row>input,.sup-request-row>input{
  width:100%!important;min-height:var(--ui-field-h)!important;height:var(--ui-field-h)!important;padding:0 11px!important;border:1px solid var(--ui-line-strong)!important;border-radius:var(--ui-control-r)!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;box-shadow:none!important;font-size:10.5px!important
}
.write-field textarea{height:auto!important;min-height:76px!important;padding:9px 11px!important;resize:vertical!important}
/* UI detail hotfix · write-form checkboxes must never inherit text-input sizing */
.write-field .check{
  display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;
  width:auto!important;height:var(--ui-field-h)!important;min-height:var(--ui-field-h)!important;margin:0!important;padding:0!important;
  color:var(--ui-text)!important;font-size:10px!important;font-weight:750!important;line-height:1.2!important;white-space:nowrap!important;cursor:pointer!important
}
.write-field .check input[type="checkbox"]{
  -webkit-appearance:checkbox!important;appearance:auto!important;display:inline-block!important;flex:0 0 16px!important;
  width:16px!important;min-width:16px!important;max-width:16px!important;height:16px!important;min-height:16px!important;max-height:16px!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:3px!important;background:transparent!important;box-shadow:none!important;
  accent-color:#202225!important;cursor:pointer!important
}
html[data-erp-theme="dark"] .write-field .check input[type="checkbox"]{accent-color:#e7e9ec!important}
.write-section{margin-top:13px!important}.write-section-title{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0 0 7px!important;font-size:10.5px!important;font-weight:850!important;color:var(--ui-text)!important}
.write-section-title button,.write-inline-actions button,.write-row button,.inline-input button,.pr-master-line button{
  height:32px!important;min-height:32px!important;padding:0 10px!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;background:var(--ui-surface-2)!important;color:#555d66!important;font-size:9.5px!important;font-weight:800!important
}
.write-section-title button:hover:not(:disabled),.write-inline-actions button:hover:not(:disabled),.write-row button:hover:not(:disabled),.inline-input button:hover:not(:disabled),.pr-master-line button:hover:not(:disabled){background:var(--ui-surface-3)!important;color:var(--ui-text)!important}
.write-inline-actions{display:flex!important;align-items:center!important;gap:6px!important;margin-top:10px!important;flex-wrap:wrap!important}
.write-inline-actions button.primary,.write-inline-actions button.write-action:not(:disabled),.write-row button.primary,.write-row button.write-action:not(:disabled){background:#17191c!important;color:#fff!important;border-color:#17191c!important}
.write-inline-actions button:disabled,.write-row button:disabled,.write-section-title button:disabled{background:#eceef0!important;color:#a3a9b0!important;border-color:#e5e7ea!important;opacity:1!important;cursor:not-allowed!important}
.write-list,.write-option-group,.po-form-card,.po-item-table,.ja-table-wrap,.jb-qc-card,.jb-stocktake .write-section,.rcv-item-table,.sup-master-list{border:1px solid var(--ui-line)!important;border-radius:12px!important;background:var(--ui-surface)!important;box-shadow:none!important;overflow:hidden!important}
.write-row{min-height:50px!important;padding:9px 11px!important;border-bottom:1px solid var(--ui-line)!important}.write-row:last-child{border-bottom:0!important}
.write-row strong{font-size:10.5px!important}.write-row span{margin-top:4px!important;font-size:8.8px!important;color:var(--ui-muted)!important}
.write-status{margin-top:9px!important;padding:8px 10px!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;font-size:9px!important}
.write-status.ok{background:#edf6f0!important;color:#31724f!important;border-color:#dbece1!important}.write-status.bad{background:#faeeee!important;color:#a0443e!important;border-color:#f0d8d6!important}
.write-option-host{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;gap:8px!important}
.write-option-head{display:flex!important;justify-content:space-between!important;gap:12px!important;padding:9px 11px!important;background:var(--ui-surface-2)!important}.write-option-head strong{font-size:10.5px!important}.write-option-head span{font-size:8.5px!important;color:var(--ui-muted)!important}
.write-option-row{display:grid!important;grid-template-columns:minmax(190px,.46fr) minmax(360px,1.54fr) 86px!important;gap:9px!important;align-items:center!important;padding:8px 10px!important;border-top:1px solid var(--ui-line)!important;font-size:9.8px!important}
.write-option-row small{display:block!important;margin-top:3px!important;color:var(--ui-muted)!important;font-size:8.5px!important}
.write-metrics{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:7px!important;margin-top:9px!important}.write-metrics>div{padding:9px 10px!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;background:var(--ui-surface)!important}.write-metrics small{font-size:8px!important;color:var(--ui-muted)!important}.write-metrics strong{margin-top:4px!important;font-size:11px!important}
.po-summary{gap:7px!important;margin-top:9px!important}.po-summary>div{min-height:72px!important;padding:10px!important;border-radius:10px!important}
.rcv-inspection-row{grid-template-columns:minmax(250px,2fr) 100px 100px 160px minmax(180px,1.2fr) 88px!important;gap:8px!important;padding:10px!important}.rcv-inspection-row input[type="date"]{min-width:154px!important}

/* Purchase request approval route: business concept first, implementation account second. */
.approval-route-section{padding:12px!important;border:1px solid var(--ui-line)!important;border-radius:12px!important;background:var(--ui-surface)!important}
.approval-route-section .write-section-title{margin:0 0 6px!important}
.approval-route-help{margin:0 0 9px!important;padding:8px 10px!important;border-radius:9px!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;font-size:8.8px!important;line-height:1.5!important}
.approval-route-head,.approval-route-row{display:grid!important;grid-template-columns:58px minmax(150px,.7fr) minmax(250px,1.3fr) 118px!important;gap:7px!important;align-items:center!important}
.approval-route-head{padding:0 5px 5px!important;color:var(--ui-muted)!important;font-size:8.2px!important;font-weight:800!important}
.approval-route-row{min-height:48px!important;padding:6px 5px!important;border-top:1px solid var(--ui-line)!important}.approval-route-row:first-child{border-top:0!important}
.approval-step-no{display:flex!important;align-items:center!important;justify-content:center!important;height:34px!important;border-radius:8px!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;font-size:9px!important;font-weight:850!important;white-space:nowrap!important}
.approval-route-row input{width:100%!important;height:36px!important;border:1px solid var(--ui-line-strong)!important;border-radius:8px!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;padding:0 9px!important;font-size:9.8px!important}
.approval-route-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:4px!important}
.approval-route-actions button{height:30px!important;min-width:30px!important;padding:0 7px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;font-size:9px!important;font-weight:800!important}
.approval-route-actions button:hover:not(:disabled){background:var(--ui-surface-3)!important;color:var(--ui-text)!important}.approval-route-actions button:disabled{opacity:.34!important;cursor:not-allowed!important}.approval-route-actions .approval-remove{min-width:42px!important;color:#8a4c48!important}

/* ---------- 5. Common interaction details ---------- */
button{transition:background .11s ease,color .11s ease,border-color .11s ease,transform .05s ease!important}button:active:not(:disabled){transform:translateY(1px)!important}
input[type="checkbox"]{accent-color:#202225}
.placeholder{min-height:88px!important;padding:22px 16px!important;display:grid!important;place-items:center!important;align-content:center!important;color:var(--ui-muted)!important}
.empty-state{min-height:92px!important;margin-top:9px!important;padding:22px 16px!important;border:1px dashed var(--ui-line-strong)!important;border-radius:11px!important;background:var(--ui-surface-2)!important;text-align:center!important;color:var(--ui-muted)!important}
.future-shell{padding:42px 20px!important}.erp-subnav{margin-bottom:9px!important;padding:4px!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;background:var(--ui-surface-2)!important}.erp-subnav button{min-height:30px!important;padding:0 10px!important;border-radius:7px!important}.erp-subnav button.active{background:#17191c!important;color:#fff!important;box-shadow:none!important}
.erp-modal{border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-surface)!important;box-shadow:var(--ui-shadow-float)!important}.erp-modal-head{padding:16px 18px 11px!important}.erp-modal-message{padding:18px!important}.erp-modal-actions{padding:10px 14px!important}.erp-modal-actions button{height:34px!important;border-radius:8px!important}
.erp-toast{border-radius:10px!important;box-shadow:var(--ui-shadow-float)!important}
.table-doc-btn{width:auto!important;min-width:0!important;height:32px!important;min-height:32px!important;padding:0 10px!important;border:1px solid var(--ui-line-strong)!important;border-radius:8px!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;font-size:9.5px!important;font-weight:800!important;white-space:nowrap!important;cursor:pointer!important}
.table-doc-btn:hover:not(:disabled){background:#17191c!important;color:#fff!important;border-color:#17191c!important}.table-doc-btn:disabled{background:#f1f2f3!important;color:#a0a6ad!important;border-color:#e2e5e8!important;cursor:not-allowed!important}

/* ---------- 6. Dark workspace, light sidebar ---------- */
html[data-erp-theme="dark"] .topbar{background:rgba(24,27,31,.97)!important;border-bottom-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-erp-theme="dark"] .hamburger{background:#252a30!important;color:#cdd2d7!important}
html[data-erp-theme="dark"] .topbar-logo-light{display:none!important}html[data-erp-theme="dark"] .topbar-logo-dark{display:block!important}
html[data-erp-theme="dark"] .context-path,html[data-erp-theme="dark"] .top-user,html[data-erp-theme="dark"] .role{color:#9299a2!important}
html[data-erp-theme="dark"] .context-title{color:#f0f2f4!important}
html[data-erp-theme="dark"] .theme-switch{background:#20242a!important;border-color:#41464d!important}.theme-btn{color:#808790!important}html[data-erp-theme="dark"] .theme-btn{color:#9ba2aa!important}html[data-erp-theme="dark"] .theme-btn.active{background:#f2f3f4!important;color:#111315!important}
html[data-erp-theme="dark"] .role{border-left-color:#3a4046!important}.logout{color:#4f565e}html[data-erp-theme="dark"] .logout{background:#20242a!important;color:#d9dde1!important;border-color:#3a4046!important}
html[data-erp-theme="dark"] .tabs{background:var(--ui-bg)!important;border-bottom-color:var(--ui-line)!important}.tab{color:#878f98!important}html[data-erp-theme="dark"] .tab:hover{background:#20242a!important;color:#d9dde1!important}html[data-erp-theme="dark"] .tab.active{background:#1a1d21!important;color:#f0f2f4!important;border-color:#30353b!important;box-shadow:none!important}html[data-erp-theme="dark"] .tab-close:hover{background:rgba(255,255,255,.08)!important}
html[data-erp-theme="dark"] .toolbar,html[data-erp-theme="dark"] .page,html[data-erp-theme="dark"] .panel,html[data-erp-theme="dark"] .table-card,html[data-erp-theme="dark"] .ref-filter,html[data-erp-theme="dark"] .write-list,html[data-erp-theme="dark"] .write-option-group,html[data-erp-theme="dark"] .po-form-card,html[data-erp-theme="dark"] .po-item-table,html[data-erp-theme="dark"] .ja-table-wrap,html[data-erp-theme="dark"] .jb-qc-card,html[data-erp-theme="dark"] .rcv-item-table,html[data-erp-theme="dark"] .sup-master-list{background:var(--ui-surface)!important;border-color:var(--ui-line)!important;box-shadow:none!important}
html[data-erp-theme="dark"] .toolbar button{background:#252a30!important;color:#d9dde1!important}html[data-erp-theme="dark"] .toolbar button:hover:not(:disabled){background:#30363d!important;color:#fff!important}html[data-erp-theme="dark"] .toolbar button.query:active,html[data-erp-theme="dark"] .toolbar button.query.is-working,html[data-erp-theme="dark"] .toolbar button.query.is-working:disabled,html[data-erp-theme="dark"] .toolbar button.write,html[data-erp-theme="dark"] .toolbar button.write-action,html[data-erp-theme="dark"] .toolbar button.primary{background:#f2f3f4!important;color:#111315!important}html[data-erp-theme="dark"] .toolbar button:disabled{background:#20242a!important;color:#626a73!important}
html[data-erp-theme="dark"] .home-work-item,html[data-erp-theme="dark"] .home-quick-item,html[data-erp-theme="dark"] .write-banner,html[data-erp-theme="dark"] .approval-route-help,html[data-erp-theme="dark"] .approval-step-no,html[data-erp-theme="dark"] .write-status,html[data-erp-theme="dark"] .erp-subnav{background:var(--ui-surface-2)!important}html[data-erp-theme="dark"] .home-work-item:hover,html[data-erp-theme="dark"] .home-quick-item:hover{background:var(--ui-surface-3)!important;border-color:var(--ui-line-strong)!important}html[data-erp-theme="dark"] .home-work-icon,html[data-erp-theme="dark"] .home-quick-icon{background:#2c3137!important;color:#d3d7dc!important}
html[data-erp-theme="dark"] .home-edit,html[data-erp-theme="dark"] .home-refresh{background:#20242a!important;color:#cfd4d9!important;border-color:#30353b!important}html[data-erp-theme="dark"] .home-edit:hover,html[data-erp-theme="dark"] .home-refresh:hover{background:#292e34!important;color:#fff!important}
html[data-erp-theme="dark"] .summary.summary-link{background:var(--ui-surface)!important;border-color:var(--ui-line)!important}html[data-erp-theme="dark"] .summary.summary-link:hover{background:var(--ui-surface-2)!important;border-color:var(--ui-line-strong)!important}
html[data-erp-theme="dark"] .ref-filter .field input,html[data-erp-theme="dark"] .ref-filter .field select,html[data-erp-theme="dark"] .write-field input,html[data-erp-theme="dark"] .write-field select,html[data-erp-theme="dark"] .write-field textarea,html[data-erp-theme="dark"] .approval-route-row input,html[data-erp-theme="dark"] .pr-master-line input,html[data-erp-theme="dark"] .po-item-row input{background:#20242a!important;color:#eef0f2!important;border-color:#41464d!important}html[data-erp-theme="dark"] input[type="date"]{color-scheme:dark!important}html[data-erp-theme="dark"] option{background:#20242a!important;color:#eef0f2!important}
html[data-erp-theme="dark"] .table-wrap th{background:#24282d!important;color:#bfc5cc!important;border-bottom-color:#30353b!important}html[data-erp-theme="dark"] .table-wrap td{background:#1a1d21!important;color:#dfe3e7!important;border-bottom-color:#2b3036!important}html[data-erp-theme="dark"] .table-wrap tbody tr:nth-child(even) td{background:#1d2125!important}html[data-erp-theme="dark"] .table-wrap tbody tr:hover td{background:#272c32!important}
html[data-erp-theme="dark"] .write-inline-actions button,html[data-erp-theme="dark"] .write-section-title button,html[data-erp-theme="dark"] .write-row button,html[data-erp-theme="dark"] .inline-input button,html[data-erp-theme="dark"] .pr-master-line button,html[data-erp-theme="dark"] .approval-route-actions button,html[data-erp-theme="dark"] .table-doc-btn{background:#252a30!important;color:#d9dde1!important;border-color:#3b4148!important}html[data-erp-theme="dark"] .write-inline-actions button:hover:not(:disabled),html[data-erp-theme="dark"] .write-section-title button:hover:not(:disabled),html[data-erp-theme="dark"] .write-row button:hover:not(:disabled),html[data-erp-theme="dark"] .approval-route-actions button:hover:not(:disabled),html[data-erp-theme="dark"] .table-doc-btn:hover:not(:disabled){background:#f2f3f4!important;color:#111315!important;border-color:#f2f3f4!important}html[data-erp-theme="dark"] .write-inline-actions button.primary,html[data-erp-theme="dark"] .write-inline-actions button.write-action:not(:disabled),html[data-erp-theme="dark"] .write-row button.primary{background:#f2f3f4!important;color:#111315!important;border-color:#f2f3f4!important}html[data-erp-theme="dark"] .write-inline-actions button:disabled,html[data-erp-theme="dark"] .write-row button:disabled,html[data-erp-theme="dark"] .table-doc-btn:disabled{background:#20242a!important;color:#626a73!important;border-color:#30353b!important}
html[data-erp-theme="dark"] .write-status.ok{background:#20342b!important;color:#91c7a7!important;border-color:#294637!important}html[data-erp-theme="dark"] .write-status.bad{background:#3a2a2a!important;color:#e0a6a1!important;border-color:#4a3130!important}
html[data-erp-theme="dark"] .ref-filter .check-field input[type="checkbox"],html[data-erp-theme="dark"] body[data-erp-screen="purchase-need"] input[type="checkbox"]{accent-color:#e7e9ec!important}
html[data-erp-theme="dark"] .erp-subnav button.active{background:#f2f3f4!important;color:#111315!important}
html[data-erp-theme="dark"] .bottom-status{background:linear-gradient(to top,var(--ui-bg) 76%,transparent)!important}

/* ---------- 7. Responsive: reflow controls, never crush data ---------- */
@media(max-width:1180px){
  .write-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.write-metrics{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .approval-route-head,.approval-route-row{grid-template-columns:54px minmax(130px,.65fr) minmax(220px,1.35fr) 108px!important}
}
@media(max-width:980px){
  .nav{transform:translateX(-100%)!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important}
  .topbar,.main{left:0!important}body.mobile-nav-open .nav,body.mobile-nav-open.p21-sidebar-hidden .nav{transform:translateX(0)!important}
  .topbar-brand{display:flex!important}.home-dashboard{width:100%!important}.home-work-grid{grid-template-columns:1fr!important}.home-work-grid>.panel{min-height:0!important}
  .home-live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}.write-option-row{grid-template-columns:minmax(150px,.42fr) minmax(280px,1.58fr) 80px!important}
  .approval-route-head{display:none!important}.approval-route-row{grid-template-columns:54px minmax(130px,.7fr) minmax(220px,1.3fr) 108px!important}
  .tabs{padding-left:10px!important;padding-right:10px!important}.work{padding-left:10px!important;padding-right:10px!important}.toolbar{margin-left:10px!important;margin-right:10px!important}.bottom-status{left:10px!important;right:10px!important}
}
@media(max-width:700px){
  .topbar{padding:0 10px!important}.context{min-width:0!important;max-width:150px!important}.topbar-brand{display:none!important}.top-user,.role,.logout{display:none!important}
  .home-hero{align-items:stretch!important;flex-direction:column!important}.home-hero-actions{justify-content:flex-end!important}.home-live-summary,.home-quick-grid{grid-template-columns:1fr!important}.home-work-grid>.panel{min-height:0!important}
  .write-grid{grid-template-columns:1fr!important}.write-field.span2,.write-field.span3{grid-column:span 1!important}.write-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .write-option-row{grid-template-columns:96px minmax(190px,1fr) 72px!important}.write-line-grid,.write-line-grid.po{grid-template-columns:1fr!important}.write-row,.write-row.multi{grid-template-columns:1fr!important}.row-actions{flex-wrap:wrap!important}
  .approval-route-row{grid-template-columns:52px minmax(0,1fr) 102px!important}.approval-route-row .approval-email{grid-column:2/4!important}.approval-route-actions{grid-column:3!important}
  .ref-filter .field,.ref-filter .field.grow{flex:1 1 100%!important;min-width:0!important}.ref-filter .check-field{flex:0 0 auto!important}.ref-filter .check-field>label{margin-top:0!important}
  .bottom-status span:last-child{display:none!important}
}


/* =========================================================
   XYZ ERP · GOOGLE WORKSPACE LOGIN · LEGACY VISUAL PARITY
   정본: 기존 Google Sheets Web ERP 로그인 디자인
   ========================================================= */
[hidden]{display:none!important}
.erp-login-gate{position:fixed;inset:0;display:grid;grid-template-rows:auto 1fr auto;min-width:320px;min-height:100%;padding:66px 8vw 32px;overflow:auto;background:radial-gradient(circle at 78% 26%,rgba(255,255,255,.035),rgba(255,255,255,0) 30%),#050505;color:#fff;z-index:50000;font-family:var(--font,"Pretendard","Apple SD Gothic Neo","Malgun Gothic",sans-serif)}
.erp-login-brand{display:flex;align-items:center;gap:34px}
.erp-login-logo{width:218px;flex:0 0 auto;color:#fff;line-height:0}.erp-login-logo svg{display:block;width:100%;height:auto}
.erp-login-tagline{padding-left:2px;color:#fff;font-size:16px;font-weight:700;line-height:1.65;letter-spacing:-.015em}
.erp-login-main{display:flex;align-items:center;justify-content:flex-end}
.erp-login-panel{position:relative;width:min(470px,100%);overflow:hidden;border:1px solid #414141;border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,0) 46%),#090909;box-shadow:0 26px 70px rgba(0,0,0,.32)}
.erp-login-panel::after{content:"";position:absolute;top:0;right:0;width:92px;height:1px;background:rgba(255,255,255,.9);transform:rotate(-45deg);transform-origin:right top;pointer-events:none}
.erp-login-panel-head{padding:27px 30px 24px;border-bottom:1px solid #353535}.erp-login-kicker{margin-bottom:10px;color:#8f8f8f;font-size:9px;font-weight:700;letter-spacing:.16em}.erp-login-title{color:#fff;font-size:30px;font-weight:760;letter-spacing:-.03em}.erp-login-subtitle{margin-top:8px;color:#9d9d9d;font-size:11px;line-height:1.65}
.erp-login-panel-body{padding:25px 30px 28px}.erp-login-google-box{display:grid;gap:12px;padding:16px;border:1px solid #333;border-radius:12px;background:#0d0d0d}.erp-login-google-title{color:#fff;font-size:11px;font-weight:760}
.erp-login-google-copy{color:#8f8f8f;font-size:10px;line-height:1.65}
.erp-login-google-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:44px;padding:0 14px;border:1px solid #d7d7d7;border-radius:10px;background:#fff;color:#161616;font-family:inherit;font-size:12px;font-weight:680;cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .08s ease}.erp-login-google-button:hover{background:#f7f7f7;border-color:#bdbdbd}.erp-login-google-button:active{transform:translateY(1px)}.erp-login-google-button:disabled{cursor:not-allowed;opacity:.55}.erp-login-google-g{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#fff;color:#4285f4;font-size:16px;font-weight:800;line-height:1}.erp-login-form{display:grid;gap:10px}.erp-login-field-label{color:#bdbdbd;font-size:10px;font-weight:650}
.erp-login-input{box-sizing:border-box;width:100%;min-height:44px;padding:0 12px;border:1px solid #444;border-radius:10px;outline:0;background:#050505;color:#fff;font-family:inherit;font-size:12px}.erp-login-input:focus{border-color:#fff}.erp-login-input::placeholder{color:#666}.erp-login-google-note{margin-top:2px;color:#777;font-size:9px;line-height:1.55}
.erp-login-button{width:100%;min-height:46px;margin-top:1px;border:1px solid #fff;border-radius:10px;background:#fff;color:#050505;font-family:inherit;font-size:12px;font-weight:760;cursor:pointer;transition:background .12s ease,color .12s ease,transform .12s ease}.erp-login-button:hover{background:#e9e9e9;transform:translateY(-1px)}.erp-login-button:active{transform:translateY(0)}.erp-login-button:disabled{border-color:#484848;background:#242424;color:#777;cursor:wait;transform:none}
.erp-login-account{display:none}.erp-login-message{min-height:20px;margin-top:7px;color:#bdbdbd;font-size:10px;line-height:1.6;white-space:pre-line}.erp-login-message.error{color:#ff9292}.erp-login-message.success{color:#8fd2ad}
.erp-login-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-top:17px;border-top:1px solid #363636;color:#777;font-size:8.5px;letter-spacing:.05em}.erp-login-footer strong{color:#9b9b9b;font-weight:500}
.bottom-status-right{margin-left:auto;display:flex;align-items:center;gap:12px;min-width:0}.build-signature{flex:0 0 auto;padding-left:12px;border-left:1px solid var(--ui-line,#d9dde2);font-size:8.5px;font-weight:700;letter-spacing:.045em;color:#747b83;white-space:nowrap}html[data-erp-theme="dark"] .build-signature{border-left-color:#363b42;color:#777f88}
@media(max-width:760px){.erp-login-gate{padding:42px 24px 24px}.erp-login-brand{align-items:flex-start;flex-direction:column;gap:20px}.erp-login-logo{width:160px}.erp-login-tagline{font-size:13px}.erp-login-main{justify-content:stretch;padding:44px 0}.erp-login-panel{width:100%}}
@media(max-width:520px){.erp-login-gate{padding:30px 18px 20px}.erp-login-tagline{display:none}.erp-login-main{padding:38px 0}.erp-login-panel-head,.erp-login-panel-body{padding-left:22px;padding-right:22px}}

/* 업무 목적 subview: 한 번에 한 역할만 보인다. */
.erp-subnav{position:sticky;top:0;z-index:8;display:flex;align-items:center;gap:4px;overflow-x:auto;scrollbar-width:thin;margin:0 0 10px;padding:4px;border:1px solid var(--ui-line,#d9dde2);border-radius:10px;background:var(--ui-surface,#fff)}
.erp-subnav button{height:32px;min-width:max-content;padding:0 11px;border:0;border-radius:7px;background:transparent;color:var(--ui-muted,#747b83);font:inherit;font-size:9.5px;font-weight:800;cursor:pointer}
.erp-subnav button:hover{background:var(--ui-surface-2,#f4f5f6);color:var(--ui-text,#1b1e22)}
.erp-subnav button.active{background:#17191c;color:#fff}
html[data-erp-theme="dark"] .erp-subnav{background:#1a1d21;border-color:#30353b}
html[data-erp-theme="dark"] .erp-subnav button{color:#9da4ac}
html[data-erp-theme="dark"] .erp-subnav button:hover{background:#252a30;color:#edf0f2}
html[data-erp-theme="dark"] .erp-subnav button.active{background:#f2f3f4;color:#111315}
[data-subview-panel][hidden]{display:none!important}
.write-page>[data-subview-panel]{min-width:0}

@media(max-width:760px){
  .erp-login-gate{padding:42px 24px 24px}
  .erp-login-brand{align-items:flex-start;flex-direction:column;gap:20px}
  .erp-login-logo{width:160px}
  .erp-login-tagline{font-size:13px}
  .erp-login-main{justify-content:stretch;padding:44px 0}
  .erp-login-panel{width:100%}
  .erp-login-footer{padding-top:14px}
  .bottom-status-right>span:first-child{display:none}
}

/* Legacy SYSTEM STATUS parity */
.system-parity-page{display:flex;flex-direction:column;gap:10px}
.system-parity-actions{display:flex;justify-content:flex-end;gap:8px}
.system-parity-card{padding:14px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface)}
.system-parity-note{display:flex;gap:12px;align-items:flex-start;padding:11px 13px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface-2);font-size:9px;color:var(--ui-muted)}
.system-parity-note strong{flex:0 0 auto;color:var(--ui-text);font-size:9.5px}.system-parity-note span{line-height:1.55}
.system-kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.system-kpi{min-width:0;padding:12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface-2)}
.system-kpi span,.system-kpi em{display:block;color:var(--ui-muted);font-size:8.5px;font-style:normal}.system-kpi strong{display:block;margin:6px 0 4px;font-size:18px;color:var(--ui-text)}
.system-kpi.ok strong{color:#1d7a4c}.system-kpi.bad strong{color:#b42318}
.system-meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.system-meta-grid>div{padding:10px;border-top:1px solid var(--ui-line)}.system-meta-grid span{display:block;color:var(--ui-muted);font-size:8px}.system-meta-grid strong{display:block;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9.5px}
.system-connection-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.system-connection-card{min-width:0;padding:12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface-2)}
.system-connection-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.system-connection-top strong{font-size:10px}.system-pill{padding:3px 7px;border-radius:999px;background:#eee;color:#555;font-size:8px;font-weight:800}.system-pill.ok{background:#e8f5ee;color:#1d7a4c}.system-pill.bad{background:#fcebea;color:#b42318}
.system-connection-card dl{display:grid;grid-template-columns:42px minmax(0,1fr);gap:6px 8px;margin:11px 0 0}.system-connection-card dt{color:var(--ui-muted);font-size:8px}.system-connection-card dd{min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8.7px}.system-connection-card p{margin:10px 0 0;color:var(--ui-muted);font-size:8.5px}
.system-log-filter .check-field>label{border:0!important;background:transparent!important;padding:0!important}
@media(max-width:1200px){.system-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.system-connection-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.system-kpi-grid,.system-meta-grid,.system-connection-grid{grid-template-columns:1fr}}
html[data-erp-theme="dark"] .system-parity-card,html[data-erp-theme="dark"] .system-kpi,html[data-erp-theme="dark"] .system-connection-card{background:var(--ui-surface)!important;border-color:var(--ui-line)!important}
html[data-erp-theme="dark"] .system-parity-note{background:var(--ui-surface-2)!important}
