/* ---- Client Management (Business overview + client detail) ---- */

.client-overview-subtitle {
    margin-bottom: 20px;
}

/* Total customers trend card */

.client-trend-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.client-trend-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.client-trend-delta {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6fd67f;
}

.client-trend-chart-wrap {
    position: relative;
}

.client-trend-chart {
    width: 100%;
    height: 70px;
    display: block;
    overflow: visible;
}

.client-trend-dot {
    position: absolute;
    right: -4px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--app-surface);
}

.client-trend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.client-trend-label {
    font-size: 0.72rem;
    color: var(--app-text-muted);
}

/* Business rating card */

.client-rating-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 16px;
    margin-bottom: 24px;
}

.client-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-rating-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--app-text);
}

.client-rating-stars {
    display: flex;
    gap: 2px;
    color: var(--ui-primary);
    font-size: 0.95rem;
}

.client-rating-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--app-text-muted);
}

/* Pipeline stages */

.client-pipeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.client-pipeline-sub {
    margin: 6px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ui-primary);
}

.client-pipeline-sub--muted {
    color: var(--app-text-muted);
    font-weight: 400;
}

/* Payment phase */

.client-payment-subtitle {
    margin-bottom: 12px;
}

.client-payment-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--app-surface-raised);
    margin-bottom: 16px;
}

.client-payment-segment--paid {
    background: #6fd67f;
}

.client-payment-segment--pending {
    background: #f2b880;
}

.client-payment-segment--unpaid {
    background: #e0685f;
}

.client-payment-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.client-payment-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-payment-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.client-payment-dot--paid {
    background: #6fd67f;
}

.client-payment-dot--pending {
    background: #f2b880;
}

.client-payment-dot--unpaid {
    background: #e0685f;
}

.client-payment-legend-label {
    font-size: 0.9rem;
    color: var(--app-text);
}

.client-payment-legend-value {
    margin-left: auto;
    font-size: 0.88rem;
    color: var(--app-text-muted);
}

/* Close rate donut */

.client-donut-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 8px auto 12px;
}

.client-donut-chart {
    width: 100%;
    height: 100%;
    display: block;
}

.client-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.client-donut-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--app-text);
}

.client-donut-label {
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

.client-donut-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--app-text-muted);
    margin: 0 0 24px;
}

/* Clock In tab */

.job-clock-job-select {
    margin-bottom: 16px;
}

.job-clock-section-label {
    margin: 0 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-text);
}

.employee-filter-chip:disabled {
    opacity: 0.5;
    cursor: default;
}

.job-clock-break-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 16px;
}

.job-clock-reminder-link {
    border: none;
    background: transparent;
    color: var(--ui-primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.job-clock-reminder-link:disabled {
    opacity: 0.5;
    cursor: default;
}

.job-clock-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(111, 214, 127, 0.14);
    color: #6fd67f;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.job-clock-timer {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--app-text);
}

.job-clock-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.job-clock-actions .ui-button {
    flex: 1;
}

.job-clock-employee-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-clock-employee-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    width: 100%;
}

.job-clock-employee-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.job-clock-employee-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--app-text);
}

.job-clock-employee-sub {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.job-clock-employee-hours {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--app-text);
    flex-shrink: 0;
}

/* Assign employees picker modal */

.employee-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.employee-picker-panel {
    width: 100%;
    max-width: var(--app-max-content);
    max-height: min(600px, 85dvh);
    margin-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: column;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    padding: 16px;
    overflow: hidden;
}

.employee-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.employee-picker-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-text);
}

.employee-picker-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.employee-picker-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.employee-picker-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--app-text-muted);
    font-size: 0.9rem;
}

.employee-picker-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px 10px 34px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-raised);
    color: var(--app-text);
    font-size: 0.92rem;
    font-family: inherit;
}

.employee-picker-search-input::placeholder {
    color: var(--app-text-muted);
}

.employee-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-bottom: 8px;
}

.employee-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    width: 100%;
}

.employee-picker-row:disabled {
    opacity: 0.6;
    cursor: default;
}

.employee-picker-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.employee-picker-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.employee-picker-sub {
    font-size: 0.76rem;
    color: var(--app-text-muted);
}

.employee-picker-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--app-border);
    color: transparent;
    flex-shrink: 0;
}

