/* Existing management functions in a compact ERP workspace. */
/* Theme tokens are shared with the dashboards in base.css. */
body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif; font-size:13px; }
.header { position:sticky; top:0; z-index:60; height:42px; min-height:42px; padding:0 16px 0 182px; background:#242c38; border:0; box-shadow:none; gap:10px; }
.header h1 { position:fixed; left:0; top:0; width:170px; height:54px; display:flex; align-items:center; padding:0 20px; background:#151a22; color:#fff; font-size:18px; letter-spacing:1px; z-index:65; }
.header .nav { flex:none; gap:12px; }
.header .nav a,.header .nav button { color:#d7dbe4; background:transparent; border:0; font-size:12px; padding:5px; }
.erp-tabs { display:flex; align-items:end; flex:1; min-width:0; height:100%; overflow-x:auto; }
.erp-tabs button { flex:none; height:34px; min-height:34px; background:transparent; color:#cbd1db; border:0; border-radius:5px 5px 0 0; padding:0 16px; font-size:12px; font-weight:400; white-space:nowrap; }
.erp-tabs button.active { background:white; color:#172031; }
.layout,.layout:has(#sec-targets.active) { max-width:none; margin:0; padding:0 12px 24px 182px; gap:0; }
.layout > .sidebar { position:fixed; left:0; top:54px; bottom:0; width:170px; min-width:170px; padding:8px 0; margin:0; overflow-y:auto; background:#151a22; border:0; border-radius:0; box-shadow:none; z-index:61; }
.sidebar .nav-section { margin:0 0 6px; border:0; padding:0; }
.sidebar .nav-section summary { color:#e1e4e9; padding:12px 16px; font-size:13px; border:0; background:transparent; }
.sidebar .nav-item { color:#bcc3ce; background:transparent; padding:8px 12px 8px 28px; min-height:36px; border:0; border-radius:0; font-size:12px; font-weight:400; }
.sidebar .nav-item:hover { background:#252f3f; color:white; }
.sidebar .nav-item.active { color:white; background:#3477f5; box-shadow:none; }
.content { min-width:0; width:100%; }
.section-heading { margin:0 -12px 12px; padding:12px 20px; min-height:70px; background:white; border-bottom:1px solid var(--border); }
.section-heading h2 { font-size:16px; margin:0; }
.section-heading .eyebrow { display:none; }
.section-heading p { margin-top:5px; font-size:12px; }
.section.active { gap:12px; }
.panel,.screen-card,.workflow-card { border:1px solid var(--border); border-radius:4px; box-shadow:none; padding:14px; }
.panel h2 { font-size:14px; margin-bottom:12px; }
.panel h2 .sub { font-size:12px; }
button,input,select,.field { border-radius:3px !important; font-size:13px; }
button { min-height:32px; padding:6px 12px; font-weight:400; }
input:not([type=checkbox]):not([type=radio]),select { min-height:32px; }
table { font-size:12px; }
th { background:#fafbfc; color:#172031; font-weight:600; }
th,td { padding:10px 12px; border-bottom:1px solid var(--border); }
tr:hover td { background:#f2f7ff; }
.matrix-scroll { border-radius:3px; }
.matrix-toolbar { padding-bottom:12px; }
.target-matrix { padding:12px; }
.matrix-legacy { border-radius:3px; }
#sec-roles.active { display:grid; grid-template-columns:200px minmax(0,1fr); align-items:stretch; gap:12px; }
.erp-role-rail { background:white; border:1px solid var(--border); min-height:calc(100vh -145px); }
.erp-role-title { display:flex; align-items:center; justify-content:space-between; font-size:18px; font-weight:600; padding:12px; border-bottom:1px solid var(--border); }
#erpRoleList { padding:8px; }
#erpRoleList button { display:flex; align-items:center; gap:8px; width:100%; text-align:left; background:transparent; color:#3b4351; border:0; padding:9px; font-size:12px; }
#erpRoleList button.active { color:#315efb; background:#eaf0ff; }
#erpRoleList small { border:1px solid #f2c9a1; padding:0 3px; color:#b86622; }
#sec-roles > .panel { min-width:0; overflow-x:auto; }
.handoff-dialog { width:min(1050px,calc(100vw - 32px)); max-height:90vh; margin:auto; padding:24px; border:1px solid var(--border); border-radius:5px; color:var(--text); background:white; overflow:auto; box-shadow:0 16px 60px #10182833; }
.handoff-dialog::backdrop { background:#10182866; }
.handoff-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.handoff-title h2 { font-size:18px; }
.handoff-dialog fieldset { border:0; margin:18px 0; padding:0; }
.handoff-dialog select,.handoff-dialog input { border:1px solid #cbd4e2; background:white; padding:6px 10px; }
.handoff-range,.handoff-recipient { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:10px; }
.handoff-dialog h3 { font-size:13px; margin:18px 0 10px; }
.handoff-recipient select { min-width:220px; }
.handoff-recipient input { width:90px; }
.handoff-reason { display:flex; gap:12px; align-items:center; margin-top:18px; }
.handoff-reason input { flex:1; min-width:0; }
.handoff-preview-scroll { max-height:300px; overflow:auto; border:1px solid var(--border); }
.handoff-preview-scroll table { width:100%; }
.handoff-preview-scroll th { position:sticky; top:0; }
#handoffStatus,#handoffSummary { margin:12px 0; }
#handoffStatus.error { color:#b42318; }
.handoff-dialog button:disabled { opacity:.5; cursor:not-allowed; }
@media(max-width:900px) {
 .header { padding:0 12px; height:auto; min-height:48px; flex-wrap:wrap; }
 .header h1 { position:static; width:auto; height:auto; padding:8px 0; background:transparent; }
 .erp-tabs { order:3; flex-basis:100%; height:34px; }
 .layout,.layout:has(#sec-targets.active) { padding:12px; }
 .layout > .sidebar { display:none; }
 .section-heading { margin:0 0 12px; }
 #sec-roles.active { grid-template-columns:1fr; }
 .erp-role-rail { min-height:0; }
 #erpRoleList { display:flex; overflow:auto; }
 #erpRoleList button { width:auto; white-space:nowrap; }
}
body .header { background:#242c38; }
.header .erp-tabs button { background:transparent; color:#cbd1db; border:0; }
.header .erp-tabs button.active { background:white; color:#172031; }
.matrix-toolbar { margin-bottom:8px; padding-bottom:0; }
.matrix-tabs { margin-top:10px; }
.matrix-table td,.matrix-table th { padding:6px 8px; }
#userTable { min-width:850px; }
#roleTable { min-width:660px; }
#sec-users > .panel { overflow-x:auto; }
@media(max-width:900px) {
 button,.header .nav button,.header .nav a { min-height:40px; }
 .header .erp-tabs button { min-height:34px; }
}
/* Closable page tabs and compact existing module rail. */
.erp-tab { display:flex; align-items:center; flex:none; height:34px; border-radius:4px 4px 0 0; }
.erp-tab.active { background:#fff; }
.header .erp-tab.active button { color:#172031; }
.header .erp-tab > button { padding:0 10px; }
.header .erp-tab .erp-tab-close { padding:0; width:24px; min-width:24px; visibility:hidden; font-size:17px; }
.erp-tab:hover .erp-tab-close,.erp-tab:focus-within .erp-tab-close { visibility:visible; }
.header .erp-tab .erp-tab-close:hover { background:#e8edf6; }
.admin-rail-toggle { position:fixed; left:0; bottom:0; z-index:66; width:170px; height:42px; border:0; background:#151a22; color:#bdc5d2; text-align:left; padding-left:20px; font-size:21px; }
.layout > .sidebar { bottom:42px; }
.rail-icon { display:none; }
body.admin-rail-narrow .layout,body.admin-rail-narrow .layout:has(#sec-targets.active) { padding-left:76px; }
body.admin-rail-narrow .header { padding-left:76px; }
body.admin-rail-narrow .header h1 { width:64px; font-size:12px; padding:0 8px; }
body.admin-rail-narrow .layout > .sidebar { width:64px; min-width:64px; }
body.admin-rail-narrow .sidebar summary { display:flex; flex-direction:column; align-items:center; gap:5px; font-size:11px; padding:12px 3px; list-style:none; }
body.admin-rail-narrow .sidebar .nav-item { display:none; }
body.admin-rail-narrow .rail-icon { display:block; width:18px; height:18px; filter:invert(.7); }
body.admin-rail-narrow .admin-rail-toggle { width:64px; }
@media(max-width:900px) {
 .admin-rail-toggle { display:none; }
 body.admin-rail-narrow .layout,body.admin-rail-narrow .layout:has(#sec-targets.active) { padding:12px; }
 body.admin-rail-narrow .header { padding:0 12px; }
 body.admin-rail-narrow .header h1 { width:auto; font-size:18px; }
 .header .erp-tab .erp-tab-close { visibility:visible; }
}
.handoff-dialog:has(#handoffScope option[value=listing]:checked) { width:min(1400px,calc(100vw - 32px)); }
.handoff-items-scroll { overflow:auto; max-height:280px; border:1px solid var(--border); margin-top:10px; }
.handoff-items-scroll table { width:100%; min-width:980px; }
.handoff-items-scroll input[type=number] { width:100px; }
.handoff-items-scroll th { position:sticky; top:0; background:#f8fafc; z-index:2; }
.handoff-group td { background:#eef3fa; font-weight:500; }
.handoff-items-scroll input[type=checkbox] { width:18px; height:18px; }
.admin-rail-toggle img { width:22px; height:22px; filter:invert(.75); vertical-align:middle; }
body.admin-rail-narrow .header h1 { white-space:nowrap; letter-spacing:0; font-size:11px; padding:0 6px; }

.sku-diagnosis{margin:10px 0 2px;padding:8px 10px;background:#f7f9fc;border:1px solid #e3e8ef;border-radius:3px;font-size:12px;line-height:1.65}.sku-diagnosis summary{cursor:pointer;color:#36567e}.sku-diagnosis p{margin:3px 0}.sku-diagnosis>div{margin-top:10px}#skuTargetStatus[data-error=true]{color:#b42318}#skuTargetRows input{min-width:105px}#skuTargetRows td:nth-child(-n+5){white-space:nowrap}

.matrix-table[aria-label="SKU目标明细"]{min-width:1040px;table-layout:auto}.matrix-table[aria-label="SKU目标明细"] th:first-child,.matrix-table[aria-label="SKU目标明细"] td:first-child{min-width:88px;width:88px}.matrix-table[aria-label="SKU目标明细"] input{min-width:90px;width:100%;text-align:center}
.matrix-table[aria-label="SKU目标明细"] thead th{text-align:center;padding-left:8px;padding-right:8px}
.sku-person-group td{background:#edf3ff!important;text-align:left!important;padding:12px!important}.sku-month-group td{background:#f7f9fd!important;text-align:left!important;padding:9px 12px 9px 28px!important}.sku-group-toggle{border:0!important;background:transparent!important;color:#1e3a5f!important;text-align:left;font-weight:650;font-size:15px!important;padding:3px!important}.sku-group-toggle span{font-size:13px;color:#536780;font-weight:400;margin-left:12px}.sku-person-group small,.sku-month-group small{display:block;color:#536780;margin:5px 0 0 20px;font-size:12px}.sku-detail-row small{display:block;font-size:12px;margin-top:4px;white-space:normal}.sku-detail-row td{vertical-align:middle;text-align:center!important}.sku-detail-row td:first-child{min-width:160px!important}.sku-detail-row td:nth-child(2),.sku-detail-row td:nth-child(3){max-width:220px;white-space:normal!important;overflow-wrap:anywhere}.sku-mismatch{color:#b42318!important}.sku-listing-search{border-top:1px solid #dce3ec;padding:12px 0;margin-top:12px}.sku-listing-search>input{min-width:260px;margin:0 8px}.sku-listing-choice{display:block;width:100%;text-align:left;background:#fff;color:#26384f;border:1px solid #dce3ec;padding:10px;margin:5px 0}.sku-listing-choice:hover{background:#edf3ff}.sku-listing-choice small{display:block;color:#64748b;margin-top:4px}#skuListingChoices{max-height:330px;overflow:auto}.sku-detail-row input[data-field="note"]{min-width:170px!important}

.owner-changes-dialog{margin:auto;font-size:14px;line-height:1.55;width:min(900px,92vw);max-height:85vh;overflow:auto;border:1px solid #cbd5e1;border-radius:10px;padding:24px;color:#17243b;background:#fff}
.owner-changes-dialog::backdrop{background:#17243b70}.owner-changes-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.owner-change-group{padding:18px 0;border-top:1px solid #dce3ed;display:grid;gap:12px}.owner-change-group>input{width:100%}.owner-change-group label{display:flex;align-items:center;gap:8px}
.owner-has-changes{color:#b45309!important;background:#fff7ed!important;border-color:#fdba74!important}.owner-change-group table{width:100%}

.owner-change-group>input{border:1px solid #cbd5e1;border-radius:4px;padding:9px 12px;color:#17243b;font-size:14px}.owner-change-group>button{justify-self:start}

.sku-listing-choice{display:flex;align-items:flex-start;gap:10px;cursor:pointer}.sku-listing-choice>input{flex:none;margin-top:3px;width:17px;height:17px}.sku-listing-choice.is-selected{background:#edf3ff;border-color:#5074e8}.sku-listing-selected{background:#f5f8ff;border:1px solid #dce3ec;border-radius:4px;padding:12px;margin-top:12px;color:#26384f}.sku-listing-selected>button{margin-left:16px}.sku-listing-selected ul{padding-left:20px;margin:8px 0;max-height:160px;overflow:auto}.sku-listing-selected li{margin:5px 0;overflow-wrap:anywhere}.sku-listing-selected small{display:block;color:#536780}.sku-listing-selected li button{padding:2px 6px;margin-left:8px}
