/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F5F6F8;
  color: #17181C;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; }
input { font-family: inherit; outline: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===== Layout ===== */
.app { display: flex; height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #FBFBFD;
  border-right: 1px solid #E0E5EB;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.logo-area {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: #2563EB;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-text { font-size: 18px; font-weight: 700; color: #17181C; }

.nav-section { flex: 1; padding: 12px; overflow-y: auto; }
.nav-label {
  font-size: 11px; font-weight: 600; color: #8A92A6;
  padding: 8px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #5E6678;
  font-size: 14px;
  font-weight: 400;
}
.nav-item:hover { background: #F0F2F5; color: #17181C; }
.nav-item.active { background: #2563EB; color: #fff; font-weight: 500; }
.nav-item.active svg path,
.nav-item.active svg circle,
.nav-item.active svg rect,
.nav-item.active svg polyline,
.nav-item.active svg line { stroke: #fff; }
.nav-item svg { width: 20px; height: 20px; min-width: 20px; }

.profile-area {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-top: 1px solid #E0E5EB;
}
.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #2563EB;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.profile-info { flex: 1; }
.profile-name { font-size: 13px; font-weight: 600; color: #17181C; }
.profile-role { font-size: 11px; color: #8A92A6; }

/* ===== Main Content ===== */
.main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.top-bar {
  height: 64px; min-height: 64px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.page-title { font-size: 20px; font-weight: 700; color: #17181C; }
.search-bar {
  width: 320px; min-height: 36px;
  background: #F0F2F5;
  border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  position: relative;
}
.search-bar input {
  border: none; background: transparent; flex: 1;
  font-size: 13px; color: #17181C;
}
.search-bar input::placeholder { color: #8A92A6; }
.search-bar svg { width: 18px; height: 18px; min-width: 18px; }

.top-actions { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.bell-wrap {
  width: 36px; height: 36px;
  border-radius: 8px; background: #F0F2F5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: background 0.15s;
}
.bell-wrap:hover { background: #E5E7EB; }
.bell-wrap svg { width: 18px; height: 18px; }
.bell-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EB5757;
}
.top-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.top-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #2563EB; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.top-user-name { font-size: 13px; font-weight: 500; color: #17181C; }

.content-area { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid #E8EAED;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(5, 7, 12, 0.04);
}

/* ===== KPI Cards ===== */
.kpi-row { display: flex; gap: 16px; }
.kpi-card { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kpi-label { font-size: 13px; color: #8A92A6; }
.kpi-value { font-size: 28px; font-weight: 700; color: #17181C; }
.kpi-change { display: flex; align-items: center; gap: 4px; }
.kpi-change-val { font-size: 12px; font-weight: 500; }
.kpi-change-val.up { color: #27AE60; }
.kpi-change-val.down { color: #EB5757; }
.kpi-change-val.warn { color: #F2994A; }
.kpi-change-sub { font-size: 12px; color: #8A92A6; }

/* ===== Charts Row ===== */
.charts-row { display: flex; gap: 16px; }
.trend-card { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; }
.chart-title { font-size: 15px; font-weight: 600; color: #17181C; }
.chart-period { font-size: 12px; color: #8A92A6; }
.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

.funnel-card { width: 420px; min-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.funnel-rate { font-size: 12px; font-weight: 500; color: #27AE60; }

/* ===== Bottom Row ===== */
.bottom-row { display: flex; gap: 16px; }
.tasks-card { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.orders-card { width: 420px; min-width: 420px; display: flex; flex-direction: column; gap: 16px; }

.link-text { font-size: 12px; color: #2563EB; cursor: pointer; }
.link-text:hover { text-decoration: underline; }

/* ===== Task List ===== */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: #F8F9FB; border-radius: 8px;
  transition: background 0.15s;
}
.task-item:hover { background: #F0F2F5; }
.task-text { font-size: 13px; font-weight: 500; color: #17181C; }
.task-meta { font-size: 12px; }
.task-meta.high { color: #EB5757; }
.task-meta.mid { color: #F2994A; }
.task-meta.low { color: #8A92A6; }

/* ===== Order List ===== */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: #F8F9FB; border-radius: 8px;
  transition: background 0.15s;
}
.order-item:hover { background: #F0F2F5; }
.order-customer { font-size: 13px; font-weight: 500; color: #17181C; }
.order-right { display: flex; align-items: center; gap: 10px; }
.order-amount { font-size: 13px; font-weight: 600; color: #17181C; }
.order-status { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; }
.order-status.shipped { color: #27AE60; background: rgba(39,174,96,0.1); }
.order-status.pending { color: #F2994A; background: rgba(242,153,74,0.1); }
.order-status.done { color: #27AE60; background: rgba(39,174,96,0.1); }
.order-status.processing { color: #2563EB; background: rgba(37,99,235,0.1); }

.order-footer { display: flex; align-items: center; justify-content: space-between; }
.order-summary { font-size: 12px; color: #8A92A6; }
.btn-primary {
  background: #2563EB; color: #fff;
  padding: 8px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1D4ED8; }

/* ===== Table Page ===== */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.filter-group { display: flex; gap: 8px; }
.filter-btn {
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  background: #F0F2F5; color: #5E6678;
  transition: all 0.15s;
}
.filter-btn:hover { background: #E5E7EB; }
.filter-btn.active { background: #2563EB; color: #fff; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 12px; font-weight: 600; color: #8A92A6;
  border-bottom: 1px solid #E8EAED;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: 13px; color: #17181C;
  border-bottom: 1px solid #F0F2F5;
}
.data-table tr:hover td { background: #F8F9FB; }
.data-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 500;
}
.badge.green { color: #27AE60; background: rgba(39,174,96,0.1); }
.badge.blue { color: #2563EB; background: rgba(37,99,235,0.1); }
.badge.orange { color: #F2994A; background: rgba(242,153,74,0.1); }
.badge.red { color: #EB5757; background: rgba(235,87,87,0.1); }
.badge.gray { color: #8A92A6; background: rgba(138,146,166,0.1); }

.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
}
.pagination { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #5E6678;
  background: #F0F2F5; transition: all 0.15s;
}
.page-btn:hover { background: #E5E7EB; }
.page-btn.active { background: #2563EB; color: #fff; }

/* ===== Product Grid ===== */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-card { display: flex; flex-direction: column; gap: 12px; }
.product-img {
  height: 120px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.product-name { font-size: 14px; font-weight: 600; color: #17181C; }
.product-desc { font-size: 12px; color: #8A92A6; line-height: 1.4; }
.product-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.product-price { font-size: 16px; font-weight: 700; color: #2563EB; }
.product-stock { font-size: 12px; color: #8A92A6; }

/* 价格体系：底价 + 指导价 */
.product-price-detail { display: flex; flex-direction: column; gap: 2px; }
.price-floor { font-size: 12px; color: #8A92A6; }
.price-floor::before { content: '底价 '; font-size: 11px; color: #C0C4CC; }
.price-guide { font-size: 15px; font-weight: 700; color: #2563EB; }
.price-guide::before { content: '指导价 '; font-size: 11px; color: #8A92A6; font-weight: 400; }

/* 多子型号产品 */
.product-price-multi {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 0; width: 100%;
}
.multi-badge {
  display: inline-flex; align-items: center; gap: 2px;
  background: #FEF3C7; color: #D97706; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 12px; border: 1px solid #FDE68A;
}
.multi-toggle { font-size: 11px; color: #8A92A6; }
.sub-products-panel {
  display: none; width: 100%; margin-top: 4px;
  border: 1px solid #E8EAED; border-radius: 8px; overflow: hidden;
}
.sub-products-panel.expanded { display: block; }
.sub-product-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; font-size: 12px; border-bottom: 1px solid #F3F4F6;
}
.sub-product-row:last-child { border-bottom: none; }
.sub-product-name { color: #5E6678; font-weight: 500; }
.sub-product-prices { display: flex; gap: 8px; }
.sub-floor { color: #8A92A6; font-size: 11px; }
.sub-guide { color: #2563EB; font-weight: 600; font-size: 11px; }
.sub-floor.na, .sub-guide.na { color: #C0C4CC; font-style: italic; }

/* 子型号编辑表单 */
.sub-products-edit-list {
  border: 1px solid #E8EAED; border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.sub-product-edit-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.sub-edit-name { flex: 1; font-size: 12px; color: #5E6678; }

/* ===== Pipeline ===== */
.pipeline-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pipeline-column { display: flex; flex-direction: column; gap: 12px; }
.pipeline-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.pipeline-count { font-size: 12px; opacity: 0.8; }
.pipeline-card {
  background: #F8F9FB; border-radius: 8px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  border-left: 3px solid transparent;
  transition: box-shadow 0.15s;
}
.pipeline-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.pipeline-customer { font-size: 13px; font-weight: 600; color: #17181C; }
.pipeline-amount { font-size: 15px; font-weight: 700; color: #2563EB; }
.pipeline-meta { font-size: 11px; color: #8A92A6; display: flex; gap: 8px; }

/* ===== Timeline ===== */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px; background: #E8EAED;
}
.timeline-item { display: flex; gap: 16px; padding: 0 0 24px 0; position: relative; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; min-width: 32px;
  z-index: 1; position: relative;
}
.timeline-content { flex: 1; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.timeline-title { font-size: 14px; font-weight: 600; color: #17181C; }
.timeline-time { font-size: 12px; color: #8A92A6; }
.timeline-desc { font-size: 13px; color: #5E6678; line-height: 1.5; }
.timeline-tag { display: inline-block; margin-top: 6px; }

/* ===== Followup Quote Section ===== */
.fu-quote-section {
  border: 1px solid #E8EAED; border-radius: 10px; margin: 4px 0;
  overflow: hidden;
}
.fu-quote-divider {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #F8F9FB; font-size: 13px; font-weight: 600; color: #5E6678;
}
.fu-quote-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: #2563EB; cursor: pointer; }
.fu-quote-toggle input { width: 15px; height: 15px; cursor: pointer; }
.fu-quote-fields { padding: 12px 14px; }

.fu-quote-info { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fq-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px;
}
.fq-badge em { font-style: normal; opacity: 0.7; font-size: 10px; }
.fq-badge-product { background: #EFF4FF; color: #2563EB; }
.fq-badge-price { background: #FFF7E6; color: #D48806; }
.fq-badge-pay { background: #E8F8F0; color: #27AE60; }

.fu-quote-summary {
  background: #F8F9FB; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; color: #17181C; line-height: 1.6;
}
.fq-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 8px; margin-right: 4px;
}
.fq-tag-blue { background: #EFF4FF; color: #2563EB; }
.fq-tag-orange { background: #FFF7E6; color: #D48806; }

/* ===== Settings ===== */
.settings-section { display: flex; flex-direction: column; gap: 20px; }
.settings-group { display: flex; flex-direction: column; gap: 16px; }
.settings-group-title { font-size: 15px; font-weight: 600; color: #17181C; margin-bottom: 4px; }
.form-row { display: flex; align-items: flex-start; gap: 16px; }
.form-label { width: 120px; min-width: 120px; font-size: 13px; color: #5E6678; padding-top: 8px; }
.form-input {
  flex: 1; height: 38px; padding: 0 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: #2563EB; }
.form-select {
  flex: 1; height: 38px; padding: 0 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C; background: #fff;
}
.form-textarea {
  flex: 1; min-height: 80px; padding: 10px 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C; resize: vertical;
}
.form-actions { display: flex; gap: 12px; padding-top: 8px; }
.btn-secondary {
  background: #F0F2F5; color: #5E6678;
  padding: 8px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #E5E7EB; }

/* ===== Stats Page ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-chart-card { display: flex; flex-direction: column; gap: 16px; }

/* ===== Receivables ===== */
.ar-summary-row { display: flex; gap: 16px; }
.ar-summary-card {
  flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ar-summary-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.ar-summary-icon { font-size: 20px; }
.ar-summary-label { font-size: 12px; color: #8A92A6; }
.ar-summary-value { font-size: 22px; font-weight: 700; }
.ar-summary-count { font-size: 11px; color: #8A92A6; margin-top: 2px; }

.ar-dashboard-card { display: flex; flex-direction: column; gap: 12px; }
.ar-dash-row { display: flex; gap: 24px; }
.ar-dash-item { flex: 1; }
.ar-dash-label { font-size: 12px; color: #8A92A6; margin-bottom: 4px; }
.ar-dash-value { font-size: 20px; font-weight: 700; }

.ar-payment-info {
  background: #F8F9FB; border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px;
}
.ar-payment-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #8A92A6;
}
.ar-payment-row strong { color: #17181C; font-size: 14px; }

.ar-detail { display: flex; flex-direction: column; gap: 0; }
.ar-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: 16px; border-bottom: 1px solid #E8EAED; margin-bottom: 16px;
}
.ar-detail-amounts {
  display: flex; gap: 16px; margin-bottom: 16px;
}
.ar-detail-amount-item {
  flex: 1; text-align: center; padding: 12px;
  background: #F8F9FB; border-radius: 10px;
}
.ar-detail-amount-label { font-size: 11px; color: #8A92A6; margin-bottom: 4px; }
.ar-detail-amount-value { font-size: 18px; font-weight: 700; }
.ar-progress-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.ar-progress-bar {
  flex: 1; height: 8px; background: #F0F2F5; border-radius: 4px; overflow: hidden;
}
.ar-progress-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s ease;
}
.ar-detail-meta {
  display: flex; gap: 24px; padding: 12px 16px;
  background: #F8F9FB; border-radius: 10px;
}
.ar-detail-meta > div { display: flex; flex-direction: column; gap: 2px; }
.ar-detail-meta span { font-size: 11px; color: #8A92A6; }
.ar-detail-meta strong { font-size: 13px; color: #17181C; }

.ar-customer-group { border-bottom: 1px solid #F0F2F5; }
.ar-customer-header { cursor: pointer; transition: background 0.15s; }
.ar-customer-header:hover { background: #F8F9FB; }
.ar-customer-header td { padding: 14px 12px; }
.ar-customer-detail > td { padding: 0; }
.ar-customer-detail .data-table thead th { background: #F0F2F5; font-size: 11px; padding: 8px 12px; }
.ar-customer-detail .data-table tbody td { padding: 8px 12px; font-size: 12px; }

/* ===== Overdue Alert Styles ===== */
.overdue-alert-banner {
  animation: overdueBannerSlideIn 0.3s ease-out;
}
@keyframes overdueBannerSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.overdue-level-chip {
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.overdue-level-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.overdue-days-badge {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
}
.overdue-detail-alert {
  animation: overduePulse 2s ease-in-out infinite;
}
@keyframes overduePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
  50% { box-shadow: 0 0 0 3px rgba(192,57,43,0.06); }
}
.lawyer-alert-box {
  animation: lawyerBoxSlideIn 0.3s ease-out;
}
@keyframes lawyerBoxSlideIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Mobile Elements (hidden on desktop) ===== */
.mobile-nav { display: none; }
.mobile-more-sheet { display: none; }
.mobile-search-btn { display: none; }
.mobile-search-overlay { display: none; }

/* ===== Responsive — Large Tablet (<= 1200px) ===== */
@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .funnel-card { width: 360px; min-width: 360px; }
  .orders-card { width: 360px; min-width: 360px; }
}

/* ===== Responsive — Small Tablet (<= 1024px) ===== */
@media (max-width: 1024px) {
  .sidebar { width: 64px; min-width: 64px; }
  .logo-text, .nav-item span, .nav-label, .profile-info { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .logo-area { justify-content: center; padding: 0; }
  .profile-area { justify-content: center; padding: 12px; }
  .search-bar { width: 200px; }
}

/* ===== Responsive — Mobile (<= 768px) ===== */
@media (max-width: 768px) {
  body { overflow: auto; font-size: 14px; -webkit-text-size-adjust: 100%; }
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .main { height: auto; min-height: 100vh; overflow: visible; }

  /* Hide sidebar, show bottom nav */
  .sidebar { display: none; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    height: 56px; background: #fff; border-top: 1px solid #E0E5EB;
    z-index: 8000; justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #8A92A6; font-size: 10px; cursor: pointer; flex: 1;
    transition: color 0.15s; background: none; border: none; padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-item.active { color: #2563EB; }
  .mobile-nav-item svg { width: 22px; height: 22px; }

  /* Top bar */
  .top-bar { height: 52px; min-height: 52px; padding: 0 12px; gap: 8px; }
  .page-title { font-size: 17px; }
  .search-bar { display: none; }
  .top-user-name { display: none; }
  .bell-wrap { width: 36px; height: 36px; }
  .top-avatar { width: 28px; height: 28px; font-size: 12px; }

  /* Mobile search button + overlay */
  .mobile-search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; background: #F0F2F5;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mobile-search-btn:active { background: #E5E7EB; }
  .mobile-search-btn svg { width: 18px; height: 18px; color: #5E6678; }
  .mobile-search-overlay {
    display: none; position: fixed; inset: 0; z-index: 9800;
    background: rgba(0,0,0,0.3);
  }
  .mobile-search-overlay.active { display: flex; flex-direction: column; }
  .mobile-search-bar {
    background: #fff; padding: 8px 12px;
    display: flex; align-items: center; gap: 8px;
    padding-top: calc(8px + env(safe-area-inset-top, 0));
  }
  .mobile-search-bar input {
    flex: 1; height: 38px; padding: 0 12px;
    border: 1px solid #E0E5EB; border-radius: 8px;
    font-size: 14px; background: #F8F9FB;
  }
  .mobile-search-bar input:focus { border-color: #2563EB; background: #fff; }
  .mobile-search-cancel {
    color: #2563EB; font-size: 14px; font-weight: 500;
    background: none; border: none; padding: 8px 4px; cursor: pointer;
    white-space: nowrap;
  }
  .mobile-search-results {
    flex: 1; overflow-y: auto; background: #fff;
    padding: 8px 12px 16px;
  }

  /* Content */
  .content-area { flex: 1; padding: 12px; gap: 12px; padding-bottom: 72px; overflow-y: visible; }

  /* KPI — 2 per row */
  .kpi-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px; gap: 4px; border-radius: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 12px; }
  .kpi-change-val, .kpi-change-sub { font-size: 11px; }

  /* Charts — stack */
  .charts-row { flex-direction: column; }
  .funnel-card { width: 100%; min-width: 0; }
  .card { padding: 14px; border-radius: 10px; }

  /* Bottom row — stack */
  .bottom-row { flex-direction: column; }
  .orders-card { width: 100%; min-width: 0; }

  /* Products — 2 per row */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card { padding: 12px; }
  .product-img { height: 72px; font-size: 26px; border-radius: 6px; }
  .product-name { font-size: 13px; }
  .product-desc { font-size: 11px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .product-price { font-size: 14px; }
  .product-card-actions { gap: 4px; }
  .pc-action-btn { padding: 4px 8px; font-size: 11px; }

  /* Pipeline — horizontal scroll */
  .pipeline-grid { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .pipeline-column { min-width: 260px; scroll-snap-align: start; }

  /* AR summary — 2x2 grid */
  .ar-summary-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ar-summary-card { padding: 14px; }
  .ar-summary-value { font-size: 18px; }

  /* AR dashboard row — stack */
  .ar-dash-row { flex-direction: column; gap: 12px; }
  .ar-dash-item { display: flex; align-items: center; justify-content: space-between; }
  .ar-dash-label { margin-bottom: 0; }
  .ar-dash-value { font-size: 16px; }

  /* AR detail — stack amounts */
  .ar-detail-amounts { flex-direction: row; gap: 8px; }
  .ar-detail-amount-item { padding: 8px; }
  .ar-detail-amount-value { font-size: 14px; }
  .ar-detail-meta { flex-direction: column; gap: 8px; }

  /* Stats — single column */
  .stats-grid { grid-template-columns: 1fr; }

  /* Tables → Cards */
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; }
  .data-table tr { display: flex; flex-wrap: wrap; margin-bottom: 8px; padding: 12px; background: #fff; border: 1px solid #E8EAED; border-radius: 10px; }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table td { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 0; border: none; font-size: 13px; }
  .data-table td::before { content: attr(data-label); font-weight: 600; color: #8A92A6; font-size: 11px; margin-right: 12px; flex-shrink: 0; }
  .data-table td[data-label=""]::before { display: none; }
  .data-table .row-actions { width: 100%; justify-content: flex-end; opacity: 1; padding-top: 6px; border-top: 1px solid #F0F2F5; margin-top: 4px; }

  /* Table card wrapper */
  .card[style*="padding:0"] { padding: 12px !important; }
  .card[style*="padding:0"] > div:first-child { padding: 0 4px 12px !important; }

  /* Toolbars — stack */
  .table-toolbar { flex-direction: column; gap: 10px; align-items: stretch; }
  .filter-group { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .filter-btn { white-space: nowrap; }

  /* Inline-styled toolbars (products, opportunities, followups) */
  .content-area [style*="space-between"] { flex-direction: column !important; gap: 10px; align-items: stretch !important; }
  .content-area [style*="space-between"] .filter-group { overflow-x: auto; flex-wrap: nowrap; }
  .content-area [style*="space-between"] .btn-primary { width: 100%; justify-content: center; }

  /* Settings — stack forms */
  .form-row { flex-direction: column; gap: 6px; }
  .form-label { width: auto; min-width: 0; padding-top: 0; }

  /* Modal → full screen */
  .modal-overlay { align-items: stretch; justify-content: flex-start; padding: 0; }
  .modal { width: 100vw; min-width: 100vw; max-width: 100vw; height: 100vh; min-height: 100vh; max-height: 100vh; height: 100dvh; min-height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; display: flex; flex-direction: column; }
  .modal-header { padding: 14px 16px; position: sticky; top: 0; background: #fff; z-index: 10; }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
  .modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0)); position: sticky; bottom: 0; background: #fff; z-index: 10; display: flex; gap: 10px; }
  .modal-footer button { flex: 1; justify-content: center; min-height: 44px; font-size: 14px; }
  .modal-form-row.inline { flex-direction: column !important; gap: 16px; }
  .modal-form-row.inline > .field { flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }

  /* Touch-friendly inputs */
  .field-input, .field-select, .field-textarea { min-height: 44px !important; font-size: 14px !important; }
  .field-select, .form-select { max-width: 100%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
  .form-input, .form-select { height: 44px; font-size: 14px; }

  /* Touch-friendly action icons */
  .action-icon { width: 36px; height: 36px; }
  .action-icon svg { width: 18px; height: 18px; }

  /* Pagination */
  .table-footer { flex-direction: column; gap: 8px; align-items: center; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .page-btn { width: 36px; height: 36px; font-size: 13px; }

  /* Toast */
  .toast-container { top: 60px; right: 12px; left: 12px; }
  .toast { font-size: 13px; padding: 12px 16px; }

  /* Timeline */
  .timeline-header { flex-direction: column; gap: 2px; align-items: flex-start; }
  .timeline-item { padding-bottom: 16px; }
  .timeline-desc { font-size: 13px; }
  .fu-quote-info { gap: 4px; }
  .fq-badge { font-size: 10px; padding: 2px 6px; }

  /* Mobile more sheet */
  .mobile-more-sheet { display: none; position: fixed; inset: 0; z-index: 9500; background: rgba(0,0,0,0.4); }
  .mobile-more-sheet.active { display: flex; align-items: flex-end; }
  .mobile-more-content { width: 100%; background: #fff; border-radius: 16px 16px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0)); animation: sheetSlideUp 0.25s ease; }
  @keyframes sheetSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .mobile-more-handle { width: 36px; height: 4px; background: #E0E5EB; border-radius: 2px; margin: 0 auto 16px; }
  .mobile-more-title { font-size: 14px; font-weight: 700; color: #17181C; margin-bottom: 16px; text-align: center; }
  .mobile-more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .mobile-more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; background: #F8F9FB; cursor: pointer; transition: background 0.15s; border: none; -webkit-tap-highlight-color: transparent; }
  .mobile-more-item:active { background: #E8EAED; }
  .mobile-more-item svg { width: 24px; height: 24px; color: #5E6678; }
  .mobile-more-item span { font-size: 11px; color: #5E6678; }

  /* Global search dropdown on mobile */
  .global-search-dropdown { max-height: 300px; }

  /* COA tables — horizontal scroll on mobile */
  .coa-table { font-size: 12px; }
  .coa-table th { padding: 6px 8px; }
  .coa-table td { padding: 6px 8px; }

  /* Settlement radio buttons — stack */
  .settlement-radio-group { flex-direction: column; }
  .tax-radio-group { flex-wrap: wrap; }

  /* Followup form on mobile */
  .modal-body .modal-form-row.inline .field { width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
  .modal-body .modal-form-row.inline .field[style*="flex:2"] { flex: 1 1 auto !important; width: 100% !important; }
  .modal-body .modal-form-row.inline .field[style*="flex"] { flex: 1 1 auto !important; width: 100% !important; }
  .fu-quote-divider { flex-direction: column !important; align-items: flex-start !important; gap: 10px; }
  .fu-quote-toggle { width: 100%; justify-content: space-between; }
  .fu-quote-fields { padding: 12px 0; }

  /* Customer detail page */
  .cd-summary-row { grid-template-columns: 1fr 1fr; }
  .cd-sections { grid-template-columns: 1fr; }
  .cd-header-card { padding: 16px; }
  .cd-header-top { flex-direction: column; gap: 12px; }
  .cd-header-badges { flex-wrap: wrap; }
  .cd-quick-actions { width: 100%; }
  .cd-quick-actions button { flex: 1; font-size: 12px; padding: 8px 10px; min-height: 40px; }
  .cs-detail-grid { grid-template-columns: 1fr; }
  .od-detail-info { grid-template-columns: 1fr; }
  .od-settlement-grid { grid-template-columns: 1fr 1fr; }

  /* Product sub-products panel */
  .sub-product-row { font-size: 11px; padding: 8px; }
  .sub-product-prices { gap: 4px; }

  /* Employee management */
  .emp-row { gap: 10px; padding: 10px 0; }
  .emp-avatar { width: 36px; height: 36px; font-size: 14px; }

  /* Settings sections */
  .settings-section { gap: 12px; }
  .settings-group { gap: 12px; }

  /* Overdue banner levels */
  .overdue-banner-levels { gap: 8px; }
  .overdue-level-chip { font-size: 11px; padding: 4px 8px; }

  /* Empty state */
  .empty-state { padding: 40px 16px; }
  .empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; }
  .no-data { padding: 30px 16px; }

  /* Kanban (大屏看板) mobile */
  .kanban-page { padding: 12px; border-radius: 0; min-height: calc(100vh - 52px - 56px); gap: 12px; overflow: visible; overflow-y: auto; }
  .kb-header { flex-wrap: wrap; gap: 8px; }
  .kb-header-left { width: 100%; text-align: center; }
  .kb-company { font-size: 20px; }
  .kb-subtitle { font-size: 11px; }
  .kb-clock-wrap { width: 100%; }
  .kb-clock { font-size: 32px; letter-spacing: 1px; }
  .kb-date { font-size: 12px; }
  .kb-header-right { width: 100%; justify-content: center; }
  .kb-btn { padding: 6px 12px; font-size: 12px; }
  .kb-quote-bar { padding: 10px 14px; gap: 8px; }
  .kb-quote-icon { font-size: 18px; }
  .kb-quote-text { font-size: 14px; }
  .kb-kpi-row { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .kb-kpi-row::-webkit-scrollbar { height: 4px; }
  .kb-kpi-row::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 2px; }
  .kb-kpi-card { flex: 0 0 auto; width: 42vw; min-width: 140px; max-width: 170px; padding: 12px 14px; }
  .kb-kpi-label { font-size: 12px; white-space: nowrap; }
  .kb-kpi-value { font-size: 22px; white-space: nowrap; }
  .kb-kpi-unit { font-size: 12px; }
  .kb-kpi-sub { font-size: 10px; }
  .kb-main-row { grid-template-columns: 1fr; gap: 12px; flex: none; }
  .kb-panel { overflow: visible; }
  .kb-panel-body { overflow: visible; padding: 10px 12px; }
  .kb-panel-header { padding: 10px 14px; }
  .kb-panel-title { font-size: 14px; }
  .kb-panel-body { padding: 10px 12px; }
  .kb-person-row { padding: 8px 10px; gap: 8px; }
  .kb-person-name { font-size: 13px; min-width: 80px; }
  .kb-person-avatar { width: 28px; height: 28px; font-size: 12px; }
  .kb-task-badge { font-size: 11px; padding: 3px 8px; }
  .kb-alert-item { padding: 6px 10px; font-size: 12px; }
  .kb-funnel-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kb-funnel-item { padding: 10px 8px; }
  .kb-funnel-label { font-size: 11px; }
  .kb-funnel-count { font-size: 20px; }

  /* Tech module mobile */
  .tech-tabs-bar { padding-bottom: 8px; }
  .tech-tab { padding: 6px 12px; font-size: 12px; }
  .tech-spec-grid { grid-template-columns: 1fr; }
  .tech-spec-params { grid-template-columns: 1fr; }
  .tech-doc-item { flex-wrap: wrap; }
  .tech-doc-actions { width: 100%; justify-content: flex-end; }
  .qa-header { flex-direction: column; gap: 8px; }
  .qa-meta { width: 100%; }
  .qa-card { padding: 14px 16px; }
  .tech-detail-params { grid-template-columns: 1fr 1fr; }

  /* Conversion/Workplan mobile */
  .conv-dashboard { grid-template-columns: 1fr; }
  .conv-rate-grid { grid-template-columns: 1fr 1fr; }
  .factors-grid { grid-template-columns: 1fr; }
  .stage-prob-model { gap: 6px; }
  .stage-prob-cell { min-width: 90px; padding: 10px 6px; }
  .stage-prob-icon { width: 30px; height: 30px; font-size: 15px; }
  .stage-prob-label { font-size: 12px; }
  .stage-progress-bar { flex-wrap: wrap; gap: 6px; }
  .stage-progress-cell { min-width: 80px; }
  .wp-metrics-grid { grid-template-columns: 1fr; }
  .wp-detail-metrics { grid-template-columns: 1fr; }
  .mini-factors-row { flex-wrap: wrap; }
  .conv-summary-row { gap: 10px; }
  .conv-rate-grid { gap: 10px; }
  .conv-rate-card { padding: 12px; }
  .conv-rate-value { font-size: 20px; }
  .funnel-label { min-width: 70px; font-size: 12px; }
  .funnel-row { gap: 6px; }
  .assess-radio-card { min-width: 80px; padding: 10px 6px; }
  .comp-dim-row { padding: 8px; }
  .comp-btn { font-size: 11px; padding: 4px 6px; }

  /* COA item rows mobile */
  .coa-item-row { flex-wrap: wrap; }
  .coa-item-row .field-input,
  .coa-item-row .field-select { flex: 1 1 45% !important; }

  /* ProdCOA mobile */
  .prodcoa-param-row { flex-direction: column; align-items: stretch; }
  .prodcoa-param-row .field-input,
  .prodcoa-param-row .field-select { flex: 1 1 100% !important; min-width: 0 !important; }

  /* Report detail mobile */
  .report-detail-summary { grid-template-columns: repeat(2, 1fr); }
  .trend-chart-bars { height: 140px; }
  .trend-bar-col { width: 34px; }

  /* Product category header */
  .product-category-header { gap: 8px; padding: 8px 0; }
  .pc-header-icon { font-size: 18px; }
  .pc-header-name { font-size: 14px; }

  /* Settings — backup list */
  .settings-group { gap: 12px; }

  /* Voice settings panel */
  .content-area select { font-size: 14px; min-height: 40px; }

  /* Work plan active header */
  .wp-active-header { flex-direction: column; gap: 8px; }
  .wp-active-header > div:last-child { text-align: left; }
  .wp-overall-rate { font-size: 22px; }
  .wp-metric-card { padding: 12px; }

  /* Conversion summary cards */
  .conv-summary-row > .card { min-width: 0 !important; }

  /* AR customer detail nested table */
  .ar-customer-detail .data-table thead { display: none; }
  .ar-customer-detail > td { padding: 0 !important; }

  /* Inline filter selects */
  .content-area select { max-width: 100%; }

  /* Lawyer letter form */
  .modal-body [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .modal-body [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .modal-body [style*="display:flex;gap:10px"] { flex-wrap: wrap; }

  /* Contact rows in customer form */
  .modal-body [style*="display:flex;gap:8px;align-items:center;margin-bottom:8px"] { flex-wrap: wrap; }
  .modal-body [style*="display:flex;gap:8px;align-items:center;margin-bottom:8px"] > * { flex: 1 1 45%; min-width: 120px; }

  /* Lead cards — mobile */
  .lead-card-header { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .lead-card-main { width: 100%; }
  .lead-card-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
  .lead-card-customer { font-size: 13px; }
  .mini-factors-row { flex-wrap: wrap; gap: 3px; }
  .mini-factor-bar { width: 18px; height: 16px; }
  .hard-badges-row { gap: 2px; }
  .hard-badge { font-size: 11px; padding: 1px 3px; }
  .lead-card-expanded { padding: 0 12px 14px; }
  .expanded-section-title { font-size: 12px; }
  .inline-edit-section { padding: 10px; }
  .inline-textarea { font-size: 13px; }
  .inline-pick-btn { font-size: 11px; padding: 4px 8px; }
  .comp-grid { grid-template-columns: 1fr; gap: 8px; }
  .comp-dim-row { padding: 8px; }
  .comp-pick { font-size: 10px; padding: 3px 6px; }
  .assess-factor-row { padding: 10px; flex-wrap: wrap; gap: 8px; }
  .assess-factor-info { width: 100%; }
  .assess-factor-bar-wrap { width: 60px; }
  .assess-factor-score { width: 100%; justify-content: flex-end; }
}

/* ===== Responsive — Very Small Mobile (<= 380px) ===== */
@media (max-width: 380px) {
  .kpi-row { grid-template-columns: 1fr; }
  .ar-summary-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .kb-kpi-row { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; }
  .kb-kpi-card { flex: 0 0 auto; width: 45vw; min-width: 130px; max-width: 160px; padding: 10px 12px; }
  .kb-kpi-value { font-size: 20px; }
  .conv-rate-grid { grid-template-columns: 1fr; }
  .cd-summary-row { grid-template-columns: 1fr; }
  .mobile-more-grid { grid-template-columns: repeat(3, 1fr); }
  .mobile-nav-item span { font-size: 9px; }
  .page-title { font-size: 15px; }
  .content-area { padding: 10px; gap: 10px; }
  .card { padding: 12px; }
  .kb-funnel-row { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeIn 0.25s ease; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: #8A92A6;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 560px; max-width: 90vw;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #E8EAED;
}
.modal-title { font-size: 18px; font-weight: 700; color: #17181C; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #8A92A6; transition: all 0.15s;
  background: transparent; font-size: 20px;
}
.modal-close:hover { background: #F0F2F5; color: #17181C; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #E8EAED;
}
.modal-footer .btn-primary { font-size: 13px; padding: 10px 20px; }
.modal-footer .btn-secondary { font-size: 13px; padding: 10px 20px; }

/* ===== Modal Forms ===== */
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-form-row { display: flex; flex-direction: column; gap: 6px; }
.modal-form-row.inline { flex-direction: row; gap: 16px; }
.modal-form-row.inline > .field { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px; font-weight: 500; color: #5E6678;
}
.field-label .required { color: #EB5757; }
.field-input {
  height: 40px; padding: 0 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C;
  transition: border-color 0.15s;
  background: #fff;
}
.field-input:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.field-input.error { border-color: #EB5757; }
.field-select {
  height: 40px; padding: 0 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C; background: #fff;
}
.field-textarea {
  min-height: 80px; padding: 10px 12px;
  border: 1px solid #E0E5EB; border-radius: 8px;
  font-size: 13px; color: #17181C; resize: vertical;
  font-family: inherit;
}
.field-textarea:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.field-error { font-size: 12px; color: #EB5757; }

/* ===== Action Icons in Tables ===== */
.action-icons { display: flex; gap: 4px; }
.action-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #8A92A6; transition: all 0.15s;
  background: transparent;
}
.action-icon:hover { background: #F0F2F5; color: #2563EB; }
.action-icon.delete:hover { color: #EB5757; }
.action-icon svg { width: 16px; height: 16px; }

/* ===== Product Card Actions ===== */
.product-card-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.pc-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid #E8EAED; background: #fff;
  font-size: 12px; font-weight: 500;
  color: #5E6678; white-space: nowrap;
  transition: all 0.15s; cursor: pointer;
}
.pc-action-btn:hover {
  border-color: #2563EB; color: #2563EB; background: #F5F8FF;
}
.pc-action-btn.delete:hover {
  border-color: #EB5757; color: #EB5757; background: #FEF2F2;
}
.pc-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== Confirm Dialog ===== */
.confirm-text { font-size: 14px; color: #5E6678; line-height: 1.6; }
.confirm-text strong { color: #17181C; }
.btn-danger {
  background: #EB5757; color: #fff;
  padding: 10px 20px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover { background: #D64545; }

/* ===== Toast ===== */
.toast-container {
  position: fixed; top: 80px; right: 24px;
  z-index: 10000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #17181C; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 8px;
  animation: toastSlideIn 0.25s ease;
}
.toast.success { background: #27AE60; }
.toast.error { background: #EB5757; }
.toast.warning { background: #F2994A; }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.fade-out { animation: toastFadeOut 0.3s ease forwards; }
@keyframes toastFadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ===== Table Row Actions ===== */
.data-table .row-actions { opacity: 0; transition: opacity 0.15s; }
.data-table tr:hover .row-actions { opacity: 1; }

/* ===== Stat Badge in Header ===== */
.stat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}

/* ===== Search Results Highlight ===== */
.search-highlight { background: rgba(37,99,235,0.12); border-radius: 2px; padding: 0 2px; }

/* ===== No Data ===== */
.no-data {
  text-align: center; padding: 40px 20px;
  color: #8A92A6; font-size: 14px;
}
.no-data-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.3; }

/* ===== Link Text (clickable names in lists) ===== */
.link-text {
  color: #2563EB; cursor: pointer; font-weight: 500;
  transition: color 0.15s;
}
.link-text:hover { color: #1E40AF; text-decoration: underline; }

/* ===== Global Search Dropdown ===== */
.global-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12); z-index: 200;
  max-height: 420px; overflow-y: auto; padding: 6px;
}
.gs-section { margin-bottom: 4px; }
.gs-section-title {
  font-size: 11px; font-weight: 600; color: #8A92A6;
  padding: 6px 12px 4px; text-transform: uppercase; letter-spacing: 0.3px;
}
.gs-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.gs-item:hover { background: #F3F4F6; }
.gs-item-title { font-size: 13px; font-weight: 500; color: #2D3340; }
.gs-item-sub { font-size: 11px; color: #8A92A6; }

/* ===== Customer Detail Page ===== */
.cd-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: #2563EB; cursor: pointer; font-size: 13px; font-weight: 500;
  margin-bottom: 16px; transition: color 0.15s;
}
.cd-back:hover { color: #1E40AF; }

.cd-header-card {
  padding: 24px; margin-bottom: 20px;
}
.cd-header-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.cd-header-info { flex: 1; min-width: 200px; }
.cd-header-name { font-size: 20px; font-weight: 700; color: #2D3340; margin-bottom: 8px; }
.cd-header-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #5E6678; }
.cd-header-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cd-header-note { font-size: 12px; color: #8A92A6; margin-top: 8px; padding: 6px 10px; background: #F8F9FB; border-radius: 6px; }
.cd-header-badges { display: flex; gap: 6px; flex-shrink: 0; }
.cd-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Customer Source Info ===== */
.cs-badge {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 500; padding: 2px 8px;
  border-radius: 4px; white-space: nowrap;
  background: #EFF3F8; color: #5E6678;
}
.cs-badge-referral {
  background: #FEF3C7; color: #92400E;
}
.cs-detail-card {
  padding: 16px; margin-bottom: 16px;
}
.cs-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cs-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.cs-detail-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; background: #F8F9FB; border-radius: 8px;
}
.cs-detail-label {
  font-size: 11px; color: #8A92A6; font-weight: 500;
}
.cs-detail-value {
  font-size: 13px; color: #2D3340; font-weight: 500;
}
.cs-detail-desc {
  font-size: 13px; color: #5E6678; padding: 8px 0;
}
.cs-form-divider {
  font-size: 12px; font-weight: 600; color: #2563EB;
  margin: 16px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid #E8EAED;
}
.cs-referral-fields, .cs-commission-fields {
  padding: 12px; background: #F8F9FB; border-radius: 8px; margin-top: 8px;
}

.cd-summary-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.cd-summary-card { padding: 16px; }
.cd-summary-icon { font-size: 18px; margin-bottom: 8px; }
.cd-summary-label { font-size: 12px; color: #8A92A6; margin-bottom: 4px; }
.cd-summary-value { font-size: 18px; font-weight: 700; }

.cd-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cd-section { padding: 16px; }
.cd-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cd-section .chart-title { font-size: 14px; font-weight: 600; color: #2D3340; }
.cd-list { display: flex; flex-direction: column; gap: 8px; }
.cd-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; background: #F8F9FB;
  transition: background 0.12s;
}
.cd-list-item:hover { background: #F0F4FF; }
.cd-list-dot {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.cd-list-main { flex: 1; min-width: 0; }
.cd-list-title {
  font-size: 13px; font-weight: 500; color: #2D3340;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.cd-list-sub { font-size: 11px; color: #8A92A6; }
.cd-list-right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* ===== Order Detail Modal ===== */
.od-detail { padding: 4px 0; }
.od-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid #F0F1F3; margin-bottom: 14px;
}
.od-detail-header h3 { font-size: 18px; font-weight: 700; color: #2D3340; margin: 0; }
.od-detail-info {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px;
  margin-bottom: 16px;
}
.od-info-item { display: flex; flex-direction: column; gap: 2px; }
.od-info-item span { font-size: 11px; color: #8A92A6; }
.od-info-item strong { font-size: 14px; font-weight: 500; color: #2D3340; }
.od-linked-section {
  background: #F8F9FB; border-radius: 10px; padding: 14px; margin-bottom: 12px;
}
.od-linked-title {
  font-size: 12px; font-weight: 600; color: #5E6678;
  margin-bottom: 8px; display: flex; align-items: center; gap: 4px;
}
.od-linked-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: #fff; border-radius: 6px; margin-bottom: 4px;
  font-size: 13px;
}
.od-linked-item:last-child { margin-bottom: 0; }

/* ===== Settlement Method (Order Form) ===== */
.settlement-radio-group { display: flex; gap: 10px; }
.settlement-radio {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 2px solid #E8EAED; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: #5E6678;
  transition: all 0.15s; flex: 1; justify-content: center;
}
.settlement-radio input { display: none; }
.settlement-radio.active { border-color: #2563EB; background: #EFF4FF; color: #2563EB; }
.settlement-radio .settlement-icon { font-size: 18px; }

.tax-radio-group { display: flex; gap: 8px; }
.tax-radio {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 14px; border: 2px solid #E8EAED; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: #5E6678;
  transition: all 0.15s; flex: 1; justify-content: center;
}
.tax-radio input { display: none; }
.tax-radio.active { border-color: #27AE60; background: #E8F8F0; color: #27AE60; }

.settlement-summary {
  background: #F8F9FB; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.ss-row { display: flex; justify-content: space-between; align-items: center; }
.ss-label { font-size: 13px; color: #8A92A6; }
.ss-value { font-size: 15px; font-weight: 600; color: #2D3340; }

/* Order Detail - Settlement Grid */
.od-settlement-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 16px;
}
.od-settlement-item { display: flex; flex-direction: column; gap: 2px; }
.od-settlement-item span { font-size: 11px; color: #8A92A6; }
.od-settlement-item strong { font-size: 14px; font-weight: 600; color: #2D3340; }
/* od-settlement-grid & settlement-radio-group mobile — merged into main mobile media query */
.od-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ===== Opportunity Convert Button ===== */
.opp-convert-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; background: #ECFDF5; color: #059669;
  font-size: 11px; font-weight: 600; cursor: pointer; border: none;
  transition: background 0.12s;
}
.opp-convert-btn:hover { background: #D1FAE5; }
.opp-won-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; background: #F0FDF4; color: #16A34A;
  font-size: 11px; font-weight: 600;
}

/* ===== Responsive: Customer Detail on Mobile — merged into main mobile media query ===== */

/* ===== Employee Management ===== */
.emp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #F0F1F3;
}
.emp-row:last-child { border-bottom: none; }
.emp-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 13px; font-weight: 500; color: #2D3340; }
.emp-self { color: #8A92A6; font-weight: 400; font-size: 12px; }
.emp-meta { font-size: 11px; color: #8A92A6; margin-top: 2px; }
.role-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
}

/* ===== Template Management ===== */
.template-section {
  border: 1px solid #F0F1F3; border-radius: 10px; overflow: hidden;
}
.template-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #F8F9FB;
  font-size: 13px; font-weight: 600; color: #2D3340;
}
.btn-text-sm {
  background: none; border: none; color: #2563EB;
  font-size: 12px; font-weight: 500; cursor: pointer; padding: 2px 8px;
  border-radius: 4px; transition: background 0.12s;
}
.btn-text-sm:hover { background: #F0F4FF; }
.template-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-top: 1px solid #F0F1F3;
  transition: background 0.12s;
}
.template-item:hover { background: #F8F9FB; }
.template-item-info { flex: 1; min-width: 0; }
.template-item-name { font-size: 13px; font-weight: 500; color: #2D3340; margin-bottom: 4px; }
.template-item-content { font-size: 12px; color: #8A92A6; line-height: 1.5; }

/* ===== Tech Module Styles ===== */
.tech-tabs-bar {
  display: flex; gap: 4px; padding: 0 0 16px 0;
  border-bottom: 1px solid #E8EAED; margin-bottom: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tech-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: none; border: none;
  font-size: 13px; font-weight: 500; color: #8A92A6;
  white-space: nowrap; cursor: pointer; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.15s;
}
.tech-tab:hover { color: #5E6678; background: #F8F9FB; }
.tech-tab.active { color: #7C3AED; border-bottom-color: #7C3AED; font-weight: 600; }
.tech-tab span:first-child { font-size: 15px; }

.tech-param-chip {
  display: inline-block; padding: 2px 8px; margin: 2px;
  background: #F0F4FF; color: #2563EB; border-radius: 4px;
  font-size: 11px; line-height: 1.6;
}
.tech-param-chip strong { font-weight: 600; }
.tech-param-list { display: flex; flex-wrap: wrap; gap: 2px; }

.tech-detail-params {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px; margin-top: 8px;
}
.tech-detail-param {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; background: #F8F9FB; border-radius: 8px;
}
.tech-detail-param span { font-size: 11px; color: #8A92A6; }
.tech-detail-param strong { font-size: 14px; color: #2D3340; }

.param-pair {
  display: flex; gap: 8px; align-items: center;
}

.badge.purple { background: #EDE9FE; color: #7C3AED; }

/* Tech Specs Grid */
.tech-spec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.tech-spec-card {
  padding: 20px;
}
.tech-spec-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.tech-spec-product { font-size: 15px; font-weight: 600; color: #17181C; }
.tech-spec-version { font-size: 12px; color: #8A92A6; margin-top: 2px; }
.tech-spec-params {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.tech-spec-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; background: #F8F9FB; border-radius: 6px;
}
.tech-spec-item span { font-size: 11px; color: #8A92A6; }
.tech-spec-item strong { font-size: 13px; color: #2D3340; }
.tech-spec-usage {
  padding: 10px 12px; background: #EFF6FF; border-radius: 8px;
  margin-bottom: 12px;
}
.tech-spec-label { font-size: 11px; color: #8A92A6; display: block; margin-bottom: 4px; }
.tech-spec-usage div { font-size: 13px; color: #2563EB; line-height: 1.5; }
.tech-spec-history { margin-top: 8px; }
.tech-spec-timeline { display: flex; flex-direction: column; gap: 6px; }
.tech-spec-timeline-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Q&A Pool */
.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa-card {
  background: #fff; border: 1px solid #E8EAED; border-radius: 12px;
  padding: 16px 20px; transition: box-shadow 0.15s;
}
.qa-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.qa-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.qa-question { display: flex; gap: 8px; align-items: flex-start; flex: 1; }
.qa-q-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
  background: #2563EB; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.qa-q-text { font-size: 14px; font-weight: 600; color: #17181C; line-height: 1.5; }
.qa-meta { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.qa-answer { display: flex; gap: 8px; align-items: flex-start; }
.qa-a-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
  background: #27AE60; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.qa-a-text { font-size: 13px; color: #5E6678; line-height: 1.7; flex: 1; }
.qa-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.qa-tag {
  padding: 2px 8px; background: #F3F4F6; color: #5E6678;
  border-radius: 4px; font-size: 11px;
}
.qa-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #F0F1F3;
}

/* Tech Docs */
.tech-doc-group { margin-bottom: 16px; }
.tech-doc-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid #E8EAED;
}
.tech-doc-group-name { font-size: 14px; font-weight: 600; color: #17181C; }
.tech-doc-list { padding: 8px 12px; }
.tech-doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid #F0F1F3;
  transition: background 0.12s;
}
.tech-doc-item:last-child { border-bottom: none; }
.tech-doc-item:hover { background: #F8F9FB; }
.tech-doc-icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.tech-doc-info { flex: 1; min-width: 0; }
.tech-doc-name { font-size: 13px; font-weight: 500; color: #2D3340; }
.tech-doc-meta { font-size: 11px; color: #8A92A6; margin-top: 2px; }
.tech-doc-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.tech-doc-download {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 12px;
}
.tech-doc-download svg { width: 14px; height: 14px; }

/* Product Card Tech Doc Badges */
.tech-doc-row {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid #F0F1F3;
}
.tech-doc-badge {
  padding: 2px 8px; border-radius: 4px; font-size: 10px;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
  border: none;
}
.tech-doc-badge:hover { opacity: 0.8; }
.tech-doc-mini-row { display: flex; gap: 4px; flex-wrap: wrap; }
.tech-doc-mini {
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 600; cursor: pointer; border: 1px solid;
  transition: all 0.15s;
}
.tech-doc-mini:hover { transform: translateY(-1px); }

/* Tech module mobile — merged into main mobile media query */

/* ===== 线索成交意向评估系统 ===== */
.conv-summary-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.conv-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.conv-funnel-card { padding: 20px; }
.funnel-container { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-label { font-size: 13px; color: #5E6678; min-width: 90px; text-align: right; }
.funnel-bar-wrap { flex: 1; height: 32px; background: #F8F9FB; border-radius: 6px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; transition: width 0.5s ease; }
.funnel-count { color: #fff; font-weight: 600; font-size: 13px; }
.funnel-drop { font-size: 11px; color: #5E6678; min-width: 50px; }
.funnel-total { text-align: center; font-size: 12px; color: #8A92A6; margin-top: 12px; padding-top: 10px; border-top: 1px solid #E8EAED; }

/* 阶段成交概率模型 */
.stage-prob-model { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding-bottom: 6px; }
.stage-prob-cell {
  flex: 1; min-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border: 2px solid #E8EAED; border-radius: 10px; background: #F8F9FB; transition: all 0.3s ease;
}
.stage-prob-cell.active { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; }
.stage-prob-cell.active:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stage-prob-cell.selected { background: #fff; box-shadow: 0 0 0 3px #2563EB; }
.stage-prob-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stage-prob-info { text-align: center; }
.stage-prob-label { font-size: 13px; font-weight: 600; }
.stage-prob-range { font-size: 11px; color: #8A92A6; margin-top: 2px; }
.stage-prob-count { font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }

/* 阶段进度条（详情弹窗） */
.stage-progress-bar { display: flex; gap: 4px; }
.stage-progress-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border-radius: 8px; border: 2px solid transparent; transition: all 0.3s ease;
}

/* 概率进度条（列表中） */
.prob-bar-wrap { height: 8px; background: #E8EAED; border-radius: 4px; overflow: hidden; }
.prob-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.prob-badge { font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 20px; }

.grade-bars-container { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.funnel-row { cursor: pointer; transition: background 0.2s; border-radius: 4px; padding: 4px 6px; }
.funnel-row:hover { background: #F8F9FB; }
.funnel-row.selected { background: #2563EB08; }

.grade-bar-row { display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background 0.2s; border-radius: 6px; padding: 4px 6px; }
.grade-bar-row:hover { background: #F8F9FB; }
.grade-bar-row.selected { background: #2563EB08; }
.grade-bar-icon { font-size: 14px; }
.grade-bar-label { font-size: 13px; min-width: 50px; line-height: 1.2; }
.grade-bar-track { flex: 1; height: 20px; background: #F8F9FB; border-radius: 4px; overflow: hidden; }
.grade-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.grade-bar-count { font-size: 13px; font-weight: 600; min-width: 24px; text-align: right; }

.factors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.factor-card { background: #F8F9FB; border-radius: 8px; padding: 12px; }
.factor-card-hard { background: #FAF5FF; border-left: 3px solid #7C3AED; }
.factor-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.factor-icon { font-size: 14px; }
.factor-label { font-size: 13px; font-weight: 600; flex: 1; }
.factor-weight { font-size: 11px; color: #2563EB; background: #DBEAFE; padding: 2px 6px; border-radius: 4px; }
.factor-desc { font-size: 11px; color: #8A92A6; line-height: 1.4; }

.score-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid; font-size: 14px; }

.mini-factors-row { display: flex; gap: 4px; }
.mini-factor { display: flex; align-items: center; gap: 3px; }
.mini-factor-label { font-size: 10px; }
.mini-factor-bar { width: 24px; height: 20px; background: #E8EAED; border-radius: 2px; overflow: hidden; }
.mini-factor-fill { height: 100%; border-radius: 2px; }

.risk-alert-card { border-left: 4px solid #EB5757; margin-bottom: 20px; padding: 16px 20px; }
.risk-alert-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.risk-alert-desc { font-size: 12px; color: #8A92A6; margin-bottom: 12px; }
.risk-alert-list { display: flex; flex-direction: column; gap: 8px; }
.risk-alert-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #FEF2F2; border-radius: 8px; transition: background 0.2s; }
.risk-alert-item:hover { background: #FEE2E2; }

.assess-detail { padding: 4px 0; }
.assess-factors-list { display: flex; flex-direction: column; gap: 10px; }
.assess-factor-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #F8F9FB; border-radius: 8px; }
.assess-factor-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.assess-factor-icon { font-size: 18px; }
.assess-factor-score { display: flex; align-items: center; gap: 8px; }
.assess-factor-bar-wrap { width: 100px; height: 6px; background: #E8EAED; border-radius: 3px; overflow: hidden; }
.assess-factor-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.assess-factor-hard { background: #FAF5FF; border-left: 3px solid #7C3AED; }

/* 硬性标准徽章（列表行） */
.hard-badges-row { display: flex; gap: 3px; }
.hard-badge { font-size: 12px; padding: 2px 4px; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.hard-badge.filled { background: #7C3AED15; }
.hard-badge.auto { background: #3B82F615; }
.hard-badge.empty { background: #F8F9FB; opacity: 0.5; filter: grayscale(1); }
.hard-badge:hover { transform: scale(1.2); }

/* 评估详情 — 可编辑区域 */
.assess-edit-section { background: #F8F9FB; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.assess-edit-header { display: flex; align-items: center; gap: 8px; }
.assess-radio-card {
  flex: 1; min-width: 100px; padding: 12px; border: 2px solid #E8EAED; border-radius: 10px;
  background: #fff; cursor: pointer; transition: all 0.2s; text-align: center;
}
.assess-radio-card:hover { border-color: #2563EB; box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.assess-radio-card.selected { border-color: #2563EB; background: #2563EB08; box-shadow: 0 0 0 2px #2563EB; }

/* 竞争分析维度行 */
.comp-dim-row { background: #fff; padding: 12px; border-radius: 8px; }
.comp-btn {
  padding: 5px 10px; border: 1px solid #E8EAED; border-radius: 6px; background: #fff;
  font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.comp-btn:hover { border-color: #2563EB; }

/* ===== 线索卡片列表（内联展开式） ===== */
.lead-cards-list { display: flex; flex-direction: column; gap: 10px; }
.lead-card {
  background: #fff; border: 1px solid #E8EAED; border-radius: 10px; overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.lead-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.lead-card.expanded { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #D1D5DB; }
.lead-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; cursor: pointer; gap: 12px; transition: background 0.15s;
}
.lead-card-header:hover { background: #F9FAFB; }
.lead-card-main { flex: 1; min-width: 0; }
.lead-card-customer { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lead-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.lead-card-expanded { padding: 0 16px 16px; border-top: 1px solid #F0F1F3; }
.expanded-section { margin-top: 14px; }
.expanded-section-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: #2D3748; }

/* 内联编辑区 */
.inline-edit-section { background: #F8F9FB; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.inline-edit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.inline-textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #E8EAED; border-radius: 6px;
  font-size: 13px; resize: vertical; font-family: inherit; background: #fff;
}
.inline-textarea:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 2px #2563EB15; }

.inline-btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.inline-pick-btn {
  padding: 5px 10px; border: 1px solid #E8EAED; border-radius: 6px; background: #fff;
  font-size: 12px; cursor: pointer; transition: all 0.15s; color: #5E6678;
}
.inline-pick-btn:hover { border-color: #2563EB; }
.inline-pick-btn.selected { border-color: #2563EB; background: #2563EB15; color: #2563EB; font-weight: 600; }

/* 竞争分析网格 */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp-dim-row { background: #fff; padding: 10px; border-radius: 6px; }
.comp-dim-label { font-size: 12px; font-weight: 500; margin-bottom: 6px; color: #2D3748; }
.comp-pick { font-size: 11px; padding: 4px 8px; }

/* ===== 工作计划表 ===== */
.wp-active-card { padding: 20px; }
.wp-active-header { display: flex; justify-content: space-between; align-items: flex-start; }
.wp-overall-rate { font-size: 28px; font-weight: 700; }
.wp-metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.wp-metric-card { background: #F8F9FB; border-radius: 8px; padding: 14px; }
.wp-metric-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.wp-metric-values { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.wp-metric-bar-wrap { height: 6px; background: #E8EAED; border-radius: 3px; overflow: hidden; }
.wp-metric-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.wp-metric-rate { font-size: 13px; font-weight: 600; margin-top: 4px; }

.wp-mini-bar-wrap { width: 80px; height: 6px; background: #E8EAED; border-radius: 3px; overflow: hidden; }
.wp-mini-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

.wp-detail { padding: 4px 0; }
.wp-detail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wp-detail-metric { background: #F8F9FB; border-radius: 8px; padding: 14px; }

/* Conversion/Workplan mobile — merged into main mobile media query */

/* ===== Product Batches & COA ===== */
.coa-item-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
}
.coa-item-row .field-input,
.coa-item-row .field-select {
  padding: 6px 8px; font-size: 13px; min-height: 34px;
}
.coa-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.coa-table th {
  background: #F9FAFB; padding: 8px 12px; text-align: left;
  font-weight: 600; color: #5E6678; font-size: 12px;
  border-bottom: 2px solid #E8EAED;
}
.coa-table td {
  padding: 8px 12px; border-bottom: 1px solid #F0F1F3;
}
.coa-table tbody tr:hover { background: #F9FAFB; }

/* COA mobile — merged into main mobile media query */

/* ===== Internal Production COA Module ===== */
.prodcoa-param-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.prodcoa-param-row .field-input,
.prodcoa-param-row .field-select {
  padding: 6px 8px; font-size: 13px;
}
.badge.red { background: #FEE2E2; color: #DC2626; }
.badge.gray { background: #F3F4F6; color: #6B7280; }

/* ProdCOA mobile — merged into main mobile media query */

/* ===== Product Category Section (大类分组视图) ===== */
.product-category-section {
  margin-bottom: 24px;
}
.product-category-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 10px 0;
}
.pc-header-icon {
  font-size: 22px;
}
.pc-header-name {
  font-size: 16px; font-weight: 700; color: #2D3436;
}
.pc-header-count {
  font-size: 13px; color: #8A92A6; font-weight: 500;
  background: #F3F4F6; padding: 2px 10px; border-radius: 10px;
}
.pc-header-line {
  flex: 1; height: 1px; background: linear-gradient(90deg, #E8EAED, transparent);
}

/* ===== Report Detail Modals ===== */
.kpi-card { transition: transform .15s, box-shadow .15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.12); }
.stat-chart-card { transition: transform .15s, box-shadow .15s; }
.stat-chart-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.12); }

.report-detail-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
  margin-bottom: 20px;
}
.rds-card {
  background: #F8FAFF; border: 1px solid #E8EDF5; border-radius: 10px;
  padding: 14px; text-align: center;
}
.rds-label { font-size: 12px; color: #8A92A6; margin-bottom: 6px; }
.rds-value { font-size: 18px; font-weight: 700; color: #2563EB; }

.report-detail-section { margin-bottom: 20px; }
.report-detail-title {
  font-size: 14px; font-weight: 600; color: #2D3340;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.report-detail-title::before {
  content: ''; width: 4px; height: 14px; background: #2563EB; border-radius: 2px;
}

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  background: #F8FAFF; border-radius: 8px; padding: 10px 12px;
}
.rank-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #2563EB; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rank-item:nth-child(1) .rank-num { background: #F59E0B; }
.rank-item:nth-child(2) .rank-num { background: #64748B; }
.rank-item:nth-child(3) .rank-num { background: #B45309; }
.rank-name { flex: 1; font-size: 13px; color: #2D3340; }
.rank-val { font-size: 13px; font-weight: 600; color: #2563EB; }

.bar-bg { width: 100%; height: 8px; background: #E8EDF5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2563EB, #60A5FA); border-radius: 4px; }

.trend-chart-bars {
  position: relative; height: 160px; background: #F8FAFF; border-radius: 10px;
  margin-bottom: 16px; border: 1px solid #E8EDF5;
}
.trend-bar-col {
  position: absolute; bottom: 30px; width: 44px;
  background: linear-gradient(180deg, #2563EB, #60A5FA); border-radius: 4px 4px 0 0;
  transition: height .3s ease;
}
.trend-bar-val {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: #2563EB; font-weight: 600; white-space: nowrap;
}
.trend-bar-label {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #8A92A6;
}

/* Report detail mobile — merged into main mobile media query */

/* ===== Kanban (大屏看板) ===== */
.kanban-page {
  min-height: calc(100vh - 120px);
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  border-radius: 16px;
  padding: 24px;
  color: #F1F5F9;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.kb-header-left { flex-shrink: 0; }
.kb-company {
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, #60A5FA, #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kb-subtitle { font-size: 13px; color: #94A3B8; margin-top: 2px; }
.kb-clock-wrap { text-align: center; flex: 1; }
.kb-clock {
  font-size: 48px; font-weight: 700; color: #F1F5F9;
  font-variant-numeric: tabular-nums; letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
}
.kb-date { font-size: 15px; color: #94A3B8; margin-top: 4px; }
.kb-header-right { display: flex; gap: 8px; flex-shrink: 0; }
.kb-btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid #334155;
  background: rgba(30, 41, 59, 0.8); color: #E2E8F0;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.kb-btn:hover { background: #334155; border-color: #475569; }

.kb-quote-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.kb-quote-icon { font-size: 22px; }
.kb-quote-text {
  font-size: 18px; font-weight: 600; color: #FBBF24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.kb-kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.kb-kpi-card {
  background: rgba(30, 41, 59, 0.6); border-radius: 12px;
  padding: 16px 20px; backdrop-filter: blur(10px);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
.kb-kpi-label { font-size: 13px; color: #94A3B8; margin-bottom: 6px; }
.kb-kpi-value { font-size: 32px; font-weight: 700; line-height: 1.2; }
.kb-kpi-unit { font-size: 14px; font-weight: 400; margin-left: 4px; color: #94A3B8; }
.kb-kpi-sub { font-size: 11px; margin-top: 4px; }

.kb-main-row {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; flex: 1; min-height: 0;
}
.kb-panel {
  background: rgba(30, 41, 59, 0.5); border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5); overflow: hidden;
  display: flex; flex-direction: column;
}
.kb-panel-header {
  padding: 12px 20px; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 23, 42, 0.4);
}
.kb-panel-icon { font-size: 20px; }
.kb-panel-title { font-size: 16px; font-weight: 600; color: #F1F5F9; }
.kb-panel-body { padding: 12px 16px; overflow-y: auto; flex: 1; }

.kb-person-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 6px;
  background: rgba(51, 65, 85, 0.3); transition: background 0.2s;
}
.kb-person-row:hover { background: rgba(51, 65, 85, 0.5); }
.kb-person-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #F1F5F9; min-width: 100px;
}
.kb-person-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #2563EB, #60A5FA);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.kb-person-tasks { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-task-badge {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
}

.kb-alert-section { margin-bottom: 14px; }
.kb-alert-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kb-alert-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 4px;
  background: rgba(51, 65, 85, 0.3); font-size: 13px;
}
.kb-alert-customer { flex: 1; color: #E2E8F0; }
.kb-alert-amount { font-weight: 600; color: #FBBF24; }
.kb-alert-person { font-size: 12px; color: #94A3B8; }
.kb-alert-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: rgba(245, 158, 11, 0.2); color: #FBBF24; }

.kb-funnel-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.kb-funnel-item {
  background: rgba(30, 41, 59, 0.5); border-radius: 10px;
  padding: 12px; text-align: center; border: 1px solid rgba(51, 65, 85, 0.5);
}
.kb-funnel-label { font-size: 12px; color: #94A3B8; margin-bottom: 4px; }
.kb-funnel-count { font-size: 24px; font-weight: 700; }

.kb-empty {
  text-align: center; padding: 30px 20px; color: #64748B; font-size: 14px;
}

/* ===== Layout Density (Super Admin) ===== */
body.density-compact .card { padding: 12px !important; }
body.density-compact .settings-group { padding: 0 !important; }
body.density-compact .data-table th,
body.density-compact .data-table td { padding: 6px 10px !important; font-size: 12px !important; }
body.density-compact .nav-item { padding: 8px 16px !important; }
body.density-compact .page-content { gap: 10px !important; }
body.density-compact .form-row { margin-bottom: 10px !important; }
body.density-compact .kpi-card { padding: 12px !important; }
body.density-compact .kpi-value { font-size: 24px !important; }

body.density-spacious .card { padding: 28px !important; }
body.density-spacious .settings-group { padding: 4px 0 !important; }
body.density-spacious .data-table th,
body.density-spacious .data-table td { padding: 14px 18px !important; }
body.density-spacious .nav-item { padding: 14px 18px !important; }
body.density-spacious .page-content { gap: 20px !important; }
body.density-spacious .form-row { margin-bottom: 20px !important; }
body.density-spacious .kpi-card { padding: 24px !important; }
body.density-spacious .kpi-value { font-size: 32px !important; }

/* Kanban responsive — merged into main mobile media query above */
