/* 视觉基准：直接复用已确认的 crm-prototype/index.html 样式。 */
*{box-sizing:border-box}
body{margin:0;font:14px -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#25332e;background:#f4f6f5}
button,input,select,textarea{font:inherit}
button{cursor:pointer;background:white;border:1px solid #ced7d2;border-radius:4px;padding:8px 13px;color:inherit}
button:hover{background:#edf6f1}
button.primary{background:#217346;color:white;border-color:#217346}
button.link{border:0;background:none;color:#217346;padding:4px}
input,select,textarea{padding:8px;border:1px solid #cbd5ce;border-radius:3px;background:white;color:inherit;min-width:0}
input[type=checkbox]{accent-color:#217346}
header{height:58px;background:#205f3d;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 22px}
header strong{font-size:19px}
header small{margin-left:14px;color:#d3e9dc}
header select{padding:5px;margin-left:8px}
aside{position:fixed;width:205px;top:58px;bottom:0;background:#fff;border-right:1px solid #d7dfd9;padding:16px 10px;overflow:auto}
aside .group{color:#89958e;font-size:12px;padding:18px 12px 7px}
nav button{display:block;width:100%;text-align:left;border:0;margin:3px 0;padding:11px 14px}
nav button.active{background:#e4f1e9;color:#1d683e;font-weight:600;border-left:3px solid #217346}
main{margin-left:205px;padding:23px 25px}
.breadcrumb{color:#79877e;font-size:13px;margin-bottom:9px}
h1{font-size:23px;margin:0 0 8px}
p{line-height:1.7}
.sub{color:#718078;margin:0 0 18px}
.panel{background:#fff;border:1px solid #d9e1dc;border-radius:5px;margin-bottom:16px;padding:17px}
.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.toolbar label{display:flex;align-items:center;gap:6px}
.toolbar .spacer{flex:1}
.tablewrap{overflow:auto;border:1px solid #d7dfd9;background:white}
table{border-collapse:collapse;width:100%;white-space:nowrap}
th,td{border-right:1px solid #dfe5e1;border-bottom:1px solid #dfe5e1;padding:11px 12px;text-align:left;height:45px}
th{background:#edf2ee;font-weight:500;color:#4b5d51;position:sticky;top:0}
tbody tr:hover{background:#f1f7f3}
td.num{text-align:right;font-variant-numeric:tabular-nums}
td.index{width:43px;text-align:center;background:#f8faf8;color:#86948c}
.tag{display:inline-block;padding:3px 8px;border-radius:3px;background:#e5f1e9;color:#23643f}
.tag.warn{background:#fff1db;color:#986217}
.muted{color:#8b978f}
.foot{padding:12px 2px;color:#79877e;font-size:13px}
.note{padding:12px 15px;background:#f0f6f2;border-left:3px solid #75a588;line-height:1.7;margin-bottom:16px}
.btnrow{display:flex;gap:9px;justify-content:flex-end;margin-top:17px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.field{display:flex;flex-direction:column;gap:7px}
.field.wide{grid-column:1/-1}
.field label{color:#4d5f53}
.required{color:#b74c3e}
textarea{min-height:80px;resize:vertical}
.overlay{position:fixed;inset:0;background:#102a204d;z-index:10;display:flex;justify-content:flex-end}
.drawer{width:560px;background:white;height:100%;display:flex;flex-direction:column;box-shadow:-5px 0 25px #17302320}
.drawer .body{padding:22px;overflow:auto;flex:1}
.modal{background:white;width:min(1000px,94vw);max-height:85vh;margin:auto;border-radius:6px;display:flex;flex-direction:column}
.modal .body{padding:22px;overflow:auto}
.dialoghead{padding:19px 22px;border-bottom:1px solid #e0e6e2;display:flex;justify-content:space-between;align-items:center}
.dialoghead h2{margin:0;font-size:19px}
.dialogfoot{padding:16px 22px;border-top:1px solid #e0e6e2;display:flex;justify-content:flex-end;gap:9px}
.close{font-size:23px;border:0;padding:0 5px}
.steps{display:flex;gap:0;margin:0 0 22px}
.steps span{background:#edf2ee;padding:10px 24px;border-right:2px solid white}
.steps span.on{background:#dceee2;color:#217346}
.summary{display:flex;gap:30px;padding:14px 0}
.summary b{font-size:23px;margin-right:6px;color:#217346}
.empty{text-align:center;padding:45px;color:#87938b}
.upload{padding:25px;border:1px dashed #aebfb3;background:#f9fbf9;margin:12px 0}
.login{max-width:420px;margin:70px auto}
.login .field{margin:15px 0}
.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#244f36;color:white;padding:12px 22px;border-radius:5px;z-index:50}
.rolehint{font-size:13px;color:#63786a}
.pageform{max-width:920px}
.statusbar{font-size:12px;background:#edf3ef;padding:8px 13px;color:#6e7d73}
.pending{background:#fff8ee}
a{color:#217346}
.right{text-align:right}
@media(max-width:800px){aside{width:155px}
main{margin-left:155px;padding:15px}
.grid{grid-template-columns:1fr}
.field.wide{grid-column:auto}
header small{display:none}
.drawer{width:100%}
}


/* 以下只适配真实页面的服务端标签结构，不改变原型的基本尺寸与配色。 */
body { line-height:normal; }
header { position:sticky; top:0; z-index:15; gap:14px; }
header .session { display:flex; align-items:center; gap:14px; white-space:nowrap; }
header .session a { padding:6px 12px; color:#25332e; background:white; border:1px solid #ced7d2; border-radius:4px; text-decoration:none; }
header .session span { font-size:13px; color:#d3e9dc; }
main { min-width:0; }
.login-shell main { margin-left:0; }
.sidebar { z-index:10; }
.sidebar nav { display:block; }
.sidebar .group { padding:18px 12px 7px; }
.sidebar nav a { display:block; width:100%; text-align:left; border:0; margin:3px 0; padding:11px 14px; color:#25332e; text-decoration:none; border-radius:4px; }
.sidebar nav a:hover { background:#edf6f1; }
.sidebar nav a.active { background:#e4f1e9; color:#1d683e; font-weight:600; border-left:3px solid #217346; }
.sidebar .account-link { display:block; margin:22px 12px 0; padding-top:14px; border-top:1px solid #d7dfd9; color:#79877e; font-size:13px; }
.business { min-width:0; }
.business > p.muted:first-of-type { color:#718078; margin:0 0 18px; }
label { font-weight:400; }
.business input:not([type=hidden]):not([type=checkbox]):not([type=radio]),.business select { min-height:34px; }
.business textarea { min-height:80px; }
.business form:not(.filter-form) > label { display:block; margin:15px 0; max-width:600px; }
.business form:not(.filter-form) > label > input,.business form:not(.filter-form) > label > select { display:block; margin-top:7px; width:100%; }
button { line-height:normal; }
form button:not([type=button]) { background:#217346; color:white; border-color:#217346; }
form button:not([type=button]):hover { background:#195b37; }
.secondary { background:white; color:#217346; }
.filter-form { display:flex; align-items:center; flex-wrap:wrap; gap:10px; background:white; border:1px solid #d9e1dc; border-radius:5px; margin:0 0 16px; padding:17px; }
.filter-form label { display:flex; align-items:center; gap:6px; margin:0; white-space:nowrap; color:#4d5f53; }
.filter-form input:not([type=checkbox]),.filter-form select { width:140px; max-width:100%; }
.filter-form label:first-child input { width:210px; }
.filter-form label.check { font-size:14px; }
.filter-form > a { padding:8px 13px; border:1px solid #ced7d2; border-radius:4px; background:white; text-decoration:none; }
input[type=checkbox],input[type=radio] { width:16px; height:16px; padding:0; margin:0; accent-color:#217346; vertical-align:middle; }
.check { display:flex; align-items:center; gap:8px; }
.table-scroll { overflow:auto; max-width:100%; max-height:70vh; border:1px solid #d7dfd9; background:white; margin:0 0 12px; }
.table-scroll table { margin:0; }
.data-grid { width:max-content; min-width:100%; }
.data-grid td { min-width:96px; max-width:300px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.data-grid th,.data-grid td { height:45px; }
.data-grid td.index,.data-grid th.index { min-width:43px; width:43px; text-align:center; background:#f8faf8; color:#86948c; }
.data-grid .number { text-align:right; font-variant-numeric:tabular-nums; }
.data-grid .actions { min-width:115px; }
.data-grid td.actions a { display:inline-block; padding:4px 0; text-decoration:none; }
.data-grid tbody tr:hover td { background:#f1f7f3; }
.record-grid { white-space:normal; }
.record-grid th { width:auto; }
.record-grid td:first-child { width:24%; color:#718078; }
.record-grid td { overflow-wrap:anywhere; }
.empty-cell { text-align:center; padding:45px; color:#87938b; }
.notice { padding:12px 15px; background:#f0f6f2; border-left:3px solid #75a588; line-height:1.7; margin-bottom:16px; }
.error { padding:12px 15px; background:#fff0ed; border-left:3px solid #b74c3e; color:#96372b; line-height:1.7; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; max-width:920px; }
.form-grid > label { display:flex; flex-direction:column; gap:7px; margin:0; color:#4d5f53; }
.form-grid > label:has(textarea) { grid-column:1/-1; }
.form-grid > label.check { display:flex; flex-direction:row; align-items:center; }
.form-actions { display:flex; gap:9px; justify-content:flex-end; align-items:center; margin-top:17px; }
.form-actions a { padding:8px 13px; border:1px solid #ced7d2; border-radius:4px; color:#25332e; text-decoration:none; background:white; }
.details { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:0; }
.details > div { min-width:0; }
.details dt { color:#79877e; font-size:13px; }
.details dd { margin:7px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.tabs { display:flex; gap:9px; flex-wrap:wrap; margin:0 0 16px; }
.tabs a { border:1px solid #ced7d2; border-radius:4px; padding:8px 13px; background:white; text-decoration:none; color:#25332e; }
.tabs a.selected { color:white; background:#217346; border-color:#217346; }
fieldset { margin:20px 0; padding:17px; border:1px solid #d9e1dc; border-radius:5px; background:white; }
fieldset .check { display:inline-flex; margin:10px 22px 10px 0; min-width:140px; }
/* 客户和账号编辑：恢复原型右侧 560px 抽屉，而非居中弹窗。 */
.edit-window { position:fixed; top:0; right:0; bottom:0; left:auto; margin:0; width:560px; max-width:100vw; height:100dvh; max-height:100dvh; padding:0; border:0; border-left:1px solid #d7dfd9; background:white; color:#25332e; box-shadow:-5px 0 25px #17302320; overflow:auto; }
.edit-window::backdrop { background:#102a204d; }
.edit-window > h2 { margin:0; padding:19px 22px; border-bottom:1px solid #e0e6e2; font-size:19px; overflow-wrap:anywhere; }
.edit-window h2 .close { float:right; text-decoration:none; color:#718078; }
.edit-window > p { margin:0; padding:16px 22px 0; color:#718078; line-height:1.7; }
.edit-window > form { padding:22px; }
.edit-window .form-actions { position:sticky; bottom:-22px; z-index:2; padding:16px 0; margin-top:22px; border-top:1px solid #e0e6e2; background:white; }
.card { max-width:420px; margin:70px auto; border:1px solid #d9e1dc; border-radius:5px; padding:22px; background:white; }
.card label { display:block; margin:15px 0; color:#4d5f53; }
.card label input { display:block; width:100%; margin-top:7px; }
.card button[type=submit] { width:100%; }
.card .small { font-size:13px; color:#79877e; line-height:1.7; }
.card table { margin:18px 0; white-space:normal; }
.card th { position:static; width:38%; }
.card.wide { max-width:650px; margin:0; }
.section-title { font-size:18px; margin:0 0 12px; }
:focus-visible { outline:2px solid #217346; outline-offset:2px; }
@media(max-width:800px) { .sidebar { width:155px; } .sidebar nav a { padding:11px 10px; } .sidebar .group { padding-left:10px; } main { margin-left:155px; padding:15px; } .login-shell main { margin-left:0; } .form-grid,.details { grid-template-columns:1fr; } .form-grid > label:has(textarea) { grid-column:auto; } .edit-window { width:100%; } header .session span { display:none; } .filter-form label { flex-wrap:wrap; } }
@media(max-width:520px) { header { padding:0 14px; } header small { display:none; } aside.sidebar { width:130px; padding:12px 6px; } .app-shell main { margin-left:130px; padding:14px 10px; } .filter-form { padding:12px; } .filter-form label input,.filter-form label:first-child input,.filter-form label select { width:100%; } .filter-form label { width:100%; } }
.panel form:has(input[type=file]) { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.panel form:has(input[type=file]) > label { margin:0; }
.panel form input[type=file] { display:inline-block; padding:6px; max-width:100%; }
.business form > button { margin-top:12px; }
.filter-form > button,.panel form:has(input[type=file]) > button { margin-top:0; }
.pageform > form { margin-top:17px; }
.edit-window > .notice { margin:16px 22px 0; }
.edit-window > p > a { display:none; }
/* 订单选客沿用原型中的居中列表弹窗；编辑抽屉后面保留原列表。 */
.picker-window { width:min(1000px,94vw); max-width:94vw; max-height:85dvh; padding:0; border:0; border-radius:6px; color:#25332e; background:white; box-shadow:0 12px 40px #17302333; }
.picker-window::backdrop { background:#102a204d; }
.picker-window > h2 { margin:0; padding:19px 22px; border-bottom:1px solid #e0e6e2; font-size:19px; }
.picker-window .close { float:right; color:#718078; text-decoration:none; }
.picker-body { padding:22px; overflow:auto; }
.picker-body form { display:flex; align-items:center; gap:10px; margin-bottom:15px; }
.picker-body form label { display:flex; gap:8px; align-items:center; }
.picker-body .table-scroll { max-height:45vh; }
/* 浏览器适配修正：侧栏必须锚定视口左侧，不能继承 main 的静态起点。 */
:root { --nav-width:205px; --top-height:58px; }
html,body { width:100%; min-width:0; }
header { width:100%; max-width:100%; min-width:0; }
header > div:first-child { display:flex; align-items:center; min-width:0; flex:1 1 auto; }
header strong { flex-shrink:0; }
header small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
header .session { min-width:0; flex:0 1 auto; }
header .session span { min-width:0; max-width:220px; overflow:hidden; text-overflow:ellipsis; }
header .session a { flex-shrink:0; }
aside.sidebar { position:fixed; left:0; right:auto; top:var(--top-height); bottom:0; width:var(--nav-width); margin:0; }
.app-shell main { margin:0 0 0 var(--nav-width); width:calc(100% - var(--nav-width)); max-width:calc(100% - var(--nav-width)); min-width:0; padding:23px 25px; }
.login-shell main { width:100%; max-width:100%; margin:0; }
.business,.workspace,.panel,.pageform,.form-grid { min-width:0; max-width:100%; }
.table-scroll { width:100%; min-width:0; max-width:100%; }
.panel > table { white-space:normal; table-layout:fixed; }
.panel > table th,.panel > table td { overflow-wrap:anywhere; }
.filter-form { min-width:0; max-width:100%; }
.filter-form > label { min-width:0; max-width:100%; }
.form-grid > label,.details > div { min-width:0; }
.form-grid input,.form-grid select,.form-grid textarea { width:100%; max-width:100%; }
@media(max-width:800px) {
  :root { --nav-width:155px; }
  .app-shell main { padding:15px; }
}
@media(max-width:520px) {
  /* 窄屏将侧栏放回正常文档流，正文不再被固定菜单挤压。 */
  .app-shell main { margin:0; width:100%; max-width:100%; padding:14px 10px; }
  aside.sidebar { position:static; width:100%; padding:8px; margin:0 0 18px; border:1px solid #d7dfd9; border-radius:4px; }
  .sidebar nav { display:flex; flex-wrap:wrap; gap:3px; }
  .sidebar nav .group { display:none; }
  .sidebar nav a { display:inline-block; width:auto; margin:0; padding:8px 10px; }
  .sidebar .account-link { margin:8px 4px 0; padding-top:8px; }
  header { gap:8px; }
  header .session { gap:0; }
  header .session a { padding:6px 8px; }
}
/* 客户列表与跟进的操作列放在最左，并在横向滚动时保持可见。 */
.customer-list-table .data-grid th:first-child,
.customer-list-table .data-grid td:first-child { position:sticky; left:0; min-width:68px; width:68px; max-width:68px; border-right:1px solid #d7dfd9; }
.customer-list-table .data-grid td:first-child { z-index:2; background:white; }
.customer-list-table .data-grid th:first-child { z-index:4; background:#edf2ee; }
.customer-list-table .data-grid tbody tr:hover td:first-child { background:#f1f7f3; }
button:disabled { opacity:.65; cursor:wait; }
/* 来源更新使用居中、两步式弹窗，不跳离导入列表。 */
.source-window { width:min(620px,94vw); max-width:94vw; max-height:88dvh; margin:auto; padding:0; border:0; border-radius:6px; background:white; color:#25332e; box-shadow:0 12px 40px #17302333; overflow:auto; }
.source-window::backdrop { background:#102a204d; }
.source-heading { display:flex; justify-content:space-between; align-items:center; padding:18px 22px; border-bottom:1px solid #e0e6e2; }
.source-heading h2 { font-size:19px; margin:0; }
.source-close { border:0; padding:0 6px; font-size:24px; background:white; }
.source-content { padding:22px; }
.source-window [hidden] { display:none!important; }
.source-window label { display:block; margin:16px 0; color:#4d5f53; }
.source-window label input,.source-window label select { display:block; width:100%; margin-top:7px; }
.source-target { text-align:center; padding:18px 4px; }
.source-target h3 { margin:8px 0; font-size:20px; overflow-wrap:anywhere; }
.source-target p { margin:4px 0; overflow-wrap:anywhere; }
.source-result { text-align:center; padding:24px 0; }
.source-result h3 { color:#217346; font-size:22px; }
.source-search-status { font-size:13px; }
.source-back { color:#217346; background:white; }
