/* MISSION 66 (W3-production) -- R920 S018 jobs list, S019 job page
   (+ modal_run, modal_proof_printer), S020 QC (+ qc_incomplete), S021
   handover. Builds on the shared pb-oc-* card / key-value / stepper /
   action-bar classes (Content/r920/orderschat.css) and site.css tokens;
   adds only the pb-w3p-* pieces below. RTL-safe: logical properties only. */

.pb-w3p-crumb { margin: 0 0 4px; }
.pb-w3p-ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }
.pb-w3p-status-line { margin: 0 0 12px; }
.pb-w3p-next-explain { flex-basis: 100%; margin: 0 0 4px; }
.pb-w3p-field-button { flex: 0 0 auto; justify-content: flex-end; }
.pb-oc-field select, .pb-oc-field input[type="text"], .pb-oc-field input[type="number"], .pb-oc-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm, 10px); font-family: inherit; background: var(--surface); color: inherit;
}

/* S018 summary stats */
.pb-w3p-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.pb-w3p-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm, 10px); color: inherit; text-decoration: none; }
.pb-w3p-stat strong { font-size: 1.5rem; line-height: 1.1; }
.pb-w3p-stat span { color: var(--text-secondary); font-size: 0.9rem; }
.pb-w3p-stat--warn { border-color: var(--pb-warning-text); background: var(--pb-warning-surface); }
@media (max-width: 767px) { .pb-w3p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* S018 table: stacked rows on mobile */
.pb-w3p-table { width: 100%; border-collapse: collapse; }
.pb-w3p-table th { text-align: start; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border-color); }
.pb-w3p-table td { padding: 10px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.pb-w3p-row--overdue td { background: var(--pb-warning-surface); }
@media (max-width: 767px) {
    .pb-w3p-table thead { display: none; }
    .pb-w3p-table, .pb-w3p-table tbody, .pb-w3p-table tr, .pb-w3p-table td { display: block; width: 100%; }
    .pb-w3p-table tr { border: 1px solid var(--border-color); border-radius: var(--radius-sm, 10px); margin-bottom: 10px; padding: 4px 0; }
    .pb-w3p-table td { border-bottom: 0; padding: 6px 12px; }
    .pb-w3p-table td::before { content: attr(data-label); display: block; font-size: 0.8rem; color: var(--text-secondary); }
}

/* Chips */
.pb-w3p-chip { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); margin-inline-start: 6px; }
.pb-w3p-chip--warn { background: var(--pb-warning-surface); color: var(--pb-warning-text); }
.pb-w3p-chip--ok { background: var(--pb-success-surface); color: var(--pb-success-text); }

.pb-w3p-list { list-style: none; margin: 0 0 8px; padding: 0; }
.pb-w3p-list li { padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.pb-w3p-list li:last-child { border-bottom: 0; }
.pb-w3p-attempts { margin: 0 0 8px; padding-inline-start: 18px; }
.pb-w3p-attempts li { margin-bottom: 12px; }
.pb-w3p-ext { padding: 8px 0; border-bottom: 1px solid var(--border-color); }

/* qc_incomplete banner (R920 yellow) */
.pb-w3p-banner-warn { background: var(--pb-warning-surface); border: 1px solid var(--pb-warning-text); color: var(--pb-warning-text); border-radius: var(--radius-sm, 10px); padding: 14px 18px; margin-bottom: 16px; }
.pb-w3p-banner-warn strong { display: block; margin-bottom: 4px; color: var(--pb-warning-text); }

/* Checklist + drop zone */
.pb-w3p-checklist { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pb-w3p-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.pb-w3p-check input { width: 18px; height: 18px; }
.pb-w3p-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm, 10px); background: var(--surface-2); text-align: center; }
.pb-w3p-drop input[type="file"] { max-width: 100%; }

/* Evidence tiles */
.pb-w3p-evidence-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pb-w3p-evidence { position: relative; display: flex; flex-direction: column; gap: 4px; width: 132px; padding: 6px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm, 10px); color: inherit; text-decoration: none; }
.pb-w3p-evidence img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.pb-w3p-evidence .pb-w3p-chip { margin: 0; align-self: flex-start; }
.pb-w3p-evidence--locked { min-height: 96px; justify-content: center; }

/* Modals (R920 modal_run / modal_proof_printer): CSS :target, no JS needed. */
.pb-w3p-modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(17, 24, 39, 0.45); align-items: center; justify-content: center; padding: 16px; }
.pb-w3p-modal:target { display: flex; }
.pb-w3p-modal-box { position: relative; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 24px 26px; }
.pb-w3p-modal-box h2 { font-size: 1.3rem; margin: 0 0 8px; padding-inline-end: 48px; }
