/* Installed ERP and browser share the same responsive workspace. */
html,body{width:100%;height:100%;min-height:0;overflow:hidden;}
.main{min-width:0;min-height:0;}
.main>.work{min-width:0;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding:18px 0 80px;}
.nav-scroll{min-height:0;overscroll-behavior:contain;}
.topbar{min-width:0;}.topbar .hamburger,.topbar .logout,.topbar .theme-switch{flex-shrink:0;}
.topbar .context{min-width:0!important;flex:1 1 128px;}
.topbar .context-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.topbar .top-user{min-width:0;max-width:34%;overflow:hidden;text-overflow:ellipsis;}
.main>.toolbar{flex-wrap:wrap;height:auto!important;flex-shrink:0;}
.main>.toolbar button{flex-shrink:0;}
.tabs{min-width:0;overscroll-behavior-x:contain;}
.work>.page,.work .write-field,.work .write-banner>*,.work .write-row>*{min-width:0;}
.work .write-banner{flex-wrap:wrap;}
.work .write-section-title{gap:10px;flex-wrap:wrap;}
.work .table-wrap,.work .ja-table-wrap{max-width:100%;overscroll-behavior-x:contain;}
.bottom-status{pointer-events:none;}
.erp-modal-backdrop{padding:16px;}
.erp-modal{display:flex;flex-direction:column;max-width:100%;max-height:calc(100dvh - 32px);}
.erp-modal-head,.erp-modal-actions{flex-shrink:0;}
.erp-modal-message{min-height:0;overflow:auto;overscroll-behavior:contain;}
.erp-modal-actions{flex-wrap:wrap;}
.notice-dialog{max-height:calc(100dvh - 32px);}
.erp-login-gate{height:100dvh;min-height:0!important;overflow:auto;overscroll-behavior:contain;}
@media(display-mode:standalone){
 .main{bottom:env(safe-area-inset-bottom,0px);}
 .nav{padding-top:env(safe-area-inset-top,0px);}
 .work{scrollbar-width:thin;}
 .topbar{user-select:none;-webkit-user-select:none;}
 .topbar button{user-select:auto;}
}
@media(max-width:1180px){
 .topbar .top-user{max-width:220px;font-size:9px!important;}
 .topbar .role{display:none;}
}
@media(max-width:980px){
 .topbar .top-user{max-width:30%;}
 .work .write-option-row{grid-template-columns:minmax(90px,.5fr) minmax(0,1.5fr) 72px!important;}
 .work .approval-route-row{grid-template-columns:42px minmax(0,1fr) minmax(0,1.2fr) 88px!important;}
 .work .approval-route-row input,.work .approval-route-row select{min-width:0;max-width:100%;}
}
@media(max-width:700px){
 .topbar .top-user,.topbar .role{display:none!important;}
 .topbar .theme-switch{margin-left:auto!important;}
 .topbar .theme-btn{min-width:38px!important;}
 .topbar .logout{padding:0 8px!important;}
 .work .approval-route-row{grid-template-columns:42px minmax(0,1fr) 88px!important;}
 .work .write-option-row{grid-template-columns:80px minmax(0,1fr)!important;}
 .work .write-option-row>*:last-child{grid-column:2;}
 .work .write-inline-actions,.work .row-actions{flex-wrap:wrap;}
 .work .write-inline-actions button{max-width:100%;height:auto;min-height:34px;white-space:normal;}
 .work .notice-form-grid{grid-template-columns:1fr;}
}
@media(max-height:600px){
 .tabs{height:40px!important;min-height:40px!important;padding-top:3px!important;}
 .main>.toolbar{margin-top:6px!important;min-height:40px!important;}
 .nav .brand-row{min-height:58px;flex-basis:58px;padding-top:10px;padding-bottom:10px;}
 .nav .user-card{margin:6px 10px;padding:8px 12px;}
 .erp-login-main{transform:none!important;padding-top:20px!important;padding-bottom:20px!important;}
 .ai-help-panel{min-height:0!important;max-height:calc(100dvh - 24px)!important;}
}
@media(prefers-reduced-motion:reduce){.nav,.tab,.ai-help-panel{transition:none!important;}}
/* Consistent everyday controls across legacy and newly added screens. */
.work :is(input,select,textarea){font-family:inherit;transition:border-color .12s,box-shadow .12s;}
.work :is(input,select,textarea):focus-visible{outline:2px solid var(--ui-muted,var(--muted));outline-offset:2px;}
.work :is(button,a):focus-visible,.tabs button:focus-visible,.nav button:focus-visible{outline:2px solid var(--ui-muted,var(--muted));outline-offset:3px;}
.work :is(input,textarea)::placeholder{color:var(--ui-muted,var(--muted));opacity:.8;}
.work :is(input,select,textarea):disabled{opacity:.6;cursor:not-allowed;}
.work button:disabled{cursor:not-allowed;}
.work :is(input,textarea)[readonly]{color:var(--muted);}
.work .write-page button:not(.tab-close){border-radius:9px;}
.work .write-page button:not([class]){min-height:34px;padding:0 12px;border:1px solid var(--line);background:var(--soft);color:var(--text);font-size:10px;font-weight:750;}
.work input[type=file]{max-width:100%;color:var(--muted);font-size:10px;}
.work input[type=file]::file-selector-button{padding:7px 12px;margin-right:10px;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--text);font:inherit;font-weight:750;cursor:pointer;}
.work input[type=checkbox]{accent-color:var(--text);}
.work .write-inline-actions{align-items:center;gap:8px;}
.work .placeholder{line-height:1.7;overflow-wrap:anywhere;}
.work :is(.ref-filter,.write-list,.po-form-card,.table-card){border-radius:14px;}
.work .ref-filter{row-gap:12px;}
.work .table-wrap{scrollbar-width:thin;scrollbar-color:var(--muted) transparent;}
.work .table-wrap:focus-visible{outline:2px solid var(--muted);outline-offset:2px;}
.work table td{font-variant-numeric:tabular-nums;}
.work .write-status:not(:empty){line-height:1.65;overflow-wrap:anywhere;}
.erp-modal-actions{gap:8px;}.erp-modal-actions button{min-width:68px;}
.erp-toast-host{max-width:calc(100vw - 32px);pointer-events:none;}
.erp-toast{overflow-wrap:anywhere;max-width:100%;}
@media(display-mode:standalone){
 .main>.work{padding-bottom:76px!important;}
 .tabs{padding-top:7px!important;}
 .toolbar{box-shadow:0 1px 2px rgba(0,0,0,.025)!important;}
}

