/* Customer Health dashboard */

.ch-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ch-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    flex-shrink: 0;
}

.ch-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }

.ch-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Overview stat cards */
.ch-overview {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.ch-stat-card {
    flex: 1;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.ch-stat-card.ch-stat-warn {
    border-color: #fbbf24;
    background: #fffbeb;
}

.ch-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.ch-stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ch-stat-sub {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Sections */
.ch-section {
    margin-bottom: 28px;
}

.ch-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ch-section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.ch-section-subtitle {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.ch-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
}

/* Tables */
.ch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.ch-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ch-table td {
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.ch-clickable { cursor: pointer; }
.ch-clickable:hover { background: #f9fafb; }

.ch-email {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.ch-rank {
    font-weight: 700;
    color: var(--text-secondary);
    width: 30px;
}

/* Risk indicators */
.ch-days-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}

.ch-risk-medium { background: #fef3c7; color: #92400e; }
.ch-risk-high { background: #fee2e2; color: #991b1b; }
.ch-risk-churned { background: #f3f4f6; color: #6b7280; }

.ch-overdue {
    font-size: 0.8em;
    color: #dc2626;
    font-weight: 500;
}

/* Status badges */
.ch-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.ch-status-healthy { background: #dcfce7; color: #166534; }
.ch-status-warning { background: #fef3c7; color: #92400e; }
.ch-status-danger { background: #fee2e2; color: #991b1b; }

/* Client detail health bar */
.ch-client-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ch-risk-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85em;
}

.ch-bar-item {
    text-align: center;
}

.ch-bar-value {
    font-size: 1em;
    font-weight: 700;
    color: var(--text-primary);
}

.ch-bar-label {
    font-size: 0.65em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ch-trend-up .ch-bar-value { color: #166534; }
.ch-trend-down .ch-bar-value { color: #dc2626; }

.ch-loading, .ch-no-data {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.ch-client-bar .ch-no-data {
    font-style: italic;
}
