/* 布局骨架 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); background: var(--color-bg); color: var(--color-text); font-size: 14px; }

#app {width:100%; display: flex; height: 100vh; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px; min-width: 220px; height: 100vh;
  background: #1F2937; color: #fff;
  display: flex; flex-direction: column;
  transition: width 0.25s, min-width 0.25s;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; min-width: 64px; }
.sidebar-logo {
  height: 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; font-size: 18px; font-weight: 700;
  white-space: nowrap; color: var(--color-primary);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo .logo-icon { font-size: 24px; flex-shrink: 0; }
.sidebar.collapsed .sidebar-logo { padding: 0 20px; justify-content: center; }
.sidebar.collapsed .logo-text { display: none; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.menu-group-title {
  padding: 12px 20px 6px; font-size: 11px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 1px;
  white-space: nowrap;
}
.sidebar.collapsed .menu-group-title { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer; font-size: 14px;
  color: var(--el-menu-text-color); transition: all 0.15s;
  white-space: nowrap; border-left: 3px solid transparent;
}
.menu-item:hover { background: var(--el-menu-hover-bg-color); color: #E5E7EB; }
.menu-item.active { color: var(--el-menu-active-color); background: rgba(0,184,169,0.12); border-left-color: var(--el-menu-active-color); }
.menu-item .mi-icon { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar.collapsed .menu-item { padding: 10px 0; justify-content: center; }
.sidebar.collapsed .mi-text { display: none; }
.menu-item .mi-badge {
  margin-left: auto; background: var(--color-danger); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
}
.sidebar.collapsed .mi-badge { display: none; }

.sidebar-toggle {
  padding: 12px; text-align: center; cursor: pointer;
  color: #6B7280; font-size: 16px; border-top: 1px solid rgba(255,255,255,0.06);
  transition: color 0.15s;
}
.sidebar-toggle:hover { color: #E5E7EB; }

/* ===== Header ===== */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.header {
  height: 56px; background: var(--color-white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: var(--shadow-sm); z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb { font-size: 14px; color: var(--color-text-secondary); }
.breadcrumb span { color: var(--color-text); font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 20px; font-size: 13px; color: var(--color-text-secondary); }

/* ===== 内容区 ===== */
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.page-section { background: var(--color-white); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.page-section:last-child { margin-bottom: 0; }
.section-title { font-size: 16px; font-weight: 600; color: var(--color-text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ===== KPI 卡片 ===== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--color-white); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm); display: flex;
  align-items: center; gap: 16px; transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.kpi-info { flex: 1; }
.kpi-num { font-size: 28px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.kpi-label { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }
.kpi-sub { font-size: 11px; color: var(--color-text-disabled); margin-top: 4px; }

/* ===== 图表容器 ===== */
.chart-box { width: 100%; height: 320px; }

/* ===== 表格工具栏 ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; }

/* ===== 状态标签（设计规范） ===== */
.status-tag { display: inline-block; padding: 2px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; }
.status-tag.pending { background: #FEF3C7; color: #B45309; }
.status-tag.follow { background: #DBEAFE; color: #2563EB; }
.status-tag.signed { background: #DCFCE7; color: #16A34A; }
.status-tag.lost { background: #FEE2E2; color: #DC2626; }
.status-tag.design { background: #DBEAFE; color: #2563EB; }
.status-tag.talk { background: #FEF3C7; color: #B45309; }
.status-tag.sign { background: #F3E8FF; color: #7C3AED; }
.status-tag.done { background: #DCFCE7; color: #16A34A; }

/* ===== 跟进类型图标 ===== */
.follow-type { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.follow-type.call { color: #3B82F6; } .follow-type.visit { color: #22C55E; }
.follow-type.note { color: #6B7280; } .follow-type.sign { color: #F59E0B; }

/* ===== 进度条 ===== */
.progress-bar { height: 6px; background: var(--color-bg); border-radius: 3px; overflow: hidden; min-width: 60px; }
.progress-bar .fill { height: 100%; border-radius: 3px; background: var(--gradient-primary); transition: width 0.4s; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 40px 0; color: var(--color-text-disabled); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar .logo-text, .sidebar .mi-text, .sidebar .menu-group-title, .sidebar .mi-badge { display: none; }
  .kpi-row { grid-template-columns: 1fr; }
}

/* ===== 登录页 ===== */
.login-wrapper {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1e3a3a 50%, #004d4a 100%);
  position: relative; overflow: hidden;
}
.login-wrapper::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(0,184,169,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(0,212,195,0.1) 0%, transparent 50%);
  animation: loginFloat 20s ease-in-out infinite;
}
@keyframes loginFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 20px); }
}
.login-card {
  width: 400px; max-width: 90vw;
  background: rgba(255,255,255,0.98);
  border-radius: 16px; padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,184,169,0.1);
  position: relative; z-index: 1;
  backdrop-filter: blur(10px);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-title {
  font-size: 24px; font-weight: 700; color: #1F2937;
  margin-bottom: 6px; letter-spacing: 1px;
}
.login-subtitle { font-size: 13px; color: #6B7280; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 8px; }
.login-label { font-size: 13px; font-weight: 600; color: #374151; }
.login-error {
  background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA;
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.login-hint {
  text-align: center; font-size: 12px; color: #9CA3AF;
  margin-top: 16px; padding: 8px; background: #F3F4F6;
  border-radius: 6px;
}
.login-footer {
  text-align: center; font-size: 12px; color: #9CA3AF;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid #E5E7EB;
}
.logout-btn { transition: opacity 0.2s; }
.logout-btn:hover { opacity: 0.8; text-decoration: underline; }
.header-right { gap: 16px; }
