/* =====================================================
   Fooshun Desk｜丰顺出海工单系统 - 全局样式 v2.2
   企业级出海客户线索与工单管理平台
   主色调：深蓝 #1e3a5f / 科技蓝 #2563eb
   ===================================================== */

:root {
  --sidebar-w: 240px;
  --header-h: 56px;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-sidebar-bg: #0f1c2e;
  --color-sidebar-border: rgba(255,255,255,.06);
  --color-sidebar-hover: rgba(255,255,255,.07);
  --color-sidebar-active: rgba(37,99,235,.25);
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-bg: #f1f5f9;
  --color-card: #ffffff;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif; background: var(--color-bg); color: var(--color-text); font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }

/* =====================================================
   布局
   ===================================================== */
.fd-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--color-sidebar-bg);
  display: flex; flex-direction: column; z-index: 100;
  overflow: hidden;
}
.fd-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
}
.fd-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h); background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: var(--shadow);
}
.fd-content { flex: 1; padding: 24px; }

/* =====================================================
   侧边栏
   ===================================================== */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--color-sidebar-border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 38px; height: 38px; border-radius: 8px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar-brand-sub { color: rgba(255,255,255,.4); font-size: 11px; }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 8px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.nav-group-label {
  color: rgba(255,255,255,.3); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 12px 10px 4px; margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,.65);
  transition: all .15s; font-size: 13.5px; position: relative; cursor: pointer;
}
.nav-item:hover { background: var(--color-sidebar-hover); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--color-sidebar-active); color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 2px; background: var(--color-primary);
}
.nav-icon { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 100px;
  background: #ef4444; color: #fff; text-transform: uppercase; letter-spacing: .3px;
}

