/* Lead timeline and dashboard widgets (part D). Plain CSS on Filament's colour variables. */

.crm-muted { color: var(--gray-500, #6b7280); font-size: .875rem; }

/* Timeline */
.crm-timeline { display: flex; flex-direction: column; gap: .25rem; }
.crm-timeline-item { display: flex; gap: .75rem; padding: .625rem 0; border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.crm-timeline-item:last-of-type { border-bottom: 0; }
.dark .crm-timeline-item { border-bottom-color: rgba(255, 255, 255, .08); }
.crm-timeline-icon {
    flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    background: var(--crm-tone-bg); color: var(--crm-tone-fg);
}
.crm-timeline-svg { width: 1.125rem; height: 1.125rem; }
.crm-timeline-body { min-width: 0; flex: 1 1 auto; }
.crm-timeline-head { display: flex; flex-wrap: wrap; gap: .125rem .5rem; align-items: baseline; }
.crm-timeline-type { font-weight: 600; font-size: .875rem; }
.crm-timeline-meta { color: var(--gray-500, #6b7280); font-size: .75rem; }
.crm-timeline-text { margin-top: .125rem; font-size: .875rem; white-space: pre-line; overflow-wrap: anywhere; }
.crm-timeline-details { margin-top: .125rem; font-size: .75rem; color: var(--gray-500, #6b7280); }

.crm-tone-primary { --crm-tone-bg: var(--primary-50, #fbf7ee); --crm-tone-fg: var(--primary-700, #8a6d2c); }
.crm-tone-info { --crm-tone-bg: var(--info-50, #eff6ff); --crm-tone-fg: var(--info-700, #1d4ed8); }
.crm-tone-warning { --crm-tone-bg: var(--warning-50, #fffbeb); --crm-tone-fg: var(--warning-700, #b45309); }
.crm-tone-success { --crm-tone-bg: var(--success-50, #f0fdf4); --crm-tone-fg: var(--success-700, #15803d); }
.crm-tone-danger { --crm-tone-bg: var(--danger-50, #fef2f2); --crm-tone-fg: var(--danger-700, #b91c1c); }
.crm-tone-gray { --crm-tone-bg: var(--gray-100, #f3f4f6); --crm-tone-fg: var(--gray-700, #374151); }
.dark .crm-tone-primary, .dark .crm-tone-info, .dark .crm-tone-warning,
.dark .crm-tone-success, .dark .crm-tone-danger, .dark .crm-tone-gray { --crm-tone-bg: rgba(255, 255, 255, .06); --crm-tone-fg: var(--gray-200, #e5e7eb); }

/* Dashboard: short lists */
.crm-list { display: flex; flex-direction: column; }
.crm-list-title { font-weight: 600; font-size: .875rem; margin: .5rem 0 .25rem; }
.crm-list-title:first-child { margin-top: 0; }
.crm-list-row {
    display: flex; justify-content: space-between; align-items: center; gap: .75rem;
    padding: .625rem .25rem; border-bottom: 1px solid var(--gray-200, #e5e7eb);
    text-decoration: none; color: inherit; min-height: 2.75rem;
}
.dark .crm-list-row { border-bottom-color: rgba(255, 255, 255, .08); }
.crm-list-row:hover, .crm-list-row:focus-visible { background: var(--gray-50, #f9fafb); }
.dark .crm-list-row:hover, .dark .crm-list-row:focus-visible { background: rgba(255, 255, 255, .04); }
.crm-list-main { display: block; flex: 1 1 auto; min-width: 0; }
.crm-list-name { display: block; font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-list-sub { display: block; font-size: .75rem; color: var(--gray-500, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-list-side { flex: 0 0 auto; font-size: .75rem; text-align: right; }
.crm-overdue { color: var(--danger-600, #dc2626); font-weight: 600; }
.crm-list-more { font-size: .8125rem; padding-top: .5rem; }

/* Dashboard: pipeline numbers */
.crm-pipeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 640px) { .crm-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .crm-pipeline { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.crm-pipeline-tile {
    display: flex; flex-direction: column; gap: .125rem; padding: .625rem .75rem; border-radius: .5rem;
    border: 1px solid var(--gray-200, #e5e7eb); text-decoration: none; color: inherit;
}
.dark .crm-pipeline-tile { border-color: rgba(255, 255, 255, .1); }
.crm-pipeline-tile:hover, .crm-pipeline-tile:focus-visible { border-color: var(--primary-500, #b08d3c); }
.crm-pipeline-count { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.crm-pipeline-label { font-size: .75rem; color: var(--gray-600, #4b5563); }
.dark .crm-pipeline-label { color: var(--gray-400, #9ca3af); }
.crm-pipeline-tile.crm-is-zero .crm-pipeline-count { color: var(--gray-400, #9ca3af); }
