/* DIYguru DWR – Performance Operating System Styles v4.0 */

/* ── Base ── */
.perf-loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
.perf-empty { text-align: center; padding: 32px; color: #94a3b8; font-size: 14px; background: #f8fafc; border-radius: 12px; }

/* ── Tabs ── */
.perf-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 16px; }
.perf-tab-btn { padding: 8px 16px; border: none; background: transparent; color: #64748b; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 8px 8px 0 0; white-space: nowrap; transition: all 0.2s; }
.perf-tab-btn:hover { background: #f1f5f9; color: #1e293b; }
.perf-tab-btn.active { background: #0a2f26; color: #fff; }

/* ── Badges ── */
.badge-green { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.badge-amber { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.badge-red { background: #fecaca; color: #991b1b; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.badge-none { background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 9999px; font-size: 12px; }
.dept-badge { background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 500; margin-left: 4px; }
.cat-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; text-transform: uppercase; font-weight: 600; }
.cat-discipline { background: #dbeafe; color: #1e40af; }
.cat-execution { background: #fae8ff; color: #7e22ce; }
.cat-outcome { background: #d1fae5; color: #065f46; }
.mini-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; margin: 1px; }

/* ── Buttons ── */
.btn-sm { padding: 4px 12px; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: #0a2f26; color: #fff; }
.btn-primary:hover { background: #134e3e; }
.btn-warn { background: #f59e0b; color: #fff; }
.btn-warn:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ── KRA Admin ── */
.perf-kra-admin { padding: 8px 0; }
.perf-emp-kra { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.perf-emp-kra h4 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weight-total { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; }
.weight-total.ok { background: #dcfce7; color: #166534; }
.weight-total.warn { background: #fecaca; color: #991b1b; }
.perf-kra-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perf-kra-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid #e5e7eb; color: #64748b; font-size: 11px; text-transform: uppercase; }
.perf-kra-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; }

/* ── Target vs Actual Widget ── */
.perf-target-widget { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid #e5e7eb; }
.perf-widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.perf-widget-header h3 { margin: 0; font-size: 16px; }
.perf-compliance { font-size: 12px; color: #64748b; }
.perf-kpi-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f8fafc; flex-wrap: wrap; }
.perf-kpi-row.owner-metric { background: #fffbeb; margin: 0 -16px; padding: 10px 16px; border-radius: 8px; }
.kpi-info { flex: 1; min-width: 180px; }
.kpi-name { font-weight: 600; font-size: 13px; display: block; }
.kpi-cat { font-size: 11px; }
.kpi-bar-wrap { flex: 2; min-width: 120px; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.kpi-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.kpi-numbers { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 4px; font-size: 13px; }
.kpi-actual { font-weight: 700; }
.kpi-target { color: #94a3b8; }
.kpi-pct { margin-left: auto; }

/* ── Alerts ── */
.perf-alerts h3 { margin: 0 0 12px; }
.alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 8px; margin-bottom: 8px; }
.alert-critical { background: #fef2f2; border-left: 4px solid #ef4444; }
.alert-warning { background: #fffbeb; border-left: 4px solid #f59e0b; }
.alert-info { background: #f0f9ff; border-left: 4px solid #3b82f6; }
.alert-icon { font-size: 18px; line-height: 1; }
.alert-body { flex: 1; }
.alert-msg { font-size: 13px; font-weight: 500; }
.alert-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.alert-count { background: #ef4444; color: #fff; padding: 1px 6px; border-radius: 9999px; font-size: 11px; font-weight: 700; }

/* ── Manager Review Table ── */
.perf-review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perf-review-table th { text-align: left; padding: 8px; border-bottom: 2px solid #e5e7eb; color: #64748b; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
.perf-review-table td { padding: 8px; border-bottom: 1px solid #f1f5f9; }
.row-green { background: #f0fdf4; }
.row-amber { background: #fffbeb; }
.row-red { background: #fef2f2; }
.review-done { color: #16a34a; font-weight: 600; font-size: 12px; }

/* ── Leaderboard ── */
.perf-leaderboard h3 { margin: 0 0 16px; }
.lb-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; margin-bottom: 8px; background: #fff; border: 1px solid #e5e7eb; transition: all 0.15s; }
.lb-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.lb-green { border-left: 4px solid #10b981; }
.lb-amber { border-left: 4px solid #f59e0b; }
.lb-red { border-left: 4px solid #ef4444; }
.lb-rank { font-size: 20px; font-weight: 800; min-width: 40px; text-align: center; }
.lb-info { flex: 1; }
.lb-name { font-weight: 700; font-size: 14px; }
.lb-dept { font-size: 12px; color: #64748b; }
.lb-score { text-align: center; min-width: 70px; }
.lb-final { font-size: 24px; font-weight: 800; }
.lb-details { display: flex; gap: 8px; font-size: 11px; color: #64748b; }
.lb-details span { background: #f8fafc; padding: 2px 6px; border-radius: 4px; }
.streak-badge { background: #fef3c7 !important; color: #92400e !important; }
.lb-owner { font-size: 11px; color: #64748b; white-space: nowrap; }

/* ── PIP ── */
.pip-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.pip-draft { border-left: 4px solid #f59e0b; }
.pip-active { border-left: 4px solid #3b82f6; }
.pip-completed { border-left: 4px solid #10b981; }
.pip-failed { border-left: 4px solid #ef4444; }
.pip-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pip-status { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.pip-draft .pip-status { background: #fef3c7; color: #92400e; }
.pip-active .pip-status { background: #dbeafe; color: #1e40af; }
.pip-completed .pip-status { background: #dcfce7; color: #166534; }
.pip-failed .pip-status { background: #fecaca; color: #991b1b; }
.pip-body { font-size: 13px; color: #475569; }
.pip-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ── Overview Table ── */
.perf-overview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perf-overview-table th { text-align: left; padding: 8px; border-bottom: 2px solid #e5e7eb; color: #64748b; font-size: 11px; text-transform: uppercase; }
.perf-overview-table td { padding: 8px; border-bottom: 1px solid #f1f5f9; }

/* ── Evidence ── */
.perf-evidence-upload { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.evidence-url-input { flex: 1; padding: 4px 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; }
.evidence-ok { color: #16a34a; font-weight: 600; font-size: 12px; }
.evidence-err { color: #ef4444; font-weight: 600; font-size: 12px; }

/* ── KRA Select ── */
.dwr-kra-select { width: 100%; padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; background: #fff; }

/* ── Admin Tools ── */
.perf-admin-tools { padding: 16px; }
.perf-admin-tools h3 { margin: 0 0 16px; }
.perf-admin-tools button { margin-right: 8px; margin-bottom: 8px; padding: 8px 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .perf-kpi-row { flex-direction: column; gap: 4px; }
    .kpi-bar-wrap { width: 100%; }
    .perf-review-table { font-size: 11px; }
    .perf-review-table th, .perf-review-table td { padding: 4px; }
    .lb-card { flex-wrap: wrap; }
    .lb-details { flex-wrap: wrap; }
    .perf-tabs { gap: 2px; }
    .perf-tab-btn { padding: 6px 10px; font-size: 12px; }
}
