/**
 * prod-dashboard.css — 生产进度看板 + 大屏样式
 * [v2.4.0] 阶段十四
 */

/* ========== 基础布局 ========== */
.prod-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.prod-dashboard.pd-dark {
    background: #0f1117;
    color: #e8e8e8;
}

/* ========== 工具栏 ========== */
.pd-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.pd-dark .pd-toolbar {
    background: #1a1d29;
    border-bottom-color: #2a2d3a;
}

.pd-tabs {
    display: flex;
    gap: 4px;
}

.pd-tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #E0E6ED;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pd-tab:hover { background: #f0f0f0; }
.pd-tab.active { background: #1890ff; color: #fff; }

.pd-dark .pd-tab { color: #a0a0a0; }
.pd-dark .pd-tab:hover { background: #2a2d3a; }
.pd-dark .pd-tab.active { background: #1890ff; color: #fff; }

.pd-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pd-btn {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.pd-btn:hover { border-color: #1890ff; color: #1890ff; }

.pd-dark .pd-btn {
    background: #2a2d3a;
    border-color: #3a3d4a;
    color: #e8e8e8;
}

.pd-last-update { font-size: 11px; color: #AAB0B8; }

/* ========== 统计卡片 ========== */
.pd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
}

.pd-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.pd-dark .pd-stat-card {
    background: #1a1d29;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.pd-stat-label {
    font-size: 13px;
    color: #E0E6ED;
    margin-bottom: 8px;
}

.pd-stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'DIN Alternate', monospace;
}

.pd-stat-unit {
    font-size: 14px;
    font-weight: 400;
    margin-left: 4px;
    color: #AAB0B8;
}

/* ========== 区块 ========== */
.pd-section {
    padding: 0 16px 16px;
}

.pd-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.pd-dark .pd-section-title { color: #e8e8e8; }

.pd-count { font-size: 12px; font-weight: 400; color: #AAB0B8; }

/* ========== 表格 ========== */
.pd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pd-table thead {
    background: #fafafa;
}

.pd-dark .pd-table thead { background: #1a1d29; }

.pd-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #E0E6ED;
    border-bottom: 2px solid #e8e8e8;
}

.pd-dark .pd-table th {
    color: #a0a0a0;
    border-bottom-color: #2a2d3a;
}

.pd-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.pd-dark .pd-table td { border-bottom-color: #1e2130; }

.pd-order-no { font-weight: 600; color: #1890ff; }

/* ========== 进度条 ========== */
.pd-progress-bar {
    position: relative;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    min-width: 80px;
}

.pd-dark .pd-progress-bar { background: #2a2d3a; }

.pd-progress-fill {
    height: 100%;
    background: #1890ff;
    border-radius: 10px;
    transition: width 0.3s;
}

.pd-progress-fill.pd-half { background: #52c41a; }
.pd-progress-fill.pd-done { background: #00b42a; }

.pd-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.pd-dark .pd-progress-text { color: #e8e8e8; }

/* ========== 状态标签 ========== */
.pd-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.pd-status-pending { background: #fff7e6; color: #fa8c16; }
.pd-status-in_progress { background: #e6f7ff; color: #1890ff; }
.pd-status-completed { background: #f6ffed; color: #52c41a; }
.pd-status-cancelled { background: #fff1f0; color: #f5222d; }

.pd-dark .pd-status-pending { background: rgba(250,140,22,0.15); }
.pd-dark .pd-status-in_progress { background: rgba(24,144,255,0.15); }
.pd-dark .pd-status-completed { background: rgba(82,196,26,0.15); }
.pd-dark .pd-status-cancelled { background: rgba(245,34,45,0.15); }

/* ========== 钻取导航 ========== */
.pd-drill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.pd-drill-header h3 {
    font-size: 15px;
    margin: 0;
}

.pd-btn-back {
    background: transparent;
    border: 1px solid #d9d9d9;
    color: #1890ff;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== 产线看板 ========== */
.pd-line-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.pd-line-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.pd-dark .pd-line-card {
    background: #1a1d29;
}

.pd-line-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pd-line-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 8px;
}

.pd-metric {
    text-align: center;
}

.pd-metric-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
    font-family: 'DIN Alternate', monospace;
}

.pd-metric-val.pd-metric-warn { color: #f5222d; }

.pd-metric-label {
    display: block;
    font-size: 11px;
    color: #AAB0B8;
    margin-top: 2px;
}

.pd-bar-h {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.pd-dark .pd-bar-h { background: #2a2d3a; }

.pd-bar-fill {
    height: 100%;
    background: #1890ff;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ========== 摘要网格 ========== */
.pd-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.pd-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 6px;
}

.pd-dark .pd-summary-item { background: #1a1d29; }

.pd-summary-name { font-size: 13px; }
.pd-summary-val { font-size: 13px; font-weight: 600; color: #1890ff; }

/* ========== 空状态 ========== */
.pd-empty {
    text-align: center;
    padding: 40px 20px;
    color: #AAB0B8;
    font-size: 14px;
}

/* ========== 大屏模式 ========== */
.pd-fullscreen-container {
    padding: 24px;
    min-height: 100vh;
}

.pd-full-section {
    margin-bottom: 32px;
}

.pd-full-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #fff;
}

.pd-stats-grid-large {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pd-stats-grid-large .pd-stat-card {
    padding: 32px;
}

.pd-stats-grid-large .pd-stat-value {
    font-size: 48px;
}

.pd-stats-grid-large .pd-stat-label {
    font-size: 16px;
}

.pd-line-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.pd-line-card-large {
    padding: 24px;
}

.pd-line-card-large .pd-line-name {
    font-size: 18px;
    margin-bottom: 16px;
}

.pd-line-card-large .pd-metric-val {
    font-size: 28px;
}

.pd-line-card-large .pd-metric-label {
    font-size: 13px;
}

.pd-large { font-size: 28px !important; }

/* ========== 全屏覆盖 ========== */
.prod-dashboard.pd-fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    overflow-y: auto;
}
