/* SAJ Task 49 — centralized project quality center */
#saj-project-quality-modal{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(5,18,32,.66);backdrop-filter:blur(3px);direction:rtl;font:12px/1.8 Tahoma,Arial,sans-serif;color:#172b3d;box-sizing:border-box}
#saj-project-quality-modal[hidden]{display:none!important}
.saj-qc-card{width:min(820px,100%);max-height:min(92vh,900px);overflow:auto;background:#fff;border:1px solid #d9e3ec;border-radius:17px;box-shadow:0 24px 70px rgba(0,0,0,.3);padding:16px;box-sizing:border-box}
.saj-qc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;border-bottom:1px solid #e5edf4;padding-bottom:12px;margin-bottom:12px}
.saj-qc-heading{min-width:0}.saj-qc-eyebrow{color:#0f766e;font-size:10px;font-weight:700}.saj-qc-title{margin:3px 0 2px;font-size:18px;color:#153b56}.saj-qc-intro{margin:0;color:#64748b;font-size:11px}.saj-qc-close{width:42px;height:42px;min-width:42px;border:1px solid #d9e2eb;border-radius:11px;background:#f8fafc;color:#475569;font-size:24px;cursor:pointer}
.saj-qc-filters{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:9px}.saj-qc-filters label{display:flex;flex-direction:column;gap:4px;color:#475569;font-size:10px;font-weight:700}.saj-qc-filters select{width:100%;min-height:40px;padding:7px 9px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#172b3d;font:11px Tahoma,Arial,sans-serif;min-width:0}.saj-qc-filters label[hidden]{display:none!important}
.saj-qc-main-actions{display:flex;gap:8px;margin-top:10px}.saj-qc-main-actions button,.saj-qc-downloads button,.saj-qc-show{min-height:44px;padding:8px 14px;border:0;border-radius:10px;background:#0f766e;color:#fff;font:700 11px Tahoma,Arial,sans-serif;cursor:pointer}.saj-qc-main-actions .saj-qc-rerun{background:#eef4f8;color:#25445d;border:1px solid #cbd8e4}.saj-qc-main-actions button:disabled{opacity:.5;cursor:wait}.saj-qc-status{margin:9px 0;padding:8px 10px;border-radius:8px;background:#f1f5f9;color:#475569;font-size:10px;overflow-wrap:anywhere}.saj-qc-status[data-kind="error"]{background:#fef2f2;color:#991b1b}.saj-qc-status[data-kind="warn"]{background:#fffbeb;color:#92400e}.saj-qc-status[data-kind="ok"]{background:#ecfdf5;color:#166534}.saj-qc-status[data-kind="busy"]{background:#eff6ff;color:#1d4ed8}
.saj-qc-results{margin-top:10px}.saj-qc-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.saj-qc-metric{display:flex;flex-direction:column;gap:4px;padding:10px;border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc;min-width:0}.saj-qc-metric small{color:#64748b;font-size:9px}.saj-qc-metric b{font-size:19px;color:#1e3a50;overflow-wrap:anywhere}.saj-qc-metric.danger{background:#fff1f2;border-color:#fecdd3}.saj-qc-metric.danger b{color:#b91c1c}.saj-qc-metric.warning{background:#fffbeb;border-color:#fde68a}.saj-qc-metric.warning b{color:#a16207}.saj-qc-metric.info{background:#eff6ff;border-color:#bfdbfe}.saj-qc-metric.info b{color:#1d4ed8}
.saj-qc-categories,.saj-qc-issues{margin-top:12px;border:1px solid #e2e8f0;border-radius:11px;padding:10px}.saj-qc-categories h3,.saj-qc-issues h3{margin:0 0 8px;font-size:12px;color:#183c56}.saj-qc-category{display:flex;justify-content:space-between;gap:8px;padding:6px 2px;border-bottom:1px solid #eef2f6;font-size:10px}.saj-qc-category:last-child{border-bottom:0}.saj-qc-category b{white-space:nowrap;color:#475569}.saj-qc-empty{margin:4px 0;color:#166534;font-size:11px}.saj-qc-issue{padding:9px;margin:8px 0;border:1px solid #e2e8f0;border-radius:10px;background:#fff}.saj-qc-issue.blocking{border-right:4px solid #dc2626}.saj-qc-issue.warning{border-right:4px solid #d97706}.saj-qc-issue-top{display:flex;justify-content:space-between;gap:8px;align-items:center}.saj-qc-issue-top strong{font-size:11px}.saj-qc-severity{font-size:9px;color:#991b1b;background:#fef2f2;padding:2px 7px;border-radius:20px;white-space:nowrap}.saj-qc-issue.warning .saj-qc-severity{color:#92400e;background:#fffbeb}.saj-qc-issue-message{margin:5px 0;color:#475569;font-size:10px}.saj-qc-refs,.saj-qc-detail{display:block;color:#64748b;font-size:9px;overflow-wrap:anywhere}.saj-qc-show{margin-top:7px;min-height:38px;padding:6px 11px;background:#e8f2f7;color:#164b69;border:1px solid #c6d9e5}.saj-qc-show:disabled{opacity:.5}.saj-qc-downloads{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.saj-qc-downloads .secondary{background:#eff4f8;color:#23435e;border:1px solid #cbd8e4}.saj-qc-limit{font-size:10px;color:#64748b}.saj-qc-legal-note{margin:11px 0 0;padding-top:9px;border-top:1px solid #e5edf4;color:#64748b;font-size:9px;line-height:1.8}.saj-qc-map-popup{direction:rtl;min-width:170px;font:11px/1.8 Tahoma,Arial,sans-serif}.saj-qc-map-popup span{display:block;color:#64748b;font-size:9px}.saj-qc-map-popup p{margin:4px 0 0}
#saj-project-device-export .saj-device-export-quality{width:100%;min-height:36px;padding:7px;border:1px solid #b9d5df;background:#e9f5f7;color:#10566b;font-weight:700}
@media(max-width:600px){#saj-project-quality-modal{padding:7px;align-items:flex-end}.saj-qc-card{max-height:94dvh;border-radius:16px;padding:12px}.saj-qc-title{font-size:16px}.saj-qc-filters{grid-template-columns:1fr 1fr}.saj-qc-filters label:first-child{grid-column:1/-1}.saj-qc-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.saj-qc-main-actions button{flex:1}.saj-qc-category{align-items:flex-start;flex-direction:column}.saj-qc-category b{white-space:normal}.saj-qc-issue{padding:8px}.saj-qc-downloads button{flex:1}}
@media(prefers-reduced-motion:reduce){#saj-project-quality-modal *{scroll-behavior:auto!important;transition:none!important}}

.saj-qc-guidance{margin:6px 0;padding:7px 9px;border-radius:8px;background:#f0f7fa;border:1px solid #d7e8ef;color:#28566b;font-size:10px;line-height:1.9}
@media(max-width:600px){.saj-qc-guidance{font-size:10px;padding:8px}}

.saj-qc-nav-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:5px}.saj-qc-nav-actions .saj-qc-show{min-height:40px}


/* SAJ Task 50 — configured 17-field completeness audit */
.saj-qc-form-summary{margin-top:12px;padding:10px;border:1px solid #dbe7ef;border-radius:12px;background:#fbfdff}
.saj-qc-form-summary h3{margin:0 0 8px;font-size:12px;color:#183c56}
.saj-qc-form-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.saj-qc-form-metric{display:flex;flex-direction:column;gap:3px;min-width:0;padding:8px;border:1px solid #e2e8f0;border-radius:9px;background:#fff}
.saj-qc-form-metric small{font-size:9px;color:#64748b}
.saj-qc-form-metric b{font-size:15px;color:#183c56;overflow-wrap:anywhere}
.saj-qc-form-note{margin:8px 0 0;padding:7px 9px;border-radius:8px;background:#eff8f6;color:#245b50;font-size:10px;line-height:1.9}
.saj-qc-form-audit{margin-top:9px;border-top:1px solid #e5edf4;padding-top:8px}
.saj-qc-form-audit>summary,.saj-qc-form-record>summary{cursor:pointer;min-height:40px;display:flex;align-items:center;font-weight:700;color:#25445d;font-size:10px}
.saj-qc-form-record{margin:5px 0;padding:6px 8px;border:1px solid #e2e8f0;border-radius:9px;background:#fff}
.saj-qc-form-field-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.saj-qc-form-field-group{min-width:0;border:1px solid #edf2f6;border-radius:8px;padding:7px}
.saj-qc-form-field-group>strong{display:block;margin-bottom:5px;color:#475569;font-size:10px}
.saj-qc-form-field{display:flex;justify-content:space-between;align-items:flex-start;gap:7px;padding:4px 2px;border-bottom:1px solid #f1f5f9;font-size:9px}
.saj-qc-form-field:last-child{border-bottom:0}
.saj-qc-form-field span{color:#475569;overflow-wrap:anywhere}
.saj-qc-form-field b{white-space:nowrap;font-size:8px;color:#166534}
.saj-qc-form-field.missing-required b,.saj-qc-form-field.invalid b{color:#b91c1c}
.saj-qc-form-field.missing-optional b{color:#94a3b8}
.saj-qc-form-field.not-applicable b{color:#64748b}
.saj-qc-form-field small{flex-basis:100%;color:#991b1b;font-size:8px}
.saj-qc-field-list{margin-top:7px;padding:7px;border-radius:8px;background:#fff8f7;border:1px solid #fee2e2}
.saj-qc-field-item{display:flex;flex-wrap:wrap;gap:4px 8px;padding:4px 0;border-bottom:1px dashed #fecaca;font-size:9px}
.saj-qc-field-item:last-child{border-bottom:0}
.saj-qc-field-item b{color:#991b1b}.saj-qc-field-item span{color:#7f1d1d}
@media(max-width:600px){.saj-qc-form-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.saj-qc-form-field-groups{grid-template-columns:1fr}.saj-qc-form-audit>summary,.saj-qc-form-record>summary{min-height:44px}.saj-qc-form-field{font-size:10px}.saj-qc-form-field b{font-size:9px}}

/* Stage 96 / Task 51 — GEOS-backed polygon QA summary and topology-assistant handoff. */
.saj-qc-geometry-summary{margin:14px 0;padding:12px;border:1px solid var(--saj-qc-border,#d7e0e8);border-radius:14px;background:var(--saj-qc-surface,#fff)}
.saj-qc-geometry-summary h3{margin:0 0 10px;font-size:14px;font-weight:800}
.saj-qc-geometry-summary .saj-qc-form-note{margin:9px 0 0}
.saj-qc-repair-assistant{margin:8px 0 4px;min-height:44px;background:#0f766e;color:#fff;border-color:#0f766e}
.saj-qc-repair-assistant:hover{background:#115e59}
.saj-qc-repair-assistant:focus-visible{outline:3px solid #99f6e4;outline-offset:2px}
@media(max-width:640px){.saj-qc-geometry-summary{padding:10px}.saj-qc-repair-assistant{width:100%;min-height:46px}}


/* Stage 97 / Task 52 — identifier consistency summary and manual correction workflow. */
.saj-qc-identity-summary{margin:12px 0;padding:11px;border:1px solid #d6e5ef;border-radius:12px;background:#f7fbfd}
.saj-qc-identity-summary h3{margin:0 0 9px;font-size:12px;color:#183c56}
.saj-qc-id-correction{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}
.saj-qc-id-correction:focus-visible{outline:3px solid #fdba74;outline-offset:2px}
@media(max-width:600px){.saj-qc-identity-summary{padding:9px}.saj-qc-id-correction{width:100%;min-height:46px}}

.saj-qc-identity-info-row{display:grid;grid-template-columns:1fr;gap:3px;padding:8px 9px;margin:6px 0;border:1px solid #dcece7;border-radius:9px;background:#f4fbf8;font-size:9px}
.saj-qc-identity-info-row strong{color:#14532d;font-size:10px}.saj-qc-identity-info-row span{color:#334155;overflow-wrap:anywhere}.saj-qc-identity-info-row small{color:#64748b;overflow-wrap:anywhere}

/* Stage 98 / Task 53 — geometry-to-description relationship audit */
.saj-qc-relationship-summary{margin:12px 0;padding:12px;border:1px solid #cbd5e1;border-radius:14px;background:var(--saj-qc-card,#fff)}.saj-qc-relationship-summary h3{margin:0 0 10px;font-size:14px}.saj-qc-relationship-row{display:grid;grid-template-columns:1fr;gap:5px;padding:9px 0;border-bottom:1px solid #e2e8f0;font-size:12px}.saj-qc-relationship-row .saj-qc-show{justify-self:start;min-height:40px}@media(min-width:700px){.saj-qc-relationship-row{grid-template-columns:1fr 1fr auto;align-items:center}}

.saj-qc-relationship-audit{margin-top:10px;padding:9px;border:1px solid #dbe4ec;border-radius:10px;background:#f8fafc}.saj-qc-relationship-audit>summary{cursor:pointer;font-weight:700;padding:6px}


/* Stage 99 / Task 54 — validation-derived visual quality status. */
.saj-qc-visual-status{margin:0 0 11px;padding:10px 12px;border:1px solid;border-right-width:4px;border-radius:12px;min-width:0;box-sizing:border-box}
.saj-qc-visual-status.is-red{background:#fff1f2;border-color:#fecdd3;border-right-color:#dc2626;color:#7f1d1d}
.saj-qc-visual-status.is-yellow{background:#fffbeb;border-color:#fde68a;border-right-color:#d97706;color:#78350f}
.saj-qc-visual-status.is-green{background:#ecfdf5;border-color:#a7f3d0;border-right-color:#16a34a;color:#14532d}
.saj-qc-visual-status-top,.saj-qc-visual-status-identity{display:flex;align-items:center;gap:8px;min-width:0}
.saj-qc-visual-status-top{justify-content:space-between;flex-wrap:wrap}
.saj-qc-visual-status-identity{flex:1 1 220px}
.saj-qc-visual-status-dot{width:10px;height:10px;min-width:10px;border-radius:50%;box-shadow:0 0 0 3px rgba(255,255,255,.82)}
.is-red .saj-qc-visual-status-dot{background:#dc2626}.is-yellow .saj-qc-visual-status-dot{background:#d97706}.is-green .saj-qc-visual-status-dot{background:#16a34a}
.saj-qc-visual-status-title{font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.saj-qc-visual-status-tag{padding:2px 8px;border:1px solid currentColor;border-radius:20px;font-size:9px;font-weight:700;white-space:nowrap}
.saj-qc-visual-status-reason{margin:5px 0 3px;font-size:10px;line-height:1.9;overflow-wrap:anywhere}
.saj-qc-visual-status-counts{margin:0;padding-top:5px;border-top:1px solid currentColor;border-color:rgba(100,116,139,.22);font-size:9px;line-height:1.8;overflow-wrap:anywhere}
@media(max-width:600px){.saj-qc-visual-status{padding:9px 10px;margin-bottom:9px}.saj-qc-visual-status-title{font-size:11px}.saj-qc-visual-status-reason{font-size:10px}.saj-qc-visual-status-counts{font-size:9px}.saj-qc-visual-status-top{gap:5px}}


/* Stage 100 / Task 55 — actionable, filterable quality issue list. */
.saj-qc-issue-filters{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:7px;margin:8px 0;padding:9px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}
.saj-qc-issue-filters label{display:flex;flex-direction:column;gap:4px;min-width:0;color:#475569;font-size:10px;font-weight:700}
.saj-qc-issue-filters select{width:100%;min-width:0;min-height:40px;padding:6px 8px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172b3d;font:10px Tahoma,Arial,sans-serif}
.saj-qc-issue-filter-count{margin:5px 1px;color:#64748b;font-size:10px;line-height:1.8}
.saj-qc-issue-list{display:grid;gap:7px;min-width:0}
.saj-qc-issue{min-width:0;box-sizing:border-box}
.saj-qc-issue-top{align-items:flex-start}
.saj-qc-issue-badges{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap}
.saj-qc-severity.is-error{color:#991b1b;background:#fef2f2}
.saj-qc-severity.is-warning{color:#92400e;background:#fffbeb}
.saj-qc-reviewed-tag{display:inline-flex;padding:2px 7px;border-radius:20px;border:1px solid #bbf7d0;background:#f0fdf4;color:#166534;font-size:9px;font-weight:700;white-space:nowrap}
.saj-qc-issue.is-reviewed{border-style:dashed}
.saj-qc-action-note{margin:5px 0;padding:6px 8px;border-radius:8px;background:#f8fafc;color:#475569;font-size:10px;line-height:1.8}
.saj-qc-refs{font-size:10px;line-height:1.8;overflow-wrap:anywhere}
.saj-qc-issue-primary{background:#e0f2fe;color:#075985;border-color:#bae6fd}
.saj-qc-source-link{background:#f1f5f9;color:#334155;border-color:#cbd5e1}
.saj-qc-review-toggle{background:#f0fdf4;color:#166534;border-color:#bbf7d0}
.saj-qc-review-toggle[aria-pressed="true"]{background:#ecfdf5;color:#14532d;border-color:#86efac}
.saj-qc-nav-actions{align-items:stretch}
.saj-qc-nav-actions button{max-width:100%;overflow-wrap:anywhere;white-space:normal;line-height:1.6}
@media(max-width:600px){
  .saj-qc-issue-filters{grid-template-columns:1fr 1fr;padding:7px;gap:6px}
  .saj-qc-issue-filters label:first-child{grid-column:1/-1}
  .saj-qc-issue-filters select{min-height:44px;font-size:11px}
  .saj-qc-issue-top{gap:5px;flex-wrap:wrap}
  .saj-qc-issue-top>strong{flex:1 1 100%;overflow-wrap:anywhere}
  .saj-qc-issue-badges{justify-content:flex-start}
  .saj-qc-nav-actions button{flex:1 1 100%;min-height:44px;margin-top:3px}
  .saj-qc-issue-filter-count{font-size:10px}
}
