/* YOI CRM · 天青蓝主题（与 YOI 交付物同一色系：#2b6ca3 + #7fb3d9） */
:root {
  --brand: #2b6ca3;
  --brand-dark: #1d4f7a;
  --brand-soft: #e8f2fa;
  --accent: #7fb3d9;
  --ink: #1f2a37;
  --ink-2: #344054;
  --muted: #6b7a8c;
  --muted-2: #98a5b5;
  --line: #e3e9f0;
  --line-2: #eef2f7;
  --bg: #f3f6f9;
  --panel: #ffffff;
  --ok: #12805c;
  --ok-soft: #e3f5ee;
  --warn: #b25e09;
  --warn-soft: #fdf1e2;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --violet: #6941c6;
  --violet-soft: #f2edff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 8px 24px rgba(16, 40, 66, .08);
  --shadow-lg: 0 24px 64px rgba(16, 40, 66, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 238px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- layout ---------------- */
.app { min-height: 100%; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: #fff;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(127, 179, 217, .28), transparent 55%),
    linear-gradient(168deg, #163a5b 0%, #1d4f7a 48%, #2b6ca3 100%);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.logo {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #d7e8f5);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: rgba(255, 255, 255, .62); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .74);
  font-size: 14px;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item .ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, .09);
  font-size: 12px;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }
.nav-item.active .ico { background: var(--accent); color: var(--brand-dark); }
.badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: #ffb648;
  color: #4a2b00;
  font-size: 11px;
  font-weight: 700;
}
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .13); }
.side-mini { font-size: 11.5px; color: rgba(255, 255, 255, .64); line-height: 1.9; }
.side-mini b { color: #fff; font-weight: 600; }
.ver { margin-top: 10px; font-size: 10.5px; color: rgba(255, 255, 255, .38); }

.main { min-height: 100%; margin-left: var(--sidebar); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: .2px; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 9px; }

.searchbox {
  display: flex; align-items: center; gap: 7px;
  width: 290px;
  padding: 0 10px;
  height: 38px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.searchbox:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 179, 217, .22); }
.search-ico { color: var(--muted-2); font-size: 18px; line-height: 1; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.searchbox kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  color: var(--muted-2);
  font-size: 10.5px;
  background: #fff;
}

.content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 60px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(43, 108, 163, .24); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: var(--line); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #dcebf7; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.btn-danger-ghost { background: #fff; color: var(--danger); border-color: var(--line); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #f3b6b1; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.plus { font-size: 16px; line-height: 1; margin-top: -1px; }
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 17px;
  display: grid; place-items: center;
}
.only-mobile { display: none; }

.menu-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 248px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 60;
}
.popover a, .popover button {
  display: block; width: 100%;
  padding: 9px 11px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}
