/* ERP visual and interaction polish. Loaded last to unify legacy and workbench pages. */
:root{
  --erp-blue:#1677ff;
  --erp-blue-hover:#0f65dc;
  --erp-navy:#071c2f;
  --erp-sidebar:#082238;
  --erp-bg:#f4f7fb;
  --erp-card:#fff;
  --erp-line:#e3e9f0;
  --erp-text:#233247;
  --erp-muted:#748196;
  --erp-shadow:0 8px 24px rgba(23,43,77,.06);
}

html{background:var(--erp-bg)}
body{background:var(--erp-bg);color:var(--erp-text);font-family:Inter,"PingFang SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button{white-space:nowrap}

/* Normal application shell */
.sidebar{width:188px;background:linear-gradient(180deg,var(--erp-navy),var(--erp-sidebar));box-shadow:4px 0 18px rgba(2,17,31,.12)}
.logo{height:58px;justify-content:flex-start;padding:0 18px;border-bottom:1px solid rgba(255,255,255,.08);letter-spacing:.2px}
.logo-icon{flex:0 0 32px;box-shadow:0 5px 14px rgba(22,119,255,.28)}
.sidebar .menu{height:calc(100vh - 58px);padding:10px 0 24px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.sidebar .menu-item{min-height:42px;padding:10px 18px;border-left:3px solid transparent;transition:background-color .16s ease,color .16s ease,border-color .16s ease}
.sidebar .menu-item:hover{background:rgba(255,255,255,.07)}
.sidebar .menu-item.active,.sidebar .menu-item[aria-current="page"]{border-left-color:#59b5ff;background:linear-gradient(90deg,rgba(22,119,255,.95),rgba(22,119,255,.72));color:#fff}
.sidebar .menu-icon{margin-right:10px;color:#9fc7e8}
.sidebar .submenu{background:rgba(0,8,18,.28);transition:max-height .18s ease}
.sidebar .submenu-item{position:relative;padding:9px 15px 9px 48px;border-left:3px solid transparent;color:rgba(232,242,250,.72);transition:background-color .14s ease,color .14s ease}
.sidebar .submenu-item:before{content:"";position:absolute;left:31px;top:50%;width:4px;height:4px;margin-top:-2px;border-radius:50%;background:#66839b}
.sidebar .submenu-item:hover{background:rgba(255,255,255,.05);color:#fff}
.sidebar .submenu-item.active,.sidebar .submenu-item[aria-current="page"]{background:rgba(22,119,255,.16);color:#8fceff}
.sidebar .submenu-item.active:before,.sidebar .submenu-item[aria-current="page"]:before{background:#42a5ff;box-shadow:0 0 0 3px rgba(66,165,255,.18)}

.header{left:188px;height:58px;padding:0 20px;border-bottom:1px solid var(--erp-line);box-shadow:0 2px 12px rgba(30,54,83,.04)}
.breadcrumb{color:#8692a3}
.breadcrumb span:last-child,.page-title{color:#35445a;font-weight:600}
.header-right{gap:8px}
.header-btn{width:34px;height:34px;border-radius:8px}
.user-info{padding:6px 8px;border-radius:8px}
.main-content{margin-left:188px;margin-top:58px;min-height:calc(100vh - 58px);padding:18px;background:var(--erp-bg)}
.tab-content:not(.hidden){animation:erp-page-in .12s ease-out}
@keyframes erp-page-in{from{opacity:.65;transform:translateY(2px)}to{opacity:1;transform:none}}

.stats-row{gap:16px;margin-bottom:16px}
.stat-card,.chart-card,.table-card{border:1px solid var(--erp-line);border-radius:10px;box-shadow:var(--erp-shadow)}
.stat-card{min-height:104px;padding:18px;transition:transform .16s ease,box-shadow .16s ease}
.stat-card:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(23,43,77,.09)}
.stat-icon{width:50px;height:50px;border-radius:13px}
.stat-content h3{color:#17263a;font-size:26px}
.charts-row{gap:16px;margin-bottom:16px}
.chart-card{padding:20px}
.table-card{margin-bottom:16px;overflow:hidden}
.table-header{min-height:50px;padding:12px 18px;background:linear-gradient(180deg,#fff,#fbfcfe)}
.table-header h3{color:#243449;font-weight:600}
.btn{min-height:32px;padding:6px 12px;border-color:#d5dde7;border-radius:6px;transition:border-color .14s ease,background-color .14s ease,color .14s ease}
.btn-primary{border-color:var(--erp-blue);background:var(--erp-blue);box-shadow:0 3px 8px rgba(22,119,255,.16)}
.btn-primary:hover{border-color:var(--erp-blue-hover);background:var(--erp-blue-hover);color:#fff}
input,select,textarea{transition:border-color .14s ease,box-shadow .14s ease}
input:focus,select:focus,textarea:focus{outline:0;border-color:#69a8ff!important;box-shadow:0 0 0 3px rgba(22,119,255,.09)}

/* Purchase, permissions and settings */
.ap-page{padding:16px;background:var(--erp-bg);font-size:13px}
.ap-toolbar{min-height:48px;padding:8px 12px;border-color:var(--erp-line);border-radius:9px;box-shadow:0 4px 14px rgba(30,54,83,.035)}
.ap-toolbar strong{font-size:16px}
.ap-toolbar input,.ap-toolbar select,.ap-toolbar button,.ap-card button{height:32px;border-color:#d5dde7;border-radius:5px}
.ap-summary{gap:12px;margin:12px 0}
.ap-summary>div{height:72px;padding:12px 15px;border-color:var(--erp-line);border-radius:8px;box-shadow:0 4px 14px rgba(30,54,83,.035)}
.ap-card{margin-top:12px;border-color:var(--erp-line);border-radius:9px;overflow:hidden;box-shadow:var(--erp-shadow)}
.ap-card>header{height:46px;padding:0 14px;background:#fbfcfe}
.ap-table th{height:40px;padding:0 12px;background:#f7f9fc;color:#526176;font-weight:600}
.ap-table td{height:42px;padding:8px 12px}
.ap-table tbody tr:hover td{background:#f6faff}
.ap-settings{grid-template-columns:180px 1fr;margin-top:12px;min-height:520px;border-color:var(--erp-line);border-radius:9px;overflow:hidden;box-shadow:var(--erp-shadow)}
.ap-settings aside{background:#f8fafc}
.ap-settings aside button{height:46px;padding:0 16px;color:#45556a}
.ap-settings aside button.active{border-left-color:var(--erp-blue);background:#eaf4ff;color:var(--erp-blue);font-weight:600}
.ap-settings main{padding:22px}
.ap-setting-form{gap:16px 20px;padding:20px 0}
.ap-setting-form input{height:34px;border-radius:5px}
.ap-setting-note{border-color:#f4d889;border-radius:6px;background:#fffaf0}

/* JPERP-style workbenches: inline accordion navigation */
body.jperp-workbench-mode .sidebar{width:148px;box-shadow:2px 0 12px rgba(2,17,31,.12)}
body.jperp-workbench-mode .sidebar .logo{height:48px;padding:0 13px;justify-content:flex-start}
body.jperp-workbench-mode .sidebar .logo span{display:inline;font-size:14px;white-space:nowrap}
body.jperp-workbench-mode .sidebar .logo-icon{margin-right:8px;font-size:20px}
body.jperp-workbench-mode .sidebar .menu{width:100%;height:calc(100vh - 48px);padding:5px 0 18px;overflow-x:hidden;overflow-y:auto}
body.jperp-workbench-mode .sidebar .menu-item{min-height:40px;display:flex;flex-direction:row;justify-content:flex-start;gap:0;padding:9px 12px;margin:1px 0;border:0;border-left:3px solid transparent;border-radius:0;text-align:left}
body.jperp-workbench-mode .sidebar .menu-item .menu-icon{margin:0 9px 0 0;font-size:15px}
body.jperp-workbench-mode .sidebar .menu-item span:nth-child(2){font-size:13px;white-space:nowrap}
body.jperp-workbench-mode .sidebar .menu-item.active{border-left-color:#72bdff;background:linear-gradient(90deg,#1682ed,#0d69c4);box-shadow:none}
body.jperp-workbench-mode .sidebar .jx-menu-arrow{margin-left:auto;color:#7ea2bd;font-size:17px;line-height:1;transition:transform .18s ease}
body.jperp-workbench-mode .sidebar .jx-menu-group:has(.submenu.open) .jx-menu-arrow{transform:rotate(90deg);color:#b9ddfa}
body.jperp-workbench-mode .sidebar .submenu{position:static;display:block;left:auto;top:auto;bottom:auto;width:100%;max-height:0;overflow:hidden;padding:0;border:0;border-radius:0;background:rgba(0,8,18,.28);box-shadow:none;transition:max-height .2s ease}
body.jperp-workbench-mode .sidebar .submenu.open{position:static;display:block;width:100%;max-height:460px;overflow:hidden;padding:3px 0 5px;border:0;border-radius:0;background:rgba(0,8,18,.28);box-shadow:none}
body.jperp-workbench-mode .sidebar .submenu-item{min-height:33px;padding:8px 10px 8px 39px;border:0;color:rgba(232,242,250,.76);font-size:12px;white-space:nowrap}
body.jperp-workbench-mode .sidebar .submenu-item:before{display:block;left:25px;background:#63809a}
body.jperp-workbench-mode .header{left:148px;height:48px;padding:0 14px}
body.jperp-workbench-mode .main-content{margin-left:148px;margin-top:48px;height:calc(100vh - 48px);padding:0}
body.jperp-workbench-mode .sidebar,
body.jperp-workbench-mode .header,
body.jperp-workbench-mode .main-content{transition:width .18s ease,left .18s ease,margin-left .18s ease}
body.jperp-workbench-mode.jperp-nav-drawer-open .sidebar{width:148px}
body.jperp-workbench-mode.jperp-nav-drawer-open .header{left:148px}
body.jperp-workbench-mode.jperp-nav-drawer-open .main-content{margin-left:148px}

.jp-shell{color:#344256;background:#fff}
.jp-toolbar{height:42px;padding:5px 8px;gap:4px;overflow-x:auto;overflow-y:hidden;border-bottom-color:var(--erp-line);background:linear-gradient(180deg,#fff,#f8fafc);scrollbar-width:none}
.jp-toolbar::-webkit-scrollbar{display:none}
.jp-search-group{flex:0 0 auto;height:30px}
.jp-search-field,.jp-search,.jp-search-button,.jp-search-clear,.jp-search-filter{height:30px}
.jp-search-field{width:110px;border-color:#d3dce6;border-radius:5px 0 0 5px}
.jp-search{width:230px;border-color:#d3dce6}
.jp-search-button{border-color:var(--erp-blue);background:var(--erp-blue)}
.jp-search-clear{border-radius:0 5px 5px 0}
.jp-search-filter{border-radius:5px}
.jp-tool{flex:0 0 auto;height:30px;min-width:30px;padding:0 9px;border:1px solid transparent;border-radius:5px;color:#556477;white-space:nowrap}
.jp-tool:hover{border-color:#c9e1fb;background:#eef6ff;color:var(--erp-blue)}
.jp-tool.primary{color:#0878dc}
.jp-tool.danger{color:#d44b4b}
.jp-product-grid,.jp-order-grid{height:calc(100% - 70px)}
.jp-product-grid{grid-template-columns:180px 38px minmax(480px,1.08fr) 38px minmax(390px,.82fr)}
.jp-order-grid{grid-template-columns:var(--jp-order-tree-width,148px) 4px minmax(680px,1fr)}
.jp-tree{padding:9px 8px 35px;border-right-color:#dce5ed;background:#f3f9fd}
.jp-tree-filter{height:30px}
.jp-tree-row{height:30px;padding:0 8px;border-radius:5px}
.jp-tree-row:hover,.jp-tree-row.active{background:#deefff;color:#0d78d4}
.jp-tree button.jp-tree-row{width:100%;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.jp-tree button.jp-tree-row.active{background:#deefff;color:#0d78d4;font-weight:600;box-shadow:inset 3px 0 #1688e8}
.jp-tree button.jp-tree-row:focus-visible{outline:2px solid #1688e8;outline-offset:-2px}
.jp-order-status-row .jp-count{margin-left:auto;min-width:22px;text-align:right}
.jp-order-filter-group{margin:2px 0}
.jp-tree-group-toggle{font-weight:500}
.jp-tree-group-toggle.has-filter{color:#0d78d4;background:#eaf5ff}
.jp-tree-chevron{display:inline-block;width:12px;color:#607d91;font-weight:400;text-align:center}
.jp-tree-filter-dot{margin-left:auto;color:#1688e8;font-size:9px}
.jp-tree-branch{display:none;margin:1px 0 5px}
.jp-tree-branch.open{display:block}
.jp-tree button.jp-tree-filter-child{height:29px;margin-left:17px;width:calc(100% - 17px);padding-left:6px;font-size:11px}
.jp-tree button.jp-tree-filter-child span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
.jp-tree button.jp-tree-filter-child .jp-count{margin-left:auto;min-width:19px;text-align:right}
.jp-pane{border-right-color:var(--erp-line);scrollbar-color:#aebdca #f4f7fa;scrollbar-width:thin}
.jp-table th{height:39px;padding:0 11px;border-color:#e2e8ef;background:#f7f9fc;color:#47566a;font-weight:600}
.jp-table td{height:38px;padding:0 11px;border-color:#ebeff4}
.jp-table tbody tr:hover{background:#f2f7fd}
.jp-table tbody tr.selected{background:#e5f2ff}
.jp-table tr:hover .jp-pinned-left,.jp-table tr:hover .jp-pinned-right{background:#f2f7fd}
.jp-table tr.selected .jp-pinned-left,.jp-table tr.selected .jp-pinned-right{background:#e5f2ff}
.jp-table .link{color:#0878d5}
.jp-rail{padding-top:7px;border-right-color:var(--erp-line);background:#f8fafc}
.jp-rail button{width:31px;height:32px;border-radius:5px}
.jp-detail-tabs,.jp-order-subtabs{height:38px;border-bottom-color:var(--erp-line);background:#fbfcfe}
.jp-detail-tab,.jp-order-subtab{height:38px;padding:11px 12px 8px}
.jp-detail-tab.active,.jp-order-subtab.active{border-top:0;border-bottom:2px solid var(--erp-blue);color:var(--erp-blue);background:#fff}
.jp-detail-content{height:calc(100% - 38px)}
.jp-statusbar{height:28px;border-top-color:var(--erp-line);background:#f8fafc}
.jp-order-main{grid-template-rows:minmax(220px,var(--jp-order-top-height,58%)) 4px minmax(180px,1fr)}
.jp-order-top{grid-template-columns:minmax(620px,1fr) 126px;border-bottom-color:var(--erp-line)}
.jp-order-actions{padding:12px;background:#f8fafc}
.jp-order-actions button,.jp-order-actions select{height:32px;border-color:#d1dbe5;border-radius:5px}
.jp-order-actions button.primary{border-color:var(--erp-blue);background:var(--erp-blue)}
.jp-order-bottom{grid-template-columns:minmax(660px,1fr) 225px}
.jp-order-grid-resizer,.jp-order-row-resizer{position:relative;z-index:8;background:#edf2f7;transition:background .12s ease}
.jp-order-grid-resizer{cursor:col-resize;border-left:1px solid #d7e0e8;border-right:1px solid #d7e0e8}
.jp-order-row-resizer{cursor:row-resize;border-top:1px solid #d7e0e8;border-bottom:1px solid #d7e0e8}
.jp-order-grid-resizer:hover,.jp-order-row-resizer:hover,.jp-layout-dragging .jp-order-grid-resizer,.jp-layout-dragging .jp-order-row-resizer{background:#8fc7f4}
.jp-order-grid-resizer:after,.jp-order-row-resizer:after{content:"";position:absolute;border-radius:3px;background:#7a9ab6}
.jp-order-grid-resizer:after{top:50%;left:1px;width:2px;height:34px;transform:translateY(-50%);box-shadow:2px 0 #7a9ab6}
.jp-order-row-resizer:after{top:1px;left:50%;width:34px;height:2px;transform:translateX(-50%);box-shadow:0 2px #7a9ab6}
.jp-layout-dragging{cursor:grabbing!important;user-select:none!important}
.jp-resizable-table{table-layout:fixed}
.jp-resizable-table th{position:relative;overflow:visible;cursor:grab;user-select:none}
.jp-resizable-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jp-column-resizer{position:absolute;z-index:5;top:0;right:-4px;width:9px;height:100%;cursor:col-resize}
.jp-column-resizer:after{content:"";position:absolute;top:6px;bottom:6px;left:4px;width:1px;background:#b9c8d6}
.jp-column-resizer:hover:after{width:2px;background:#1688e8}
.jp-column-dragging{opacity:.45}
.jp-column-drop-target{background:#dceeff!important;box-shadow:inset 3px 0 #1688e8}
.jp-order-notes{padding:12px;border-left-color:#f1df9d;background:#fffbea}
.jp-empty{height:220px;color:#8c98a7;background:radial-gradient(circle at center,rgba(232,241,249,.52),rgba(255,255,255,0) 60%)}
.jp-modal-card,.ap-modal,.jx-modal-card{border:1px solid rgba(219,227,235,.9);border-radius:10px;box-shadow:0 22px 65px rgba(12,32,55,.26)}
.jp-modal-head,.ap-modal-head{height:48px}
.jp-modal-head h3,.ap-modal-head h3{font-size:15px;font-weight:600}
.jp-form-row input,.jp-form-row select,.jp-form-row textarea{height:33px;border-radius:5px}
.jp-form-row textarea{height:76px}

/* JPERP parity: complete specification and order editors. */
.jp-variant-modal-card{width:min(900px,96vw)}
.jp-variant-modal-card .jp-modal-body{min-height:0;max-height:72vh}
.jp-variant-form{grid-template-columns:1fr 1fr}
.jp-inline-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
.jp-inline-field>label{display:flex;align-items:center;gap:4px;margin:0;text-align:left;white-space:nowrap}
.jp-inline-field>label input{width:auto;height:auto}
.jp-triple-field{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.jp-save-continue{display:flex;align-items:center;gap:5px;margin-right:auto;color:#64748b;font-size:12px}
.jp-order-create-card{width:min(980px,96vw)}
.jp-order-create-card .jp-modal-body{min-height:0;max-height:72vh}
.jp-order-create-card [hidden]{display:none!important}
.jp-order-edit-card{width:min(1040px,96vw);max-height:92vh}
.jp-order-edit-card .jp-modal-head h3{display:flex;align-items:center;gap:11px}
.jp-order-edit-card .jp-modal-head h3 strong{font-size:13px;color:#26394c}
.jp-order-copy{width:24px;height:24px;border:0;border-radius:4px;background:#f1f5f8;color:#5e7387;cursor:pointer}
.jp-order-copy:hover{background:#e3f2fd;color:#1688e8}
.jp-order-edit-card .jp-modal-body{min-height:0;max-height:72vh;padding:10px 18px 15px}
.jp-order-edit-card [data-jp-order-panel][hidden]{display:none!important}
.jp-order-edit-card .jp-modal-tabs{align-items:stretch}
.jp-order-edit-card .jp-modal-tab{border:0;border-bottom:2px solid transparent;background:transparent;color:#8c98a4;cursor:pointer;font:inherit}
.jp-order-edit-card .jp-modal-tab:hover{color:#1688e8;background:#f7fbff}
.jp-order-edit-card .jp-modal-tab.active{border-bottom-color:#1688e8;color:#1688e8;background:#fff}
.jp-order-edit-section{padding:2px 0 5px}
.jp-order-edit-section-title{height:27px;margin:0 0 8px;border-bottom:1px solid #e3e8ed;color:#ef6c2f;font-size:12px}
.jp-order-edit-section-title span{position:relative;top:10px;padding:0 12px 0 8px;background:#fff}
.jp-order-edit-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px}
.jp-order-edit-grid .jp-form-row{grid-template-columns:72px minmax(0,1fr)}
.jp-order-edit-grid .jp-form-row label{margin-right:7px;font-size:11px;white-space:nowrap}
.jp-order-edit-grid .jp-form-row.span2{grid-column:span 2}
.jp-order-edit-grid .jp-form-row.span3{grid-column:span 3}
.jp-order-edit-grid .jp-form-row.span4{grid-column:span 4}
.jp-order-edit-grid .jp-form-row input,.jp-order-edit-grid .jp-form-row select{height:30px;padding:3px 7px}
.jp-order-edit-grid .jp-form-row textarea{height:57px;min-height:57px}
.jp-copy-field{display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:4px}
.jp-copy-field button{border:1px solid #ccd5de;background:#fff;color:#52677a;cursor:pointer}
.jp-copy-field button:hover{border-color:#1688e8;color:#1688e8}
.jp-order-money-section{padding-bottom:2px}
.jp-order-money-scroll{max-width:100%;overflow-x:auto;border:1px solid #e0e6eb;background:#fafcfd}
.jp-order-money-grid{display:grid;grid-template-columns:142px 22px 142px 22px 142px 22px 142px 22px 142px 22px 142px 22px 142px 22px 142px 22px 142px;align-items:end;width:max-content;min-width:100%}
.jp-order-money-cell{min-width:0;padding:6px 8px 8px;border-right:1px solid #e3e8ed;background:#fff}
.jp-order-money-cell:last-child{border-right:0}
.jp-order-money-cell label{display:block;margin-bottom:5px;color:#667789;font-size:11px;text-align:center}
.jp-order-money-cell input{width:100%;height:29px;padding:3px 7px;border:1px solid #ccd5de;border-radius:3px;text-align:right}
.jp-order-money-cell.primary input{border-color:#93c9f1;background:#f4faff;color:#126eac;font-weight:700}
.jp-order-money-sign{align-self:end;padding-bottom:14px;color:#758596;font-weight:700;text-align:center}
.jp-order-edit-group-head{height:25px;margin-top:2px;border-bottom:1px solid #e5eaee;color:#ef6c2f;font-size:11px}
.jp-order-edit-group-head.span2{grid-column:span 2}
.jp-order-edit-group-head span{position:relative;top:9px;padding:0 8px;background:#fff}
.jp-order-edit-foot{min-height:50px;height:auto}
.jp-order-step{display:flex;gap:7px}
.jp-order-step button:disabled{color:#b9c1c9;background:#f7f8f9;cursor:not-allowed}
.jp-order-edit-counter{color:#8a97a4;font-size:11px}
.jp-order-edit-spacer{flex:1}
.jp-order-edit-card input:disabled{color:#6f7e8b;background:#f5f7f9}
.jp-order-payment-check{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px;padding:5px 9px;border:1px solid #dbe4ec;border-radius:3px;background:#f8fbfd;color:#718093;font-size:11px}
.jp-order-payment-check strong{color:#1688e8;font-size:12px}
@media(max-width:1050px){.jp-order-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.jp-order-edit-grid .jp-form-row.span3{grid-column:span 1}.jp-order-edit-grid .jp-form-row.span4{grid-column:span 2}}
@media(max-width:700px){.jp-order-edit-grid{grid-template-columns:1fr}.jp-order-edit-grid .jp-form-row.span2,.jp-order-edit-grid .jp-form-row.span3,.jp-order-edit-grid .jp-form-row.span4,.jp-order-edit-group-head.span2{grid-column:span 1}.jp-order-money-grid{grid-template-columns:1fr}.jp-order-money-sign{display:none}.jp-order-money-cell{border-right:0;border-bottom:1px solid #e3e8ed}.jp-order-edit-foot{flex-wrap:wrap}.jp-order-edit-spacer{display:none}}
.jp-order-status-tree .jp-tree-row.child span:first-child{white-space:pre}
.ap-quick-qty,.ap-po-price{width:86px;height:28px;padding:3px 7px;border:1px solid #cbd4dd;border-radius:4px}
.ap-table input[type="checkbox"]{width:15px;height:15px;vertical-align:middle}

/* Grid image hover preview */
.jp-grid-thumb[data-jp-preview-src]{cursor:zoom-in}
.jp-image-hover-preview{position:fixed;z-index:10050;width:268px;max-width:calc(100vw - 24px);padding:8px;border:1px solid #d6e0ea;border-radius:10px;background:#fff;box-shadow:0 16px 42px rgba(15,23,42,.25);pointer-events:none}
.jp-image-hover-preview[hidden]{display:none}
.jp-image-hover-preview img{display:block;width:100%;height:220px;object-fit:contain;border-radius:6px;background:#f8fafc}
.jp-image-hover-caption{padding:7px 3px 1px;overflow:hidden;color:#475569;font-size:12px;text-overflow:ellipsis;white-space:nowrap}

/* Rectangular report shortcuts */
#tab-reports .erp-report-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
#tab-reports .erp-report-card{min-width:0;min-height:94px;display:grid;grid-template-columns:104px minmax(0,1fr);align-items:center;gap:13px;padding:13px;border:1px solid #e1e8ef;border-radius:9px;background:#fff;color:#344256;text-align:left;box-shadow:0 4px 14px rgba(26,54,84,.07);cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
#tab-reports .erp-report-card:hover{transform:translateY(-2px);border-color:#9dcef7;box-shadow:0 8px 22px rgba(26,91,148,.13)}
#tab-reports .erp-report-card:focus-visible{outline:2px solid #1688e8;outline-offset:2px}
#tab-reports .erp-report-preview{width:104px;height:58px;display:flex;box-sizing:border-box;overflow:hidden;border:1px solid #dbe6ef;border-radius:5px;background:linear-gradient(180deg,#f7fbff,#edf5fb)}
#tab-reports .erp-report-bars{align-items:flex-end;justify-content:center;gap:5px;padding:8px 9px 7px}
#tab-reports .erp-report-bars i{width:7px;min-height:5px;border-radius:2px 2px 0 0;background:linear-gradient(180deg,#53b5ff,#187bd5)}
#tab-reports .erp-report-line{padding:6px}
#tab-reports .erp-report-line svg{width:100%;height:100%}
#tab-reports .erp-report-line path{fill:none;stroke:#f05f66;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
#tab-reports .erp-report-line circle{fill:#fff;stroke:#f05f66;stroke-width:2}
#tab-reports .erp-report-ranking{flex-direction:column;justify-content:center;gap:7px;padding:10px 12px}
#tab-reports .erp-report-ranking i{display:block;height:7px;border-radius:4px;background:linear-gradient(90deg,#f3b53f,#ef8f27)}
#tab-reports .erp-report-segments{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:9px}
#tab-reports .erp-report-segments i{border-radius:3px;background:#78a9e5}
#tab-reports .erp-report-segments i:nth-child(2n){background:#65c6b4}
#tab-reports .erp-report-segments i:nth-child(3n){background:#9b8ee7}
#tab-reports .erp-report-copy{min-width:0;display:flex;flex-direction:column;gap:6px}
#tab-reports .erp-report-copy strong{font-size:15px;color:#263548}
#tab-reports .erp-report-copy small{overflow:hidden;color:#7a8796;font-size:12px;text-overflow:ellipsis;white-space:nowrap}

.jx-page{height:100%;background:var(--erp-bg)}
.jx-toolbar{height:50px;min-height:50px;border-bottom-color:var(--erp-line)}
.jx-workbench{grid-template-columns:190px minmax(0,1fr)}
.jx-tree{background:#f3f9fd}
.jx-table th{height:39px;background:#f7f9fc}
.jx-table td{height:38px}

@media (max-width:1100px){
  .sidebar{width:176px}
  .header{left:176px}
  .main-content{margin-left:176px}
  .jp-product-grid{grid-template-columns:160px 36px minmax(430px,1fr) 36px minmax(350px,.72fr)}
  .jp-order-grid{grid-template-columns:var(--jp-order-tree-width,165px) 6px minmax(700px,1fr)}
  #tab-reports .erp-report-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:768px){
  .header{left:0;height:56px;padding:0 12px}
  .main-content{margin-left:0;margin-top:56px;padding:12px}
  .ap-page{padding:10px}
  .ap-toolbar{align-items:flex-start;flex-wrap:wrap}
  .ap-toolbar i{display:none}
  .ap-settings{grid-template-columns:1fr}
  .ap-settings aside{display:flex;overflow-x:auto;border-right:0;border-bottom:1px solid var(--erp-line)}
  .ap-settings aside button{min-width:110px}
  .ap-setting-form{grid-template-columns:1fr}
  #tab-reports .erp-report-shortcuts{grid-template-columns:1fr}
}
