:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e8ecf4;
  --line-2: #f1f4f9;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --green: #16a34a;
  --green-soft: #e8f8ee;
  --red: #e11d48;
  --red-soft: #fdeaee;
  --amber: #f59e0b;
  --amber-soft: #fef4e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.only-mobile { display: none !important; }
.dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ------------------------------------------------------------- 登录页 */
body.is-auth {
  background:
    radial-gradient(1200px 500px at 50% -10%, #e8efff 0%, rgba(244, 246, 250, 0) 70%),
    var(--bg);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .07);
}

.auth-card .field { margin-top: 16px; }
.auth-tip { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 10px 0 0; }
.auth-foot { text-align: center; color: #b6bfcd; font-size: 11.5px; margin: 4px 0 0; }

/* ------------------------------------------------------------- 通用组件 */
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.brand-lg { justify-content: center; margin-bottom: 8px; flex-direction: column; gap: 12px; text-align: center; }
.brand-lg .brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-lg strong { font-size: 18px; }
.brand-lg small { color: var(--muted); font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .28);
}

.brand-lg .brand-logo { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  white-space: nowrap;
}

.btn:hover { background: #f7f9fc; color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost { border-color: transparent; background: transparent; color: #5b6577; }
.btn-ghost:hover { background: #f3f6fb; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-outline { border-color: #d9e2f0; color: #3f4b60; background: #fff; }
.btn-outline:hover { border-color: #b9cdf0; color: var(--brand); background: #f7faff; }

.btn-danger { color: var(--red); border-color: #f4ccd5; background: #fff; }
.btn-danger:hover { background: var(--red-soft); color: #be123c; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; height: 40px; margin-top: 22px; }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: #f1f4f9; color: var(--text); }

.link-btn {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12.5px;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-blue { background: #3b82f6; }
.dot-green { background: #22c55e; }
.dot-red { background: #f43f5e; }
.dot-amber { background: #f59e0b; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.pill-A { background: #fde8ec; color: #be123c; }
.pill-B { background: #e6f8ee; color: #15803d; }
.pill-C { background: #eef2f8; color: #526172; }
.pill-D { background: #fef4e2; color: #b45309; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  background: #f1f5fb;
  color: #55657d;
  font-size: 11.5px;
  white-space: nowrap;
}

.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
}
.user-chip:hover { background: #f8fafd; }
.user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag {
  font-size: 11px;
  color: #6b7688;
  background: #f2f5fa;
  border-radius: 4px;
  padding: 1px 5px;
}

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  color: #7c4a03;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11.5px; }
.avatar-blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.avatar-green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
.avatar-purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #5b21b6; }
.avatar-rose { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #9f1239; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
  padding: 5px;
  display: none;
  z-index: 40;
}
.dropdown-menu.dropdown-right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
}
.dropdown-menu button:hover { background: #f4f7fc; color: var(--text); }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button.danger:hover { background: var(--red-soft); }

/* ------------------------------------------------------------- 页面 */
.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px 16px;
  box-shadow: var(--shadow);
  text-align: left;
  font-family: inherit;
}
.stat-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-clickable:hover { border-color: #c9dbf7; box-shadow: 0 4px 14px rgba(37, 99, 235, .09); }

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #6b7688;
}
.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: var(--text);
  line-height: 1.1;
}
.stat-value em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 5px; letter-spacing: 0; }

.toolbar {
  margin: 14px 0 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.search-box {
  flex: 1 1 280px;
  min-width: 200px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfd;
  color: #9aa4b5;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within {
  background: #fff;
  border-color: #a9c6f5;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--text);
}
.search-box input::placeholder { color: #a7b0bf; }

.toolbar-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.sel {
  height: 38px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff url("data:image/svg+xml;charset=utf8,%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='%238a94a6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 12.8px;
  color: #4b5768;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  max-width: 150px;
  transition: border-color .15s, box-shadow .15s;
}
.sel:hover { border-color: #cfd9e8; }
.sel:focus { outline: 0; border-color: #a9c6f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

/* ------------------------------------------------------------- 批量条 */
.bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f2f6ff;
  border: 1px solid #d9e6ff;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #3b4a63;
}
.bulkbar-left { display: flex; align-items: center; gap: 12px; }
.bulk-count b { color: var(--brand); font-weight: 700; }

/* ------------------------------------------------------------- 表格 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }

.grid {
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.8px;
  white-space: nowrap;
}

.grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
  color: #7d8798;
  font-weight: 500;
  font-size: 12.3px;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.grid tbody td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-2);
  color: #52606f;
  vertical-align: middle;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #fafcff; }
.grid tbody tr.is-selected td { background: #f4f8ff; }

.c-check { width: 34px; padding-right: 0 !important; }
.c-check input, .grid input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--brand);
  cursor: pointer;
  vertical-align: middle;
}

.c-seq { color: #98a2b3; }
.c-company { max-width: 190px; }
.c-company span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 600;
}
.c-email { max-width: 168px; }
.c-email a, .c-site a { display: block; overflow: hidden; text-overflow: ellipsis; color: #3f5d8f; }
.c-products { max-width: 190px; }
.c-industry { max-width: 120px; }
.c-quote { max-width: 160px; }
.c-act { text-align: right; padding-right: 14px !important; }
.c-act .btn { margin-left: 6px; }

/* 操作列固定在右侧，横向滚动时始终可见 */
.grid thead th.c-act,
.grid tbody td.c-act {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -10px 0 12px -10px rgba(15, 23, 42, .18);
}
.grid thead th.c-act { background: #fbfcfe; z-index: 3; }
.grid tbody tr:hover td.c-act { background: #fafcff; }
.grid tbody tr.is-selected td.c-act { background: #f4f8ff; }

.owner-cell { display: inline-flex; align-items: baseline; gap: 5px; }
.owner-cell em { font-style: normal; color: #a4aebf; font-size: 11.5px; }

.contact-cell { display: flex; flex-direction: column; gap: 1px; line-height: 1.45; }
.contact-cell em { font-style: normal; color: #97a2b3; font-size: 11.3px; }

.tags { display: flex; gap: 4px; flex-wrap: wrap; }

.alert-cell { font-size: 12px; }
.alert-today { color: var(--green); font-weight: 600; }
.alert-overdue { color: var(--red); font-weight: 600; }
.alert-soon { color: #b45309; }
.alert-none { color: #a9b2c0; }
.alert-closed { color: #a9b2c0; }

.quote-cell { display: flex; flex-direction: column; gap: 2px; }
.quote-no { color: #34435c; font-weight: 600; font-size: 12.3px; }
.quote-meta { color: #94a0b2; font-size: 11.3px; }
.quote-none { color: #b3bcc9; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; font-size: 13px; }

.skeleton { padding: 18px; display: grid; gap: 12px; }
.sk-row {
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f3f6fb 25%, #eaeff7 37%, #f3f6fb 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
}
.pager-btns { display: flex; gap: 6px; align-items: center; }
.pager-btns button {
  min-width: 30px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: #5b6577;
  font-size: 12.5px;
  padding: 0 8px;
}
.pager-btns button:hover:not(:disabled) { border-color: #bfd4f5; color: var(--brand); }
.pager-btns button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-btns button:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------- 弹窗 */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); }
.modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
}
.modal.modal-wide { width: min(980px, 100%); }
.modal.modal-narrow { width: min(470px, 100%); }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .1px; }
.modal-desc { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.modal-head-actions { display: flex; gap: 8px; align-items: center; }
#modal-actions { display: flex; gap: 8px; }
#modal-actions:empty { display: none; }
.modal-body { padding: 16px 24px; overflow-y: auto; }
.modal-foot {
  padding: 8px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
  padding-top: 14px;
}
.modal-foot .left { margin-right: auto; }

/* ------------------------------------------------------------- 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.4px; color: #6b7688; }
.field > span i { color: var(--red); font-style: normal; margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #a9c6f5;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.field select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml;charset=utf8,%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='%238a94a6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 28px; }
.field small { color: #a3acba; font-size: 11.5px; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: #7d8798;
  letter-spacing: .4px;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.tag-input:focus-within { border-color: #a9c6f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.tag-input input {
  border: 0;
  outline: 0;
  height: 24px;
  flex: 1;
  min-width: 90px;
  font-size: 13px;
  padding: 0 2px;
  background: transparent;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 4px 0 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 500;
}
.chip button {
  border: 0;
  background: none;
  color: #93aef0;
  font-size: 13px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 4px;
}
.chip button:hover { color: #1d4ed8; background: #dfe9ff; }

/* ------------------------------------------------------------- 详情 */
.detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faff, #fbfcfe);
  border: 1px solid var(--line);
}
.detail-hero h4 { margin: 0 0 5px; font-size: 16px; font-weight: 650; }
.detail-hero .meta { color: var(--muted); font-size: 12.4px; display: flex; gap: 12px; flex-wrap: wrap; }
.detail-hero .grow { flex: 1; min-width: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 12.8px;
}
.info-grid div { display: flex; gap: 8px; min-width: 0; }
.info-grid dt { color: var(--muted); flex: none; width: 62px; }
.info-grid dd { margin: 0; color: #334155; overflow: hidden; text-overflow: ellipsis; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 16px 20px;
  border-left: 1px solid #e6ecf5;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd8ea;
  box-shadow: 0 0 0 3px #fff;
}
.timeline li.hot::before { background: var(--brand); }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: 12.4px; color: var(--muted); }
.tl-head b { color: #334155; font-weight: 600; font-size: 12.8px; }
.tl-body { margin: 5px 0 0; font-size: 13px; color: #475569; line-height: 1.6; white-space: pre-wrap; }

.quote-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.quote-row:hover { border-color: #d6e4f8; background: #fcfdff; }
.quote-row .grow { flex: 1; min-width: 0; }
.quote-row .no { font-weight: 650; font-size: 13px; color: #1f2a3d; }
.quote-row .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.st-sent::before { background: #3b82f6; }
.st-confirmed::before { background: var(--green); }
.st-expired::before { background: var(--red); }

/* ------------------------------------------------------------- 报价明细 */
.quote-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.quote-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.quote-table td { padding: 5px 4px; }
.quote-table input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12.8px;
  outline: 0;
  background: #fff;
}
.quote-table input:focus { border-color: #a9c6f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.quote-table .num { text-align: right; }
.quote-table tfoot td { padding-top: 12px; font-size: 13px; }

/* ------------------------------------------------------------- 业务员 */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-2);
}
.user-row:last-child { border-bottom: 0; }
.user-row .grow { flex: 1; min-width: 0; }
.user-row .nm { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #1f2a3d; }
.user-row .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.user-row .ops { display: flex; gap: 8px; }
.badge-admin {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef4e2;
  border-radius: 4px;
  padding: 2px 6px;
}
.badge-off { font-size: 11px; color: #94a3b8; background: #f1f5f9; border-radius: 4px; padding: 2px 6px; }

/* ------------------------------------------------------------- toast */
.toast-root {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #16233a;
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 9px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .24);
  animation: toastIn .18s ease-out;
}
.toast.err { background: #9f1239; }
.toast.ok { background: #14532d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- 报价单打印 */
.print-sheet {
  background: #fff;
  padding: 28px 30px;
  font-size: 12.5px;
  color: #1f2937;
}
.print-sheet h2 { margin: 0 0 4px; font-size: 19px; }
.print-sheet .ps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #1f2937; padding-bottom: 12px; }
.print-sheet .ps-meta { text-align: right; font-size: 12px; color: #475569; line-height: 1.7; }
.print-sheet table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12px; }
.print-sheet th, .print-sheet td { border: 1px solid #dbe1ea; padding: 7px 9px; text-align: left; }
.print-sheet th { background: #f4f6fa; font-weight: 600; }
.print-sheet .r { text-align: right; }
.print-sheet .ps-foot { display: flex; justify-content: space-between; margin-top: 18px; color: #475569; font-size: 12px; gap: 20px; }
.print-sheet .totals { margin-left: auto; border-collapse: collapse; min-width: 220px; width: auto; }

@media print {
  body * { visibility: hidden !important; }
  .modal-root, .modal-root * { visibility: visible !important; }
  .modal-mask, .modal-head, .modal-foot, .toast-root { display: none !important; }
  .modal-root { position: static; padding: 0; display: block; }
  .modal { box-shadow: none; width: 100%; max-height: none; border-radius: 0; }
  .modal-body { padding: 0; overflow: visible; }
  .print-sheet { padding: 0; }
  body { background: #fff; }
}

/* ------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .c-source { display: none; }
}

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-email, .c-industry { display: none; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page { padding: 12px 12px 40px; }
  .topbar-inner { padding: 0 12px; height: 52px; gap: 8px; }
  .topbar-actions { gap: 2px; }
  .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }
  .brand { gap: 8px; min-width: 0; }
  .brand strong { font-size: 13px; white-space: nowrap; letter-spacing: 0; }
  .brand-logo { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
  .user-chip { padding: 0 6px 0 3px; }
  .user-name { display: none; }
  .role-tag { display: none; }
  .grid { min-width: 0; }
  .toolbar { padding: 8px; gap: 8px; }
  .search-box { flex: 1 1 100%; }
  .toolbar-filters { width: 100%; }
  .toolbar-filters .sel { flex: 1 1 auto; max-width: none; min-width: 0; height: 34px; }
  .toolbar-filters .btn-primary { width: 100%; height: 36px; }

  .table-wrap { overflow: visible; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: auto; }
  .grid thead { display: none; }
  .grid tbody { padding: 6px; }
  .grid tbody tr {
    border: 1px solid var(--line);
    border-radius: 11px;
    margin: 8px 4px;
    padding: 10px 12px 8px;
    position: relative;
    background: #fff;
  }
  .grid tbody td {
    border: 0;
    padding: 3px 0;
    display: flex;
    gap: 8px;
    white-space: normal;
    max-width: none;
  }
  .grid tbody td::before {
    content: attr(data-label);
    color: #9aa4b5;
    font-size: 11.5px;
    width: 58px;
    flex: none;
    padding-top: 1px;
  }
  .grid tbody td.c-check { position: absolute; right: 10px; top: 12px; padding: 0; }
  .grid tbody td.c-check::before { display: none; }
  .grid tbody td.c-act {
    justify-content: flex-end;
    padding-top: 8px !important;
    position: static;
    box-shadow: none;
    background: transparent;
  }
  .grid tbody td.c-act::before { display: none; }
  .grid tbody td.c-company span { font-size: 14px; }
  .c-email, .c-source { display: none; }
  .c-products { display: flex; }
  .c-check { display: block; }

  .modal-root { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    animation: sheetUp .2s ease-out;
  }
  @keyframes sheetUp { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
  .modal-head { padding: 16px 16px 0; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 10px 16px 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .info-grid { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat-value { font-size: 22px; }
  .detail-hero { flex-direction: column; }
  .user-row { flex-wrap: wrap; }
  .user-row .ops { width: 100%; }
}
