/* Dispatch module — global styles (badge classes must be global; CellCssClassFunc spans are owned by MyDxGrid) */

/* Source badges */
.dsp-src-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.dsp-src-echelon { background: #ede9fe; color: #7c3aed; }
.dsp-src-email   { background: #dbeafe; color: #1d4ed8; }
.dsp-src-note    { background: #fef3c7; color: #b45309; }
.dsp-src-auto    { background: #d1fae5; color: #065f46; }
.dsp-src-manual  { background: #f1f5f9; color: #475569; }

/* Status badges */
.dsp-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.dsp-status-0 { background: #fef3c7; color: #92400e; }
.dsp-status-1 { background: #dbeafe; color: #1e40af; }
.dsp-status-2 { background: #d1fae5; color: #065f46; }
.dsp-status-3 { background: #f1f5f9; color: #64748b; }

/* Overdue badge */
.dsp-overdue-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    background: #fee2e2;
    color: #dc2626;
}

/* Required docs — template editor (inline list in DispatchRequestTypeEditor) */
.dsp-doc-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.dsp-doc-editor-input { flex: 1; }
.dsp-doc-add-btn {
    font-size: 12px;
    color: #11c683;
    padding: 0;
    margin-top: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

/* Required docs — intake checklist (in DispatchEditor) */
.dsp-doc-checklist {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.dsp-doc-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.dsp-doc-check-row:last-child { border-bottom: none; }
.dsp-doc-verified { background: #f0fdf4; }
.dsp-doc-missing  { background: #fff; }
.dsp-doc-check-icon { font-size: 13px; width: 14px; flex-shrink: 0; }
.dsp-doc-verified .dsp-doc-check-icon { color: #16a34a; }
.dsp-doc-missing  .dsp-doc-check-icon { color: #ef4444; }
.dsp-doc-check-label { flex: 1; color: #334155; }
.dsp-doc-check-meta  { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.dsp-doc-verify-btn {
    font-size: 11px;
    color: #0ea5e9;
    padding: 2px 10px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #f0f9ff;
    cursor: pointer;
    white-space: nowrap;
}

/* Attachments on a request (in DispatchEditor) */
.dsp-att-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.dsp-att-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.dsp-att-row:last-child { border-bottom: none; }
.dsp-att-empty { font-size: 12px; color: #94a3b8; padding: 7px 10px; }
.dsp-att-name { flex: 1; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsp-att-meta { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.dsp-att-add { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.dsp-att-btn {
    font-size: 11px;
    color: #0ea5e9;
    padding: 2px 10px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #f0f9ff;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}
.dsp-att-btn--danger { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.dsp-att-btn:disabled { opacity: 0.5; cursor: default; }
.dsp-att-error { font-size: 12px; color: #dc2626; margin-top: 6px; }
.dsp-att-filed { font-size: 11px; color: #16a34a; white-space: nowrap; }
.dsp-att-filed--wait { color: #94a3b8; }

/* Email triage: who sent an emailed request, and an AI suggestion waiting for staff (in DispatchEditor and the grid) */
.dsp-sender { font-size: 12px; color: #475569; margin-bottom: 8px; }
.dsp-sender-tag { font-size: 11px; color: #16a34a; margin-left: 8px; }
.dsp-sug { border: 1px solid #bae6fd; background: #f0f9ff; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; color: #334155; display: flex; flex-direction: column; gap: 3px; }
.dsp-sug-title { font-weight: 600; color: #0369a1; }
.dsp-sug-conf { font-weight: 400; color: #64748b; }
.dsp-sug-reason { color: #64748b; font-style: italic; }
.dsp-sug-actions { display: flex; gap: 8px; margin-top: 4px; }
.dsp-suggestion-badge { font-size: 11px; color: #0369a1; }

/* LW+CL:22.10.26 Chase a client for missing documents */
.dsp-chase-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.dsp-chase-last-text { font-size: 12px; color: var(--bs-secondary-color, #6c757d); }
.dsp-chase-last { font-size: 13px; margin-bottom: 8px; }
.dsp-chase-docs { display: flex; flex-direction: column; gap: 4px; }
.dsp-chase-tools { display: flex; gap: 14px; margin-top: 6px; }
.dsp-chase-link { background: none; border: 0; padding: 0; color: var(--bs-link-color, #0d6efd); cursor: pointer; font-size: 12px; }
.dsp-chase-link:disabled { opacity: .5; cursor: default; }

/* LW+CL:03.11.26 The client's email on a request, read-only, above the form. */
.dsp-email { border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; margin-bottom: 12px; }
.dsp-email-head { padding: 8px 12px; border-bottom: 1px solid #e2e8f0; }
.dsp-email-subject { font-size: 13px; font-weight: 600; color: #1e3a5f; }
.dsp-email-meta { font-size: 11px; color: #64748b; margin-top: 2px; }
.dsp-email-body { padding: 10px 12px; font-size: 12.5px; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.dsp-readonly-note { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.dsp-source-line { font-size: 12px; color: #475569; margin-bottom: 8px; } /* LW+CL:10.11.26 C117 */

/* LW+CL:03.11.26 the entity summary strip under the request's Entity field */
.dsp-entity-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: #475569; }
.dsp-risk-badge { display: inline-block; padding: 0 8px; border-radius: 999px; color: #fff; background: #64748b; font-weight: 600; font-size: 11px; }
.dsp-overdue-text { color: #b91c1c; font-weight: 600; }

/* LW+CL:03.11.26 one line per part of the AI suggestion, with its own Apply / Dismiss */
.dsp-sug-part { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 4px 0; }
.dsp-sug-part .dsp-sug-actions { margin-top: 0; }