/* 2026-10-10 실제 앱 검수 반영 · 앱 공통 마감 (r3) */
/* 탭: 넘칠 때 굵은 스크롤바가 탭을 밀어 올리지 않도록 숨기고, 양끝 흐림으로 더 있음을 표시 */
.tabs{scrollbar-width:none!important;overflow-y:hidden!important;scroll-behavior:smooth;}
.tabs::-webkit-scrollbar{display:none!important;height:0!important;}
.tabs.erp-tabs-more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 42px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 42px),transparent);}
.tabs.erp-tabs-more-left{-webkit-mask-image:linear-gradient(to right,transparent,#000 42px);mask-image:linear-gradient(to right,transparent,#000 42px);}
.tabs.erp-tabs-more-left.erp-tabs-more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 42px,#000 calc(100% - 42px),transparent);mask-image:linear-gradient(to right,transparent,#000 42px,#000 calc(100% - 42px),transparent);}

/* 체크박스·라디오: 다크/라이트 모두 ERP 입력칸과 같은 표면·테두리 사용 (브라우저 기본 흰 상자 제거) */
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=checkbox]:not(#erp-native-check),
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=radio]:not(#erp-native-check){
 -webkit-appearance:none!important;appearance:none!important;display:inline-grid!important;place-content:center;
 flex:0 0 15px!important;width:15px!important;height:15px!important;min-width:15px!important;min-height:15px!important;max-width:15px!important;
 margin:0!important;padding:0!important;vertical-align:middle;border:1px solid var(--ui-line-strong,var(--line))!important;border-radius:4px!important;
 background:var(--ui-surface,var(--surface))!important;box-shadow:none!important;cursor:pointer;font-size:0!important;transition:background .12s,border-color .12s;
}
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=radio]:not(#erp-native-check){border-radius:50%!important;}
:is(.work,.erp-modal,.notice-dialog,.ai-help) :is(input[type=checkbox],input[type=radio]):not(#erp-native-check):hover{border-color:var(--ui-muted,var(--muted))!important;}
:is(.work,.erp-modal,.notice-dialog,.ai-help) :is(input[type=checkbox],input[type=radio]):not(#erp-native-check):checked{background:var(--ui-text,var(--text))!important;border-color:var(--ui-text,var(--text))!important;}
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=checkbox]:not(#erp-native-check):checked::after{content:'';width:7px;height:4px;border-left:2px solid var(--ui-surface,var(--surface));border-bottom:2px solid var(--ui-surface,var(--surface));transform:translateY(-1px) rotate(-45deg);}
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=radio]:not(#erp-native-check):checked::after{content:'';width:5px;height:5px;border-radius:50%;background:var(--ui-surface,var(--surface));}
:is(.work,.erp-modal,.notice-dialog,.ai-help) input[type=checkbox]:not(#erp-native-check):indeterminate::after{content:'';width:7px;height:2px;background:var(--ui-surface,var(--surface));}
:is(.work,.erp-modal,.notice-dialog,.ai-help) :is(input[type=checkbox],input[type=radio]):not(#erp-native-check):disabled{opacity:.45;cursor:not-allowed;}
:is(.work,.erp-modal,.notice-dialog,.ai-help) :is(input[type=checkbox],input[type=radio]):not(#erp-native-check):focus-visible{outline:2px solid var(--ui-muted,var(--muted))!important;outline-offset:2px;}

/* ERP 가이드 버튼: 업무 화면 위에 떠서 입력칸·버튼을 가리지 않도록 하단 상태줄 안의 작은 버튼으로 배치 */
@media(min-width:601px){
 .ai-help{right:18px!important;bottom:3px!important;}
 .ai-help-launch{height:24px!important;padding:0 10px 0 8px!important;gap:5px!important;font-size:9.5px!important;font-weight:800!important;box-shadow:none!important;border:1px solid var(--ui-line,var(--line))!important;background:var(--ui-surface,var(--surface))!important;color:var(--ui-text,var(--text))!important;}
 .ai-help-launch:hover{background:var(--ui-surface-2,var(--soft))!important;border-color:var(--ui-muted,var(--muted))!important;}
 .ai-help-launch[aria-expanded="true"]{background:var(--ui-text,var(--text))!important;color:var(--ui-surface,var(--surface))!important;border-color:var(--ui-text,var(--text))!important;}
 .ai-help-launch-icon{font-size:11px!important;}
 .bottom-status-right{padding-right:100px;}
 .ai-help-panel:not([style*="top"]){bottom:40px!important;}
}

/* 출고검사 QC 기록 입력칸: 다른 업무 입력칸과 같은 글꼴 크기 */
.jb-qc-field :is(input,textarea,select){font-size:10.5px!important;line-height:1.55;}

/* 월말실사 입력 표: 제목·건수가 카드 테두리에 붙어 잘리던 문제, No 열 과대 폭 */
.jb-stocktake .write-section>.write-section-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0!important;padding:12px 14px!important;border-bottom:1px solid var(--ui-line,var(--line));font-size:11px;font-weight:800;}
.jb-stocktake .write-section>.write-section-title span:last-child{font-size:9.5px;font-weight:750;color:var(--ui-muted,var(--muted));}
.jb-stock-table th:first-child,.jb-stock-table td:first-child{width:48px;}
.jb-stock-table td.placeholder{text-align:left!important;padding:22px 16px!important;color:var(--ui-muted,var(--muted));}

/* 렌탈·자산관리: 안내문과 결과 제목이 본문보다 크게 표시되던 문제 */
body[data-erp-screen="rental"] .write-page>.muted{margin:4px 0 2px;padding:10px 12px;border:1px solid var(--ui-line,var(--line));border-radius:10px;background:var(--ui-surface-2,var(--soft));color:var(--ui-muted,var(--muted));font-size:10px!important;font-weight:600!important;line-height:1.65;}
body[data-erp-screen="rental"] #rtResults>h3{margin:22px 0 8px;font-size:12px!important;font-weight:800;line-height:1.4;color:var(--ui-text,var(--text));}
body[data-erp-screen="rental"] #rtStatus:empty{display:none;}
body[data-erp-screen="rental"] #rtStatus:not(:empty){font-size:10px;color:var(--ui-muted,var(--muted));}

/* 공지사항 관리·공지 창: ERP 공통 글꼴 크기와 무채색 버튼 체계로 통일 */
.notice-admin-head{margin-bottom:14px!important;padding:12px 14px;border:1px solid var(--ui-line,var(--line));border-radius:12px;background:var(--ui-surface-2,var(--soft));}
.notice-admin-head h2{font-size:13px!important;font-weight:850;margin:0 0 3px!important;}
.notice-admin-head p{font-size:9.5px!important;margin:0!important;color:var(--ui-muted,var(--muted));opacity:1!important;}
:is(.notice-admin,.notice-dialog,.notice-home .panel-head) button{min-height:30px;padding:0 12px!important;border:1px solid var(--ui-line,var(--line))!important;border-radius:9px!important;background:var(--ui-surface-2,var(--soft))!important;color:var(--ui-text,var(--text))!important;font-size:10px!important;font-weight:750;}
:is(.notice-admin,.notice-dialog,.notice-home .panel-head) button:hover:not(:disabled){border-color:var(--ui-muted,var(--muted))!important;}
:is(.notice-admin,.notice-dialog) button.primary{background:var(--ui-text,var(--text))!important;color:var(--ui-surface,var(--surface))!important;border-color:var(--ui-text,var(--text))!important;}
.notice-admin .notice-title{font-size:10.5px!important;font-weight:750!important;}
.notice-admin .notice-title:hover{color:var(--ui-text,var(--text))!important;}
.notice-admin table td{font-size:10.5px!important;padding:10px 12px!important;}
.notice-admin table th{font-size:9.5px!important;padding:9px 12px!important;}
.notice-admin table td:last-child button{min-height:26px;padding:0 9px!important;font-size:9.5px!important;}
.notice-admin .notice-category,.notice-detail-dialog .notice-category{font-size:9px!important;border-radius:6px;}
.notice-dialog :focus-visible,.notice-admin .notice-title:focus-visible{outline-color:var(--ui-muted,var(--muted))!important;}
.notice-home .panel-head button{min-height:32px;}
.notice-home .notice-row{padding:13px 18px!important;}
.notice-home .notice-row strong{font-size:12.5px!important;font-weight:800;}
.notice-home .notice-row time{font-size:10px!important;}
.notice-home .notice-row .notice-category{font-size:9px!important;}
.notice-pagination{font-size:10.5px;font-weight:750;}
.notice-pagination button{min-height:28px!important;}
.po-mail-check{display:inline-flex!important;align-items:center;gap:8px;font-size:10.5px!important;font-weight:750!important;}
.notice-admin button.notice-title{min-height:0!important;padding:3px 0!important;border:0!important;border-radius:0!important;background:transparent!important;text-decoration:underline;text-decoration-color:var(--ui-muted,var(--muted));text-underline-offset:3px;}
/* 낮은 창(높이 520px 이하): 탭·도구줄을 줄여 업무 영역 확보 */
@media(max-height:520px){
 .tabs{height:36px!important;min-height:36px!important;padding-top:2px!important;}
 .tab{height:30px!important;}
 .main>.toolbar{margin-top:4px!important;min-height:36px!important;padding-top:3px!important;padding-bottom:3px!important;}
 .main>.toolbar button{height:28px!important;min-height:28px!important;}
}
/* 월말수불부: 수량·금액 쌍 표시, 합계, 확인 표시 */
.ml-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:4px 0 12px;}
.ml-summary>div{padding:10px 12px;border:1px solid var(--ui-line,var(--line));border-radius:10px;background:var(--ui-surface-2,var(--soft));min-width:0;}
.ml-summary small{display:block;font-size:9px;color:var(--ui-muted,var(--muted));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ml-summary strong{display:block;margin-top:4px;font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ml-wrap{max-height:calc(100dvh - 330px);min-height:260px;overflow:auto;}
.ml-table{min-width:1480px;}
.ml-table thead th{position:sticky;top:0;z-index:2;background:var(--ui-surface-2,var(--soft));text-align:center;white-space:nowrap;}
.ml-table thead tr:nth-child(2) th{top:31px;}
.ml-table tfoot th,.ml-table tfoot td{position:sticky;bottom:0;z-index:1;background:var(--ui-surface-2,var(--soft));font-weight:800;border-top:1px solid var(--ui-line-strong,var(--line));}
.ml-table td.money,.ml-table td.num{white-space:nowrap;}
.ml-table td.ml-note{max-width:360px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ui-muted,var(--muted));font-size:9.5px;}
.ml-flag{display:inline-block;margin:1px 4px 1px 0;padding:2px 6px;border-radius:6px;font-size:9px;font-weight:800;white-space:nowrap;border:1px solid var(--ui-line,var(--line));}
.ml-flag.warn{color:#9a6b12;background:rgba(214,158,46,.12);border-color:rgba(214,158,46,.35);}
.ml-flag.bad{color:#b4372f;background:rgba(220,70,60,.1);border-color:rgba(220,70,60,.35);}
html[data-erp-theme="dark"] .ml-flag.warn{color:#e6c06a;}
html[data-erp-theme="dark"] .ml-flag.bad{color:#f08a80;}
.ml-help{margin:10px 2px 0;font-size:9.5px;line-height:1.7;color:var(--ui-muted,var(--muted));}
@media(max-width:1100px){.ml-summary{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Keep the existing layout; emphasize only the main business buttons. */
html body #work button[data-erp-primary="true"]:not(#erp-primary-specificity):not(:disabled){background:#202124!important;border-color:#202124!important;color:#fff!important;font-weight:800!important;}
html[data-erp-theme="dark"] body #work button[data-erp-primary="true"]:not(#erp-primary-specificity):not(:disabled){background:#f3f4f6!important;border-color:#f3f4f6!important;color:#171717!important;}
html body #work button[data-erp-primary="true"]:not(#erp-primary-specificity):focus-visible{outline:3px solid #60a5fa!important;outline-offset:3px;}
