/* 仪表板样式 - 自动生成 */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.progress {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .stat-number {
        font-size: 2em;
    }
}

/* =========================================
   New Statistics Page Styles (v1.2.3 optimization)
   ========================================= */

.stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

/* KPI Cards Row */
.stats-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

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

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.kpi-card.blue::before { background: #3b82f6; }
.kpi-card.green::before { background: #10b981; }
.kpi-card.red::before { background: #ef4444; }
.kpi-card.purple::before { background: #8b5cf6; }

/* 移除旧的 border-left 样式，改用伪元素或纯色 */
.kpi-card.blue { border-left: none; }
.kpi-card.green { border-left: none; }
.kpi-card.red { border-left: none; }
.kpi-card.purple { border-left: none; }

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.3s ease;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1) rotate(5deg);
}

.kpi-card.blue .kpi-icon { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); color: #0284c7; }
.kpi-card.green .kpi-icon { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #16a34a; }
.kpi-card.red .kpi-icon { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #dc2626; }
.kpi-card.purple .kpi-icon { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); color: #9333ea; }

.kpi-info {
    flex: 1;
    margin-right: 16px;
    margin-left: 0;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* 筛选条件样式优化 */
.filter-conditions-container {
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
}

.filter-conditions-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.filter-conditions-label {
    color: #374151;
    font-size: 14px;
    margin-right: 8px;
    font-weight: 600;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-tag strong {
    margin-right: 6px;
    color: #6b7280;
    font-weight: 600;
}

.filter-tag-date { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.filter-tag-date strong { color: #3b82f6; }

.filter-tag-shift { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.filter-tag-shift strong { color: #22c55e; }

.filter-tag-machine { background: #fdf4ff; border-color: #f0abfc; color: #86198f; }
.filter-tag-machine strong { color: #d946ef; }

.filter-tag-all { background: #f9fafb; border-color: #e5e7eb; color: #6b7280; font-style: italic; padding: 6px 16px; }

/* Split Content Layout */
.stats-content-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

@media (max-width: 1200px) {
    .stats-content-split {
        grid-template-columns: 1fr;
    }
}

/* Table Section */
.stats-table-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.stats-section-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.stats-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.01em;
}

.stats-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.stats-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.stats-modern-table th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.stats-modern-table th:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    width: 12px;
    text-align: center;
}

.stats-modern-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.stats-modern-table tr:last-child td {
    border-bottom: none;
}

.stats-modern-table tr:hover td {
    background-color: #f8fafc;
}

/* Chart Section */
.stats-chart-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
}

.chart-controls-modern {
    display: flex;
    gap: 10px;
}

.chart-select-modern {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    outline: none;
}

.chart-canvas-wrapper {
    padding: 20px;
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Ensure full width for results container */
.statistics-results {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
