/**
 * dc-crm.css — CRM-domain semantic layer for the DojoConnect UI plugin.
 *
 * Plugin-owned presentation hooks for com_dojocrm (ticket status / priority / SLA /
 * contact-type badges, email delivery state, ticket header). Mirrors the
 * dc-safeguarding.css precedent: CRM ships no component-local CSS — these semantic
 * classes live here so every view styles consistently from one source.
 *
 * Generic primitives (cards, tables, buttons, stats, avatars, progress bars, activity
 * feed, message/reply thread, utilities) live in dc-system.css, NOT here.
 *
 * @since 1.5.0
 */

:root {
    /* Ticket status palette */
    --dc-crm-status-new-bg: #e8f0fe;      --dc-crm-status-new-text: #174ea6;
    --dc-crm-status-progress-bg: #fef7e0; --dc-crm-status-progress-text: #7c5e10;
    --dc-crm-status-awaiting-bg: #fce8e6; --dc-crm-status-awaiting-text: #8c2d19;
    --dc-crm-status-resolved-bg: #e6f4ea; --dc-crm-status-resolved-text: #137333;
    --dc-crm-status-closed-bg: #f1f3f4;   --dc-crm-status-closed-text: #5f6368;

    /* Priority palette */
    --dc-crm-priority-low-bg: #f1f3f4;    --dc-crm-priority-low-text: #5f6368;
    --dc-crm-priority-normal-bg: #e8f0fe; --dc-crm-priority-normal-text: #174ea6;
    --dc-crm-priority-high-bg: #fef7e0;   --dc-crm-priority-high-text: #7c5e10;
    --dc-crm-priority-urgent-bg: #fce8e6; --dc-crm-priority-urgent-text: #a50e0e;

    /* Status progress-bar fills */
    --dc-crm-bar-new: #4285f4;     --dc-crm-bar-progress: #fbbc04;
    --dc-crm-bar-awaiting: #ea8600; --dc-crm-bar-resolved: #34a853;
    --dc-crm-bar-closed: #9aa0a6;
}

/* -- Status badges -- */
.dc-badge-new { background: var(--dc-crm-status-new-bg); color: var(--dc-crm-status-new-text); }
.dc-badge-in_progress { background: var(--dc-crm-status-progress-bg); color: var(--dc-crm-status-progress-text); }
.dc-badge-awaiting_response { background: var(--dc-crm-status-awaiting-bg); color: var(--dc-crm-status-awaiting-text); }
.dc-badge-resolved { background: var(--dc-crm-status-resolved-bg); color: var(--dc-crm-status-resolved-text); }
.dc-badge-closed { background: var(--dc-crm-status-closed-bg); color: var(--dc-crm-status-closed-text); }

/* -- Priority badges -- */
.dc-badge-low { background: var(--dc-crm-priority-low-bg); color: var(--dc-crm-priority-low-text); }
.dc-badge-normal { background: var(--dc-crm-priority-normal-bg); color: var(--dc-crm-priority-normal-text); }
.dc-badge-high { background: var(--dc-crm-priority-high-bg); color: var(--dc-crm-priority-high-text); }
.dc-badge-urgent { background: var(--dc-crm-priority-urgent-bg); color: var(--dc-crm-priority-urgent-text); }
.dc-badge-sla-breached { background: var(--dc-crm-priority-urgent-bg); color: var(--dc-crm-priority-urgent-text); }

/* -- Contact / organisation type badges -- */
.dc-badge-individual { background: var(--dc-crm-status-new-bg); color: var(--dc-crm-status-new-text); }
.dc-badge-instructor { background: var(--dc-crm-status-resolved-bg); color: var(--dc-crm-status-resolved-text); }
.dc-badge-parent { background: #e8eaf6; color: #3949ab; }
.dc-badge-vendor { background: var(--dc-crm-status-progress-bg); color: var(--dc-crm-status-progress-text); }
.dc-badge-other { background: var(--dc-crm-priority-low-bg); color: var(--dc-crm-priority-low-text); }
.dc-badge-dojo { background: var(--dc-crm-status-resolved-bg); color: var(--dc-crm-status-resolved-text); }
.dc-badge-association { background: #e8eaf6; color: #3949ab; }
.dc-badge-external { background: var(--dc-crm-priority-low-bg); color: var(--dc-crm-priority-low-text); }
.dc-badge-label { background: var(--dc-crm-priority-low-bg); color: var(--dc-crm-priority-low-text); }

/* -- Status progress-bar fills -- */
.dc-progress-new { background: var(--dc-crm-bar-new); }
.dc-progress-in-progress { background: var(--dc-crm-bar-progress); }
.dc-progress-awaiting-response { background: var(--dc-crm-bar-awaiting); }
.dc-progress-resolved { background: var(--dc-crm-bar-resolved); }
.dc-progress-closed { background: var(--dc-crm-bar-closed); }

/* -- Email delivery state -- */
.dc-email-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.dc-email-sent, .dc-email-delivered { background: var(--dc-crm-status-resolved-bg); color: var(--dc-crm-status-resolved-text); }
.dc-email-bounced, .dc-email-failed { background: var(--dc-crm-priority-urgent-bg); color: var(--dc-crm-priority-urgent-text); }
.dc-email-queued { background: var(--dc-crm-priority-low-bg); color: var(--dc-crm-priority-low-text); }

/* -- Ticket header bar -- */
.dc-ticket-header { padding: 14px 20px; border-bottom: 1px solid var(--dc-ink-200); background: var(--dc-surface); display: flex; align-items: center; gap: 12px; }
.dc-ticket-header-info { flex: 1; min-width: 0; }
.dc-ticket-number { font-family: monospace; font-size: 13px; font-weight: 500; color: var(--dc-ink-900); }
.dc-ticket-subject { font-size: 13px; color: var(--dc-ink-600); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