.employee-picker-check--on {
    background: var(--ui-primary);
    border-color: var(--ui-primary);
    color: #fff;
}

.employee-picker-footer {
    margin-top: 12px;
}

/* Conversion funnel */

.client-funnel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.client-funnel-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.client-funnel-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.client-funnel-value {
    font-size: 0.82rem;
    color: var(--app-text-muted);
}

.client-funnel-track {
    height: 8px;
    border-radius: 999px;
    background: var(--app-surface-raised);
    overflow: hidden;
}

.client-funnel-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--ui-primary);
}

/* Customer cards (overview list) - photo header with overlapping avatar */

.client-customer-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.client-customer-card {
    display: block;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    width: 100%;
    padding: 0;
    font-family: inherit;
    color: inherit;
}

.client-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--app-surface-raised);
}

.client-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.client-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-muted);
    font-size: 2rem;
}

.client-photo-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

.client-customer-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 14px 14px;
    margin-top: -24px;
    position: relative;
}

.client-customer-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ui-primary-muted);
    border: 3px solid var(--app-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ui-primary);
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.client-customer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 28px;
}

.client-customer-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--app-text);
}

.client-customer-meta {
    font-size: 0.8rem;
    color: var(--app-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-customer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.client-customer-role {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.client-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(111, 214, 127, 0.18);
    color: #6fd67f;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Weekly schedule strip - shown on overview customer cards and the detail page */

.client-week-strip {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    border-top: 1px solid var(--app-border);
    padding: 12px 0 0;
    margin-top: 10px;
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.client-customer-card .client-week-strip {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 14px;
    margin-top: 0;
}

.client-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.client-week-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--app-text);
}

.client-week-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ui-primary);
}

.client-week-days {
    display: flex;
    gap: 8px;
}

.client-week-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.client-week-day-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--app-text-muted);
    text-transform: uppercase;
}

.client-week-day-mark {
    width: 100%;
    aspect-ratio: 1;
    max-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    font-size: 0.85rem;
}

.client-week-day-mark--yes {
    color: #6fd67f;
    border-color: rgba(111, 214, 127, 0.4);
    background: rgba(111, 214, 127, 0.1);
}

.client-week-day-mark--no {
    color: var(--app-text-muted);
}

/* Client detail: photo header */

.client-detail-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--app-radius-lg);
    overflow: hidden;
    background: var(--app-surface-raised);
    margin-bottom: 8px;
}

/* Client detail: customer card */

.client-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: -24px;
    padding: 0 4px 8px;
    position: relative;
}

.client-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ui-primary-muted);
    border: 3px solid var(--app-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ui-primary);
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.client-detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 30px;
}

.client-detail-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-text);
}

.client-detail-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--app-text-secondary);
    text-decoration: none;
}

.client-detail-link:hover {
    color: var(--ui-primary);
}

.client-detail-meta {
    font-size: 0.82rem;
    color: var(--app-text-muted);
}

.client-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 8px;
}

/* Job progress checklist - flat list, no per-row cards */

.client-progress-list {
    display: flex;
    flex-direction: column;
}

.client-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--app-border);
}

.client-progress-row:last-child {
    border-bottom: none;
}

.client-progress-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.client-progress-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.client-progress-icon--pending {
    color: var(--app-text-muted);
}

.client-progress-icon--done {
    color: #6fd67f;
}

.client-progress-label {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--app-text);
}

.client-progress-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--app-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

/* Job cost - plain block, no card */

.client-cost-block {
    margin-bottom: 8px;
}

.client-cost-label {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: var(--app-text-muted);
}

.client-cost-value {
    margin: 0 0 14px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--app-text);
}

/* Contractor notes */

.client-notes-textarea {
    resize: vertical;
    margin-bottom: 10px;
    font-family: inherit;
}

.client-notes-text {
    color: var(--app-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Call log - flat rows, icon + date, notes preview beneath */

.client-call-list {
    display: flex;
    flex-direction: column;
}

.client-call-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--app-border);
}

.client-call-row:last-child {
    border-bottom: none;
}

.client-call-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ui-primary-muted);
    color: var(--ui-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.client-call-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-call-date {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--app-text);
}

.client-call-notes {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
