/* Labor mode tabs (Employee | Payroll): flat sheet, not iOS pill. */
#laborView .labor-mode-selector {
    margin-bottom: 1rem;
    width: 100%;
}

#laborView .labor-mode-control.segmented-control,
#laborView .labor-mode-control {
    display: flex;
    width: 100%;
    gap: 0.125rem;
    padding: 0.1875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    box-sizing: border-box;
}

#laborView .labor-mode-control .segment-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 1.875rem;
    padding: 0.375rem 0.625rem;
    margin: 0;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.25;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    #laborView .labor-mode-control .segment-btn:not(.active):hover {
        color: var(--text-primary);
    }
}

#laborView .labor-mode-control .segment-btn.active {
    background: var(--finance-track, var(--bg-tertiary));
    color: var(--text-primary);
    transform: none;
}

#laborView .labor-mode-control .segment-btn:focus {
    outline: none;
}

#laborView .labor-mode-control .segment-btn:focus-visible {
    outline: 1px solid var(--border-color);
    outline-offset: 0;
}

#laborView .labor-mode-control .segment-btn:active {
    opacity: 0.92;
}

/* Light: finance-track is nearly white — use tertiary track + white active chip. */
body.light-theme #laborView .labor-mode-control {
    background: var(--bg-tertiary);
}

body.light-theme #laborView .labor-mode-control .segment-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (hover: hover) and (pointer: fine) {
    body.light-theme #laborView .labor-mode-control .segment-btn:not(.active):hover {
        background: var(--surface-pressed, #e2e8f0);
        color: var(--text-primary);
    }
}

/* Labor stats: match Financial overview .ov-stat cards. */
#laborView .labor-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

@media (min-width: 720px) {
    #laborView .labor-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    #laborView .labor-stat-card.payroll {
        grid-column: 1 / -1;
    }
}

#laborView .labor-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.75rem 0.875rem;
    min-width: 0;
    box-shadow: inset 3px 0 0 var(--labor-stat-accent, transparent);
    text-align: left;
    cursor: default;
    overflow: hidden;
    position: relative;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

@media (hover: hover) and (pointer: fine) {
    #laborView .labor-stat-card:hover {
        background: var(--finance-track, var(--bg-tertiary));
        transform: none;
        border-color: var(--border-color);
    }
}

#laborView .labor-stat-card .stat-label {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.25;
    margin-bottom: 0.25rem;
}

#laborView .labor-stat-card .stat-value-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.375rem;
}

#laborView .labor-stat-card .stat-value {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    word-break: break-word;
    white-space: normal;
    margin-bottom: 0;
    max-width: 100%;
}

#laborView .labor-stat-card .stat-meta {
    margin-top: 0.25rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-regular);
    line-height: 1.35;
    color: var(--text-muted);
}

body.light-theme #laborView .labor-stat-card {
    background: var(--bg-secondary);
}

@media (hover: hover) and (pointer: fine) {
    body.light-theme #laborView .labor-stat-card:hover {
        background: var(--bg-tertiary);
    }
}

/* Employee cards: denser ov-stat sheet + large clock action (kept). */
#employeesList .employee-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    box-shadow: inset 3px 0 0 var(--employee-card-accent, transparent);
    transition: background-color 0.2s ease;
}

#employeesList .employee-item.is-clocked-in {
    --employee-card-accent: var(--finance-bar-collected);
}

#employeesList .employee-item.is-on-break {
    --employee-card-accent: var(--finance-bar-spent-labor);
}

@media (hover: hover) and (pointer: fine) {
    #employeesList .employee-item:hover {
        background: var(--finance-track, var(--bg-tertiary));
        transform: none;
        border-color: var(--border-color);
    }
}

#employeesList .employee-info {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

#employeesList .employee-name {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0;
}

#employeesList .employee-sub {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-regular);
    line-height: 1.35;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#employeesList .employee-sub--rate {
    font-variant-numeric: tabular-nums;
}

#employeesList .employee-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.125rem 0 0;
    padding: 0;
    border: none;
}

#employeesList .employee-stat {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-regular);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

#employeesList .employee-hours,
#employeesList .employee-days {
    color: var(--text-secondary);
}

#employeesList .employee-earnings {
    color: var(--text-primary);
}

#employeesList .employee-main-actions {
    min-width: 96px;
    flex: 0 0 auto;
    align-self: stretch;
}

#employeesList .btn-clock-main {
    border-radius: 0 2px 2px 0;
    min-height: 72px;
}

body.light-theme #employeesList .employee-item {
    background: var(--bg-secondary);
}

@media (hover: hover) and (pointer: fine) {
    body.light-theme #employeesList .employee-item:hover {
        background: var(--bg-tertiary);
    }
}

/* Employees empty: copy overlays whisper ghost cards (matches dashboard). */
#employeesList:has(.employees-empty-copy) {
    position: relative;
}

#employeesList .employees-empty-copy {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    width: auto;
    padding: 1.5rem 1.25rem;
    pointer-events: none;
    box-sizing: border-box;
}

#employeesList .employees-empty-copy h4 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
}

#employeesList .employees-empty-copy p {
    margin: 0;
    max-width: 28rem;
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    line-height: 1.4;
}

#employeesList .employees-empty-copy.fade-in,
#employeesList .employee-item.fade-in {
    -webkit-animation: jobSiteFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation: jobSiteFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#employeesList .employees-ghost-card {
    --job-sites-ghost-opacity: 0.1;
    cursor: default;
    pointer-events: none;
    opacity: var(--job-sites-ghost-opacity);
}

#employeesList .employees-ghost-card:hover {
    transform: none;
}

#employeesList .employees-ghost-card.fade-in,
#employeesList .employees-ghost-card.fade-in:hover {
    -webkit-animation: jobSitesGhostFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation: jobSitesGhostFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#employeesList .employees-ghost-bar {
    display: block;
    height: 10px;
    max-width: 100%;
    border-radius: 2px;
    background: var(--border-color);
    opacity: 1;
}

#employeesList .employees-ghost-card .employee-info {
    gap: 0.25rem;
}

#employeesList .employees-ghost-card .employee-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.125rem;
    border: none;
    padding: 0;
}

#employeesList .employees-ghost-card .employee-main-actions {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    min-width: 96px;
}

#employeesList .employees-ghost-action {
    height: 100%;
    min-height: 72px;
    border-radius: 0 2px 2px 0;
    align-self: stretch;
    margin: 0;
    width: 100% !important;
}
