* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #1f2329; font-size: 14px; }
.hidden { display: none !important; }
.muted { color: #8a9099; font-size: 12px; }
.err { color: #d03050; font-size: 12px; min-height: 16px; }

.login-mask { position: fixed; inset: 0; background: #eef1f5; display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.login-box h2 { margin: 0 0 6px; font-size: 20px; }
.login-box label { display: block; margin: 16px 0 4px; font-size: 13px; color: #4b5563; }
.login-box input, input, textarea, select { width: 100%; padding: 9px 10px; border: 1px solid #d9dde3; border-radius: 6px; background: #fff; font-size: 14px; color: #1f2329; }
textarea { min-height: 76px; resize: vertical; }
.btn { padding: 8px 14px; border: 1px solid #d9dde3; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: #1f2329; }
.btn:hover { border-color: #2f6feb; }
.btn.primary { background: #2f6feb; border-color: #2f6feb; color: #fff; }
.btn.primary:hover { background: #245ed0; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: #d03050; border-color: #f0c2cc; }
.login-box .btn.primary { width: 100%; margin-top: 20px; padding: 10px; }

.topbar { height: 60px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.brand { font-weight: 600; font-size: 16px; }
.version { font-weight: 400; font-size: 11px; color: #8a9099; margin-left: 8px; }
.switcher { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.switcher-label { color: #6b7280; font-size: 12px; }
.switcher select { width: 240px; }
.badge-scope { background: #e8f1ff; color: #2f6feb; border: 1px solid #c7dcff; border-radius: 12px; padding: 3px 10px; font-size: 11px; white-space: nowrap; }

.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 168px; background: #fff; border-right: 1px solid #e5e7eb; padding: 14px 0; flex: none; }
.sidebar a { display: block; padding: 11px 22px; cursor: pointer; color: #4b5563; border-left: 3px solid transparent; }
.sidebar a:hover { background: #f7f9fc; }
.sidebar a.active { color: #2f6feb; background: #eef4ff; border-left-color: #2f6feb; font-weight: 600; }
.content { flex: 1; padding: 20px 24px; min-width: 0; }
.scope-banner { background: #fff; border: 1px solid #e5e7eb; border-left: 3px solid #2f6feb; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.scope-banner strong { color: #2f6feb; }
.scope-banner .muted { margin-left: auto; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; }
.kpi .num { font-size: 26px; font-weight: 600; color: #2f6feb; }
.kpi .label { color: #8a9099; font-size: 12px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
th { color: #6b7280; font-weight: 500; background: #fafbfc; }
tr:hover td { background: #fafbfe; }
.tag { display: inline-block; background: #eef4ff; color: #2f6feb; border-radius: 4px; padding: 2px 7px; font-size: 11px; }
.tag.gray { background: #f2f3f5; color: #6b7280; }
.tag.green { background: #e8f7ee; color: #18a058; }
.tag.red { background: #fdeef1; color: #d03050; }
.form-grid { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.form-grid label { color: #6b7280; font-size: 13px; }
.empty { color: #8a9099; padding: 26px; text-align: center; }
.hint { font-size: 12px; color: #8a9099; line-height: 1.8; }
.hint code, .upgrade-tip code { background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.upgrade-tip { background: #fff7e8; border: 1px solid #f3d9a4; color: #8a5a12; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; font-size: 12.5px; line-height: 1.9; }
.upgrade-tip strong { color: #a35c00; }
pre { background: #f7f8fa; padding: 12px; border-radius: 6px; overflow: auto; font-size: 12px; }

.modal { position: fixed; inset: 0; background: rgba(15,23,42,.42); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { width: 520px; max-height: 84vh; overflow: auto; background: #fff; border-radius: 10px; padding: 22px; }
.modal-box h3 { margin: 0 0 16px; }
.modal-box .form-grid { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 客户信息模块 */
.tag.orange { background: #fff4e6; color: #b56a10; }
.info-grid { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; align-items: center; font-size: 13px; }
.info-grid label { color: #6b7280; }
.info-grid div { color: #1f2329; word-break: break-all; }
