/* Quality Module - Main CSS
 * Copyright (C) 2026 Dunamis
 */

/* Dashboard Cards */
.quality-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quality-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quality-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.quality-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quality-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.quality-card-subtitle {
    font-size: 13px;
    color: #95a5a6;
}

/* KPI Semaphore Colors */
.kpi-status-green, .kpi-status-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.kpi-status-yellow, .kpi-status-warning {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
}

.kpi-status-red, .kpi-status-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
}

/* KPI Value Display */
.kpi-value-container {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
}

.kpi-value-container.success { background: rgba(39, 174, 96, 0.1); }
.kpi-value-container.warning { background: rgba(243, 156, 18, 0.1); }
.kpi-value-container.danger { background: rgba(192, 57, 43, 0.1); }

.kpi-value {
    font-size: 48px;
    font-weight: 800;
}

.kpi-value.success { color: #27ae60; }
.kpi-value.warning { color: #f39c12; }
.kpi-value.danger { color: #c0392b; }

.kpi-unit {
    font-size: 18px;
    color: #7f8c8d;
    margin-left: 5px;
}

.kpi-trend {
    font-size: 14px;
    margin-top: 10px;
}

.kpi-trend.up { color: #27ae60; }
.kpi-trend.down { color: #c0392b; }
.kpi-trend.stable { color: #7f8c8d; }

/* Severity Badges */
.severity-minor {
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.severity-major {
    background: #f39c12;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.severity-critical {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Ishikawa Diagram */
.ishikawa-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    overflow-x: auto;
}

.ishikawa-diagram {
    min-width: 900px;
    position: relative;
}

.ishikawa-spine {
    height: 4px;
    background: #2c3e50;
    position: absolute;
    top: 50%;
    left: 0;
    right: 100px;
}

.ishikawa-head {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #e74c3c;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    max-width: 200px;
}

.ishikawa-category {
    position: absolute;
    padding: 10px 15px;
    background: #3498db;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.ishikawa-cause {
    background: #ecf0f1;
    padding: 8px 12px;
    border-radius: 5px;
    margin: 5px 0;
    font-size: 13px;
    border-left: 3px solid #3498db;
}

.ishikawa-cause.root-cause {
    background: #fdecea;
    border-left-color: #e74c3c;
    font-weight: 600;
}

/* 5W2H Form */
.form-5w2h {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-5w2h-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.form-5w2h-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-5w2h-section h4 .badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Progress Bar */
.quality-progress {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.quality-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Audit Score */
.audit-score {
    text-align: center;
    padding: 30px;
}

.audit-score-value {
    font-size: 64px;
    font-weight: 800;
}

.audit-score-label {
    font-size: 16px;
    color: #7f8c8d;
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: #f8f9fa;
}

.checklist-item.completed {
    background: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
}

/* Stats Grid */
.quality-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .quality-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .quality-stats-grid {
        grid-template-columns: 1fr;
    }
}

.quality-stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quality-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
}

.quality-stat-icon.processes { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.quality-stat-icon.kpis { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.quality-stat-icon.anomalies { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.quality-stat-icon.audits { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }

/* Responsive Tables */
.quality-table-responsive {
    overflow-x: auto;
}

.quality-table {
    width: 100%;
    border-collapse: collapse;
}

.quality-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
}

.quality-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.quality-table tr:hover {
    background: #f8f9fa;
}

/* Charts Container */
.quality-chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.quality-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}