.popover a:hover, .popover button:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ---------------- dashboard ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  position: relative;
  padding: 17px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -24px; top: -24px;
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--brand-soft);
  opacity: .65;
}
.stat-card.accent::after { background: #e6f4ef; }
.stat-card.warn::after { background: var(--warn-soft); }
.stat-card.violet::after { background: var(--violet-soft); }
.stat-label { position: relative; z-index: 1; color: var(--muted); font-size: 12.5px; }
.stat-value { position: relative; z-index: 1; margin-top: 6px; font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.stat-hint { position: relative; z-index: 1; margin-top: 6px; font-size: 11.5px; color: var(--muted-2); }

.grid-2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-top: 16px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 0;
}
.panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.panel-head .hint { color: var(--muted); font-size: 12px; }
.panel-body { padding: 14px 18px 18px; }
.panel + .panel { margin-top: 16px; }

.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 40px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-track { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s ease; }
.bar-fill.b { background: var(--accent); }
.bar-fill.c { background: #c9d6e2; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: #e29a3c; }
.bar-fill.danger { background: #cf574d; }
.bar-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.feed-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.feed-item:hover .feed-title { color: var(--brand); }
.feed-dot {
  flex: none; width: 9px; height: 9px; margin-top: 6px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.feed-main { min-width: 0; flex: 1; }
.feed-title { font-weight: 600; font-size: 13px; transition: color .15s; }
.feed-text { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { flex: none; color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }
.empty-mini { padding: 20px 0; text-align: center; color: var(--muted-2); font-size: 12.5px; }

/* ---------------- customers ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar .toolbar-search { width: 250px; }
.segmented { display: inline-flex; gap: 6px; }

/* 多选 / 批量操作 */
.td-check { width: 42px; text-align: center; padding-left: 10px; padding-right: 0 !important; }
.td-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); vertical-align: middle; }
.row-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); vertical-align: middle; }

/* 客户修改履历 */
.change-list { display: flex; flex-direction: column; gap: 8px; }
.change-item { border: 1px solid #edf1f5; border-radius: 10px; padding: 10px 12px; background: #fff; }
.change-head { font-size: 13px; color: #4d5d6c; margin-bottom: 6px; line-height: 1.6; }
.change-diff { font-size: 13px; line-height: 1.8; color: #24323f; }
.change-diff .old { color: #96201f; text-decoration: line-through; }
.change-diff .new { color: #1c6b3c; font-weight: 600; }
.bulkbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px;
  background: var(--brand-soft); border: 1px solid #cfe2f2; border-radius: 10px;
  color: var(--ink-2); font-size: 13px;
}
.bulkbar b { color: var(--brand); }
.bulkbar .link-btn { margin-left: auto; }
.select {
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7a8c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none;
  font-size: 13px;
  color: var(--ink-2);
  outline: 0;
}
.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 179, 217, .2); }
.result-count { color: var(--muted); font-size: 12.5px; }

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  font-size: 13px;
}
table.data tbody tr { cursor: pointer; transition: background .12s; }
table.data tbody tr:hover { background: #f8fbfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
.cust-name { font-weight: 600; color: var(--ink); }
.cust-sub { margin-top: 2px; color: var(--muted-2); font-size: 11.5px; }
.td-actions { text-align: right; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 4px; opacity: .45; transition: opacity .12s; }
tr:hover .row-actions { opacity: 1; }
.link-btn {
  border: 0; background: transparent;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.link-btn:hover { background: var(--brand-soft); color: var(--brand); }
.link-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.level-A { background: #e6f4ef; color: var(--ok); }
.chip.level-B { background: var(--brand-soft); color: var(--brand); }
.chip.level-C { background: #eef1f5; color: #5c6b7c; }
.chip.status-潜在 { background: var(--violet-soft); color: var(--violet); }
.chip.status-跟进中 { background: var(--warn-soft); color: var(--warn); }
.chip.status-已成交 { background: var(--ok-soft); color: var(--ok); }
.chip.status-流失 { background: #eef1f5; color: var(--muted); }
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip.due-overdue { background: var(--danger-soft); color: var(--danger); }
.chip.due-today { background: var(--warn-soft); color: var(--warn); }
.chip.due-soon { background: var(--brand-soft); color: var(--brand); }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line-2);
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
}
.pager-btns { display: flex; gap: 6px; }

.empty-state { padding: 58px 20px; text-align: center; }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 22px;
}
.empty-state h3 { margin: 0 0 5px; font-size: 15px; }
.empty-state p { margin: 0 auto 16px; max-width: 420px; color: var(--muted); font-size: 12.5px; }

/* ---------------- drawer ---------------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(16, 30, 46, .32);
  backdrop-filter: blur(1.5px);
  z-index: 70;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(600px, 94vw);
  display: flex; flex-direction: column;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  animation: slide-in .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slide-in { from { transform: translateX(26px); opacity: .4 } to { transform: none; opacity: 1 } }
.drawer-head { padding: 20px 22px 0; }
.drawer-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-title { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: .2px; }
.drawer-sub { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.drawer-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.drawer-actions { display: flex; gap: 6px; flex: none; }
.close-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  display: grid; place-items: center;
}
.close-btn:hover { background: var(--bg); color: var(--ink); }
.tabs { display: flex; gap: 3px; margin: 16px 0 0; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  padding: 9px 13px;
  border: 0; background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); font-weight: 650; }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--brand);
}
.tab .count { margin-left: 4px; color: var(--muted-2); font-size: 11.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.info-cell .k { color: var(--muted-2); font-size: 11.5px; margin-bottom: 3px; }
.info-cell .v { font-size: 13px; word-break: break-word; }
.info-cell.span-2 { grid-column: 1 / -1; }
.note-box {
  margin-top: 18px;
  padding: 13px 14px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  white-space: pre-wrap;
}
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-top h4 { margin: 0; font-size: 13.5px; }
.card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 9px;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-weight: 600; font-size: 13.5px; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-body { margin-top: 8px; color: var(--ink-2); font-size: 12.8px; white-space: pre-wrap; }
.card-actions { display: inline-flex; gap: 3px; flex: none; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 7px; color: var(--muted); font-size: 11.8px; }
.primary-tag { background: var(--brand-soft); color: var(--brand); }

.timeline { position: relative; padding-left: 19px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 5px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 16px; }
.tl-dot {
  position: absolute; left: -19px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}
.tl-item.due .tl-dot { border-color: #e29a3c; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-date { font-weight: 600; font-size: 12.5px; }
.tl-type { margin-left: 6px; }
.tl-content { margin-top: 5px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.tl-next {
  margin-top: 7px;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.8px;
}
.tl-actions { margin-top: 6px; display: flex; gap: 4px; }

/* ---------------- modal / forms ---------------- */
.modal-overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(16, 30, 46, .38);
  z-index: 90;
  animation: fade .15s ease;
}
.modal {
  width: min(620px, 100%);
  max-height: min(86vh, 860px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.975); opacity: .5 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 16px 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.form-section { grid-column: 1 / -1; margin: 16px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--brand); font-size: 12.5px; font-weight: 700; letter-spacing: .5px; }
.form-section:first-child { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: 0;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 82px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 179, 217, .2);
}
.field .help { color: var(--muted-2); font-size: 11.3px; }
.check-row { display: flex; align-items: center; gap: 8px; height: 38px; }
.check-row input { width: 16px; height: 16px; }
.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}
.import-zone {
  padding: 22px 16px;
  border: 1.5px dashed #b9cbdc;
  border-radius: 12px;
  background: #f8fbfe;
  text-align: center;
}
.import-zone strong { display: block; margin-bottom: 4px; font-size: 13.5px; }
.import-zone p { margin: 0 0 12px; color: var(--muted); font-size: 12.3px; }
.import-note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.import-note code { background: var(--bg); padding: 1px 4px; border-radius: 4px; font-size: 11.5px; }
.import-preview { margin-top: 14px; }
.import-error-list { max-height: 320px; overflow: auto; margin: 10px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.import-summary { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.mapping-wrap {
  max-height: 280px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.mapping-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mapping-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap;
}
.mapping-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.mapping-table tr:last-child td { border-bottom: 0; }
.mapping-table td:nth-child(2) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-table select {
  width: 100%; min-width: 150px; height: 32px;
  padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 12.5px; outline: 0;
}
.mapping-table select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 179, 217, .2); }

/* 审批中心 / 待审批提示 */
.approval-card { margin-bottom: 14px; }
.approval-card .panel-head { align-items: flex-start; }
.approval-card .panel-head h3 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.diff-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 320px; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.diff-table th {
  padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap;
}
.diff-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.diff-table tr:last-child td { border-bottom: 0; }
.diff-table td:nth-child(2) { color: var(--danger); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .35); }
.diff-table td:nth-child(3) { color: var(--ok); font-weight: 600; }
.pending-box {
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 14px; padding: 11px 13px;
  border: 1px solid #f0d7a8; border-radius: 10px;
  background: var(--warn-soft); color: #7a4a08;
  font-size: 12.5px; line-height: 1.6;
}
.pending-box b { color: var(--warn); }
.pending-box.reject { border-color: #f3b6b1; background: var(--danger-soft); color: #8f1c13; }
.pending-box.reject b { color: var(--danger); }
.approval-card .btn-sm { flex: none; }

/* 未分配 / 完整度 / 通知 */
.alert-panel { border-color: #f0d7a8; }
.alert-panel .panel-head h3 { color: var(--warn); }
.notif-card { margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.notif-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.notif-card.unread { border-left: 3px solid var(--brand); background: #fbfdff; }
.notif-title { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13.5px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.notif-body { margin-top: 5px; color: var(--ink-2); font-size: 13px; white-space: pre-wrap; }
.notif-time { margin-top: 6px; color: var(--muted-2); font-size: 11.5px; }

/* 客户分配汇总 */
.assign-summary { display: flex; flex-direction: column; gap: 6px; }
.assign-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink-2); text-align: left;
  transition: border-color .15s, background .15s;
}
.assign-row:hover { border-color: var(--accent); background: var(--brand-soft); }
.assign-row.unassigned { border-color: #f0d7a8; background: var(--warn-soft); color: var(--warn); }
.assign-name { font-weight: 600; font-size: 13px; }
.assign-count { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.reassign-note {
  margin-bottom: 7px; padding: 9px 11px;
  border: 1px solid #f0d7a8; border-radius: 9px;
  background: var(--warn-soft); color: #7a4a08;
  font-size: 12.5px; line-height: 1.65;
}
.reassign-note b { color: var(--warn); }
.transfer-card { margin-bottom: 14px; }
.transfer-names { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }

/* ---------------- 登录页 ---------------- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(127, 179, 217, .30), transparent 60%),
    radial-gradient(700px 420px at 105% 108%, rgba(43, 108, 163, .18), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 28px 28px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.login-brand .logo {
  width: 46px; height: 46px;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(43, 108, 163, .28);
}
.login-brand h1 { margin: 0; font-size: 18px; letter-spacing: .2px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field label { font-size: 12.5px; }
.login-form .field input { height: 42px; font-size: 14px; }
.login-submit { width: 100%; height: 43px; margin-top: 4px; font-size: 14px; }
.login-foot { margin: 18px 0 0; color: var(--muted-2); font-size: 11.8px; line-height: 1.7; }

.side-links { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.side-links .link-btn { color: rgba(255, 255, 255, .68); padding: 4px 6px; }
.side-links .link-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------------- toast ---------------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 120;
  pointer-events: none;
}
.toast {
  min-width: 220px; max-width: 380px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #1f2a37;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease;
}
.toast.ok { background: #146c50; }
.toast.err { background: #9c231a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

.auth-hint {
  max-width: 720px; margin: 40px auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.auth-hint h2 { margin: 0 0 8px; font-size: 17px; }
.auth-hint p { margin: 0 auto 6px; max-width: 520px; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* ---------------- responsive ---------------- */
@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .searchbox { width: 220px; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .toolbar .toolbar-search { width: 100%; order: -2; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: 250px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 80px; }
  .topbar-right .searchbox { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .drawer { width: 100%; }
}
@media (max-width: 680px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .topbar h1 { font-size: 17px; }
  .topbar .sub { display: none; }
  .btn-primary { padding: 0 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .toolbar .select { flex: 1 1 40%; }
  .toolbar .spacer { display: none; }
  .result-count { width: 100%; order: 9; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .modal-overlay { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-foot { border-radius: 0; }

  /* 表格转卡片 */
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr {
    padding: 13px 14px 10px;
    border-bottom: 1px solid var(--line);
  }
  table.data td {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }
  table.data td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted-2);
    font-size: 11.5px;
    text-align: left;
  }
  table.data td.td-cust { display: block; text-align: left; padding-bottom: 7px; }
  table.data td.td-cust::before { display: none; }
  table.data td.td-check { display: flex; justify-content: flex-start; padding: 0 0 7px; }
  table.data td.td-check::before { display: none; }
  .bulkbar .link-btn { margin-left: 0; }
  table.data td.td-actions { justify-content: flex-end; padding-top: 6px; }
  table.data td.td-actions::before { display: none; }
  .row-actions { opacity: 1; }
}

/* ---------------------------------------------------------------- v2.10.24 新增 */
.week-panel .panel-body { padding-top: 18px; }
.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 190px;
  padding: 8px 4px 0;
}
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.week-count { font-weight: 700; color: var(--ink); font-size: 13px; }
.week-bar-wrap {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.week-bar {
  width: 100%;
  max-width: 46px;
  min-height: 2px;
  border-radius: 8px 8px 4px 4px;
  background: var(--brand-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  box-shadow: inset 0 0 0 1px rgba(43, 108, 163, .08);
}
.week-seg { display: block; width: 100%; }
.week-label {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
}
.week-label span { display: block; font-size: 10.5px; opacity: .75; }
.week-col.today .week-count { color: var(--brand); }
.week-col.today .week-label { color: var(--brand); font-weight: 700; }
.week-col.today .week-bar { box-shadow: 0 0 0 2px var(--brand-soft), inset 0 0 0 1px rgba(43,108,163,.15); }
.week-progress {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-2, #f7fafc);
}
.week-progress.ok { border-color: rgba(90, 164, 105, .35); }
.week-progress.warn { border-color: rgba(201, 139, 46, .42); }
.week-progress-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; }
.week-progress-head span { color: var(--muted); }
.week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, #f7fafc);
  font-size: 12.5px;
  color: var(--ink-2, #4d5d6c);
}
.week-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.week-legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.week-legend-item b { color: var(--ink); font-size: 13px; }

.week-table th, .week-table td { text-align: center; }
.week-table th:first-child, .week-table td:first-child { text-align: left; }

.region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.region-grid input, .region-grid select { width: 100%; }
.region-grid.hidden { display: none; }

.completeness-hint {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: var(--surface-2, #f7fafc);
  color: var(--ink-2);
}
.completeness-hint.ok { border-color: rgba(90, 164, 105, .4); background: var(--ok-soft, #eef8f0); color: #2f6b3b; }
.completeness-hint.warn { border-color: rgba(201, 139, 46, .45); background: var(--warn-soft, #fdf6e8); color: #7a5516; }
.completeness-hint.hidden { display: none; }

.dup-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 320px; overflow: auto; }
.dup-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2, #f7fafc); }
.dup-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.danger-box { border-color: rgba(192, 87, 91, .4); background: var(--danger-soft, #fdf0f0); }

.reminder-section { padding: 10px 0 14px; border-bottom: 1px dashed var(--line); }
.reminder-section:last-child { border-bottom: 0; padding-bottom: 0; }
.reminder-section h4 { margin: 0 0 6px; font-size: 14px; }
.reminder-section p { margin: 6px 0; color: var(--ink-2); line-height: 1.7; }
.reminder-list { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; line-height: 1.8; }

@media (max-width: 760px) {
  .week-board { gap: 5px; min-height: 160px; }
  .week-bar-wrap { height: 100px; }
  .week-label { font-size: 10px; }
  .region-grid { grid-template-columns: 1fr; }
  .dup-actions { justify-content: stretch; }
  .dup-actions .btn { flex: 1 1 100%; }
}
