/* 仪表板样式 */

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.orders {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.stores {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.alerts {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-period select {
    border: none;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    outline: none;
    cursor: pointer;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.vs-period {
    color: #9ca3af;
    font-weight: 400;
}

/* 图表行 */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-tab {
    padding: 6px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chart-body {
    min-height: 300px;
}

.trend-chart {
    width: 100%;
    height: auto;
}

/* 饼图容器 */
.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 32px;
}

.pie-chart {
    width: 200px;
    height: 200px;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-label {
    font-size: 14px;
    color: #1a1a1a;
    min-width: 60px;
}

.legend-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

/* 表格行 */
.tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.table-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 2px solid #f3f4f6;
}

.data-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table td {
    padding: 16px 12px;
    font-size: 14px;
    color: #1a1a1a;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.rank-badge.top-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.rank-badge.top-2 {
    background: #9ca3af;
}

.rank-badge.top-3 {
    background: #d97706;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-name {
    font-weight: 500;
}

.product-sku {
    font-size: 12px;
    color: #6b7280;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.trend-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.trend-badge.positive {
    background: #d1fae5;
    color: #10b981;
}

/* 实时动态 */
.activity-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.activity-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.activity-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 3px solid transparent;
}

.activity-item.sale {
    border-left-color: #667eea;
}

.activity-item.replenish {
    border-left-color: #10b981;
}

.activity-item.alert {
    border-left-color: #ef4444;
}

.activity-item.display {
    border-left-color: #f59e0b;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.activity-item.sale .activity-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-item.replenish .activity-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.activity-item.alert .activity-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.activity-item.display .activity-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.activity-desc {
    font-size: 12px;
    color: #6b7280;
}

.activity-amount {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.activity-status {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.activity-status.success {
    background: #d1fae5;
    color: #10b981;
}

.activity-status.warning {
    background: #fef3c7;
    color: #d97706;
}

.activity-status.info {
    background: #dbeafe;
    color: #2563eb;
}

.activity-time {
    font-size: 11px;
    color: #9ca3af;
}
