/**
 * 通用组件样式：卡片、表格、按钮、统计块等
 */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
}

/* 统计卡片 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }

.stat-card .label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-card .extra { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #F5F6FA; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* 表格 */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: #F9FAFB;
  font-weight: 600;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F9FAFB; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(91,127,255,.2);
}

/* 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #D1FAE5; color: var(--success); }
.badge-warning { background: #FEF3C7; color: var(--warning); }

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

/* ---------- 首页 Dashboard ---------- */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.dashboard-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.dashboard-header .date {
  font-size: 13px;
  color: var(--text-muted);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1200px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dashboard-stats { grid-template-columns: 1fr; }
}

.dashboard-stat {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
  transition: box-shadow 0.2s;
}
.dashboard-stat:hover {
  box-shadow: var(--shadow-md);
}
.dashboard-stat .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dashboard-stat .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.dashboard-stat .stat-extra {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.dashboard-stat.primary .stat-value { color: var(--primary); }
.dashboard-stat.success .stat-value { color: var(--success); }
.dashboard-stat.warning .stat-value { color: var(--warning); }
.dashboard-stat.danger .stat-value { color: var(--danger); }

.dashboard-section {
  margin-bottom: 24px;
}
.dashboard-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dashboard-section-title .icon { font-size: 18px; }

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .dashboard-grid-2 { grid-template-columns: 1fr; }
}

.dashboard-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
}
.dashboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dashboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.dashboard-list li:last-child { border-bottom: none; }
.dashboard-list .num { font-weight: 600; color: var(--primary); }
.dashboard-list a { color: var(--text); text-decoration: none; }
.dashboard-list a:hover { color: var(--primary); }

.dashboard-chart-wrap {
  min-height: 260px;
  background: linear-gradient(180deg, #F9FAFB 0%, #fff 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dashboard-actions .btn {
  text-decoration: none;
}

.dashboard-todo {
  padding: 0;
  margin: 0;
  list-style: none;
}
.dashboard-todo li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.dashboard-todo li:last-child { border-bottom: none; }
.dashboard-todo .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}
.dashboard-todo .dot.done { background: var(--success); }
.dashboard-todo a { color: var(--primary); text-decoration: none; }
.dashboard-todo a:hover { text-decoration: underline; }