.sidebar-footer {
  border-top: 1px solid var(--color-sidebar-border); padding: 12px 8px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.sidebar-user:hover { background: var(--color-sidebar-hover); }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.sidebar-user-name { color: rgba(255,255,255,.9); font-size: 13px; font-weight: 500; }
.sidebar-user-role { color: rgba(255,255,255,.4); font-size: 11px; }
.sidebar-user-more { color: rgba(255,255,255,.3); font-size: 11px; margin-left: auto; }

/* =====================================================
   顶栏
   ===================================================== */
.page-title { font-size: 17px; font-weight: 600; color: var(--color-text); }
.fd-header-right { display: flex; align-items: center; gap: 12px; }
.hdr-btn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); transition: all .15s; }
.hdr-btn:hover { background: var(--color-bg); color: var(--color-text); }
.hdr-divider { width: 1px; height: 20px; background: var(--color-border); }
.hdr-time { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* =====================================================
   按钮
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 7px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-ghost { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-bg); }
.btn-danger { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #f0fdf4; color: var(--color-success); border: 1px solid #bbf7d0; }
.btn-success:hover { background: #dcfce7; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 6px 8px; }
.w-full { width: 100%; }

/* =====================================================
   卡片
   ===================================================== */
.card {
  background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--color-text); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--color-border); background: #fafafa; }

/* 统计卡 */
.stat-card {
  background: var(--color-card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.stat-card-value { font-size: 26px; font-weight: 700; color: var(--color-text); line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.stat-card-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 8px; }
.stat-card-trend { font-size: 11px; margin-top: 6px; }
.trend-up { color: var(--color-success); }
.trend-down { color: var(--color-danger); }

/* =====================================================
   P1-3 横向数据卡片网格（仪表盘 + 进粉计数器统一标准）
   ===================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.stats-grid.stats-grid-8 {
  /* 8 卡片网格：4列×2行 自动换行 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-grid.stats-grid-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid.stats-grid-8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .stats-grid,
  .stats-grid.stats-grid-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .stats-grid,
  .stats-grid.stats-grid-8 { grid-template-columns: 1fr; }
}

/* .stats-grid 内部 .stat-card 的横向布局（图标在左，数值在右）*/
.stats-grid .stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  min-height: 92px;
}
.stats-grid .stat-card .stat-icon {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 0;
}
.stats-grid .stat-card .stat-body { flex: 1; min-width: 0; }
.stats-grid .stat-card .stat-label {
  font-size: 12.5px; color: var(--color-text-muted); margin: 0 0 4px;
  letter-spacing: .2px; font-weight: 500;
}
.stats-grid .stat-card .stat-value {
  font-size: 22px; font-weight: 700; color: var(--color-text);
  line-height: 1.1; letter-spacing: -.3px;
}
.stats-grid .stat-card .stat-sub {
  font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stats-grid .stat-card .stat-loading {
  display: flex; justify-content: center; align-items: center; width: 100%;
}

/* =====================================================
   表格
   ===================================================== */
.table-wrap { overflow-x: auto; }
table.fd-table { width: 100%; border-collapse: collapse; }
.fd-table th {
  padding: 11px 16px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .4px;
  background: #f8fafc; border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.fd-table td {
  padding: 13px 16px; border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px; color: var(--color-text); vertical-align: middle;
}
.fd-table tr:last-child td { border-bottom: none; }
.fd-table tbody tr:hover td { background: #f8fafc; }
.td-primary { font-weight: 500; color: var(--color-text); }
.td-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: var(--color-text-muted); }
.td-muted { font-size: 12px; color: var(--color-text-muted); }

/* 空状态 */
.empty-state { text-align: center; padding: 56px 24px; color: var(--color-text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: 14px; }

/* =====================================================
   Badge 标签
   ===================================================== */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 100px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-muted    { background: #f1f5f9; color: #64748b; }
.badge-blue     { background: #eff6ff; color: #2563eb; }
.badge-purple   { background: #f5f3ff; color: #6d28d9; }
.badge-gold     { background: #fefce8; color: #854d0e; }

/* =====================================================
   表单
   ===================================================== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: 8px; font-size: 13.5px; font-family: inherit;
  background: #fff; color: var(--color-text); transition: all .15s; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.form-textarea { min-height: 80px; resize: vertical; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 13px; pointer-events: none; }
.input-icon-wrap .form-input { padding-left: 36px; }
.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; padding: 4px; }
.pwd-toggle:hover { color: var(--color-text-muted); }
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.col-span-2 { grid-column: span 2; }

/* =====================================================
   工具栏
   ===================================================== */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--color-border);
}
.toolbar-search {
  position: relative; flex-shrink: 0;
}
.toolbar-search .form-input { padding-left: 32px; width: 220px; }
.toolbar-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 12px; pointer-events: none; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* =====================================================
   分页
   ===================================================== */
.pagination { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 13px;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  transition: all .15s; min-width: 32px; text-align: center;
}
.pg-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--color-text); }
.pg-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pg-btn.disabled { opacity: .4; cursor: default; }
.pagination-info { font-size: 12px; color: var(--color-text-muted); }

/* =====================================================
   Modal
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,28,46,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .15s ease;
}
.modal-box {
  background: var(--color-card); border-radius: 14px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
.max-w-sm  { max-width: 400px; }
.max-w-xl  { max-width: 560px; }
.max-w-3xl { max-width: 760px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--color-border);
  font-size: 16px; font-weight: 600; color: var(--color-text);
}
.modal-close { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); transition: all .15s; font-size: 12px; }
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border); background: #f8fafc; border-radius: 0 0 14px 14px; display: flex; justify-content: flex-end; gap: 10px; }

/* =====================================================
   Toast
   ===================================================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px;
  animation: toastIn .3s cubic-bezier(.175,.885,.32,1.275) both;
  pointer-events: auto;
}
.toast-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.toast-success { background: #fff; border-left: 3px solid var(--color-success); color: var(--color-text); }
.toast-success .toast-icon { background: #dcfce7; color: var(--color-success); }
.toast-error   { background: #fff; border-left: 3px solid var(--color-danger); color: var(--color-text); }
.toast-error   .toast-icon { background: #fee2e2; color: var(--color-danger); }
.toast-warning { background: #fff; border-left: 3px solid var(--color-warning); color: var(--color-text); }
.toast-warning .toast-icon { background: #fef3c7; color: var(--color-warning); }
.toast-info    { background: #fff; border-left: 3px solid var(--color-primary); color: var(--color-text); }
.toast-info    .toast-icon { background: var(--color-primary-light); color: var(--color-primary); }
.toast-out { animation: toastOut .3s ease forwards; }

/* =====================================================
   登录页
   ===================================================== */
.login-bg {
  min-height: 100vh; background: #0a1628;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-bg-circles { position: absolute; inset: 0; pointer-events: none; }
.login-circle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.15), transparent);
}
.c1 { width: 500px; height: 500px; top: -150px; left: -150px; }
.c2 { width: 400px; height: 400px; bottom: -100px; right: 20%; }
.c3 { width: 300px; height: 300px; top: 40%; left: 40%; }
.login-wrap { display: flex; width: 100%; max-width: 920px; gap: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,.4); position: relative; z-index: 1; }
.login-brand {
  background: linear-gradient(145deg, #1a3260 0%, #0d1f3c 100%);
  padding: 48px 40px; width: 420px; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column;
}
.login-brand-logo { width: 80px; height: 80px; border-radius: 0; background: transparent; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 32px; font-weight: 800; margin-bottom: 20px; }
.login-brand-title { color: #fff; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.login-brand-sub { color: rgba(255,255,255,.5); font-size: 14px; margin-top: 4px; margin-bottom: 20px; }
.login-brand-desc { color: rgba(255,255,255,.45); font-size: 13px; line-height: 1.7; margin-bottom: 32px; }
.login-features { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.login-feat { color: rgba(255,255,255,.6); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.login-feat i { color: #3b82f6; }
.login-card { background: #fff; padding: 48px 44px; flex: 1; display: flex; flex-direction: column; }
.login-card-header { margin-bottom: 28px; }
.login-card-header h2 { font-size: 24px; font-weight: 700; color: var(--color-text); }
.login-card-header p { color: var(--color-text-muted); font-size: 13px; margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-tip { margin-top: 20px; padding: 12px 14px; background: #eff6ff; border-radius: 8px; font-size: 12px; color: #2563eb; display: flex; align-items: flex-start; gap: 8px; }
.login-footer { margin-top: auto; padding-top: 24px; font-size: 11px; color: #cbd5e1; text-align: center; }

/* =====================================================
   加载 / 空状态
   ===================================================== */
.spinner { width: 36px; height: 36px; border: 3px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; display: inline-block; vertical-align: middle; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-center { display: flex; align-items: center; justify-content: center; padding: 56px; }

/* =====================================================
   图表容器
   ===================================================== */
.chart-wrap { position: relative; }
.chart-h200 { height: 200px; }
.chart-h260 { height: 260px; }

/* =====================================================
   进度条
   ===================================================== */
.progress-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--color-primary); transition: width .3s; }

/* =====================================================
   数据看板区域
   ===================================================== */
.section-title { font-size: 14px; font-weight: 600; color: var(--color-text); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--color-primary); }

/* 数值高亮 */
.num-blue   { color: #2563eb; font-weight: 700; }
.num-green  { color: #16a34a; font-weight: 700; }
.num-orange { color: #d97706; font-weight: 700; }
.num-red    { color: #dc2626; font-weight: 700; }
.num-muted  { color: var(--color-text-muted); }

/* =====================================================
   工具类
   ===================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-gap { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-muted { color: var(--color-text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================
   动画
   ===================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%) scale(.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(100%); } }

/* =====================================================
   移动端适配
   ===================================================== */
@media (max-width: 768px) {
  .fd-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .fd-sidebar.open { transform: translateX(0); }
  .fd-main { margin-left: 0; }
  .login-wrap { flex-direction: column; border-radius: 0; max-width: 100%; }
  .login-brand { width: 100%; padding: 32px 24px; }
  .login-brand-title { font-size: 22px; }
  .login-card { padding: 32px 24px; }
  .login-features { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .fd-content { padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-search .form-input { width: 100%; }
  .toolbar-right { margin-left: 0; }
}
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-card-value { font-size: 22px; }
}

/* =====================================================
   仪表盘专用
   ===================================================== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-chart-card { grid-column: span 1; }
.dash-legend { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--color-text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* =====================================================
   详情页专用
   ===================================================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-section { margin-bottom: 4px; }
.detail-section-title { font-size: 13px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--color-border); }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.detail-table td { padding: 6px 0; vertical-align: top; }
.detail-table td:first-child { color: var(--color-text-muted); width: 100px; padding-right: 12px; white-space: nowrap; }
.detail-table td:last-child { color: var(--color-text); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }

/* =====================================================
   跟进记录
   ===================================================== */
.followup-item { border-left: 3px solid var(--color-primary-light); padding: 10px 14px; margin-bottom: 10px; background: #f8fafc; border-radius: 0 8px 8px 0; }
.followup-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.followup-content { font-size: 13.5px; color: var(--color-text); line-height: 1.6; }

/* =====================================================
   筛选栏
   ===================================================== */
.filter-bar { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-input { max-width: 200px; min-width: 120px; }
.filter-select { max-width: 160px; min-width: 100px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border); }

/* =====================================================
   优先级行高亮
   ===================================================== */
.tr-urgent { background: #fff5f5 !important; }
.tr-urgent:hover { background: #fee2e2 !important; }

/* =====================================================
   Alert 提示块
   ===================================================== */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13.5px; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }

/* =====================================================
   stat-card 颜色变体补充
   ===================================================== */
.stat-card-teal .stat-card-icon { background: rgba(20,184,166,.12); color: #14b8a6; }
.stat-card-indigo .stat-card-icon { background: rgba(99,102,241,.12); color: #6366f1; }
.stat-card-cyan .stat-card-icon { background: rgba(6,182,212,.12); color: #06b6d4; }
.stat-card-gold .stat-card-icon { background: rgba(245,158,11,.12); color: #d97706; }
.stat-card-red .stat-card-icon { background: rgba(239,68,68,.12); color: #ef4444; }
.stat-card-emerald .stat-card-icon { background: rgba(16,185,129,.12); color: #10b981; }

/* ===== stat-card 动态数值颜色 ===== */
.stat-card-blue    .stat-card-value { color: #2563eb; }
.stat-card-green   .stat-card-value { color: #16a34a; }
.stat-card-emerald .stat-card-value { color: #10b981; }
.stat-card-orange  .stat-card-value { color: #d97706; }
.stat-card-red     .stat-card-value { color: #ef4444; }
.stat-card-purple  .stat-card-value { color: #8b5cf6; }
.stat-card-teal    .stat-card-value { color: #14b8a6; }
.stat-card-gold    .stat-card-value { color: #d97706; }
.stat-card-indigo  .stat-card-value { color: #6366f1; }
.stat-card-cyan    .stat-card-value { color: #06b6d4; }

/* ===== badge 颜色补充 ===== */
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gold   { background: #fef3c7; color: #b45309; }

/* ===== 工具类补充 ===== */
.fw-medium { font-weight: 500; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.ml-2 { margin-left: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger) !important; }
.text-success { color: var(--color-success) !important; }
.text-blue-600 { color: #2563eb !important; }
.text-blue-500 { color: #3b82f6; }
.text-blue-700 { color: #1d4ed8; }
.text-green-500 { color: #22c55e; }
.text-pink-500  { color: #ec4899; }
